Package com.groiss.wfxml
Class WfXMLFolder
java.lang.Object
com.groiss.wfxml.WfXMLObject
com.groiss.wfxml.WfXMLForm
com.groiss.wfxml.WfXMLFolder
- All Implemented Interfaces:
Cloneable
This class represents a DMSFolder. Other
See
WfXMLObject
objects can be
added as content to the folder.See
WfXMLObject
for examples on how to use the WfXMLObject objects in
general.-
Field Summary
Fields inherited from class com.groiss.wfxml.WfXMLForm
content, formName, id, subformId, subForms, version
Fields inherited from class com.groiss.wfxml.WfXMLObject
notes, userId
-
Constructor Summary
ConstructorDescriptionWfXMLFolder
(DMSFolder dmsFolder) This constructor creates a WfXMLFolder out of aDMSFolder
.WfXMLFolder
(String name, String userId) Create a new empty standard folder and set a name for it.WfXMLFolder
(org.apache.xmlbeans.XmlObject obj) loads theWfXMLFolder
from aFolderFormDocument.FolderForm
element -
Method Summary
Modifier and TypeMethodDescriptionvoid
addContent
(WfXMLObject obj) Add anotherWfXMLObject
to the content of this folder.clone()
Creates a copy of this WfXMLFolder.createDMSObject
(User defaultCreator) This method creates aDMSFolder
out of this WfXMLObject object.createDMSObject
(User defaultCreator, DMSFolder parentFolder) void
This method fills an existing DMS folder with the data contained in this WfXML folder.getName()
Get the name of the folder.org.apache.xmlbeans.XmlObject
You get aList
filled with the content of this folder.Use this method to get a list containing all subfolders of this folder.void
Set a name for the folder.Methods inherited from class com.groiss.wfxml.WfXMLForm
addSubForm, attachNote, attachNote, getField, getFormName, getId, getNotes, getSubformId, getSubForms, getVersion, removeField, setField, setField, setField, setField, setFormName, setId, setSubformId, setVersion
Methods inherited from class com.groiss.wfxml.WfXMLObject
createInstance, createInstance, getUser, getUser, getUserId, setUserId
-
Constructor Details
-
WfXMLFolder
Create a new empty standard folder and set a name for it.- Parameters:
name
- The name of the folder.userId
- The user who will be the creator of this folder. Set it tonull
, if you don't want to specify a user.
-
WfXMLFolder
public WfXMLFolder(org.apache.xmlbeans.XmlObject obj) loads theWfXMLFolder
from aFolderFormDocument.FolderForm
element -
WfXMLFolder
This constructor creates a WfXMLFolder out of aDMSFolder
. All content of the folder is also transformed toWfXMLObject
objects.- Parameters:
dmsFolder
- The DMSFolder folder.- Throws:
Exception
- if an item of the folder cannot be created.
-
-
Method Details
-
getName
Get the name of the folder. The name of the folder is also the name that you will see in DMS folders where the folder is displayed. -
setName
Set a name for the folder.- Parameters:
name
- The new folder name.
-
addContent
Add anotherWfXMLObject
to the content of this folder.- Parameters:
obj
- The object you want to add.
-
listContent
You get aList
filled with the content of this folder. The elements of the list areWfXMLObject
objects. You can perform changes on the list without affecting this WfXMLFolder, but the referencedWfXMLObject
objects are not copied, thus changes on them also affect the referenced objects of this folder.- Returns:
- A
List
containing the content (WfXMLObject
objects) of this folder. If the folder is empty, the returned List is also empty.
-
listSubFolders
Use this method to get a list containing all subfolders of this folder.- Returns:
- A
List
filled with the subfolders of this folder. The elements of the List are WfXMLFolder objects. If there are no subfolders, the returned List will be empty.
-
fill
This method fills an existing DMS folder with the data contained in this WfXML folder. That means: every object that already exists in the DMS folder, will be updated with the data of corresponding objects (same name) in this WfXML folder, or, if objects don't exist they will be created and added to the DMS folder.- Overrides:
fill
in classWfXMLForm
- Parameters:
existingFolder
- An existingDMSFolder
that you wish to fill with the data of thisWfXMLFolder
. If you pass not aDMSFolder
, the method will do nothing.defaultCreator
- A default creator for elements that will be newly created. It would be good to provide a default creator for this method, because maybe there will be new DMS objects created and then a creator is needed in case that the corresponding WfXML objects don't contain creators.- Throws:
Exception
- if filling theDMSFolder
fails (update of existing elements or creation of new elements doesn't work).
-
createDMSObject
This method creates aDMSFolder
out of this WfXMLObject object. The whole content of that folder will also be created (variousDMSObject
objects. Usually the objects are created by the user who was defined to create them. If no user is defined in a WfXMLObject (or if the defined user doesn't exist), thedefaultCreator
will be used.- Overrides:
createDMSObject
in classWfXMLForm
- Parameters:
defaultCreator
- You can specify a default creator for the case that no other user can be found.- Returns:
- A reference to the
DMSForm
, which represents thisWfXMLForm
. - Throws:
Exception
- if no user can be found for creating theDMSObject
objects, or if creating the folder or parts of its content fails.
-
createDMSObject
- Throws:
Exception
-
clone
Creates a copy of this WfXMLFolder. If the foldertype also includes a form, this form-part is copied like withWfXMLForm.clone()
, so you can find more details there. The folder content array of this WfXMLFolder is cloned, but the referencedWfXMLObject
objects are not cloned. So if you want to modify these objects, you should take care.- Overrides:
clone
in classWfXMLForm
- Returns:
- A WfXMLFolder object which is a clone of this object. You can cast
it to
WfXMLFolder
, because the returned object is always of that type.
-
getXMLObject
public org.apache.xmlbeans.XmlObject getXMLObject()- Overrides:
getXMLObject
in classWfXMLForm
-