com.netscape.pm.fields
Class BasicCustomField

java.lang.Object
  |
  +--com.netscape.pm.fields.BasicCustomField
All Implemented Interfaces:
IChecksum, IDataElement, IParameters, IPMElement, IPresentationElement

public class BasicCustomField
extends java.lang.Object
implements IPMElement, IChecksum, IParameters, IDataElement, IPresentationElement


Field Summary
protected  java.lang.String mCheckSum
           
 
Fields inherited from interface com.netscape.pm.dm.IChecksum
NOT_COMPUTED
 
Fields inherited from interface com.netscape.pm.model.IParameters
ADMIN, BLOB_wf_blob_content, BLOB_wf_field_cn, BLOB_wf_instance_id, BPM_AUTOMATED_AGENT, BPM_CLUSTER_INI, CP_wf_app_cn, CP_wf_archived_flag, CP_wf_creation_date, CP_wf_creator_dn, CP_wf_entry_cn, CP_wf_instance_id, CP_wf_last_modified, CP_wf_node_cn, CP_wf_observer_url, CP_wf_performer_url, CP_wf_pi_state, CP_wf_priority, CP_wf_title, DATASOURCE_NAME, DATASOURCE_XML_FILE_NAME, DEFAULT_FIELD_SIZE, DG_wf_fork_id, DG_wf_group_flag, DG_wf_group_id, DG_wf_instance_id, DG_wf_node_cn, DG_wf_user_id, ENGINE, ENTITY_KEY_SIZE, EXCEPTION, HIST_LEN_wf_comment, HIST_LEN_wf_event_id, HIST_wf_app_cn, HIST_wf_comment, HIST_wf_event_date, HIST_wf_event_id, HIST_wf_event_type, HIST_wf_fork_id, HIST_wf_instance_id, HIST_wf_node_cn, HIST_wf_sequence, HIST_wf_user_dn, HIST_wf_wi_cdate, HIST_wf_wi_exp_date, ID_next_range, IPM_CLUSTER_MANAGER_INI, IX_history_ix, IX_id_indx, IX_pi_ix, IX_user_dn_ix, IX_wi_ix, LOG_DIRECTORY, LOG_TYPE_ERROR, LOG_TYPE_INFO, LOG_TYPE_SECURITY, MAX_COMMENT_SIZE, MAX_DN_SIZE, MAX_ENTITY_KEY_SIZE, MAX_EVENT_ID_SIZE, MAX_FILE_NAME_SIZE, MAX_FORK_ID_SIZE, MAX_RDN_SIZE, MAX_TITLE_SIZE, MAX_URL_SIZE, PI_LEN_wf_title, PI_wf_app_cn, PI_wf_archived_flag, PI_wf_creation_date, PI_wf_creator_dn, PI_wf_entry_cn, PI_wf_exit_cn, PI_wf_instance_id, PI_wf_last_modified, PI_wf_observer_url, PI_wf_performer_url, PI_wf_pi_state, PI_wf_priority, PI_wf_title, PROPERTY_accesscontrolrule, PROPERTY_actioncn, PROPERTY_actionorder, PROPERTY_activityplugin, PROPERTY_adminurl, PROPERTY_adminUsers, PROPERTY_allow_search, PROPERTY_allowcomment, PROPERTY_allowdelegate, PROPERTY_allowsave, PROPERTY_applicationcn, PROPERTY_applicationurl, PROPERTY_appownerdn, PROPERTY_apppriorityfield, PROPERTY_apptitlefield, PROPERTY_assignmentplugin, PROPERTY_businessurl, PROPERTY_clusterdn, PROPERTY_clustername, PROPERTY_cn, PROPERTY_columns, PROPERTY_condition, PROPERTY_conditionevaluationorder, PROPERTY_configbinddn, PROPERTY_configbinddnpassword, PROPERTY_configport, PROPERTY_configserver, PROPERTY_constraint, PROPERTY_csbase, PROPERTY_cspassword, PROPERTY_cstimeout, PROPERTY_cstmp, PROPERTY_csuser, PROPERTY_datamapping, PROPERTY_datamapping_fieldname, PROPERTY_datamapping_script, PROPERTY_datamapping_scripttext, PROPERTY_DB_datasource, PROPERTY_DB_driveridentifier, PROPERTY_DB_identifier, PROPERTY_DB_name, PROPERTY_DB_password, PROPERTY_DB_type, PROPERTY_DB_url, PROPERTY_DB_user, PROPERTY_dbdatasource, PROPERTY_dbdatatablename, PROPERTY_dbdriveridentifier, PROPERTY_dbidentifier, PROPERTY_dbname, PROPERTY_dbpassword, PROPERTY_dbtype, PROPERTY_dburl, PROPERTY_dbuser, PROPERTY_default_value, PROPERTY_deferred, PROPERTY_deployurl, PROPERTY_description, PROPERTY_entrypointcn, PROPERTY_entrypointform, PROPERTY_eventuser, PROPERTY_eventuserpassword, PROPERTY_exceptioncn, PROPERTY_expirationsetterplugin, PROPERTY_expressurl, PROPERTY_fieldclassid, PROPERTY_fieldcn, PROPERTY_fieldparams, PROPERTY_fieldtype, PROPERTY_groupdn, PROPERTY_help, PROPERTY_hierarchicalorder, PROPERTY_ldapbase, PROPERTY_ldapfilter, PROPERTY_ldappassword, PROPERTY_ldapport, PROPERTY_ldapserver, PROPERTY_ldapuser, PROPERTY_length, PROPERTY_max_length, PROPERTY_nodeclassid, PROPERTY_nodetype, PROPERTY_notificationaudience, PROPERTY_notificationcclist, PROPERTY_notificationcharset, PROPERTY_notificationcontent, PROPERTY_notificationcontenttype, PROPERTY_notificationsubject, PROPERTY_objectclass, PROPERTY_oncompletionplugin, PROPERTY_onexpireplugin, PROPERTY_onverifyplugin, PROPERTY_options, PROPERTY_positionx, PROPERTY_positiony, PROPERTY_prettyname, PROPERTY_rh_activityplugin, PROPERTY_rh_assignmentplugin, PROPERTY_rh_expirationsetterplugin, PROPERTY_rh_oncompletionplugin, PROPERTY_rh_onexpireplugin, PROPERTY_rh_onverifyplugin, PROPERTY_rh_subprocesscreatorplugin, PROPERTY_roleclassid, PROPERTY_roletype, PROPERTY_rows, PROPERTY_schemaversion, PROPERTY_smtpport, PROPERTY_smtpreplyto, PROPERTY_smtpserver, PROPERTY_splitid, PROPERTY_subprocesscreatorplugin, PROPERTY_synchronous, PROPERTY_targetname, PROPERTY_targetnodedn, PROPERTY_threadid, PROPERTY_uniquemember, PROPERTY_usercachepolicy, PROPERTY_virtual, PROPERTY_wfschedule, PROPERTY_workmanagerclassid, PROPERTY_workperformerclassid, SCHEMA_VERSION, SL_wf_app_cn, SL_wf_archived_flag, SL_wf_automated_flag, SL_wf_creation_date, SL_wf_creator_dn, SL_wf_deferred_flag, SL_wf_entry_cn, SL_wf_exit_cn, SL_wf_exp_date, SL_wf_expired_flag, SL_wf_fork_id, SL_wf_instance_id, SL_wf_last_modified, SL_wf_node_cn, SL_wf_observer_url, SL_wf_performer_url, SL_wf_pi_state, SL_wf_priority, SL_wf_target_cn, SL_wf_title, SL_wf_user_dn, SL_wf_wi_cdate, SL_wf_wi_state, TB_dynamic_group, TB_history, TB_process_instance, TB_wf_blobs, TB_wf_id_range, TB_work_item, VALUE_wfbase, VALUE_wfdomain, VW_closed_process, VW_searchlist, VW_worklist, WI_wf_app_cn, WI_wf_automated_flag, WI_wf_deferred_flag, WI_wf_execution_stage, WI_wf_exp_date, WI_wf_expired_flag, WI_wf_fork_id, WI_wf_instance_id, WI_wf_node_cn, WI_wf_performer_url, WI_wf_target_cn, WI_wf_user_dn, WI_wf_wi_cdate, WI_wf_wi_state, WL_wf_app_cn, WL_wf_automated_flag, WL_wf_creation_date, WL_wf_creator_dn, WL_wf_deferred_flag, WL_wf_entry_cn, WL_wf_exp_date, WL_wf_expired_flag, WL_wf_fork_id, WL_wf_instance_id, WL_wf_last_modified, WL_wf_node_cn, WL_wf_observer_url, WL_wf_performer_url, WL_wf_pi_state, WL_wf_priority, WL_wf_target_cn, WL_wf_title, WL_wf_user_dn, WL_wf_wi_cdate, WL_wf_wi_state
 
Fields inherited from interface com.netscape.pm.model.IDataElement
NOT_YET_LOADED, TYPE_BOOLEAN, TYPE_DATE, TYPE_DATETIME, TYPE_ENTITY, TYPE_FLOAT, TYPE_INT, TYPE_LONGTEXT, TYPE_TEXT, TYPE_UNDEFINED
 
Fields inherited from interface com.netscape.pm.model.IPresentationElement
MODE_EDIT, MODE_HIDDEN, MODE_VIEW
 
Constructor Summary
BasicCustomField()
           
 
Method Summary
 void archive(IProcessInstance pi, java.io.OutputStream os)
          Called when the process instance this field is associated with is being archived.
 boolean canSearch()
          Is this field searchable from the PMExpress application search page?
 void create(IProcessInstance pi)
          initializes the process instance with the default value
 void display(IHTMLPage html, int displayMode, java.lang.String displayFormat)
          Display field at the entry point node BEFORE the process instance has been instantiated.
 void display(IProcessInstance pi, IHTMLPage html, int displayMode, java.lang.String displayFormat)
          Display field AFTER the process instance has been instantiated.
 java.util.Hashtable dumpState()
          Returns the properties of the configuration element in a hashtable.
protected  PMException generateLockException()
           
 java.lang.String getChecksum()
           
 IDataElement getDataElement()
          Get access to the data storage side of the field.
 java.lang.Object getDefaultValue()
          returns the Default Value of the field's DB column
 java.lang.String getDescription()
          Returns the description of the element.
 java.lang.String getName()
          Returns the name of the element.
 IPMElement getParent()
          Returns the parent element of this configuration element.
 IPMApplication getPMApplication()
           
 IPresentationElement getPresentationElement()
          Get access to the presentation side of the field.
 java.lang.String getPrettyName()
          Returns the prettyname of the element.
 java.lang.Object getProperty(java.lang.String propName)
          Returns the value associated with a particular configuration property.
 int getSize()
          returns the size of the field's DB column
 int getType()
          returns the type of the field
 boolean isLocked()
          Returns true if the configuration element has been locked.
 void load(IProcessInstance pi)
          From the database to the process instance/business doc.
protected  void loadDataElementProperties(java.util.Hashtable entry)
          Load field specific parameters
 void lockObject()
          Locks the configuration element from any further changes to its configuration.
 void postCreation(IProcessDefinition pd)
          This method is invoked once the application has been loaded.
 void setChecksum(java.lang.String checkSum)
           
 void setParent(IPMElement elem)
          Sets the parent element of this configuration element.
 void setProperties(java.util.Hashtable entry)
          Initializes the configuration element with the properties stored in the repository.
 void store(IProcessInstance pi)
          From the process instance/business doc to the database.
 java.lang.String toString()
          Returns the string representation of the configuration element.
 void update(IProcessInstance pi, IPMRequest rq)
          Update the process instance based on the information contained in the request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

mCheckSum

protected java.lang.String mCheckSum
Constructor Detail

BasicCustomField

public BasicCustomField()
Method Detail

setProperties

public void setProperties(java.util.Hashtable entry)
                   throws PMException
Description copied from interface: IPMElement
Initializes the configuration element with the properties stored in the repository. In the process manager world, every element created from the builder contains a set of customizable properties. Invoking this method with this set of properties in effect transforms a base PMElement into a more specific version of a configuration element (such as a node element or a data field).

Users should note that as a part of the configuration element creation procedure, this object is locked to prevent run-time changes to its definition; hence, any calls to this method during run-time will result in an exception being thrown.

Specified by:
setProperties in interface IPMElement
Following copied from interface: com.netscape.pm.model.IPMElement
Parameters:
entry - the properties to associate this element with
Throws:
PMException - if there is a problem with configuring this element with the properties provided.

getProperty

public java.lang.Object getProperty(java.lang.String propName)
Description copied from interface: IPMElement
Returns the value associated with a particular configuration property.
Specified by:
getProperty in interface IPMElement
Following copied from interface: com.netscape.pm.model.IPMElement
Parameters:
propName - the name of the configuration property
Returns:
the value associated with the configuration property; null if no such property has been defined.

getName

public java.lang.String getName()
Description copied from interface: IPMElement
Returns the name of the element.
Specified by:
getName in interface IPMElement
Following copied from interface: com.netscape.pm.model.IPMElement
Returns:
the name of the element.

getDescription

public java.lang.String getDescription()
Description copied from interface: IPMElement
Returns the description of the element.
Specified by:
getDescription in interface IPMElement
Following copied from interface: com.netscape.pm.model.IPMElement
Returns:
the description of the element.

getPrettyName

public java.lang.String getPrettyName()
Description copied from interface: IPMElement
Returns the prettyname of the element. As of PAE 4.0, the name and prettyname of an element are identical.
Specified by:
getPrettyName in interface IPMElement
Following copied from interface: com.netscape.pm.model.IPMElement
Returns:
the prettyname of the element.

postCreation

public void postCreation(IProcessDefinition pd)
                  throws PMException
Description copied from interface: IPMElement
This method is invoked once the application has been loaded. This method is meant to act as a hook to resolve module dependencies which cannot be resolved during application initialization.

Users should note that as a part of the configuration element creation procedure, this object is locked to prevent run-time changes to its definition; hence, any calls to this method during run-time will result in an exception being thrown.

Specified by:
postCreation in interface IPMElement
Following copied from interface: com.netscape.pm.model.IPMElement
Parameters:
pd - the process definition for the application
Throws:
PMException - if there is a problem with the post creation phase of this configuration element; or if this object has been locked
See Also:
IProcessDefinition

setParent

public void setParent(IPMElement elem)
Description copied from interface: IPMElement
Sets the parent element of this configuration element. Each configuration element is bound to a chain of parent elements, for instance each node element is bound to the process map that contains it.

Users should note that as a part of the configuration element creation procedure, this object is locked to prevent run-time changes to its definition; hence, any calls to this method during run-time will result in an exception being thrown.

Specified by:
setParent in interface IPMElement
Following copied from interface: com.netscape.pm.model.IPMElement
Parameters:
elem - the parent element of this element

getParent

public IPMElement getParent()
Description copied from interface: IPMElement
Returns the parent element of this configuration element. Each configuration element is bound to a chain of parent elements, for instance each node element is bound to the process map that contains it.

Users will probably never need to invoke this method. It has been included in this interface as a convenience method for internal engine functionality.

Specified by:
getParent in interface IPMElement
Following copied from interface: com.netscape.pm.model.IPMElement
Returns:
the parent element of this element.

lockObject

public void lockObject()
Description copied from interface: IPMElement
Locks the configuration element from any further changes to its configuration. If any mutators are invoked on this method after the element has been locked, an exception will be thrown.
Specified by:
lockObject in interface IPMElement

isLocked

public boolean isLocked()
Description copied from interface: IPMElement
Returns true if the configuration element has been locked.
Specified by:
isLocked in interface IPMElement
Following copied from interface: com.netscape.pm.model.IPMElement
Returns:
true if the element has been locked; false otherwise.

toString

public java.lang.String toString()
Description copied from interface: IPMElement
Returns the string representation of the configuration element.
Specified by:
toString in interface IPMElement
Overrides:
toString in class java.lang.Object
Following copied from interface: com.netscape.pm.model.IPMElement
Returns:
the string representation of the configuration element.

dumpState

public java.util.Hashtable dumpState()
Description copied from interface: IPMElement
Returns the properties of the configuration element in a hashtable. This method was designed to be used as a debugging tool; it presents users with a simple means of checking the current state of a configuration element.
Specified by:
dumpState in interface IPMElement
Following copied from interface: com.netscape.pm.model.IPMElement
Returns:
the properties of the configuration element.

setChecksum

public void setChecksum(java.lang.String checkSum)
Specified by:
setChecksum in interface IChecksum

getChecksum

public java.lang.String getChecksum()
Specified by:
getChecksum in interface IChecksum

getType

public int getType()
returns the type of the field
Specified by:
getType in interface IDataElement
Following copied from interface: com.netscape.pm.model.IDataElement
See Also:
IDataElement.TYPE_UNDEFINED, IDataElement.TYPE_TEXT, IDataElement.TYPE_LONGTEXT, IDataElement.TYPE_DATE, IDataElement.TYPE_DATETIME, IDataElement.TYPE_BOOLEAN, IDataElement.TYPE_FLOAT, IDataElement.TYPE_INT, IDataElement.TYPE_ENTITY

getSize

public int getSize()
returns the size of the field's DB column
Specified by:
getSize in interface IDataElement
Following copied from interface: com.netscape.pm.model.IDataElement
See Also:
IDataElement.getType()

getDefaultValue

public java.lang.Object getDefaultValue()
returns the Default Value of the field's DB column
Specified by:
getDefaultValue in interface IDataElement

create

public void create(IProcessInstance pi)
            throws java.lang.Exception
initializes the process instance with the default value
Specified by:
create in interface IDataElement
Following copied from interface: com.netscape.pm.model.IDataElement
Parameters:
pi - the current process instance
Throws:
java.lang.Exception - if there is a problem initializing the field's default value.
See Also:
IProcessInstance

store

public void store(IProcessInstance pi)
           throws java.lang.Exception
From the process instance/business doc to the database. The custom field is responsible for serializing itself into a persistent storage system upon receiving this call.
Specified by:
store in interface IDataElement
Following copied from interface: com.netscape.pm.model.IDataElement
Parameters:
pi - the current process instance
Throws:
java.lang.Exception - if there is a problem storing the field's data value to the back-end storage.
See Also:
IProcessInstance.getData(java.lang.String), IProcessInstance.setData(java.lang.String, java.lang.Object)

load

public void load(IProcessInstance pi)
          throws java.lang.Exception
From the database to the process instance/business doc. The custom field is responsible for loading itself from whatever persistent storage system it serialized itself into upon receiving this call. The engine uses lazy-loading so this method is only called when the field is requested via getData().
Specified by:
load in interface IDataElement
Following copied from interface: com.netscape.pm.model.IDataElement
Parameters:
pi - the current process instance
Throws:
java.lang.Exception - if there is a problem retrieving the field's data value to the back-end storage.
See Also:
IDataElement.store(com.netscape.pm.model.IProcessInstance), IProcessInstance.getData(java.lang.String)

archive

public void archive(IProcessInstance pi,
                    java.io.OutputStream os)
             throws java.lang.Exception
Called when the process instance this field is associated with is being archived. The custom field should write its value to the output stream.
Specified by:
archive in interface IDataElement
Following copied from interface: com.netscape.pm.model.IDataElement
Parameters:
pi - the current process instance
os - the output stream to archive the data element to
Throws:
java.lang.Exception - if there is a problem archiving the field's data value to the output stream.
See Also:
#IProcessInstance#archive

canSearch

public boolean canSearch()
Is this field searchable from the PMExpress application search page?
Specified by:
canSearch in interface IDataElement
Following copied from interface: com.netscape.pm.model.IDataElement
Returns:
true if this field is searchable from the Express; false otherwise.

getPresentationElement

public IPresentationElement getPresentationElement()
Description copied from interface: IDataElement
Get access to the presentation side of the field. Field designers may choose to implement their custom field in two separate components: one for the presentation logic and another for the data management logic. This method should be used to return access to the presentation portion of the field. It is not necessary to implement your custom field in this manner however, one class may contain both the data management and presentation logic.
Specified by:
getPresentationElement in interface IDataElement
Following copied from interface: com.netscape.pm.model.IDataElement
Returns:
the handle to the presentation element manager of the field.
See Also:
IPresentationElement

display

public void display(IHTMLPage html,
                    int displayMode,
                    java.lang.String displayFormat)
             throws java.lang.Exception
Display field at the entry point node BEFORE the process instance has been instantiated.
Specified by:
display in interface IPresentationElement
Parameters:
html - - html stream to output to displayMode - see IPresentationElement for possible values

display

public void display(IProcessInstance pi,
                    IHTMLPage html,
                    int displayMode,
                    java.lang.String displayFormat)
             throws java.lang.Exception
Display field AFTER the process instance has been instantiated.
Specified by:
display in interface IPresentationElement
Parameters:
pi - - current process instance reference html - html stream to output to displayMode - see IPresentationElement for possible values

update

public void update(IProcessInstance pi,
                   IPMRequest rq)
            throws java.lang.Exception
Update the process instance based on the information contained in the request.
Specified by:
update in interface IPresentationElement
Following copied from interface: com.netscape.pm.model.IPresentationElement
Parameters:
pi - the current process instance
rq - the current HTTP request
Throws:
java.lang.Exception - if there is a problem translating the HTTP parameters to the field's internal format.
See Also:
IProcessInstance, IPMRequest

getDataElement

public IDataElement getDataElement()
Description copied from interface: IPresentationElement
Get access to the data storage side of the field. Field designers may choose to implement their custom field in two separate components: one for the presentation logic and another for the data management logic. This method should be used to return access to the data access portion of the field. It is not necessary to implement your custom field in this manner however, one class may contain both the data management and presentation logic.
Specified by:
getDataElement in interface IPresentationElement
Following copied from interface: com.netscape.pm.model.IPresentationElement
Returns:
the handle to the data element manager of the field.
See Also:
IDataElement

getPMApplication

public IPMApplication getPMApplication()
                                throws PMException

generateLockException

protected PMException generateLockException()

loadDataElementProperties

protected void loadDataElementProperties(java.util.Hashtable entry)
                                  throws java.lang.Exception
Load field specific parameters