public class WfXMLNote extends WfXMLObject implements Cloneable
getAsXML()
method to get a JDOM representation of the note, or the
createDMSObject(com.groiss.org.User)
method to create a new DMSNote.WfXMLObject
for more details and examples.namespace, notes, userId
Constructor and Description |
---|
WfXMLNote(DMSNote dmsNote)
Use this constructor to build a WfXMLNote out of a
DMSNote . |
WfXMLNote(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) |
Modifier and Type | Method and Description |
---|---|
Object |
clone()
Creates a deep copy of this note.
|
DMSObject |
createDMSObject(User defaultCreator)
|
void |
fill(DMSObject existingNote,
User defaultCreator)
This method fills an existing
DMSNote with the data
of this WfXMLNote and updates it to the database. |
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.
|
createInstance, createInstance, createInstance, getUser, getUser, getUserId, setUserId
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(Element noteElem)
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(org.apache.xmlbeans.XmlObject obj)
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 WfXMLObject
public 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 WfXMLObject
existingNote
- 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)
createDMSObject
in class WfXMLObject
defaultCreator
- 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.public Element getAsXML()
getAsXML
in class WfXMLObject
Element
, which is a note element
with all information of this note.public Object clone()
WfXMLNote
.public org.apache.xmlbeans.XmlObject getXMLObject()
getXMLObject
in class WfXMLObject
@enterprise 10.0.38589 Copyright © 2001-2024 Groiss Informatics GmbH. All Rights Reserved.