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 Attachment

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.Attachment
All Implemented Interfaces:
java.io.Serializable, JDOMable, INameable, INamed

@Entity
public class Attachment
extends AbstractNamableEntity
implements INameable, java.io.Serializable, JDOMable

represents an Attachment to a Content, where Attachments are entities for downloads.

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

Constructor Summary
Attachment()
          Deprecated. 
Attachment(VirtualFile vf, java.lang.String n)
          creates a new Attachment with the given virtual file and name.
Attachment(VirtualFile vf, java.lang.String n, org.jdom.Element desc)
          creates a new Attachment with the given virtual file, name and description.
 
Method Summary
 org.jdom.Element deserializeToJDOM()
          this will deserialize the state of the JDOMable as a JDOM Element.
 org.jdom.Element getDescription()
          get the description of the Attachment.
 java.lang.String getDescriptionText()
          get the description of the Attachment as string.
 VirtualFile getVirtualFile()
          returns the VirtualFile of the Attachment.
 void setDescription(org.jdom.Element desc)
          sets the description of the Attachment.
 void setVirtualFile(VirtualFile f)
          sets the VirtualFile of the Attachment.
 net.sf.json.JSONObject toJSON()
          returns a JSON-representation of the Attachment.
 
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, equals, getFullQualifiedClassNameJAXB, getId, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, 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

Attachment

@Deprecated
public Attachment()
Deprecated. 

for HibernateTM.


Attachment

public Attachment(VirtualFile vf,
                  java.lang.String n)
creates a new Attachment with the given virtual file and name.

Parameters:
vf - the file
n - the name

Attachment

public Attachment(VirtualFile vf,
                  java.lang.String n,
                  org.jdom.Element desc)
creates a new Attachment with the given virtual file, name and description.

Parameters:
vf - the file
n - the name
desc - the description (may be null)
Method Detail

getVirtualFile

public final VirtualFile getVirtualFile()
returns the VirtualFile of the Attachment.

Returns:
the VirtualFile of the Attachment

setVirtualFile

public final void setVirtualFile(VirtualFile f)
sets the VirtualFile of the Attachment.

Parameters:
f - the file to be set

getDescription

public final org.jdom.Element getDescription()
get the description of the Attachment.

Returns:
the description of the Attachment

getDescriptionText

public final java.lang.String getDescriptionText()
get the description of the Attachment as string.

Returns:
the description of the Attachment

setDescription

public final void setDescription(org.jdom.Element desc)
sets the description of the Attachment.

Parameters:
desc - the description

deserializeToJDOM

public final org.jdom.Element deserializeToJDOM()
Description copied from interface: JDOMable
this will deserialize the state of the JDOMable as a JDOM Element.

Specified by:
deserializeToJDOM in interface JDOMable
Returns:
a JDOM representation of the Attachment
See Also:
JDOMable

toJSON

public final net.sf.json.JSONObject toJSON()
returns a JSON-representation of the Attachment.

Returns:
a JSON-representation of the Attachment