com.filenet.wcm.toolkit.server.util
Class BaseTemplate

java.lang.Object
  extended bycom.filenet.wcm.toolkit.server.util.BaseTemplate
Direct Known Subclasses:
DeclareRecordsTemplate, WcmEntryTemplate

public class BaseTemplate
extends java.lang.Object

Supplies functionality for creating, modifying, and maintaining the contents of an Template and launching the specified workflow.


Field Summary
protected  WcmAuthoringDataProvider adp
           
protected  WcmDocumentImpl doc
           
protected static java.lang.String ELEM_DEFINED
           
protected static java.lang.String ELEM_ENTRYTEMPLATE
           
protected static java.lang.String ELEM_FILE
           
protected static java.lang.String ELEM_INSTRUCTION
           
protected static java.lang.String ELEM_INSTRUCTIONS
           
protected static java.lang.String ELEM_NAME
           
protected static java.lang.String ELEM_PROPERTIES
           
protected static java.lang.String ELEM_PROPERTY
           
protected static java.lang.String ELEM_STYLE
           
protected static java.lang.String ELEM_TEMPLATETYPE
           
protected static java.lang.String ELEM_TYPE
           
protected static java.lang.String ELEM_VALUE
           
protected static java.lang.String ELEM_VERSION
           
protected static java.lang.String invalidChars
           
static java.lang.String TYPE_CUSTOM_OBJECT
          String representing a Custom Object object type.
static java.lang.String TYPE_DOCUMENT
          String representing a Document object type.
static java.lang.String TYPE_FOLDER
          String representing a Folder object type.
protected static java.lang.String XPATH_CLASSDESC
           
protected static java.lang.String XPATH_ENTRYTEMPLATE
           
protected static java.lang.String XPATH_FILE
           
protected static java.lang.String XPATH_FOLDER
           
protected static java.lang.String XPATH_INSTNAME
           
protected static java.lang.String XPATH_INSTRUCTION
           
protected static java.lang.String XPATH_INSTRUCTIONS
           
protected static java.lang.String XPATH_INSTVALUE
           
protected static java.lang.String XPATH_OBJECTSTORE
           
protected static java.lang.String XPATH_PROPDESCS
           
protected static java.lang.String XPATH_PROPERTIES
           
protected static java.lang.String XPATH_PROPERTY
           
protected static java.lang.String XPATH_TEMPLATETYPE
           
protected static java.lang.String XPATH_TYPE
           
protected static java.lang.String XPATH_VERSION
           
 
Constructor Summary
BaseTemplate()
           
 
Method Summary
 void addPropDescData(java.lang.String symName, java.lang.String dispName, java.lang.String dataType, java.lang.String objectType, java.lang.String nameValue, java.lang.String value, boolean required, boolean editable, boolean hidden)
          Add the property description node's of data.
 void addPropDescData(java.lang.String symName, java.lang.String dispName, java.lang.String dataType, java.lang.String objectType, java.lang.String nameValue, java.lang.String value, boolean required, boolean editable, boolean hidden, boolean overrideIfFound)
          Add the property description node's of data.
protected  void checkInvalidChars(java.lang.String filename)
          Check for invalid file name characters
protected static boolean checkParam(java.lang.Object o)
          Make sure object is not null and has some value.
 void doLoadFromId(java.lang.String objectStoreName, java.lang.String id)
          Get the Template contents fromt he Content Engine and parse the Template into a DOM document.
 void doLoadFromStream(com.filenet.wcm.api.TransportInputStream tis)
          Parse the Template into a DOM document
 org.w3c.dom.Node getClassDesc()
          Return a Node holding class information
 java.lang.String getClassDescId()
          Return the Class Id from holding class information
 java.lang.String getClassDescName()
          Return the Class Name from holding class information
 com.filenet.wcm.api.TransportInputStream getContents()
          Get the Etry Template contents as an input stream.
 com.filenet.wcm.api.TransportInputStream getContents(java.lang.String filename)
          Get the Etry Template contents as an input stream.
 org.w3c.dom.Document getDocumentElement()
          Return the org.w3c.dom.Document's document object currently using.
protected  org.w3c.dom.Element getEntryTemplate()
          Get or create a entry template.
 org.w3c.dom.Node getFile()
          Returns the file specified in the Template.
 java.lang.String getFilePath()
          Return the filename of content to add.
 org.w3c.dom.Node getFolder()
          Return a Node holding folder information
 java.lang.String getFolderId()
          Return a folder id from node holding folder information
 org.w3c.dom.Node getInstruction(java.lang.String name)
          Return the instruction node that contains the specified name
 org.w3c.dom.NodeList getInstructions()
          Return the instructions node list.
 java.lang.String getInstructionValue(java.lang.String name)
          Return the value of the specified instruction.
protected static org.w3c.dom.Document getNormalizedDOM()
          Return a xml in context on Buzz xml structure.
 org.w3c.dom.Node getObjectStore()
          Return node holding Object Store element
 java.lang.String getObjectStoreName()
          Return the name of Object Store from holding Object Store element
protected  java.lang.String getObjectTypeName()
          Returns the object type such as document, folder or custom object defined by the Entry Template type.
 org.w3c.dom.Node getPropDesc(java.lang.String name)
          Return a Node of property description by its name from node list.
 org.w3c.dom.NodeList getPropDescs()
          Return a node list of elements.
 java.util.ArrayList getPropDescsList()
          Return a array list of elements.
 org.w3c.dom.Document getPropDescsNormalized()
          Return property descriptions xml in context on Buzz xml structure.
 java.lang.String[] getPropDescValue(org.w3c.dom.Element propDesc)
          Get the default value of the property description node.
 java.lang.String[] getPropDescValue(java.lang.String symName)
          Get the property description propdef data.
 org.w3c.dom.Document getPropertiesNormalized()
          Return properties xml in context of Java API xml structure.
 org.w3c.dom.Document getPropertiesNormalized(boolean condensed)
          Return properties xml in context of Java API xml structure.
 org.w3c.dom.Document getPropertiesNormalized(boolean condensed, boolean addDefaultState)
          Return properties xml in context of Java API xml structure.
 org.w3c.dom.Document getPropertiesNormalized(java.util.List propDescsList, boolean condensed)
          Return properties xml in context of Java API xml structure.
 org.w3c.dom.Document getPropertiesNormalized(java.util.List propDescsList, org.w3c.dom.Document propertiesXML, boolean condensed)
          Return properties xml in context of Java API xml structure.
 org.w3c.dom.Document getPropertiesNormalized(java.util.List propDescsList, org.w3c.dom.Document propertiesCE, java.lang.String typeName, boolean condensed)
          Return properties xml in context of Java API xml structure.
 org.w3c.dom.Document getPropertiesNormalized(java.util.List propDescsList, org.w3c.dom.Document propertiesCE, java.lang.String typeName, boolean condensed, boolean addDefaultState)
          Return properties xml in context of Java API xml structure.
 org.w3c.dom.Document getPropertiesNormalized(java.util.List propDescsList, java.lang.String typeName, boolean condensed)
          Return properties xml in context of Java API xml structure.
 org.w3c.dom.Document getPropertiesNormalized(org.w3c.dom.NodeList propDescs, boolean condensed)
          Deprecated. Use new getPropertiesNormalized method with List parameter
 org.w3c.dom.Document getPropertiesNormalized(org.w3c.dom.NodeList propDescs, org.w3c.dom.Document propertiesXML, boolean condensed)
          Deprecated. Use new getPropertiesNormalized method with List parameter
protected  org.w3c.dom.Document getPropertiesNormalized(org.w3c.dom.NodeList propDescs, org.w3c.dom.Document propDescsCE, java.lang.String typeName, boolean condensed)
          Deprecated. Use new getPropertiesNormalized method with List parameter
protected  org.w3c.dom.Document getPropertiesNormalized(org.w3c.dom.NodeList propDescs, java.lang.String typeName, boolean condensed)
          Deprecated. Use new getPropertiesNormalized method with List parameter
 java.lang.String getPropertyValue(java.lang.String objectStoreName, java.lang.String id, int type, java.lang.String property)
          Helper method for retrieving the value of a particular property
protected  java.lang.String getTemplateName()
          You should overide this method to return correct template type
 org.w3c.dom.Node getTemplateType()
          Returns the template type specified in the Template.
 org.w3c.dom.Node getType()
          Returns the object type specified in the Template.
 java.lang.String getTypeName()
          Returns the entry template type name specified in the Template.
protected  void removeChoicesList()
          remove choice list from property description
protected  boolean replaceValue(java.lang.String xPath, java.lang.String value)
          Replace element value with new value.
 void setAuthoringDataProvider(WcmAuthoringDataProvider dp)
          Set up the Authoring Data Provider.
 void setClassDesc(java.lang.String id, java.lang.String name)
          Set the class information therefore can be returned by getClassDesc call.
 void setFile(java.lang.String file)
          Set the file location.
 void setFolder(java.lang.String id)
          Set the folder information therefore can be returned by getFolder call.
 void setInstruction(java.lang.String name, java.lang.String value)
          Set or add the instruction to the list.
 void setObjectStore(java.lang.String id, java.lang.String name)
          Set the Object Store properties therefore can be returned by getObjectStore call.
 void setPropDesc(org.w3c.dom.Node propDesc)
          Can used this method to set a user specified behavior into the property description element.
 void setPropDescData(java.lang.String name, java.lang.String value, boolean required, boolean editable, boolean hidden)
          Set the property description node's of data.
 void setPropDescData(java.lang.String symName, java.lang.String value, java.lang.String dataType, java.lang.String objectType, java.lang.String nameValue, boolean required, boolean editable, boolean hidden)
          Set the property description node's of data.
 void setPropDescs(org.w3c.dom.NodeList newPropDescs)
          Set the property descriptions.
 void setPropDescValue(org.w3c.dom.Node propDesc, java.lang.String[] values)
          Set the property description propdef data.
 void setPropDescValue(java.lang.String name, java.lang.String[] values)
          Set the property description propdef data.
protected  void setTemplateType(java.lang.String type)
          Set the object type properties.
 void setType(java.lang.String type)
          Set the object type properties.
 void toXML(java.lang.StringBuffer buffer)
          Append an XML string, that represents this object, to the end of the buffer passed to this method.
 void writeToFile(java.lang.String pathname)
          Save the Template to local storage as indicated by pathname parameter
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

TYPE_DOCUMENT

public static final java.lang.String TYPE_DOCUMENT
String representing a Document object type.

See Also:
Constant Field Values

TYPE_FOLDER

public static final java.lang.String TYPE_FOLDER
String representing a Folder object type.

See Also:
Constant Field Values

TYPE_CUSTOM_OBJECT

public static final java.lang.String TYPE_CUSTOM_OBJECT
String representing a Custom Object object type.

See Also:
Constant Field Values

XPATH_ENTRYTEMPLATE

protected static final java.lang.String XPATH_ENTRYTEMPLATE
See Also:
Constant Field Values

XPATH_CLASSDESC

protected static final java.lang.String XPATH_CLASSDESC
See Also:
Constant Field Values

XPATH_FOLDER

protected static final java.lang.String XPATH_FOLDER
See Also:
Constant Field Values

XPATH_FILE

protected static final java.lang.String XPATH_FILE
See Also:
Constant Field Values

XPATH_OBJECTSTORE

protected static final java.lang.String XPATH_OBJECTSTORE
See Also:
Constant Field Values

XPATH_PROPDESCS

protected static final java.lang.String XPATH_PROPDESCS
See Also:
Constant Field Values

XPATH_PROPERTIES

protected static final java.lang.String XPATH_PROPERTIES
See Also:
Constant Field Values

XPATH_PROPERTY

protected static final java.lang.String XPATH_PROPERTY
See Also:
Constant Field Values

XPATH_TYPE

protected static final java.lang.String XPATH_TYPE
See Also:
Constant Field Values

XPATH_TEMPLATETYPE

protected static final java.lang.String XPATH_TEMPLATETYPE
See Also:
Constant Field Values

XPATH_VERSION

protected static final java.lang.String XPATH_VERSION
See Also:
Constant Field Values

XPATH_INSTRUCTIONS

protected static final java.lang.String XPATH_INSTRUCTIONS
See Also:
Constant Field Values

XPATH_INSTRUCTION

protected static final java.lang.String XPATH_INSTRUCTION
See Also:
Constant Field Values

XPATH_INSTNAME

protected static final java.lang.String XPATH_INSTNAME
See Also:
Constant Field Values

XPATH_INSTVALUE

protected static final java.lang.String XPATH_INSTVALUE
See Also:
Constant Field Values

ELEM_ENTRYTEMPLATE

protected static final java.lang.String ELEM_ENTRYTEMPLATE
See Also:
Constant Field Values

ELEM_TEMPLATETYPE

protected static final java.lang.String ELEM_TEMPLATETYPE
See Also:
Constant Field Values

ELEM_DEFINED

protected static final java.lang.String ELEM_DEFINED
See Also:
Constant Field Values

ELEM_FILE

protected static final java.lang.String ELEM_FILE
See Also:
Constant Field Values

ELEM_INSTRUCTIONS

protected static final java.lang.String ELEM_INSTRUCTIONS
See Also:
Constant Field Values

ELEM_INSTRUCTION

protected static final java.lang.String ELEM_INSTRUCTION
See Also:
Constant Field Values

ELEM_NAME

protected static final java.lang.String ELEM_NAME
See Also:
Constant Field Values

ELEM_PROPERTIES

protected static final java.lang.String ELEM_PROPERTIES
See Also:
Constant Field Values

ELEM_PROPERTY

protected static final java.lang.String ELEM_PROPERTY
See Also:
Constant Field Values

ELEM_STYLE

protected static final java.lang.String ELEM_STYLE
See Also:
Constant Field Values

ELEM_TYPE

protected static final java.lang.String ELEM_TYPE
See Also:
Constant Field Values

ELEM_VALUE

protected static final java.lang.String ELEM_VALUE
See Also:
Constant Field Values

ELEM_VERSION

protected static final java.lang.String ELEM_VERSION
See Also:
Constant Field Values

adp

protected WcmAuthoringDataProvider adp

doc

protected WcmDocumentImpl doc

invalidChars

protected static final java.lang.String invalidChars
See Also:
Constant Field Values
Constructor Detail

BaseTemplate

public BaseTemplate()
Method Detail

setAuthoringDataProvider

public void setAuthoringDataProvider(WcmAuthoringDataProvider dp)
Set up the Authoring Data Provider. If this is not being set before calling doLoad.. method then those methods will throw.

Parameters:
dp - Authoring Data Provider

getDocumentElement

public org.w3c.dom.Document getDocumentElement()
                                        throws java.lang.Exception
Return the org.w3c.dom.Document's document object currently using.

Returns:
Document object.
Throws:
java.lang.Exception

doLoadFromStream

public void doLoadFromStream(com.filenet.wcm.api.TransportInputStream tis)
                      throws java.lang.Exception
Parse the Template into a DOM document

Parameters:
tis - The Input Stream item containing an entry template.
Throws:
java.lang.Exception

getContents

public com.filenet.wcm.api.TransportInputStream getContents(java.lang.String filename)
                                                     throws java.lang.Exception
Get the Etry Template contents as an input stream. The stream can be cused to pass to the Authoring Data Provider to add the Template.

Parameters:
filename - String file name.
Returns:
TransportInputStream.
Throws:
java.lang.Exception

getContents

public com.filenet.wcm.api.TransportInputStream getContents()
                                                     throws java.lang.Exception
Get the Etry Template contents as an input stream. The stream can be cused to pass to the Authoring Data Provider to add the Template.

Returns:
TransportInputStream.
Throws:
java.lang.Exception

writeToFile

public void writeToFile(java.lang.String pathname)
                 throws java.lang.Exception
Save the Template to local storage as indicated by pathname parameter

Parameters:
pathname - String holding local storage path and file name ("c:/tmp/myfile.xml")
Throws:
java.lang.Exception

doLoadFromId

public void doLoadFromId(java.lang.String objectStoreName,
                         java.lang.String id)
                  throws java.lang.Exception
Get the Template contents fromt he Content Engine and parse the Template into a DOM document.

Parameters:
objectStoreName - Object Store Id.
id - String holding template id.
Throws:
java.lang.Exception

getObjectStore

public org.w3c.dom.Node getObjectStore()
                                throws java.lang.Exception
Return node holding Object Store element

Returns:
Node Object Store's node.
Throws:
java.lang.Exception

getObjectStoreName

public java.lang.String getObjectStoreName()
                                    throws java.lang.Exception
Return the name of Object Store from holding Object Store element

Returns:
Object Store name.
Throws:
java.lang.Exception

setObjectStore

public void setObjectStore(java.lang.String id,
                           java.lang.String name)
                    throws java.lang.Exception
Set the Object Store properties therefore can be returned by getObjectStore call.

Parameters:
id - Object Store id.
name - Object Store name.
Throws:
java.lang.Exception

getTypeName

public java.lang.String getTypeName()
                             throws java.lang.Exception
Returns the entry template type name specified in the Template. Current values are document, folder, and custom object.

Returns:
String The type node value.
Throws:
java.lang.Exception

getObjectTypeName

protected java.lang.String getObjectTypeName()
                                      throws java.lang.Exception
Returns the object type such as document, folder or custom object defined by the Entry Template type. A sub class can override this method to return the object type corresponding to the entry template type. For example, a WCM entry template can override this method and return a document object type for a page type entry template since a page is a document object.

Returns:
String The object type defined by the Entry Template type.
Throws:
java.lang.Exception

getType

public org.w3c.dom.Node getType()
                         throws java.lang.Exception
Returns the object type specified in the Template. Current types supported are document, folder, and custom object.

Returns:
Node Object type node.
Throws:
java.lang.Exception

setType

public void setType(java.lang.String type)
             throws java.lang.Exception
Set the object type properties.

Parameters:
type - Document, Folder, or Custom object.
Throws:
java.lang.Exception

getTemplateType

public org.w3c.dom.Node getTemplateType()
                                 throws java.lang.Exception
Returns the template type specified in the Template.

Returns:
Node Object type node.
Throws:
java.lang.Exception

setTemplateType

protected void setTemplateType(java.lang.String type)
                        throws java.lang.Exception
Set the object type properties.

Parameters:
type - EntryTemplate, DeclareRecords....
Throws:
java.lang.Exception

getClassDesc

public org.w3c.dom.Node getClassDesc()
                              throws java.lang.Exception
Return a Node holding class information

Returns:
Node Class node.
Throws:
java.lang.Exception

getClassDescId

public java.lang.String getClassDescId()
                                throws java.lang.Exception
Return the Class Id from holding class information

Returns:
String Return the Class Id from holding class information
Throws:
java.lang.Exception

getClassDescName

public java.lang.String getClassDescName()
                                  throws java.lang.Exception
Return the Class Name from holding class information

Returns:
String Return the Class Name from holding class information
Throws:
java.lang.Exception

setClassDesc

public void setClassDesc(java.lang.String id,
                         java.lang.String name)
                  throws java.lang.Exception
Set the class information therefore can be returned by getClassDesc call.

Parameters:
id - Class id.
name - Class name.
Throws:
java.lang.Exception

getFolder

public org.w3c.dom.Node getFolder()
                           throws java.lang.Exception
Return a Node holding folder information

Returns:
Node Folder node.
Throws:
java.lang.Exception

getFolderId

public java.lang.String getFolderId()
                             throws java.lang.Exception
Return a folder id from node holding folder information

Returns:
Folder id in GUID format.
Throws:
java.lang.Exception

setFolder

public void setFolder(java.lang.String id)
               throws java.lang.Exception
Set the folder information therefore can be returned by getFolder call.

Parameters:
id - Folder id.
Throws:
java.lang.Exception

getPropDescs

public org.w3c.dom.NodeList getPropDescs()
                                  throws java.lang.Exception
Return a node list of elements.

Returns:
NodeList A node list of property description
Throws:
java.lang.Exception

getPropDescsList

public java.util.ArrayList getPropDescsList()
                                     throws java.lang.Exception
Return a array list of elements.

Returns:
ArrayList A array list of property description elements
Throws:
java.lang.Exception

getPropDescsNormalized

public org.w3c.dom.Document getPropDescsNormalized()
                                            throws java.lang.Exception
Return property descriptions xml in context on Buzz xml structure. The element structure looks somethings like:

Returns:
Document Normalized Docuemnt object.
Throws:
java.lang.Exception

setPropDescs

public void setPropDescs(org.w3c.dom.NodeList newPropDescs)
                  throws java.lang.Exception
Set the property descriptions.

Parameters:
newPropDescs - A node list of property description.
Throws:
java.lang.Exception

getPropDesc

public org.w3c.dom.Node getPropDesc(java.lang.String name)
                             throws java.lang.Exception
Return a Node of property description by its name from node list.

Parameters:
name - Property Description symbolic name.
Returns:
node A node of found property description.
Throws:
java.lang.Exception

setPropDesc

public void setPropDesc(org.w3c.dom.Node propDesc)
                 throws java.lang.Exception
Can used this method to set a user specified behavior into the property description element.

Parameters:
propDesc - A property description object.
Throws:
java.lang.Exception

setPropDescValue

public void setPropDescValue(java.lang.String name,
                             java.lang.String[] values)
                      throws java.lang.Exception
Set the property description propdef data. This method assume node already exist. If it is not then a Item not found exception will be thrown.

Parameters:
name - Property definition symbolic name(etc DocumentTitle, Description);
values - String array of value. If this property definition is single value, it take first value from array and set it.
Throws:
java.lang.Exception

setPropDescValue

public void setPropDescValue(org.w3c.dom.Node propDesc,
                             java.lang.String[] values)
                      throws java.lang.Exception
Set the property description propdef data. Also, set the state element value to be modified

Parameters:
propDesc - Node holding the Property definition
values - String array of value. If this property definition is single value, it take first value from array and set it.
Throws:
java.lang.Exception

setPropDescData

public void setPropDescData(java.lang.String name,
                            java.lang.String value,
                            boolean required,
                            boolean editable,
                            boolean hidden)
                     throws java.lang.Exception
Set the property description node's of data. This method assume node already exist.

Parameters:
name - property description name.
value - Default value.
required - Required?.
editable - Editable?.
hidden - Hidden?.
Throws:
java.lang.Exception

setPropDescData

public void setPropDescData(java.lang.String symName,
                            java.lang.String value,
                            java.lang.String dataType,
                            java.lang.String objectType,
                            java.lang.String nameValue,
                            boolean required,
                            boolean editable,
                            boolean hidden)
                     throws java.lang.Exception
Set the property description node's of data. This method assumes the node already exists.

Parameters:
symName - property description symbolic name.
value - Default value.
dataType - The data type of the property description
objectType - The object type of a object value property (may be null)
nameValue - The symbolic property name for the name property of a object value property (may be null)
required - Required?.
editable - Editable?.
hidden - Hidden?.
Throws:
java.lang.Exception

addPropDescData

public void addPropDescData(java.lang.String symName,
                            java.lang.String dispName,
                            java.lang.String dataType,
                            java.lang.String objectType,
                            java.lang.String nameValue,
                            java.lang.String value,
                            boolean required,
                            boolean editable,
                            boolean hidden)
                     throws java.lang.Exception
Add the property description node's of data. Throws an error if the node already exists.

Parameters:
symName - String property description symbolic name.
dispName - String property description display name.
dataType - String the property data type
objectType - String the object type (applies only if object value property dataType = "7")
nameValue - String Name property for object (applies only if object value property dataType = "7")
value - Default value.
required - Required?.
editable - Editable?.
hidden - Hidden?.
Throws:
java.lang.Exception

addPropDescData

public void addPropDescData(java.lang.String symName,
                            java.lang.String dispName,
                            java.lang.String dataType,
                            java.lang.String objectType,
                            java.lang.String nameValue,
                            java.lang.String value,
                            boolean required,
                            boolean editable,
                            boolean hidden,
                            boolean overrideIfFound)
                     throws java.lang.Exception
Add the property description node's of data. Throws an error if the node already exists.

Parameters:
symName - String property description symbolic name.
dispName - String property description display name.
dataType - String the property data type
objectType - String the object type (applies only if object value property dataType = "7")
nameValue - String Name property for object (applies only if object value property dataType = "7")
value - Default value.
required - Required?.
editable - Editable?.
hidden - Hidden?.
overrideIfFound - true to override the the prop description data if the property description already existed
Throws:
java.lang.Exception

getPropertiesNormalized

public org.w3c.dom.Document getPropertiesNormalized(org.w3c.dom.NodeList propDescs,
                                                    boolean condensed)
                                             throws java.lang.Exception
Deprecated. Use new getPropertiesNormalized method with List parameter

Return properties xml in context of Java API xml structure. The data in this xml is "baked up" from the property description information including mainly the default values. The element structure looks something like:

Parameters:
propDescs - NodeList of property descriptions to use to create the properties from
condensed - boolean True if you want smaller condensed version (used primarily at run time), False otherwise (typically design time).
Returns:
org.w3c.dom.Document Property DOM in context of Java API xml structure.
Throws:
java.lang.Exception

getPropertiesNormalized

public org.w3c.dom.Document getPropertiesNormalized(org.w3c.dom.NodeList propDescs,
                                                    org.w3c.dom.Document propertiesXML,
                                                    boolean condensed)
                                             throws java.lang.Exception
Deprecated. Use new getPropertiesNormalized method with List parameter

Return properties xml in context of Java API xml structure. The data in this xml is "baked up" from the property description information including mainly the default values. The element structure looks something like:

Parameters:
propDescs - NodeList of property descriptions to use to create the properties from
propertiesXML - Document The object properties XML. Copy values from the properties XML to the new output properties XML.
condensed - boolean True if you want smaller condensed version (used primarily at run time), False otherwise (typically design time).
Returns:
org.w3c.dom.Document Property DOM in context of Java API xml structure.
Throws:
java.lang.Exception

getPropertiesNormalized

protected org.w3c.dom.Document getPropertiesNormalized(org.w3c.dom.NodeList propDescs,
                                                       java.lang.String typeName,
                                                       boolean condensed)
                                                throws java.lang.Exception
Deprecated. Use new getPropertiesNormalized method with List parameter

Return properties xml in context of Java API xml structure. The data in this xml is "baked up" from the property description information including mainly the default values. The element structure looks something like:

Parameters:
propDescs - NodeList of property descriptions to use to create the properties from
typeName - String the entryTemplate type name.
condensed - boolean True if you want smaller condensed version (used primarily at run time), False otherwise (typically design time).
Returns:
org.w3c.dom.Document Property DOM in context of Java API xml structure.
Throws:
java.lang.Exception

getPropertiesNormalized

protected org.w3c.dom.Document getPropertiesNormalized(org.w3c.dom.NodeList propDescs,
                                                       org.w3c.dom.Document propDescsCE,
                                                       java.lang.String typeName,
                                                       boolean condensed)
                                                throws java.lang.Exception
Deprecated. Use new getPropertiesNormalized method with List parameter

Return properties xml in context of Java API xml structure. The data in this xml is "baked up" from the property description information including mainly the default values. The element structure looks something like:

Parameters:
propDescs - NodeList of property descriptions to use to create the properties from
propDescsCE - Document The Class Property Descriptions XML. This is used to determine if the default value is different from the server value.
typeName - String the entryTemplate type name.
condensed - boolean True if you want smaller condensed version (used primarily at run time), False otherwise (typically design time).
Returns:
org.w3c.dom.Document Property DOM in context of Java API xml structure.
Throws:
java.lang.Exception

getPropertiesNormalized

public org.w3c.dom.Document getPropertiesNormalized()
                                             throws java.lang.Exception
Return properties xml in context of Java API xml structure. The data in this xml is "baked up" from the property description information including mainly the default values. The element structure looks something like:

Returns:
A property DOM in context of Java API xml structure.
Throws:
java.lang.Exception

getPropertiesNormalized

public org.w3c.dom.Document getPropertiesNormalized(boolean condensed)
                                             throws java.lang.Exception
Return properties xml in context of Java API xml structure. The data in this xml is "baked up" from the property description information including mainly the default values. The element structure looks something like:

Parameters:
condensed - boolean True if you want smaller condensed version (used primarily at run time), False otherwise (typically design time).
Returns:
org.w3c.dom.Document Property DOM in context of Java API xml structure.
Throws:
java.lang.Exception

getPropertiesNormalized

public org.w3c.dom.Document getPropertiesNormalized(boolean condensed,
                                                    boolean addDefaultState)
                                             throws java.lang.Exception
Return properties xml in context of Java API xml structure. The data in this xml is "baked up" from the property description information including mainly the default values. The element structure looks something like:

Parameters:
condensed - boolean True if you want smaller condensed version (used primarily at run time), False otherwise (typically design time).
addDefaultState - boolean flag for specifying whether the property elements should be created with modified state
Returns:
org.w3c.dom.Document Property DOM in context of Java API xml structure.
Throws:
java.lang.Exception

getPropertiesNormalized

public org.w3c.dom.Document getPropertiesNormalized(java.util.List propDescsList,
                                                    boolean condensed)
                                             throws java.lang.Exception
Return properties xml in context of Java API xml structure. The data in this xml is "baked up" from the property description information including mainly the default values. The element structure looks something like:

Parameters:
propDescsList - ArrayList of property descriptions to use to create the properties from
condensed - boolean True if you want smaller condensed version (used primarily at run time), False otherwise (typically design time).
Returns:
org.w3c.dom.Document Property DOM in context of Java API xml structure.
Throws:
java.lang.Exception

getPropertiesNormalized

public org.w3c.dom.Document getPropertiesNormalized(java.util.List propDescsList,
                                                    org.w3c.dom.Document propertiesXML,
                                                    boolean condensed)
                                             throws java.lang.Exception
Return properties xml in context of Java API xml structure. The data in this xml is "baked up" from the property description information including mainly the default values. The element structure looks something like:

Parameters:
propDescsList - List of property descriptions to use to create the properties from
propertiesXML - Document The object properties XML. Copy values from the properties XML to the new output properties XML.
condensed - boolean True if you want smaller condensed version (used primarily at run time), False otherwise (typically design time).
Returns:
org.w3c.dom.Document Property DOM in context of Java API xml structure.
Throws:
java.lang.Exception

getPropertiesNormalized

public org.w3c.dom.Document getPropertiesNormalized(java.util.List propDescsList,
                                                    java.lang.String typeName,
                                                    boolean condensed)
                                             throws java.lang.Exception
Return properties xml in context of Java API xml structure. The data in this xml is "baked up" from the property description information including mainly the default values. The element structure looks something like:

Parameters:
propDescsList - ArrayList of property descriptions to use to create the properties from
typeName - String the entryTemplate type name.
condensed - boolean True if you want smaller condensed version (used primarily at run time), False otherwise (typically design time).
Returns:
org.w3c.dom.Document Property DOM in context of Java API xml structure.
Throws:
java.lang.Exception

getPropertiesNormalized

public org.w3c.dom.Document getPropertiesNormalized(java.util.List propDescsList,
                                                    org.w3c.dom.Document propertiesCE,
                                                    java.lang.String typeName,
                                                    boolean condensed)
                                             throws java.lang.Exception
Return properties xml in context of Java API xml structure. The data in this xml is "baked up" from the property description information including mainly the default values. The element structure looks something like:

Parameters:
propDescsList - List of property descriptions to use to create the properties from
propertiesCE - dom.Document object holding properties XML (maybe null)
typeName - String the entryTemplate type name.
condensed - boolean True if you want smaller condensed version (used primarily at run time), False otherwise (typically design time).
Returns:
org.w3c.dom.Document Property DOM in context of Java API xml structure.
Throws:
java.lang.Exception

getPropertiesNormalized

public org.w3c.dom.Document getPropertiesNormalized(java.util.List propDescsList,
                                                    org.w3c.dom.Document propertiesCE,
                                                    java.lang.String typeName,
                                                    boolean condensed,
                                                    boolean addDefaultState)
                                             throws java.lang.Exception
Return properties xml in context of Java API xml structure. The data in this xml is "baked up" from the property description information including mainly the default values. The element structure looks something like:

Parameters:
propDescsList - List of property descriptions to use to create the properties from
propertiesCE - dom.Document object holding properties XML (maybe null)
typeName - String the entryTemplate type name.
condensed - boolean True if you want smaller condensed version (used primarily at run time), False otherwise (typically design time).
addDefaultState - boolean flag for specifying whether the property objects should be created with a modified state
Returns:
org.w3c.dom.Document Property DOM in context of Java API xml structure.
Throws:
java.lang.Exception

getFile

public org.w3c.dom.Node getFile()
                         throws java.lang.Exception
Returns the file specified in the Template.

Returns:
Node Object file node.
Throws:
java.lang.Exception

getFilePath

public java.lang.String getFilePath()
                             throws java.lang.Exception
Return the filename of content to add.

Returns:
Filename String holding path to file content.
Throws:
java.lang.Exception

setFile

public void setFile(java.lang.String file)
             throws java.lang.Exception
Set the file location.

Parameters:
file - String file path on local machine
Throws:
java.lang.Exception

getInstructions

public org.w3c.dom.NodeList getInstructions()
                                     throws java.lang.Exception
Return the instructions node list.

Returns:
Instruction node list.
Throws:
java.lang.Exception

setInstruction

public void setInstruction(java.lang.String name,
                           java.lang.String value)
                    throws java.lang.Exception
Set or add the instruction to the list.

Parameters:
name - Instruction name
value - Instruction value.
Throws:
java.lang.Exception

getInstruction

public org.w3c.dom.Node getInstruction(java.lang.String name)
                                throws java.lang.Exception
Return the instruction node that contains the specified name

Parameters:
name - Instruction node name.
Returns:
Node Found node.
Throws:
java.lang.Exception

getInstructionValue

public java.lang.String getInstructionValue(java.lang.String name)
                                     throws java.lang.Exception
Return the value of the specified instruction.

Parameters:
name - Instruction name.
Returns:
String The value of the specified instruction.
Throws:
java.lang.Exception

getPropertyValue

public java.lang.String getPropertyValue(java.lang.String objectStoreName,
                                         java.lang.String id,
                                         int type,
                                         java.lang.String property)
                                  throws java.lang.Exception
Helper method for retrieving the value of a particular property

Parameters:
objectStoreName - Object Store name.
id - Object id.
type - Object type.
property - Symbolic name for request property value
Returns:
String Return vlue of particular property
Throws:
java.lang.Exception - If there are problems retrieving data or with an invalid parameter.

getPropDescValue

public java.lang.String[] getPropDescValue(java.lang.String symName)
                                    throws java.lang.Exception
Get the property description propdef data. This method assume node already exist. If it is not then a Item not found exception will be thrown.

Parameters:
symName - Property definition symbolic name (etc DocumentTitle, Description)
Throws:
java.lang.Exception

getPropDescValue

public java.lang.String[] getPropDescValue(org.w3c.dom.Element propDesc)
                                    throws java.lang.Exception
Get the default value of the property description node. This method assume node already exist. If it is not then a Item not found exception will be thrown.

Parameters:
propDesc - Element holding a property description node
Throws:
java.lang.Exception

toXML

public void toXML(java.lang.StringBuffer buffer)
           throws java.lang.Exception
Append an XML string, that represents this object, to the end of the buffer passed to this method.

Parameters:
buffer - StringBuffer to append XML data.
Throws:
java.lang.Exception - If there are problems retrieving data or with an invalid parameter.

checkParam

protected static boolean checkParam(java.lang.Object o)
                             throws java.lang.Exception
Make sure object is not null and has some value. For now it only works with String type.

Parameters:
o - XML object key name.
Returns:
boolean Return true if object is a string and not null.
Throws:
java.lang.Exception - If there are problems retrieving data or with an invalid parameter.

getNormalizedDOM

protected static org.w3c.dom.Document getNormalizedDOM()
                                                throws javax.xml.parsers.ParserConfigurationException
Return a xml in context on Buzz xml structure. The element structure looks somethings like: 1

Returns:
a Template DOM with proper xml heading.
Throws:
javax.xml.parsers.ParserConfigurationException

getEntryTemplate

protected org.w3c.dom.Element getEntryTemplate()
                                        throws java.lang.Exception
Get or create a entry template.

Returns:
an Template element.
Throws:
java.lang.Exception

getTemplateName

protected java.lang.String getTemplateName()
You should overide this method to return correct template type

Returns:
template name

replaceValue

protected boolean replaceValue(java.lang.String xPath,
                               java.lang.String value)
                        throws java.lang.Exception
Replace element value with new value.

Parameters:
xPath - XPath expression of node location.
value - New value.
Returns:
boolean Operation success or not.
Throws:
java.lang.Exception

checkInvalidChars

protected void checkInvalidChars(java.lang.String filename)
                          throws java.lang.Exception
Check for invalid file name characters

Parameters:
filename - File Name to check.
Throws:
java.lang.Exception

removeChoicesList

protected void removeChoicesList()
                          throws java.lang.Exception
remove choice list from property description

Throws:
java.lang.Exception


© Copyright IBM Corp. 2002, 2007. All Rights Reserved.