Package com.groiss.wfxml
Class WfXMLNote
java.lang.Object
com.groiss.wfxml.WfXMLObject
com.groiss.wfxml.WfXMLNote
- All Implemented Interfaces:
Cloneable
This class represents notes. It can be used to create new notes, create notes
out of JDOM elements, and create notes out of existing DMSNote objects (see
the corresponding constructors). Once you have a WfXMLNote object, you can use
the
See the super class
createDMSObject(com.groiss.org.User)
method to create a new DMSNote.See the super class
WfXMLObject
for more details and examples.-
Field Summary
Fields inherited from class com.groiss.wfxml.WfXMLObject
notes, userId
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionclone()
Creates a deep copy of this note.createDMSObject
(User defaultCreator) void
This method fills an existingDMSNote
with the data of this WfXMLNote and updates it to the database.Returns the content string of this note.getName()
Returns the name of this note.Returns the subject of this note.org.apache.xmlbeans.XmlObject
boolean
Use this method to check if this note is private or not.void
setContent
(String content) Set the content of this note.void
setPrivate
(boolean isPrivate) This method sets the note to be private or public viewable.void
setSubject
(String subject) Set a subject for the note.Methods inherited from class com.groiss.wfxml.WfXMLObject
createInstance, createInstance, getUser, getUser, getUserId, setUserId
-
Constructor Details
-
WfXMLNote
Creates a note with all possible fields.- Parameters:
subject
- A subject for the note.content
- The content of the note.userId
- Id of the user who will be (or is) the creator of the note. You can usenull
here, if you don't want to use a special user. In that case the note will be created by another user (if possible), or an error will occur.isPrivate
- Indicates whether this note is private or not. If it is private (true
), only the creator of the message has the rights to view the note.
-
WfXMLNote
-
WfXMLNote
public WfXMLNote(org.apache.xmlbeans.XmlObject obj)
-
-
Method Details
-
getContent
Returns the content string of this note.- Returns:
- A
String
containing the content of this note.
-
isPrivate
public boolean isPrivate()Use this method to check if this note is private or not.- Returns:
true
if this is a private note orfalse
if the note is public.
-
getSubject
Returns the subject of this note.- Returns:
- A
String
with the subject of this note.
-
getName
Returns the name of this note. In fact the name of a note always equals to the note's subject. This method is present here, because everyWfXMLObject
supports agetName
method, which returns the name with which the object is listed in DMS folders.- Specified by:
getName
in classWfXMLObject
- Returns:
- The name of the note (its subject).
-
setContent
Set the content of this note. Any old content will be lost if you set new content with this method.- Parameters:
content
- AString
containing the content for this note.
-
setPrivate
public void setPrivate(boolean isPrivate) This method sets the note to be private or public viewable.- Parameters:
isPrivate
-true
makes the note private,false
makes it public.
-
setSubject
Set a subject for the note.- Parameters:
subject
- AString
with the subject of the note.
-
fill
This method fills an existingDMSNote
with the data of this WfXMLNote and updates it to the database.- Specified by:
fill
in classWfXMLObject
- Parameters:
existingNote
- The existingDMSNote
. If you pass an object that is noDMSNote
, this method will simply do nothing.defaultCreator
- A creator for objects that must be created. As this method updates a note, the user will not be used, because it will not be necessary to create anything here. You can simply pass innull
.- Throws:
Exception
- If updating theDMSNote
with the data fails.
-
createDMSObject
- Specified by:
createDMSObject
in classWfXMLObject
- Parameters:
defaultCreator
- You can specify a default creator with this parameter. If there is no user defined in thisWfXMLNote
object, or if the defined user cannot be found, thedefaultCreator
will be used. If this user also does not exist, anApplicationException
will be thrown.- Returns:
- The new
DMSNote
object, ornull
if creating the note didn't work.
-
clone
Creates a deep copy of this note. The returned object can be casted toWfXMLNote
. -
getXMLObject
public org.apache.xmlbeans.XmlObject getXMLObject()- Specified by:
getXMLObject
in classWfXMLObject
-