com.groiss.wfxml
Class WfXMLFolder

java.lang.Object
  extended by com.groiss.wfxml.WfXMLObject
      extended by com.groiss.wfxml.WfXMLForm
          extended by com.groiss.wfxml.WfXMLFolder
All Implemented Interfaces:
java.lang.Cloneable

public class WfXMLFolder
extends WfXMLForm
implements java.lang.Cloneable

This class represents a DMSFolder. Other 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, FIELDDT, FORM_FIELD, FORM_FIELDNAME, FORMID, formName, FORMSUBID, FORMUSER, FORMVERSION, id, subformId, subForms, version
 
Fields inherited from class com.groiss.wfxml.WfXMLObject
namespace, notes, userId
 
Constructor Summary
WfXMLFolder(DMSFolder folder)
          This constructor creates a WfXMLFolder out of a DMSFolder.
WfXMLFolder(org.jdom.Element folderFormElem)
          Deprecated. 
WfXMLFolder(java.lang.String name, java.lang.String userId)
          Create a new empty standard folder and set a name for it.
WfXMLFolder(org.apache.xmlbeans.XmlObject obj)
          loads the WfXMLFolder from a FolderFormDocument.FolderForm element
 
Method Summary
 void addContent(WfXMLObject obj)
          Add another WfXMLObject to the content of this folder.
 java.lang.Object clone()
          Creates a copy of this WfXMLFolder.
 DMSObject createDMSObject(User defaultCreator)
          This method creates a DMSFolder out of this WfXMLObject object.
 void fill(DMSObject existingFolder, User defaultCreator)
          This method fills an existing DMS folder with the data contained in this WfXML folder.
 org.jdom.Element getAsXML()
          Deprecated. 
 java.lang.String getName()
          Get the name of the folder.
 org.apache.xmlbeans.XmlObject getXMLObject()
           
 java.util.List<WfXMLObject> listContent()
          You get a List filled with the content of this folder.
 java.util.List listSubFolders()
          Use this method to get a list containing all subfolders of this folder.
 void setFormTypesRestriction(java.util.Collection<FormType> formTypes)
          Sets a form type restriction for WfXMLDocForm objects in this folder and its subfolders.
 void setName(java.lang.String name)
          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, setFormName, setId, setSubformId, setVersion
 
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

WfXMLFolder

public WfXMLFolder(java.lang.String name,
                   java.lang.String userId)
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 to null, if you don't want to specify a user.

WfXMLFolder

public WfXMLFolder(org.apache.xmlbeans.XmlObject obj)
loads the WfXMLFolder from a FolderFormDocument.FolderForm element


WfXMLFolder

@Deprecated
public WfXMLFolder(org.jdom.Element folderFormElem)
            throws java.lang.IllegalArgumentException
Deprecated. 

This creates a WfXMLFolder object out of a JDOM Element holding data of a folder. The content of the folder is also created as WfXMLObject objects.

Parameters:
folderFormElem - A JDOM Element holding the folder and its content.
Throws:
java.lang.IllegalArgumentException - if the folderFormElem parameter is not a valid folder element.

WfXMLFolder

public WfXMLFolder(DMSFolder folder)
            throws java.lang.Exception
This constructor creates a WfXMLFolder out of a DMSFolder. All content of the folder is also transformed to WfXMLObject objects...

Parameters:
folder - The DMSFolder folder.
Throws:
java.lang.Exception - if an item of the folder cannot be created.
Method Detail

setFormTypesRestriction

public void setFormTypesRestriction(java.util.Collection<FormType> formTypes)
Sets a form type restriction for WfXMLDocForm objects in this folder and its subfolders. The restriction only affects WfXMLDocForm objects, all other WfXMLObject objects are not affected in any way. Specify a collection of form types in order to apply a restriction. Setting a form type restriction has the following effects:

Parameters:
formTypes - A collection with FormType objects, or null if you want to remove a previously set restriction.

getName

public java.lang.String 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.

Overrides:
getName in class WfXMLForm
Returns:
A String with the folder's name.

setName

public void setName(java.lang.String name)
Set a name for the folder.

Parameters:
name - The new folder name.

addContent

public void addContent(WfXMLObject obj)
Add another WfXMLObject to the content of this folder.

Parameters:
obj - The object you want to add.

listContent

public java.util.List<WfXMLObject> listContent()
You get a List filled with the content of this folder. The elements of the list are WfXMLObject objects. You can perform changes on the list without affecting this WfXMLFolder, but the referenced WfXMLObject 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

public java.util.List 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

public void fill(DMSObject existingFolder,
                 User defaultCreator)
          throws java.lang.Exception
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 class WfXMLForm
Parameters:
existingFolder - An existing DMSFolder that you wish to fill with the data of this WfXMLFolder. If you pass not a DMSFolder, 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:
java.lang.Exception - if filling the DMSFolder fails (update of existing elements or creation of new elements doesn't work).

createDMSObject

public DMSObject createDMSObject(User defaultCreator)
                          throws java.lang.Exception
This method creates a DMSFolder out of this WfXMLObject object. The whole content of that folder will also be created (various DMSObject 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), the defaultCreator will be used.

Overrides:
createDMSObject in class WfXMLForm
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 this WfXMLForm.
Throws:
java.lang.Exception - if no user can be found for creating the DMSObject objects, or if creating the folder or parts of its content fails.

getAsXML

@Deprecated
public org.jdom.Element getAsXML()
Deprecated. 

Creates an XML representation of this WfXMLFolder. The returned JDOM Element contains all the data of the folder (including all WfXMLObject objects and subfolders, etc.).

Overrides:
getAsXML in class WfXMLForm
Returns:
A JDOM Element with all the content of the folder.

clone

public java.lang.Object clone()
Creates a copy of this WfXMLFolder. If the foldertype also includes a form, this form-part is copied like with WfXMLForm.clone(), so you can find more details there. The folder content array of this WfXMLFolder is cloned, but the referenced WfXMLObject objects are not cloned. So if you want to modify these objects, you should take care.

Overrides:
clone in class WfXMLForm
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 class WfXMLForm


@enterprise 8.0.22989 Copyright © 2001-2017 Groiss Informatics GmbH. All Rights Reserved.