|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.groiss.wfxml.WfXMLObject
com.groiss.wfxml.WfXMLNote
public class WfXMLNote
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
its getAsXML() method to get a JDOM representation of the note, or the
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 |
|---|
namespace, notes, userId |
| Constructor Summary | |
|---|---|
WfXMLNote(DMSNote dmsNote)
Use this constructor to build a WfXMLNote out of a DMSNote. |
|
WfXMLNote(org.jdom.Element noteElem)
Deprecated. |
|
WfXMLNote(String subject,
String content,
String userId,
boolean isPrivate)
Creates a note with all possible fields. |
|
WfXMLNote(org.apache.xmlbeans.XmlObject obj)
|
|
| Method Summary | |
|---|---|
Object |
clone()
Creates a deep copy of this note. |
DMSObject |
createDMSObject(User defaultCreator)
Creates a DMSNote object out of this
WfXMLNote. |
void |
fill(DMSObject existingNote,
User defaultCreator)
This method fills an existing DMSNote with the data
of this WfXMLNote and updates it to the database. |
org.jdom.Element |
getAsXML()
This method creates a JDOM representation of this note. |
String |
getContent()
Returns the content string of this note. |
String |
getName()
Returns the name of this note. |
String |
getSubject()
Returns the subject of this note. |
org.apache.xmlbeans.XmlObject |
getXMLObject()
|
boolean |
isPrivate()
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, createInstance, getUser, getUser, getUserId, setUserId |
| Methods inherited from class java.lang.Object |
|---|
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public WfXMLNote(String subject,
String content,
String userId,
boolean isPrivate)
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 use null 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.
@Deprecated
public WfXMLNote(org.jdom.Element noteElem)
throws IllegalArgumentException
Element. The
Element must be a note element, otherwise an
exception will be thrown.
noteElem - JDOM Element representing a
note.
IllegalArgumentException - if the noteElem parameter
is no valid note element.
public WfXMLNote(DMSNote dmsNote)
throws Exception
DMSNote. The WfXMLNote will be filled with
the values of the DMSNote.
dmsNote - A DMSNote object.
Exception - if there occur problems reading data from the
DMSNote object.public WfXMLNote(org.apache.xmlbeans.XmlObject obj)
| Method Detail |
|---|
public String getContent()
String containing the content of this note.public boolean isPrivate()
true if this is a private note or false
if the note is public.public String getSubject()
String with the subject of this note.public String getName()
WfXMLObject supports a getName method,
which returns the name with which the object is listed in DMS folders.
getName in class WfXMLObjectpublic void setContent(String content)
content - A String containing the content for
this note.public void setPrivate(boolean isPrivate)
isPrivate - true makes the note private, false
makes it public.public void setSubject(String subject)
subject - A String with the subject of the
note.
public void fill(DMSObject existingNote,
User defaultCreator)
throws Exception
DMSNote with the data
of this WfXMLNote and updates it to the database.
fill in class WfXMLObjectexistingNote - The existing DMSNote. If you pass
an object that is no DMSNote, 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 in null.
Exception - If updating the DMSNote with the
data fails.public DMSObject createDMSObject(User defaultCreator)
DMSNote object out of this
WfXMLNote.
createDMSObject in class WfXMLObjectdefaultCreator - You can specify a default creator with this parameter.
If there is no user defined in this WfXMLNote object, or if the defined
user cannot be found, the defaultCreator will be used. If this
user also does not exist, an
ApplicationException will be
thrown.
DMSNote object, or null
if creating the note didn't work.
Exception - if no user was found for creating the note, or
creating failed.public org.jdom.Element getAsXML()
getAsXML in class WfXMLObjectElement, which is a note element
with all information of this note.public Object clone()
WfXMLNote.
clone in class Objectpublic org.apache.xmlbeans.XmlObject getXMLObject()
getXMLObject in class WfXMLObject
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||