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.component.cms.model
Class CMSContent

java.lang.Object
  extended by org.torweg.pulse.util.entity.AbstractBasicEntity
      extended by org.torweg.pulse.util.entity.AbstractNamedEntity
          extended by org.torweg.pulse.util.entity.AbstractNamableEntity
              extended by org.torweg.pulse.site.content.Content
                  extended by org.torweg.pulse.site.content.AbstractBasicContent
                      extended by org.torweg.pulse.component.cms.model.CMSContent
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Content>, ExtendedJDOMable, JDOMable, ILinkCorretable, INameable, INamed

@Entity
public class CMSContent
extends AbstractBasicContent
implements ExtendedJDOMable

the CMSContent is the base content for the pulse content management bundle.

A CMSContent is an entity representing an article in content management Bundle. An article is composed of a set of attributes (e.g. the name), a set of Pages with the contents and a set of Attachments with related files.

Version:
$Revision: 1545 $
Author:
Thomas Weber, Daniel Dietz
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.torweg.pulse.site.content.AbstractBasicContent
DEFAULT_SUFFIX
 
Constructor Summary
CMSContent()
          Deprecated. 
CMSContent(java.util.Locale locale, Bundle bundle)
          creates a new CMSContent with the given Locale and Bundle.
 
Method Summary
 void add(int i, Page page)
          adds the given Page to the CMSContent's pages at the given index.
 void addPage(Page page)
          adds the given Page to the CMSContent's pages.
 CMSContent createCopy(java.util.Locale l, User user)
          creates and returns a non-persistent (therefore id = null) copy of the current CMSContent with a given Locale.
 org.jdom.Element deserializeToJDOM()
          a CMSContent deserialised to XML.
 org.jdom.Element deserializeToJDOM(ServiceRequest r)
          a CMSContent deserialised to XML.
 java.lang.StringBuilder getFullTextValue()
          returns the full text value of AbstractBasicContent plus the text value of all Pages.
 java.util.Set<ILinkCorrectableElement> getLinkCorrectables()
          a set with the Elements to be corrected.
 int getNumberOfPages()
          returns the number of Pages belonging to the CMSContent.
 Page getPage(int index)
          get the Page with the given index.
 Page getPageById(long l)
          returns a Page of the current CMSContent specified by a given id.
 java.util.List<Page> getPages()
           
 void initLazyFields()
          initialises the lazy fields for display.
 boolean isGroup()
          returns false.
 void onVirtualFileSystemChange(VirtualFile file)
          updates the CMSContents HTML, if associated VirtualFiles have been moved in the VirtualFileSystem.
 void removePage(int index)
          removes the Page with the given index from the CMSContent 's pages.
 void removePage(Page page)
          removes the given Page from the CMSContent's pages.
 Page removePageById(long l)
          removes the Page with the id from the CMSContent's pages.
 void setPage(int index, Page page)
          sets the Page with the given index to the given Page.
 void setPages(java.util.List<Page> orderedPages)
          sets the Pages for the CMSContent.
 void updateAssociatedVirtualFiles()
          is called by the editors upon save actions to update the list of associated VirtualFiles.
 
Methods inherited from class org.torweg.pulse.site.content.AbstractBasicContent
getKeywords, getMetaDescription, getMetaKeywords, getSuffix, getSummary, getSummaryElement, getTitle, setKeywords, setMetaDescription, setMetaKeywords, setSuffix, setSummary, setTitle
 
Methods inherited from class org.torweg.pulse.site.content.Content
compareTo, equals, getAssociatedViews, getAssociatedVirtualFiles, getAttachments, getBundle, getCreated, getCreatedMillis, getCreator, getLastModified, getLastModifier, getLocale, getLocalizationMap, getLocalizationMapJAXB, getReferenceDuration, getViewTypes, hashCode, hasReferenceDuration, initLazyImageGroups, initLazyVariants, processHTML, removeReferenceDuration, setAssociatedVirtualFiles, setAttachments, setBundle, setCreator, setLastModifier, setLocale, setLocalizationMap, setReferenceDuration, toString, updateHTML, updateLocalizationMap
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractNamableEntity
setName
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractNamedEntity
getName
 
Methods inherited from class org.torweg.pulse.util.entity.AbstractBasicEntity
compareTo, getFullQualifiedClassNameJAXB, getId
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.torweg.pulse.util.INameable
setName
 
Methods inherited from interface org.torweg.pulse.util.INamed
getName
 

Constructor Detail

CMSContent

@Deprecated
public CMSContent()
Deprecated. 

HibernateTM.


CMSContent

public CMSContent(java.util.Locale locale, Bundle bundle)
creates a new CMSContent with the given Locale and Bundle.

Parameters:
locale - the Locale
bundle - the Bundle
Method Detail

getPages

public final java.util.List<Page> getPages()
Returns:
Returns the pages.

getPage

public final Page getPage(int index)
get the Page with the given index.

Parameters:
index - the "number" of the Page, starting from 0
Returns:
the Page with the given index

getPageById

public final Page getPageById(long l)
returns a Page of the current CMSContent specified by a given id.

Parameters:
l - the id
Returns:
returns a Page if the CMSContent contains a Page by the given id, null otherwise

setPage

public final void setPage(int index, Page page)
sets the Page with the given index to the given Page.

Parameters:
index - the "number" of the Page, starting from 0
page - the Page to be set

setPages

public final void setPages(java.util.List<Page> orderedPages)
sets the Pages for the CMSContent.

Parameters:
orderedPages - the Pages

addPage

public final void addPage(Page page)
adds the given Page to the CMSContent's pages.

Parameters:
page - the Page to be added

add

public final void add(int i, Page page)
adds the given Page to the CMSContent's pages at the given index.

Parameters:
i - the index
page - the Page to be added

removePage

public final void removePage(Page page)
removes the given Page from the CMSContent's pages.

Parameters:
page - the Page to be removed

removePage

public final void removePage(int index)
removes the Page with the given index from the CMSContent 's pages.

Parameters:
index - the "number" of the Page to be removed, starting from 0

removePageById

public final Page removePageById(long l)
removes the Page with the id from the CMSContent's pages.

Parameters:
l - the id of the Page to be removed
Returns:
the Page or null, if no such Page could be removed

getNumberOfPages

public final int getNumberOfPages()
returns the number of Pages belonging to the CMSContent.

Returns:
the number of Pages belonging to the CMSContent

deserializeToJDOM

public org.jdom.Element deserializeToJDOM()
a CMSContent deserialised to XML.

Specified by:
deserializeToJDOM in interface JDOMable
Overrides:
deserializeToJDOM in class AbstractBasicContent
Returns:
&lt;Content/&gt;
See Also:
JDOMable.deserializeToJDOM()

deserializeToJDOM

public org.jdom.Element deserializeToJDOM(ServiceRequest r)
a CMSContent deserialised to XML.

Specified by:
deserializeToJDOM in interface ExtendedJDOMable
Overrides:
deserializeToJDOM in class AbstractBasicContent
Parameters:
r - the request
Returns:
&lt;Content/&gt;
See Also:
ExtendedJDOMable.deserializeToJDOM(org.torweg.pulse.service.request.ServiceRequest)

getFullTextValue

public java.lang.StringBuilder getFullTextValue()
returns the full text value of AbstractBasicContent plus the text value of all Pages.

Overrides:
getFullTextValue in class AbstractBasicContent
Returns:
the full text value of AbstractBasicContent plus the text value of all Pages.

onVirtualFileSystemChange

public void onVirtualFileSystemChange(VirtualFile file)
updates the CMSContents HTML, if associated VirtualFiles have been moved in the VirtualFileSystem.

This method is executed by the VirtualFileSystem

Specified by:
onVirtualFileSystemChange in class Content
Parameters:
file - the moved files

updateAssociatedVirtualFiles

public void updateAssociatedVirtualFiles()
is called by the editors upon save actions to update the list of associated VirtualFiles.

Specified by:
updateAssociatedVirtualFiles in class Content

isGroup

public final boolean isGroup()
returns false.

Specified by:
isGroup in class Content
Returns:
false.
See Also:
Content.isGroup()

getLinkCorrectables

public java.util.Set<ILinkCorrectableElement> getLinkCorrectables()
Description copied from interface: ILinkCorretable
a set with the Elements to be corrected.

Specified by:
getLinkCorrectables in interface ILinkCorretable
Overrides:
getLinkCorrectables in class AbstractBasicContent
Returns:
the set of ILinkCorrectableElements
See Also:
AbstractBasicContent.getLinkCorrectables()

createCopy

public CMSContent createCopy(java.util.Locale l, User user)
creates and returns a non-persistent (therefore id = null) copy of the current CMSContent with a given Locale.

Specified by:
createCopy in class AbstractBasicContent
Parameters:
l - the Locale to use for the the copy
user - the user to be used as creator and last modifier
Returns:
a copy of this CMSContent

initLazyFields

public void initLazyFields()
initialises the lazy fields for display.

Overrides:
initLazyFields in class Content
See Also:
Content.initLazyFields()