public interface FormBuilderService
Modifier and Type | Method and Description |
---|---|
EntityForm |
buildAdornedListForm(AdornedTargetCollectionMetadata adornedMd,
AdornedTargetList adornedList,
String parentId,
boolean isViewCollectionItem,
EntityForm ef,
List<SectionCrumb> sectionCrumbs,
boolean isAdd)
Equivalent to
#buildAdornedListForm(AdornedTargetCollectionMetadata, AdornedTargetList, String) except rather than creating a
new EntityForm this simply uses the EntityForm that was passed in as ef. |
EntityForm |
buildAdornedListForm(AdornedTargetCollectionMetadata adornedMd,
AdornedTargetList adornedList,
String parentId,
boolean isViewCollectionItem,
List<SectionCrumb> sectionCrumbs,
boolean isAdd)
Builds the EntityForm used in modal dialogs when adding items to adorned target collections.
|
ListGrid |
buildCollectionListGrid(String containingEntityId,
DynamicResultSet drs,
Property field,
String sectionKey,
List<SectionCrumb> sectionCrumbs)
Builds a list grid that is used to render a collection inline in an entity form.
|
ListGrid |
buildMainListGrid(DynamicResultSet drs,
ClassMetadata cmd,
String sectionKey,
List<SectionCrumb> sectionCrumbs)
Builds a list grid that is typically used at the top entity level to select an entity for modification.
|
EntityForm |
buildMapForm(MapMetadata mapMd,
MapStructure mapStructure,
ClassMetadata cmd,
String parentId)
Builds the EntityForm used in modal dialogs when adding items to map collections.
|
EntityForm |
buildMapForm(MapMetadata mapMd,
MapStructure mapStructure,
ClassMetadata cmd,
String parentId,
EntityForm ef)
Equivalent to
buildMapForm(MapMetadata, MapStructure, ClassMetadata, String) except rather than creating a
new EntityForm this simply uses the EntityForm that was passed in as ef. |
Map<String,Object> |
buildSelectizeCollectionInfo(String containingEntityId,
DynamicResultSet drs,
Property field,
String sectionKey,
List<SectionCrumb> sectionCrumbs) |
Map<String,Object> |
constructSelectizeOptionMap(DynamicResultSet drs,
ClassMetadata cmd)
constructs the selectize option map based on the dynamic result set and class metadata
|
EntityForm |
createEntityForm(ClassMetadata cmd,
Entity entity,
List<SectionCrumb> sectionCrumbs)
Creates a new EntityForm that has all of the appropriate fields set up along with the values for those fields
from the given Entity.
|
EntityForm |
createEntityForm(ClassMetadata cmd,
Entity entity,
Map<String,DynamicResultSet> collectionRecords,
List<SectionCrumb> sectionCrumbs)
Builds an EntityForm that has all of the appropriate fields set up along with the values for those fields
from the given Entity as well as all sub-collections of the given Entity that appear in the collectionRecords map.
|
EntityForm |
createEntityForm(ClassMetadata cmd,
List<SectionCrumb> sectionCrumbs)
Creates a new EntityForm with the a default 'Save' action.
|
String |
extractDefaultValueFromFieldData(String fieldType,
BasicFieldMetadata fmd)
Extracts the DefaultValue from the FieldMetaData and parses it based on the
SupportedFieldType that the field uses. |
void |
populateAdornedEntityFormFields(EntityForm ef,
Entity entity,
AdornedTargetList adornedList)
Sets values for the necessary adorned fields on the EntityForm from the specified entity.
|
void |
populateEntityForm(ClassMetadata cmd,
Entity entity,
EntityForm ef,
List<SectionCrumb> sectionCrumbs)
Populates a given ef based on the given cmd to initially create fields with the necessary metadata
and then fills those fields out based on the property values from entity.
|
void |
populateEntityForm(ClassMetadata cmd,
EntityForm ef,
List<SectionCrumb> sectionCrumbs)
Populates the given ef with all of the fields based on the properties from cmd.
|
void |
populateEntityForm(ClassMetadata cmd,
Entity entity,
Map<String,DynamicResultSet> collectionRecords,
EntityForm entityForm,
List<SectionCrumb> sectionCrumbs)
Builds an EntityForm that has all of the appropriate fields set up along with the values for thsoe fields
from the given Entity as well as all sub-collections of the given Entity that appear in the collectionRecords map.
|
void |
populateEntityFormFields(EntityForm ef,
Entity entity)
Delegates to
populateEntityFormFields(EntityForm, Entity, boolean, boolean) with true for populating both
the id and type. |
void |
populateEntityFormFields(EntityForm ef,
Entity entity,
boolean populateType,
boolean populateId)
Sets values for all fields found on the EntityForm from the specified entity.
|
void |
populateEntityFormFieldValues(ClassMetadata cmd,
Entity entity,
EntityForm ef)
Populates the given
EntityForm with values based on the Entity that has been passed in. |
void |
populateMapEntityFormFields(EntityForm ef,
Entity entity)
Sets values for the necessary map fields on the EntityForm from the specified entity.
|
void |
removeNonApplicableFields(ClassMetadata cmd,
EntityForm entityForm,
String entityType)
Loops through all of the fields that are specified in given class metadata and removes fields that
are not applicable for the given polymorphic entity type from the entity form.
|
ListGrid buildMainListGrid(DynamicResultSet drs, ClassMetadata cmd, String sectionKey, List<SectionCrumb> sectionCrumbs) throws ServiceException
drs
- cmd
- sectionKey
- ServiceException
ListGrid buildCollectionListGrid(String containingEntityId, DynamicResultSet drs, Property field, String sectionKey, List<SectionCrumb> sectionCrumbs) throws ServiceException
containingEntityId
- drs
- field
- sectionKey
- ServiceException
Map<String,Object> buildSelectizeCollectionInfo(String containingEntityId, DynamicResultSet drs, Property field, String sectionKey, List<SectionCrumb> sectionCrumbs) throws ServiceException
containingEntityId
- drs
- field
- sectionKey
- ServiceException
Map<String,Object> constructSelectizeOptionMap(DynamicResultSet drs, ClassMetadata cmd)
drs
- cmd
- String extractDefaultValueFromFieldData(String fieldType, BasicFieldMetadata fmd)
SupportedFieldType
that the field uses.
Logs a warning in the event of failure to parse the value and returns null.fieldType
- fmd
- void removeNonApplicableFields(ClassMetadata cmd, EntityForm entityForm, String entityType)
cmd
- entityForm
- entityType
- EntityForm createEntityForm(ClassMetadata cmd, List<SectionCrumb> sectionCrumbs) throws ServiceException
#populateEntityForm(ClassMetadata, EntityForm)
to ensure that the newly created EntityForm
has all of the appropriate fields set up without any values based on cmdcmd
- ServiceException
#populateEntityForm(ClassMetadata, EntityForm)}
void populateEntityForm(ClassMetadata cmd, EntityForm ef, List<SectionCrumb> sectionCrumbs) throws ServiceException
#populateEntityForm(ClassMetadata, Entity, EntityForm, boolean)
cmd
- ef
- ServiceException
EntityForm createEntityForm(ClassMetadata cmd, Entity entity, List<SectionCrumb> sectionCrumbs) throws ServiceException
#createEntityForm(ClassMetadata)
for further populationcmd
- metadata that the created EntityForm
should use to initialize its fieldsentity
- ServiceException
#createEntityForm(ClassMetadata)}
void populateEntityForm(ClassMetadata cmd, Entity entity, EntityForm ef, List<SectionCrumb> sectionCrumbs) throws ServiceException
cmd
- entity
- ef
- ServiceException
#populateEntityForm(ClassMetadata, EntityForm)}
void populateEntityFormFieldValues(ClassMetadata cmd, Entity entity, EntityForm ef)
EntityForm
with values based on the Entity
that has been passed in. The
ClassMetadata
is used to determine which properties should be attempted to be populatedcmd
- 'inspect' metadata for the class being populatedentity
- the Entity
that should be used to fill out the field values in the given EntityForm
ef
- the EntityForm
to populate field values from the given Entity
EntityForm createEntityForm(ClassMetadata cmd, Entity entity, Map<String,DynamicResultSet> collectionRecords, List<SectionCrumb> sectionCrumbs) throws ServiceException
EntityForm
(that has a save action) and then populates
that EntityForm
using #populateEntityForm(ClassMetadata, Entity, Map, EntityForm)
.
NOTE: if you are submitting a validation result, you must not call this method and instead invoke the one that has
an EntityForm
as a parameter. You cannot re-assign the entityForm to the model after it has already been
bound to a BindingResult, else the binding result will be removed.cmd
- entity
- collectionRecords
- ServiceException
#populateEntityForm(ClassMetadata, Entity, Map, EntityForm)}
void populateEntityForm(ClassMetadata cmd, Entity entity, Map<String,DynamicResultSet> collectionRecords, EntityForm entityForm, List<SectionCrumb> sectionCrumbs) throws ServiceException
EntityForm
to the model or else you lose the whole BindingResult
and errors will not properly be
displayed. In that scenario, you must use this method rather than the one that does not take in an entityForm as it
will attempt to instantiate a new object.cmd
- entity
- collectionRecords
- entityForm
- rather than instantiate a new EntityForm, this will use this parameter to fill outServiceException
void populateEntityFormFields(EntityForm ef, Entity entity)
populateEntityFormFields(EntityForm, Entity, boolean, boolean)
with true for populating both
the id and type.ef
- entity
- #populateEntityFormFields(EntityForm, Entity, boolean, boolean)}
void populateEntityFormFields(EntityForm ef, Entity entity, boolean populateType, boolean populateId)
ef
- entity
- populateType
- whether or not to use the type from the given Entity
or keep the current value on
the EntityForm
populateId
- whether or not to use the id from the given Entity
or keep the current value on
the EntityForm
void populateAdornedEntityFormFields(EntityForm ef, Entity entity, AdornedTargetList adornedList)
ef
- entity
- adornedList
- void populateMapEntityFormFields(EntityForm ef, Entity entity)
ef
- entity
- EntityForm buildAdornedListForm(AdornedTargetCollectionMetadata adornedMd, AdornedTargetList adornedList, String parentId, boolean isViewCollectionItem, List<SectionCrumb> sectionCrumbs, boolean isAdd) throws ServiceException
adornedMd
- adornedList
- parentId
- isViewCollectionItem
- ServiceException
EntityForm buildAdornedListForm(AdornedTargetCollectionMetadata adornedMd, AdornedTargetList adornedList, String parentId, boolean isViewCollectionItem, EntityForm ef, List<SectionCrumb> sectionCrumbs, boolean isAdd) throws ServiceException
#buildAdornedListForm(AdornedTargetCollectionMetadata, AdornedTargetList, String)
except rather than creating a
new EntityForm
this simply uses the EntityForm
that was passed in as ef. Used mainly when
rebuilding an EntityForm
after it has already been bound by Spring.
Before invoking this method, you should invoke EntityForm.clearFieldsMap()
to ensure that you have a clean
set of field groups and tabs for this method to work withmapMd
- mapStructure
- cmd
- parentId
- isViewCollectionItem
- ef
- the form DTO to populateEntityForm
passed in but fully populatedServiceException
EntityForm buildMapForm(MapMetadata mapMd, MapStructure mapStructure, ClassMetadata cmd, String parentId) throws ServiceException
mapMd
- mapStructure
- cmd
- parentId
- ServiceException
EntityForm buildMapForm(MapMetadata mapMd, MapStructure mapStructure, ClassMetadata cmd, String parentId, EntityForm ef) throws ServiceException
buildMapForm(MapMetadata, MapStructure, ClassMetadata, String)
except rather than creating a
new EntityForm
this simply uses the EntityForm
that was passed in as ef. Used mainly when
rebuilding an EntityForm
after it has already been bound by Spring.
Before invoking this method, you should invoke EntityForm.clearFieldsMap()
to ensure that you have a clean
set of field groups and tabs for this method to work withmapMd
- mapStructure
- cmd
- parentId
- ef
- the form DTO to populateEntityForm
passed in but fully populatedServiceException
Copyright © 2022. All rights reserved.