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
Class FileContent

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.site.content.FileContent
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<Content>, ExtendedJDOMable, JDOMable, ILinkCorretable, INameable, INamed

@Entity
public class FileContent
extends AbstractBasicContent

A FileContent is a Content that represents a VirtualFile.

Version:
$Revision: 1398 $
Author:
Daniel Dietz
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.torweg.pulse.site.content.AbstractBasicContent
DEFAULT_SUFFIX
 
Constructor Summary
protected FileContent()
          Default constructor.
  FileContent(java.util.Locale locale, Bundle bundle)
          Creates a FileContent with the given Locale and the given Bundle.
  FileContent(java.lang.String name, java.util.Locale locale, Bundle bundle)
          Creates a FileContent with the given Locale and the given Bundle.
 
Method Summary
 FileContent createCopy(java.util.Locale l, User u)
          Creates a copy of the FileContent with the given Locale.
 org.jdom.Element deserializeToJDOM()
          Deserialises the state of the FileContent as a JDOM Element.
 org.jdom.Element deserializeToJDOM(ServiceRequest request)
          Deserialises the state of the FileContent as a JDOM Element building access URLs based on the current request.
 VirtualFile getFile()
          Returns the VirtualFile of the FileContent.
 void initLazyFields()
          initialises the content for display.
 boolean isGroup()
          Determines whether the Content is a group.
 boolean isIndexFile()
          Returns true if the file is indexed for search, false otherwise.
 void onVirtualFileSystemChange(VirtualFile f)
          Is called by the VirtualFileSystem, if any associated VirtualFiles have been moved in the file system.
 void setFile(VirtualFile f)
          Sets the VirtualFile for the FileContent.
 void setIndexFile(boolean index)
          Sets the indexFile.
 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
getFullTextValue, getKeywords, getLinkCorrectables, 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

FileContent

protected FileContent()
Default constructor.


FileContent

public FileContent(java.util.Locale locale, Bundle bundle)
Creates a FileContent with the given Locale and the given Bundle.

Parameters:
locale - the Locale to be used for the copy
bundle - the Bundle

FileContent

public FileContent(java.lang.String name,
                   java.util.Locale locale, Bundle bundle)
Creates a FileContent with the given Locale and the given Bundle.

Parameters:
name - the name
locale - the Locale to be used for the copy
bundle - the Bundle
Method Detail

setFile

public final void setFile(VirtualFile f)
Sets the VirtualFile for the FileContent.

Parameters:
f - the VirtualFile to set

getFile

public final VirtualFile getFile()
Returns the VirtualFile of the FileContent.

Returns:
the VirtualFile

setIndexFile

public final void setIndexFile(boolean index)
Sets the indexFile.

Parameters:
index - the indexFile to set

isIndexFile

public final boolean isIndexFile()
Returns true if the file is indexed for search, false otherwise.

Returns:
the indexFile

isGroup

public final boolean isGroup()
Description copied from class: Content
Determines whether the Content is a group.

A group is a Content generating its contents from its children in the Sitemap.

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

onVirtualFileSystemChange

public final void onVirtualFileSystemChange(VirtualFile f)
Is called by the VirtualFileSystem, if any associated VirtualFiles have been moved in the file system.

Specified by:
onVirtualFileSystemChange in class Content
Parameters:
f - the files that have been moved.
See Also:
Content.onVirtualFileSystemChange(VirtualFile)

updateAssociatedVirtualFiles

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

Specified by:
updateAssociatedVirtualFiles in class Content

createCopy

public FileContent createCopy(java.util.Locale l, User u)
Creates a copy of the FileContent with the given Locale.

Specified by:
createCopy in class AbstractBasicContent
Parameters:
l - the Locale to be used for the copy
u - the User to be used as the creator/last modifier of the copied Content
Returns:
the copy of the FileContent

initLazyFields

public void initLazyFields()
Description copied from class: Content
initialises the content for display.

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

deserializeToJDOM

public org.jdom.Element deserializeToJDOM()
Deserialises the state of the FileContent as a JDOM Element.

Specified by:
deserializeToJDOM in interface JDOMable
Overrides:
deserializeToJDOM in class AbstractBasicContent
Returns:
the state of the FileContent as a JDOM Element

deserializeToJDOM

public org.jdom.Element deserializeToJDOM(ServiceRequest request)
Deserialises the state of the FileContent as a JDOM Element building access URLs based on the current request.

Specified by:
deserializeToJDOM in interface ExtendedJDOMable
Overrides:
deserializeToJDOM in class AbstractBasicContent
Parameters:
request - the current ServiceRequest
Returns:
the state of the FileContent as a JDOM Element