@ApplicationScoped public class FormManagerImpl extends Object implements FormManager
Modifier and Type | Field and Description |
---|---|
protected FieldTypeManager |
fieldTypeManager |
FORMSTATUS_HIDDEN, FORMSTATUS_NORMAL
Constructor and Description |
---|
FormManagerImpl() |
Modifier and Type | Method and Description |
---|---|
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) |
@Inject protected FieldTypeManager fieldTypeManager
public List<Form> getFormsBySubject(String subject) throws Exception
getFormsBySubject
in interface FormManager
Exception
public List<Form> getFormsBySubjectAndName(String subject, String name) throws Exception
getFormsBySubjectAndName
in interface FormManager
Exception
public Form[] getAllForms()
getAllForms
in interface FormManager
public Form getFormForFieldEdition(FieldType fieldType) throws Exception
getFormForFieldEdition
in interface FormManager
fieldType
- for which we want to editException
- in case of errorpublic Form getFormById(Long id)
getFormById
in interface FormManager
id
- Form idpublic Form createForm(String name)
createForm
in interface FormManager
public Form createForm(String subject, String name, String displayMode, Long status)
createForm
in interface FormManager
subject
- Form subjectname
- Form namedisplayMode
- Form display modestatus
- Form statusException
- in case of errorpublic Field addFieldToForm(Form pForm, FieldType fieldType) throws Exception
addFieldToForm
in interface FormManager
Exception
public Field addFieldToForm(Form pForm, String fieldName, FieldType fieldType, I18nSet label)
addFieldToForm
in interface FormManager
pForm
- Form to be modifiedfieldName
- Field name to createfieldType
- Field typeException
- in case of errorpublic Field addFieldToForm(Form pForm, String fieldName, FieldType fieldType, I18nSet label, String inputBindingString, String outputBindingString)
addFieldToForm
in interface FormManager
pForm
- Form to be modifiedfieldName
- Field name to createfieldType
- Field typeException
- in case of errorpublic Field addFieldToForm(Form form, String fieldName, FieldType fieldType, String fieldClass, I18nSet label, String inputBinding, String outputBinding)
addFieldToForm
in interface FormManager
protected static Long generateUniqueId()
public void promoteField(Form pForm, int fieldPos, int destPos, boolean groupWithPrevious, boolean nextFieldGrouped) throws Exception
promoteField
in interface FormManager
Exception
public void degradeField(Form pForm, int fieldPos, int destPos, boolean groupWithPrevious, boolean nextFieldGrouped) throws Exception
degradeField
in interface FormManager
Exception
public void changeFieldPosition(Form pForm, int fieldPos, int destPos, boolean groupWithPrevious, boolean nextFieldGrouped) throws Exception
changeFieldPosition
in interface FormManager
pForm
- form to modifyfieldPos
- original field positiondestPos
- destination positiongroupWithPrevious
- determines that the field must be grouped with the previous fieldnextFieldGrouped
- determines that the next field must be grouped with the modified fieldException
public void moveTop(Form pForm, int fieldPos) throws Exception
moveTop
in interface FormManager
pForm
- form to modifyfieldPos
- field position to move topException
- in case of errorpublic void moveBottom(Form pForm, int fieldPos) throws Exception
moveBottom
in interface FormManager
pForm
- form to modifyfieldPos
- field position to move downException
- in case of errorpublic boolean moveUp(Form pForm, int fieldPos) throws Exception
moveUp
in interface FormManager
pForm
- form to modifyfieldPos
- field position to move upException
- in case of errorpublic void groupWithPrevious(Form pForm, int fieldPos, boolean value) throws Exception
groupWithPrevious
in interface FormManager
pForm
- form to modifyfieldPos
- field position to move upException
- in case of errorpublic boolean moveDown(Form pForm, int fieldPos) throws Exception
moveDown
in interface FormManager
pForm
- form to modifyfieldPos
- field position to move downException
- in case of errorpublic void deleteField(Form pForm, int fieldPos) throws Exception
deleteField
in interface FormManager
Exception
public void saveTemplateForForm(Long formId, String templateContent) throws Exception
saveTemplateForForm
in interface FormManager
Exception
public String getUniqueIdentifiersPreffix()
getUniqueIdentifiersPreffix
in interface FormManager
public String getUniqueIdentifier(Form form, String namespace, Field field, String fieldName)
getUniqueIdentifier
in interface FormManager
public boolean isDeleteable(Form form)
form
- Form to checkprotected void logWarn(String message)
protected void logError(String message)
public void addDataHolderToForm(Form form, String holderType, String id, String inputId, String outId, String color, String value, String path) throws Exception
addDataHolderToForm
in interface FormManager
Exception
public void addDataHolderToForm(Form form, DataHolder holder)
addDataHolderToForm
in interface FormManager
public void removeDataHolderFromForm(Form form, String holderId)
removeDataHolderFromForm
in interface FormManager
public void addAllDataHolderFieldsToForm(Form form, String holderId)
addAllDataHolderFieldsToForm
in interface FormManager
public void addAllDataHolderFieldsToForm(Form form, DataHolder holder)
addAllDataHolderFieldsToForm
in interface FormManager
protected void addDataHolderFields(Form form, DataHolder holder, boolean existing)
public void addDataFieldHolder(Form form, String bindingId, String fieldName, String fieldClass)
addDataFieldHolder
in interface FormManager
public void addSystemForm(Form form)
addSystemForm
in interface FormManager
Copyright © 2001-2014 JBoss by Red Hat. All Rights Reserved.