org.broadleafcommerce.openadmin.web.service
Interface FormBuilderService

All Known Implementing Classes:
FormBuilderServiceImpl

public interface FormBuilderService

Author:
Andre Azzolini (apazzolini)

Method Summary
 EntityForm buildAdornedListForm(AdornedTargetCollectionMetadata adornedMd, AdornedTargetList adornedList, String parentId)
          Builds the EntityForm used in modal dialogs when adding items to adorned target collections.
 ListGrid buildCollectionListGrid(String containingEntityId, Entity[] entities, Property field, String sectionKey)
          Builds a list grid that is used to render a collection inline in an entity form.
 EntityForm buildEntityForm(ClassMetadata cmd)
          Builds an EntityForm that has all of the appropriate fields set up without any values.
 EntityForm buildEntityForm(ClassMetadata cmd, Entity entity)
          Builds an EntityForm that has all of the appropriate fields set up along with the values for those fields from the given Entity.
 EntityForm buildEntityForm(ClassMetadata cmd, Entity entity, Map<String,Entity[]> collectionRecords)
          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.
 ListGrid buildMainListGrid(Entity[] entities, ClassMetadata cmd, String sectionKey)
          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.
 void copyEntityFormValues(EntityForm destinationForm, EntityForm sourceForm)
          Copies all values for fields from the destinationForm into the sourceForm.
 void populateAdornedEntityFormFields(EntityForm ef, Entity entity, AdornedTargetList adornedList)
          Sets values for the necessary adorned fields on the EntityForm from the specified entity.
 void populateEntityFormFields(EntityForm ef, Entity entity)
          Sets values for all fields found on the EntityForm from the specified entity.
 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.
 

Method Detail

buildMainListGrid

ListGrid buildMainListGrid(Entity[] entities,
                           ClassMetadata cmd,
                           String sectionKey)
                           throws ServiceException,
                                  com.gwtincubator.security.exception.ApplicationSecurityException
Builds a list grid that is typically used at the top entity level to select an entity for modification. Note that it can also be used in other places that require the same grid as the main entity search screen provided the type on the returned ListGrid is set appropriately.

Parameters:
entities -
cmd -
sectionKey -
Returns:
the ListGrid
Throws:
ServiceException
com.gwtincubator.security.exception.ApplicationSecurityException

buildCollectionListGrid

ListGrid buildCollectionListGrid(String containingEntityId,
                                 Entity[] entities,
                                 Property field,
                                 String sectionKey)
                                 throws ServiceException,
                                        com.gwtincubator.security.exception.ApplicationSecurityException
Builds a list grid that is used to render a collection inline in an entity form. Note that it can also be used in other places that require the same grid provided the type on the returned ListGrid is set appropriately.

Parameters:
containingEntityId -
entities -
field -
sectionKey -
Returns:
the ListGrid
Throws:
ServiceException
com.gwtincubator.security.exception.ApplicationSecurityException

removeNonApplicableFields

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.

Parameters:
cmd -
entityForm -
entityType -

buildEntityForm

EntityForm buildEntityForm(ClassMetadata cmd)
Builds an EntityForm that has all of the appropriate fields set up without any values.

Parameters:
cmd -
Returns:
the EntityForm

buildEntityForm

EntityForm buildEntityForm(ClassMetadata cmd,
                           Entity entity)
Builds an EntityForm that has all of the appropriate fields set up along with the values for those fields from the given Entity.

Parameters:
cmd -
entity -
Returns:
the EntityForm

buildEntityForm

EntityForm buildEntityForm(ClassMetadata cmd,
                           Entity entity,
                           Map<String,Entity[]> collectionRecords)
                           throws ServiceException,
                                  com.gwtincubator.security.exception.ApplicationSecurityException
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.

Parameters:
cmd -
entity -
collectionRecords -
Returns:
the EntityForm
Throws:
ServiceException
com.gwtincubator.security.exception.ApplicationSecurityException

populateEntityFormFields

void populateEntityFormFields(EntityForm ef,
                              Entity entity)
Sets values for all fields found on the EntityForm from the specified entity.

Parameters:
ef -
entity -

populateAdornedEntityFormFields

void populateAdornedEntityFormFields(EntityForm ef,
                                     Entity entity,
                                     AdornedTargetList adornedList)
Sets values for the necessary adorned fields on the EntityForm from the specified entity.

Parameters:
ef -
entity -
adornedList -

populateMapEntityFormFields

void populateMapEntityFormFields(EntityForm ef,
                                 Entity entity)
Sets values for the necessary map fields on the EntityForm from the specified entity.

Parameters:
ef -
entity -

copyEntityFormValues

void copyEntityFormValues(EntityForm destinationForm,
                          EntityForm sourceForm)
Copies all values for fields from the destinationForm into the sourceForm.

Parameters:
destinationForm -
sourceForm -

buildAdornedListForm

EntityForm buildAdornedListForm(AdornedTargetCollectionMetadata adornedMd,
                                AdornedTargetList adornedList,
                                String parentId)
                                throws ServiceException,
                                       com.gwtincubator.security.exception.ApplicationSecurityException
Builds the EntityForm used in modal dialogs when adding items to adorned target collections.

Parameters:
adornedMd -
adornedList -
parentId -
Returns:
the EntityForm
Throws:
ServiceException
com.gwtincubator.security.exception.ApplicationSecurityException

buildMapForm

EntityForm buildMapForm(MapMetadata mapMd,
                        MapStructure mapStructure,
                        ClassMetadata cmd,
                        String parentId)
                        throws ServiceException,
                               com.gwtincubator.security.exception.ApplicationSecurityException
Builds the EntityForm used in modal dialogs when adding items to map collections.

Parameters:
mapMd -
mapStructure -
cmd -
parentId -
Returns:
the EntityForm
Throws:
ServiceException
com.gwtincubator.security.exception.ApplicationSecurityException


Copyright © 2013. All Rights Reserved.