com.silverpeas.workflow.engine.model
Class FormImpl

java.lang.Object
  extended by com.silverpeas.workflow.engine.AbstractReferrableObject
      extended by com.silverpeas.workflow.engine.model.FormImpl
All Implemented Interfaces:
AbstractDescriptor, Form, ReferrableObjectIntf, Serializable

public class FormImpl
extends AbstractReferrableObject
implements Form, AbstractDescriptor, Serializable

Class implementing the representation of the <form> element of a Process Model.

See Also:
Serialized Form

Constructor Summary
FormImpl()
          Constructor
FormImpl(String name)
          Constructor
 
Method Summary
 void addInput(Input input)
          Add an input Method needed primarily by Castor
 void addTitle(ContextualDesignation title)
          Add a title Method needed primarily by Castor
 ContextualDesignation createDesignation()
          Create an object implementing ContextualDesignation Method needed primarily by Castor
 Input createInput()
          Create and return and object implementing Input
 DataRecord getDefaultRecord(String role, String lang, DataRecord data)
          Converts this object in a DataRecord object
 String getHTMLFileName()
          Get the name of HTML file to show this form if no HTML file is defined, XMLForm will be used to create the form
 int getId()
           
 Input getInput(Input reference)
          Get the input specified by item and / or value
 Input getInput(int idx)
          Get the input specified by the index
 Input[] getInputs()
          Get the inputs
 String getKey()
          Get the unique key, used by equals method
 String getName()
          Get the name of this form
 AbstractDescriptor getParent()
           
 String getRole()
          Get the role
 String getTitle(String role, String language)
          Get title in specific language for the given role
 ContextualDesignations getTitles()
          Get all the titles
 boolean hasId()
           
 Iterator<Input> iterateInput()
          Iterate through the inputs
 Iterator<ContextualDesignation> iterateTitle()
          Iterate through the titles
 void removeInput(int idx)
          Remove the input specified by the index
 void setHTMLFileName(String HTMLFileName)
          Set the name of HTML file to show this form if no HTML file is defined, XMLForm will be used to display the form
 void setId(int id)
          Implemented methods
 void setName(String name)
          Set the name of this form
 void setParent(AbstractDescriptor parent)
           
 void setRole(String role)
          Set the role name
 RecordTemplate toRecordTemplate(String role, String lang)
          Converts this object in a RecordTemplate object
 RecordTemplate toRecordTemplate(String role, String lang, boolean readOnly)
          Converts this object in a RecordTemplate object
 
Methods inherited from class com.silverpeas.workflow.engine.AbstractReferrableObject
equals, hashCode
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FormImpl

public FormImpl()
Constructor


FormImpl

public FormImpl(String name)
Constructor

Method Detail

getName

public String getName()
Get the name of this form

Specified by:
getName in interface Form
Returns:
form's name

getRole

public String getRole()
Description copied from interface: Form
Get the role

Specified by:
getRole in interface Form
Returns:
the role name

getHTMLFileName

public String getHTMLFileName()
Get the name of HTML file to show this form if no HTML file is defined, XMLForm will be used to create the form

Specified by:
getHTMLFileName in interface Form
Returns:
form's name

setHTMLFileName

public void setHTMLFileName(String HTMLFileName)
Set the name of HTML file to show this form if no HTML file is defined, XMLForm will be used to display the form

Specified by:
setHTMLFileName in interface Form

getInputs

public Input[] getInputs()
Get the inputs

Specified by:
getInputs in interface Form
Returns:
the inputs as an array

getInput

public Input getInput(int idx)
Description copied from interface: Form
Get the input specified by the index

Specified by:
getInput in interface Form
Parameters:
idx - the index
Returns:
the items as a Vector

getInput

public Input getInput(Input reference)
Description copied from interface: Form
Get the input specified by item and / or value

Specified by:
getInput in interface Form
Parameters:
reference - the reference object
Returns:
the items as a Vector

addInput

public void addInput(Input input)
Description copied from interface: Form
Add an input Method needed primarily by Castor

Specified by:
addInput in interface Form

iterateInput

public Iterator<Input> iterateInput()
Description copied from interface: Form
Iterate through the inputs

Specified by:
iterateInput in interface Form
Returns:
an iterator

createInput

public Input createInput()
Description copied from interface: Form
Create and return and object implementing Input

Specified by:
createInput in interface Form

removeInput

public void removeInput(int idx)
                 throws WorkflowException
Description copied from interface: Form
Remove the input specified by the index

Specified by:
removeInput in interface Form
Parameters:
idx - the index
Throws:
WorkflowException

getTitles

public ContextualDesignations getTitles()
Description copied from interface: Form
Get all the titles

Specified by:
getTitles in interface Form
Returns:
an object containing the collection of the tables

getTitle

public String getTitle(String role,
                       String language)
Description copied from interface: Form
Get title in specific language for the given role

Specified by:
getTitle in interface Form
Parameters:
role - role for which the title is
Returns:
wanted title as a String object. If title is not found, search title with given role and default language, if not found again, return the default title in given language, if not found again, return the default title in default language, if not found again, return empty string.

addTitle

public void addTitle(ContextualDesignation title)
Description copied from interface: Form
Add a title Method needed primarily by Castor

Specified by:
addTitle in interface Form

iterateTitle

public Iterator<ContextualDesignation> iterateTitle()
Description copied from interface: Form
Iterate through the titles

Specified by:
iterateTitle in interface Form
Returns:
an iterator

createDesignation

public ContextualDesignation createDesignation()
Description copied from interface: Form
Create an object implementing ContextualDesignation Method needed primarily by Castor

Specified by:
createDesignation in interface Form

setName

public void setName(String name)
Set the name of this form

Specified by:
setName in interface Form
Parameters:
name - form's name

setRole

public void setRole(String role)
Description copied from interface: Form
Set the role name

Specified by:
setRole in interface Form
Parameters:
role - name to set

getKey

public String getKey()
Get the unique key, used by equals method

Specified by:
getKey in interface ReferrableObjectIntf
Specified by:
getKey in class AbstractReferrableObject
Returns:
unique key
See Also:
equals, hashCode

toRecordTemplate

public RecordTemplate toRecordTemplate(String role,
                                       String lang)
                                throws WorkflowException
Converts this object in a RecordTemplate object

Specified by:
toRecordTemplate in interface Form
Returns:
the resulting RecordTemplate
Throws:
WorkflowException

getDefaultRecord

public DataRecord getDefaultRecord(String role,
                                   String lang,
                                   DataRecord data)
                            throws FormException,
                                   WorkflowException
Converts this object in a DataRecord object

Specified by:
getDefaultRecord in interface Form
Returns:
the resulting DataRecord object with the default values set
Throws:
FormException
WorkflowException

toRecordTemplate

public RecordTemplate toRecordTemplate(String role,
                                       String lang,
                                       boolean readOnly)
                                throws WorkflowException
Converts this object in a RecordTemplate object

Specified by:
toRecordTemplate in interface Form
Returns:
the resulting RecordTemplate
Throws:
WorkflowException

setId

public void setId(int id)
Implemented methods

Specified by:
setId in interface AbstractDescriptor

getId

public int getId()
Specified by:
getId in interface AbstractDescriptor

setParent

public void setParent(AbstractDescriptor parent)
Specified by:
setParent in interface AbstractDescriptor

getParent

public AbstractDescriptor getParent()
Specified by:
getParent in interface AbstractDescriptor

hasId

public boolean hasId()
Specified by:
hasId in interface AbstractDescriptor


Copyright © 2016 Silverpeas. All Rights Reserved.