de.hs_rm.cs.lecturenotes.shared.entity
Class Paragraph

java.lang.Object
  extended by de.hs_rm.cs.lecturenotes.shared.entity.Paragraph
All Implemented Interfaces:
com.google.gwt.user.client.rpc.IsSerializable, IStringTemplateEntity, IXMLEntity

public final class Paragraph
extends java.lang.Object
implements com.google.gwt.user.client.rpc.IsSerializable, IXMLEntity, IStringTemplateEntity

Paragraph entity or system object. The paragraph is versioned. The primary key id is just a auto-incremented per row id, while the pair (paraId, version) fully identifies a certain versioned paragraph. Each new paragraph gets a new paraId, that is incremented by the business logic. If an user makes an update the version of the paragraph is incremented (next to the version number of the Lecture.

Version:
$LastChangedRevision: 262 $
Author:
Enrico Homann

Field Summary
static java.lang.String INDENT
          Tidy the XML.
 
Constructor Summary
Paragraph()
          Default constructor.
Paragraph(long nId, long nParaId, long nLectureId, long nParentId, long nPosition, long nVersion, java.lang.String sTitle, java.lang.String sContent)
          Constructor.
Paragraph(long nId, long nParaId, long nLectureId, long nParentId, long nPosition, long nVersion, java.lang.String sTitle, java.lang.String sContent, java.util.List<Paragraph> oChildren)
          Constructor.
 
Method Summary
 void fill(Paragraph that)
          Fills this by Paragraph that.
 java.lang.String fillTemplate(java.lang.String template)
          Will return a String based upon a template where the tags were replaced using the attribute tags of the persisted table and the attributes of this object.
 java.util.List<Paragraph> getChildren()
          Will return the children.
 java.lang.String getContent()
          Will return the content.
 java.lang.Boolean getEnabled()
          Will return the soft-remove indicator enabled.
 java.util.List<Exercise> getExercises()
          Will return the exercises.
 java.lang.Long getId()
          Will return the id.
 java.lang.Long getLectureId()
          Will return the lecture id.
 java.lang.Long getParaId()
          Will return the para id.
 java.lang.Long getParentId()
          Will return the parent id.
 java.lang.Long getPosition()
          Will return the position.
 java.lang.String getTitle()
          Will return the title.
 java.lang.Long getVersion()
          Will return the version.
 java.lang.String getXMLRepresentation()
          Will return a XML representation of the entity.
 void setChildren(java.util.List<Paragraph> oChildren)
          Sets the children.
 void setContent(java.lang.String sContent)
          Sets the content.
 void setEnabled(java.lang.Boolean bEnabled)
          Sets the soft-remove indicator enabled.
 void setExercises(java.util.List<Exercise> oExercises)
          Sets the exercises.
 void setId(java.lang.Long nId)
          Sets the id.
 void setLectureId(java.lang.Long nLectureId)
          Sets the lecture id.
 void setParaId(java.lang.Long nParaId)
          Sets the para id.
 void setParentId(java.lang.Long nParentId)
          Sets the parent id.
 void setPosition(java.lang.Long nPosition)
          Sets the position.
 void setTitle(java.lang.String sTitle)
          Sets the title.
 void setVersion(java.lang.Long nVersion)
          Sets the version.
 java.lang.String toString()
           
 void writeAsXML(java.lang.StringBuffer sb)
          Writes a XML representation of the entity to StringBuffer sb .
 void writeAsXML(java.lang.StringBuffer sb, int indentNumbersOf)
          Will write XML representation of this entity to StringBuffer sb, tidy up with indentation number indentNumbersOf.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

INDENT

public static final java.lang.String INDENT
Tidy the XML. Specify one INDENT.

See Also:
Constant Field Values
Constructor Detail

Paragraph

public Paragraph()
Default constructor. Needed for serialization.


Paragraph

public Paragraph(long nId,
                 long nParaId,
                 long nLectureId,
                 long nParentId,
                 long nPosition,
                 long nVersion,
                 java.lang.String sTitle,
                 java.lang.String sContent)
Constructor.

Parameters:
nId - long
nParaId - long
nLectureId - long
nParentId - long
nPosition - long
nVersion - long
sTitle - String
sContent - String

Paragraph

public Paragraph(long nId,
                 long nParaId,
                 long nLectureId,
                 long nParentId,
                 long nPosition,
                 long nVersion,
                 java.lang.String sTitle,
                 java.lang.String sContent,
                 java.util.List<Paragraph> oChildren)
Constructor.

Parameters:
nId - long
nParaId - long
nLectureId - long
nParentId - long
nPosition - long
nVersion - long
sTitle - String
sContent - String
oChildren - List of Paragraph
Method Detail

getId

public java.lang.Long getId()
Will return the id.

Returns:
Long

setId

public void setId(java.lang.Long nId)
Sets the id.

Parameters:
nId - Long

getLectureId

public java.lang.Long getLectureId()
Will return the lecture id.

Returns:
Long

setLectureId

public void setLectureId(java.lang.Long nLectureId)
Sets the lecture id.

Parameters:
nLectureId - Long

getParaId

public java.lang.Long getParaId()
Will return the para id.

Returns:
Long

setParaId

public void setParaId(java.lang.Long nParaId)
Sets the para id.

Parameters:
nParaId - Long

getParentId

public java.lang.Long getParentId()
Will return the parent id.

Returns:
Long

setParentId

public void setParentId(java.lang.Long nParentId)
Sets the parent id.

Parameters:
nParentId - Long

getPosition

public java.lang.Long getPosition()
Will return the position.

Returns:
Long

setPosition

public void setPosition(java.lang.Long nPosition)
Sets the position.

Parameters:
nPosition - Long

getVersion

public java.lang.Long getVersion()
Will return the version.

Returns:
Long

setVersion

public void setVersion(java.lang.Long nVersion)
Sets the version.

Parameters:
nVersion - Long

getContent

public java.lang.String getContent()
Will return the content.

Returns:
String

setContent

public void setContent(java.lang.String sContent)
Sets the content.

Parameters:
sContent - String

getTitle

public java.lang.String getTitle()
Will return the title.

Returns:
String

setTitle

public void setTitle(java.lang.String sTitle)
Sets the title.

Parameters:
sTitle - String

getEnabled

public java.lang.Boolean getEnabled()
Will return the soft-remove indicator enabled.

Returns:
Boolean

setEnabled

public void setEnabled(java.lang.Boolean bEnabled)
Sets the soft-remove indicator enabled. Where true means the entity is enabled, and false means the system shall treat it like it was removed.

Parameters:
bEnabled - Boolean

getChildren

public java.util.List<Paragraph> getChildren()
Will return the children.

Returns:
List of Paragraph

setChildren

public void setChildren(java.util.List<Paragraph> oChildren)
Sets the children.

Parameters:
oChildren - List of Paragraph

getExercises

public java.util.List<Exercise> getExercises()
Will return the exercises.

Returns:
List of Exercise

setExercises

public void setExercises(java.util.List<Exercise> oExercises)
Sets the exercises.

Parameters:
oExercises - List of Exercise

writeAsXML

public void writeAsXML(java.lang.StringBuffer sb,
                       int indentNumbersOf)
Will write XML representation of this entity to StringBuffer sb, tidy up with indentation number indentNumbersOf.

Parameters:
sb - StringBuffer
indentNumbersOf - int

writeAsXML

public void writeAsXML(java.lang.StringBuffer sb)
Description copied from interface: IXMLEntity
Writes a XML representation of the entity to StringBuffer sb .

Specified by:
writeAsXML in interface IXMLEntity
Parameters:
sb - StringBuffer

getXMLRepresentation

public java.lang.String getXMLRepresentation()
Description copied from interface: IXMLEntity
Will return a XML representation of the entity.

Specified by:
getXMLRepresentation in interface IXMLEntity
Returns:
String

fill

public void fill(Paragraph that)
Fills this by Paragraph that.

Parameters:
that - Paragraph

fillTemplate

public java.lang.String fillTemplate(java.lang.String template)
Will return a String based upon a template where the tags were replaced using the attribute tags of the persisted table and the attributes of this object. While the prefix for each template tag is %user_

Specified by:
fillTemplate in interface IStringTemplateEntity
Parameters:
template - String
Returns:
String String with replaced key tags

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object