pulse - the web application framework Get pulse at SourceForge.net. Fast, secure and Free Open Source software downloads Ohloh project report for pulse-java

org.torweg.pulse.site.content.admin
Class AbstractBasicContentEditor

java.lang.Object
  extended by org.torweg.pulse.bundle.Controller
      extended by org.torweg.pulse.site.content.admin.AbstractBasicContentEditor
All Implemented Interfaces:
DeprecatedConfigurable
Direct Known Subclasses:
CMSContentEditor, ContentGroupEditor, FileContentEditor, StoreContentEditor, URLContentEditor

public class AbstractBasicContentEditor
extends Controller
implements DeprecatedConfigurable

provides a set of basic editor methods for AbstractBasicContent. TODO.

Version:
$Revision: 1984 $
Author:
Daniel Dietz

Nested Class Summary
 
Nested classes/interfaces inherited from class org.torweg.pulse.bundle.Controller
Controller.AlwaysRun
 
Field Summary
protected static org.slf4j.Logger LOGGER
          the logger.
 
Constructor Summary
AbstractBasicContentEditor()
           
 
Method Summary
 void addAttachmentToContent(Bundle bundle, ServiceRequest request)
          adds an Attachmentto a AbstractBasicContent.
 void addToLocalizationMap(Bundle bundle, ServiceRequest request)
          starts the ContentLocalizationMap-editor for a AbstractBasicContent.
protected  org.jdom.Document buildDocument(java.lang.String s)
          convenience.
 AbstractBasicContentEditorResult editAttachmentOfContent(Bundle bundle, ServiceRequest request)
          initializes the file-browser for the attachments-editor.
 void findSitemapNodesForContent(Bundle bundle, ServiceRequest request)
          loads the SitemapNodes a content is assigned to.
protected  AbstractBasicContentEditorConfig getConfig()
          Returns the configuration.
 void init(ConfigBean c)
          configures the Controller.
 FCKEditorResult initAttachmentDescriptionEditor(Bundle bundle, ServiceRequest request)
          starts the FCKEditor for the summary of the content determined by the request.
 AbstractBasicContentEditorResult initFileBrowserForAttachmentsForContent(Bundle bundle, ServiceRequest request)
          initializes the file-browser for the attachments-editor.
static void initHibernateSearchFix(org.hibernate.Session s, Content content)
          takes care of updating the search index whenever a content has been changed.
 AbstractBasicContentEditorResult initReferenceDurationEditor(ServiceRequest request)
          Returns a result to initialise the reference-duration-editor.
 FCKEditorResult initSummaryEditor(Bundle bundle, ServiceRequest request)
          starts the FCKEditor for the summary of the content determined by the request.
 FCKEditorResult loadAttachmentDescription(Bundle bundle, ServiceRequest request)
          starts the FCKEditor for the summary of the content determined by the request.
 void loadAttachmentsForContent(Bundle bundle, ServiceRequest request)
          loads the Attachments for a AbstractBasicContent.
 AbstractBasicContentEditorResult loadContentLocalizationMap(Bundle bundle, ServiceRequest request)
          starts the ContentLocalizationMap-editor for a AbstractBasicContent.
 AbstractBasicContentEditorResult loadSummary(Bundle bundle, ServiceRequest request)
           
 void removeAttachmentFromContent(Bundle bundle, ServiceRequest request)
          removes an Attachment from the AbstractBasicContent.
 void removeFromLocalizationMap(Bundle bundle, ServiceRequest request)
          starts the ContentLocalizationMap-editor for a AbstractBasicContent.
 void removeReferenceDuration(ServiceRequest request)
          Removes the reference Duration from a Content specified by given id in request.
 void saveAttachmentDescription(Bundle bundle, ServiceRequest request)
           
 void saveSummary(Bundle bundle, ServiceRequest request)
           
static net.sf.json.JSONObject setBasics(AbstractBasicContent content, ServiceRequest request, org.hibernate.Session s)
          sets the AbstractBasicContent's basic attributes: name, keywords, suffix, title, meta-keywords, meta-description and attachments.
 
Methods inherited from class org.torweg.pulse.bundle.Controller
getAlwaysRun, isAlwaysRun, setAlwaysRun
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOGGER

protected static final org.slf4j.Logger LOGGER
the logger.

Constructor Detail

AbstractBasicContentEditor

public AbstractBasicContentEditor()
Method Detail

initSummaryEditor

@RequireToken
@Action(value="initSummaryEditor", generate=true)
@Permission(value="viewAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final FCKEditorResult initSummaryEditor(Bundle bundle, ServiceRequest request)
starts the FCKEditor for the summary of the content determined by the request.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest
Returns:
the initialized summary-editor

saveSummary

@RequireToken
@Action(value="saveSummary", generate=true)
@Permission(value="editAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final void saveSummary(Bundle bundle, ServiceRequest request)
Parameters:
bundle - the current Bundle
request - the current ServiceRequest

loadSummary

@RequireToken
@Action(value="loadSummary", generate=true)
@Permission(value="viewAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final AbstractBasicContentEditorResult loadSummary(Bundle bundle, ServiceRequest request)
Parameters:
bundle - the current Bundle
request - the current ServiceRequest
Returns:
a result representing the summary of the current content

loadContentLocalizationMap

@RequireToken
@Action(value="initContentLocalizationMap", generate=true)
@Permission(value="viewLocalizationMaps")
@Groups(values="ContentAdministrator")
public final AbstractBasicContentEditorResult loadContentLocalizationMap(Bundle bundle, ServiceRequest request)
starts the ContentLocalizationMap-editor for a AbstractBasicContent.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest
Returns:
an AJAX-result

addToLocalizationMap

@RequireToken
@Action(value="contentLocalizationMapAdd", generate=true)
@Permission(value="editLocalizationMaps")
@Groups(values="ContentAdministrator")
public final void addToLocalizationMap(Bundle bundle, ServiceRequest request)
starts the ContentLocalizationMap-editor for a AbstractBasicContent.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest

removeFromLocalizationMap

@RequireToken
@Action(value="contentLocalizationMapRemove", generate=true)
@Permission(value="editLocalizationMaps")
@Groups(values="ContentAdministrator")
public final void removeFromLocalizationMap(Bundle bundle, ServiceRequest request)
starts the ContentLocalizationMap-editor for a AbstractBasicContent.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest

findSitemapNodesForContent

@RequireToken
@Action(value="loadSitemapNodesForContent", generate=true)
@Permission(value="viewAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final void findSitemapNodesForContent(Bundle bundle, ServiceRequest request)
loads the SitemapNodes a content is assigned to.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest

loadAttachmentsForContent

@RequireToken
@Action(value="loadAttachmentsForContent", generate=true)
@Permission(value="viewAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final void loadAttachmentsForContent(Bundle bundle, ServiceRequest request)
loads the Attachments for a AbstractBasicContent.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest

addAttachmentToContent

@RequireToken
@Action(value="addAttachmentToContent", generate=true)
@Permission(value="editAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final void addAttachmentToContent(Bundle bundle, ServiceRequest request)
adds an Attachmentto a AbstractBasicContent.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest

editAttachmentOfContent

@RequireToken
@Action(value="editAttachmentOfContent", generate=true)
@Permission(value="editAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final AbstractBasicContentEditorResult editAttachmentOfContent(Bundle bundle, ServiceRequest request)
initializes the file-browser for the attachments-editor.

Sets int 2 as the mode for the result which will cause xsl:choose to use html/js that builds up the editor for a Attachment.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest
Returns:
an AJAX-result: to initialize the file-browser from

removeAttachmentFromContent

@RequireToken
@Action(value="removeAttachmentFromContent", generate=true)
@Permission(value="editAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final void removeAttachmentFromContent(Bundle bundle, ServiceRequest request)
removes an Attachment from the AbstractBasicContent.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest

initAttachmentDescriptionEditor

@RequireToken
@Action(value="initAttachmentDescriptionEditor", generate=true)
@Permission(value="editAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final FCKEditorResult initAttachmentDescriptionEditor(Bundle bundle, ServiceRequest request)
starts the FCKEditor for the summary of the content determined by the request.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest
Returns:
the initialized summary-editor

loadAttachmentDescription

@RequireToken
@Action(value="loadAttachmentDescription", generate=true)
@Permission(value="editAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final FCKEditorResult loadAttachmentDescription(Bundle bundle, ServiceRequest request)
starts the FCKEditor for the summary of the content determined by the request.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest
Returns:
the initialized summary-editor

saveAttachmentDescription

@RequireToken
@Action(value="saveAttachmentDescriptionEditor", generate=true)
@Permission(value="editAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final void saveAttachmentDescription(Bundle bundle, ServiceRequest request)
Parameters:
bundle - the current Bundle
request - the current ServiceRequest

initFileBrowserForAttachmentsForContent

@RequireToken
@Action(value="initFileBrowserForAttachmentsForContent", generate=true)
@Permission(value="editAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final AbstractBasicContentEditorResult initFileBrowserForAttachmentsForContent(Bundle bundle, ServiceRequest request)
initializes the file-browser for the attachments-editor.

Sets int 1 as the mode for the result which will cause xsl:choose to use js that builds up the file-browser-panel.

Parameters:
bundle - the current Bundle
request - the current ServiceRequest
Returns:
an AJAX-result: to initialize the file-browser from

initReferenceDurationEditor

@RequireToken
@Action(value="initReferenceDurationEditor", generate=true)
@Permission(value="editAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final AbstractBasicContentEditorResult initReferenceDurationEditor(ServiceRequest request)
Returns a result to initialise the reference-duration-editor.

Parameters:
request - the current ServiceRequest
Returns:
a ViewEditorResult

removeReferenceDuration

@RequireToken
@Action(value="removeReferenceDuration", generate=true)
@Permission(value="editAbstractBasicContent")
@Groups(values="ContentAdministrator")
public final void removeReferenceDuration(ServiceRequest request)
Removes the reference Duration from a Content specified by given id in request.

Parameters:
request - the current ServiceRequest

buildDocument

protected org.jdom.Document buildDocument(java.lang.String s)
convenience.

Parameters:
s - the string to use as description
Returns:
the description as Document

setBasics

public static final net.sf.json.JSONObject setBasics(AbstractBasicContent content, ServiceRequest request,
                                                     org.hibernate.Session s)
sets the AbstractBasicContent's basic attributes: name, keywords, suffix, title, meta-keywords, meta-description and attachments.

Parameters:
content - the content to process
request - the current request
s - the current Session
Returns:
JSONObject error if occurs

initHibernateSearchFix

public static final void initHibernateSearchFix(org.hibernate.Session s, Content content)
takes care of updating the search index whenever a content has been changed.

This method must be called from subeditors, when a change content is persisted.

TODO: Check whether this can be done with an interceptor.

Parameters:
s - the current ServiceSession
content - the changed Content to be (re)indexed

init

public void init(ConfigBean c)
configures the Controller.

Specified by:
init in interface DeprecatedConfigurable
Parameters:
c - the configuration

getConfig

protected final AbstractBasicContentEditorConfig getConfig()
Returns the configuration.

Returns:
the configuration