com.groiss.wfxml
Class WfXMLDocForm

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

public class WfXMLDocForm
extends WfXMLForm

This class represents DMSDocForm objects.
See the WfXMLObject base class for general information and examples of how to use WfXMLObject objects.


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
WfXMLDocForm(DMSDocForm dmsDocForm)
          Create a WfXMLDocForm out of a DMSDocForm.
WfXMLDocForm(org.jdom.Element docFormElem)
          Deprecated. 
WfXMLDocForm(java.lang.String name, java.lang.String extension, byte[] content, java.lang.String userId)
          Creates a new WfXMLDocForm.
WfXMLDocForm(org.apache.xmlbeans.XmlObject obj)
           
 
Method Summary
 DMSObject createDMSObject(User defaultCreator)
          Use this method to create a DMSObject out of this WfXMLDocForm object.
 void fill(DMSObject existingDocForm, User defaultCreator)
          This method fills an existing DMSForm with the values of this WfXMLForm.
 org.jdom.Element getAsXML()
          Creates a XML representation of the WfXMLDocForm.
 byte[] getContent()
          Returns the document's content byte array.
Note: The byte array is not cloned, so if you modify it, the data set in this WfXMLDocForm object will also change.
 java.lang.String getExtension()
          Get the extension of the document (filename-extension).
 java.lang.String getName()
          Get the full name of the document (filename and extension).
 java.lang.String getNamePart()
          Returns just the name part of this doc form.
 org.apache.xmlbeans.XmlObject getXMLObject()
           
 void setContent(byte[] content)
          Set new content for the document.
 void setExtensionPart(java.lang.String extension)
          Set a new extension for the document.
 void setNamePart(java.lang.String name)
          Set the name part of the document (filename only; without extension).
 
Methods inherited from class com.groiss.wfxml.WfXMLForm
addSubForm, attachNote, attachNote, clone, 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

WfXMLDocForm

public WfXMLDocForm(java.lang.String name,
                    java.lang.String extension,
                    byte[] content,
                    java.lang.String userId)
Creates a new WfXMLDocForm. You can set parameters to null if they don't exist or if you prefer setting them with the corresponding setter method later.

Parameters:
name - The name of the document (filename).
extension - The extension of the document (filename-extension).
content - A byte array holding the content of this document form. The byte array will be stored in zipped form.
userId - A user who will be the creator of the DMSDocForm, when it is created. You can set this to null if you don't want to specify a particular user.

WfXMLDocForm

public WfXMLDocForm(org.apache.xmlbeans.XmlObject obj)

WfXMLDocForm

@Deprecated
public WfXMLDocForm(org.jdom.Element docFormElem)
             throws java.lang.IllegalArgumentException
Deprecated. 

Creates a WfXMLDocForm object out of a XML representation. The JDOM Element contains data and attached notes.

Parameters:
docFormElem - The JDOM Element holding data about a docForm.
Throws:
java.lang.IllegalArgumentException - if docFormElem is an unexpected element.

WfXMLDocForm

public WfXMLDocForm(DMSDocForm dmsDocForm)
             throws java.lang.Exception
Create a WfXMLDocForm out of a DMSDocForm. Attached notes are also included.

Parameters:
dmsDocForm - A DMSDocForm object.
Throws:
java.lang.Exception - if there are reading-problems and the WfXMLDocForm cannot be created.
Method Detail

getName

public java.lang.String getName()
Get the full name of the document (filename and extension).

Overrides:
getName in class WfXMLForm
Returns:
The name consisting of name and extension. If this is not a standard document, the name will be taken from the form field of the name attribute field.

setNamePart

public void setNamePart(java.lang.String name)
Set the name part of the document (filename only; without extension).

Parameters:
name - The new name for the document.

getNamePart

public java.lang.String getNamePart()
Returns just the name part of this doc form. If it is not a standard document, the name will be taken from the form field of the name attribute field.

Returns:
The name of the document (without extension!).

getExtension

public java.lang.String getExtension()
Get the extension of the document (filename-extension).

Returns:
The extension.

setExtensionPart

public void setExtensionPart(java.lang.String extension)
Set a new extension for the document. The mime type is not automatically changed when you set a new extension.

Parameters:
extension - The new extension for the document.

getContent

public byte[] getContent()
Returns the document's content byte array.
Note: The byte array is not cloned, so if you modify it, the data set in this WfXMLDocForm object will also change.

Returns:
The byte array holding the content of this document form.

setContent

public void setContent(byte[] content)
Set new content for the document.

Parameters:
content - The new content for this document form object.

fill

public void fill(DMSObject existingDocForm,
                 User defaultCreator)
          throws java.lang.Exception
Description copied from class: WfXMLForm
This method fills an existing DMSForm with the values of this WfXMLForm. It's similar to WfXMLForm.createDMSObject(com.groiss.org.User), with the only difference, that the DMSForm must already exist.
Notes and subforms will also be created and attached to the DMSForm. All values that have been defined in this WfXMLForm will be set in the DMSForm. So values, which exist in the DMSForm, will not be changed, if they are not defined in the WfXMLForm...
After filling the form with data, changes are stored in the database.

Overrides:
fill in class WfXMLForm
Parameters:
existingDocForm - An existing DMSForm, which will be filled with the values set in this WfXMLForm. If you pass an object of a different type to this method, nothing will be done.
defaultCreator - A default user for creating objects (notes, subforms), if no particular user is defined for creating them. You can set this parameter to null if you don't want to provide a default creator.
Throws:
java.lang.Exception - if no user could be found, or if something fails while objects are created and attached/added.

createDMSObject

public DMSObject createDMSObject(User defaultCreator)
                          throws java.lang.Exception
Use this method to create a DMSObject out of this WfXMLDocForm object.

Overrides:
createDMSObject in class WfXMLForm
Parameters:
defaultCreator - If the user who is defined in this document form cannot be found, or if no user was defined, this defaultCreator will be used to create DMSObject objects. Providing a default creator is optional, so you can pass null if you don't want to set a default creator.
Returns:
A reference to the DMSForm, which represents this WfXMLForm.
Throws:
java.lang.Exception - if there is no user for creating the DMSObject, or if creating failed.

getAsXML

public org.jdom.Element getAsXML()
Creates a XML representation of the WfXMLDocForm. The returned JDOM Element object contains the content of this WfXMLDocForm including attached notes.

Overrides:
getAsXML in class WfXMLForm
Returns:
A JDOM Element with the data of this WfXMLDocForm.

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.