jbpm-form-modeler-service-core 6.1.0.Beta2

org.jbpm.formModeler.core.config
Class FormManagerImpl

java.lang.Object
  extended by org.jbpm.formModeler.core.config.FormManagerImpl
All Implemented Interfaces:
Serializable, FormManager

@ApplicationScoped
public class FormManagerImpl
extends Object
implements FormManager

See Also:
Serialized Form

Field Summary
protected  FieldTypeManager fieldTypeManager
           
 
Fields inherited from interface org.jbpm.formModeler.core.config.FormManager
FORMSTATUS_HIDDEN, FORMSTATUS_NORMAL
 
Constructor Summary
FormManagerImpl()
           
 
Method Summary
 void addAllDataHolderFieldsToForm(Form form, DataHolder holder)
           
 void addAllDataHolderFieldsToForm(Form form, String holderId)
           
 void addDataFieldHolder(Form form, String bindingId, String fieldName, String fieldClass)
           
protected  void addDataHolderFields(Form form, DataHolder holder, boolean existing)
           
 void addDataHolderToForm(Form form, DataHolder holder)
           
 void addDataHolderToForm(Form form, String holderType, String id, String inputId, String outId, String color, String value, String path)
           
 Field addFieldToForm(Form pForm, FieldType fieldType)
           
 Field addFieldToForm(Form pForm, String fieldName, FieldType fieldType, I18nSet label)
          Adds a field to a form.
 Field addFieldToForm(Form pForm, String fieldName, FieldType fieldType, I18nSet label, String inputBindingString, String outputBindingString)
          Adds a field to a form.
 Field addFieldToForm(Form form, String fieldName, FieldType fieldType, String fieldClass, I18nSet label, String inputBinding, String outputBinding)
           
 void addSystemForm(Form form)
           
 void changeFieldPosition(Form pForm, int fieldPos, int destPos, boolean groupWithPrevious, boolean nextFieldGrouped)
          Moves a field to the specified position
 Form createForm(String name)
           
 Form createForm(String subject, String name, String displayMode, Long status)
          Create an empty form with given parameters
 void degradeField(Form pForm, int fieldPos, int destPos, boolean groupWithPrevious, boolean nextFieldGrouped)
           
 void deleteField(Form pForm, int fieldPos)
           
protected static Long generateUniqueId()
           
 Form[] getAllForms()
           
 Form getFormById(Long id)
          Get form by id
 Form getFormForFieldEdition(FieldType fieldType)
          Get the form to edit a form field depending on its type
 List<Form> getFormsBySubject(String subject)
          Get all forms by subject.
 List<Form> getFormsBySubjectAndName(String subject, String name)
          Get all forms by subject and name.
 String getUniqueIdentifier(Form form, String namespace, Field field, String fieldName)
           
 String getUniqueIdentifiersPreffix()
           
 void groupWithPrevious(Form pForm, int fieldPos, boolean value)
          Moves a field up in a form
 boolean isDeleteable(Form form)
          Determine if a form is deleteable, which means it is not in use in other core structures.
protected  void logError(String message)
           
protected  void logWarn(String message)
           
 void moveBottom(Form pForm, int fieldPos)
          Moves a field bottom in a form
 boolean moveDown(Form pForm, int fieldPos)
          Moves a field down in a form
 void moveTop(Form pForm, int fieldPos)
          Moves a field top in a form
 boolean moveUp(Form pForm, int fieldPos)
          Moves a field up in a form
 void promoteField(Form pForm, int fieldPos, int destPos, boolean groupWithPrevious, boolean nextFieldGrouped)
           
 void removeDataHolderFromForm(Form form, String holderId)
           
 void saveTemplateForForm(Long formId, String templateContent)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fieldTypeManager

@Inject
protected FieldTypeManager fieldTypeManager
Constructor Detail

FormManagerImpl

public FormManagerImpl()
Method Detail

getFormsBySubject

public List<Form> getFormsBySubject(String subject)
                             throws Exception
Get all forms by subject.

Specified by:
getFormsBySubject in interface FormManager
Throws:
Exception

getFormsBySubjectAndName

public List<Form> getFormsBySubjectAndName(String subject,
                                           String name)
                                    throws Exception
Get all forms by subject and name.

Specified by:
getFormsBySubjectAndName in interface FormManager
Throws:
Exception

getAllForms

public Form[] getAllForms()
Specified by:
getAllForms in interface FormManager

getFormForFieldEdition

public Form getFormForFieldEdition(FieldType fieldType)
                            throws Exception
Get the form to edit a form field depending on its type

Specified by:
getFormForFieldEdition in interface FormManager
Parameters:
fieldType - for which we want to edit
Returns:
a form suitable for editing it, or null if none fits
Throws:
Exception - in case of error

getFormById

public Form getFormById(Long id)
Get form by id

Specified by:
getFormById in interface FormManager
Parameters:
id - Form id
Returns:
a form by id

createForm

public Form createForm(String name)
Specified by:
createForm in interface FormManager

createForm

public Form createForm(String subject,
                       String name,
                       String displayMode,
                       Long status)
Create an empty form with given parameters

Specified by:
createForm in interface FormManager
Parameters:
subject - Form subject
name - Form name
displayMode - Form display mode
status - Form status
Returns:
The created form
Throws:
Exception - in case of error

addFieldToForm

public Field addFieldToForm(Form pForm,
                            FieldType fieldType)
                     throws Exception
Specified by:
addFieldToForm in interface FormManager
Throws:
Exception

addFieldToForm

public Field addFieldToForm(Form pForm,
                            String fieldName,
                            FieldType fieldType,
                            I18nSet label)
Adds a field to a form.

Specified by:
addFieldToForm in interface FormManager
Parameters:
pForm - Form to be modified
fieldName - Field name to create
fieldType - Field type
Throws:
Exception - in case of error

addFieldToForm

public Field addFieldToForm(Form pForm,
                            String fieldName,
                            FieldType fieldType,
                            I18nSet label,
                            String inputBindingString,
                            String outputBindingString)
Adds a field to a form.

Specified by:
addFieldToForm in interface FormManager
Parameters:
pForm - Form to be modified
fieldName - Field name to create
fieldType - Field type
Throws:
Exception - in case of error

addFieldToForm

public Field addFieldToForm(Form form,
                            String fieldName,
                            FieldType fieldType,
                            String fieldClass,
                            I18nSet label,
                            String inputBinding,
                            String outputBinding)
Specified by:
addFieldToForm in interface FormManager

generateUniqueId

protected static Long generateUniqueId()

promoteField

public void promoteField(Form pForm,
                         int fieldPos,
                         int destPos,
                         boolean groupWithPrevious,
                         boolean nextFieldGrouped)
                  throws Exception
Specified by:
promoteField in interface FormManager
Throws:
Exception

degradeField

public void degradeField(Form pForm,
                         int fieldPos,
                         int destPos,
                         boolean groupWithPrevious,
                         boolean nextFieldGrouped)
                  throws Exception
Specified by:
degradeField in interface FormManager
Throws:
Exception

changeFieldPosition

public void changeFieldPosition(Form pForm,
                                int fieldPos,
                                int destPos,
                                boolean groupWithPrevious,
                                boolean nextFieldGrouped)
                         throws Exception
Moves a field to the specified position

Specified by:
changeFieldPosition in interface FormManager
Parameters:
pForm - form to modify
fieldPos - original field position
destPos - destination position
groupWithPrevious - determines that the field must be grouped with the previous field
nextFieldGrouped - determines that the next field must be grouped with the modified field
Throws:
Exception

moveTop

public void moveTop(Form pForm,
                    int fieldPos)
             throws Exception
Moves a field top in a form

Specified by:
moveTop in interface FormManager
Parameters:
pForm - form to modify
fieldPos - field position to move top
Throws:
Exception - in case of error

moveBottom

public void moveBottom(Form pForm,
                       int fieldPos)
                throws Exception
Moves a field bottom in a form

Specified by:
moveBottom in interface FormManager
Parameters:
pForm - form to modify
fieldPos - field position to move down
Throws:
Exception - in case of error

moveUp

public boolean moveUp(Form pForm,
                      int fieldPos)
               throws Exception
Moves a field up in a form

Specified by:
moveUp in interface FormManager
Parameters:
pForm - form to modify
fieldPos - field position to move up
Throws:
Exception - in case of error

groupWithPrevious

public void groupWithPrevious(Form pForm,
                              int fieldPos,
                              boolean value)
                       throws Exception
Moves a field up in a form

Specified by:
groupWithPrevious in interface FormManager
Parameters:
pForm - form to modify
fieldPos - field position to move up
Throws:
Exception - in case of error

moveDown

public boolean moveDown(Form pForm,
                        int fieldPos)
                 throws Exception
Moves a field down in a form

Specified by:
moveDown in interface FormManager
Parameters:
pForm - form to modify
fieldPos - field position to move down
Throws:
Exception - in case of error

deleteField

public void deleteField(Form pForm,
                        int fieldPos)
                 throws Exception
Specified by:
deleteField in interface FormManager
Throws:
Exception

saveTemplateForForm

public void saveTemplateForForm(Long formId,
                                String templateContent)
                         throws Exception
Specified by:
saveTemplateForForm in interface FormManager
Throws:
Exception

getUniqueIdentifiersPreffix

public String getUniqueIdentifiersPreffix()
Specified by:
getUniqueIdentifiersPreffix in interface FormManager

getUniqueIdentifier

public String getUniqueIdentifier(Form form,
                                  String namespace,
                                  Field field,
                                  String fieldName)
Specified by:
getUniqueIdentifier in interface FormManager

isDeleteable

public boolean isDeleteable(Form form)
Determine if a form is deleteable, which means it is not in use in other core structures.

Parameters:
form - Form to check
Returns:
true if the form is not deleteable.

logWarn

protected void logWarn(String message)

logError

protected void logError(String message)

addDataHolderToForm

public void addDataHolderToForm(Form form,
                                String holderType,
                                String id,
                                String inputId,
                                String outId,
                                String color,
                                String value,
                                String path)
                         throws Exception
Specified by:
addDataHolderToForm in interface FormManager
Throws:
Exception

addDataHolderToForm

public void addDataHolderToForm(Form form,
                                DataHolder holder)
Specified by:
addDataHolderToForm in interface FormManager

removeDataHolderFromForm

public void removeDataHolderFromForm(Form form,
                                     String holderId)
Specified by:
removeDataHolderFromForm in interface FormManager

addAllDataHolderFieldsToForm

public void addAllDataHolderFieldsToForm(Form form,
                                         String holderId)
Specified by:
addAllDataHolderFieldsToForm in interface FormManager

addAllDataHolderFieldsToForm

public void addAllDataHolderFieldsToForm(Form form,
                                         DataHolder holder)
Specified by:
addAllDataHolderFieldsToForm in interface FormManager

addDataHolderFields

protected void addDataHolderFields(Form form,
                                   DataHolder holder,
                                   boolean existing)

addDataFieldHolder

public void addDataFieldHolder(Form form,
                               String bindingId,
                               String fieldName,
                               String fieldClass)
Specified by:
addDataFieldHolder in interface FormManager

addSystemForm

public void addSystemForm(Form form)
Specified by:
addSystemForm in interface FormManager

jbpm-form-modeler-service-core 6.1.0.Beta2

Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.