org.broadleafcommerce.openadmin.web.form.entity
Class EntityForm
java.lang.Object
org.broadleafcommerce.openadmin.web.form.entity.EntityForm
public class EntityForm
- extends Object
|
Method Summary |
void |
addAction(EntityFormAction action)
|
void |
addField(Field field)
|
void |
addField(Field field,
String groupName,
Integer groupOrder,
String tabName,
Integer tabOrder)
|
void |
addHiddenField(Field field)
|
void |
addListGrid(ListGrid listGrid,
String tabName,
Integer tabOrder)
|
void |
addMapKeyField(Field field)
|
void |
clearFieldsMap()
Clears out the cached 'fields' variable which is used to render the form on the frontend. |
Field |
findField(String fieldName)
|
ListGrid |
findListGrid(String collectionFieldName)
Convenience method for grabbing a grid by its collection field name. |
Tab |
findTab(String tabTitle)
|
Tab |
findTabForField(String fieldName)
|
List<EntityFormAction> |
getActions()
|
List<ListGrid> |
getAllListGrids()
|
String |
getCeilingEntityClassname()
|
EntityForm |
getDynamicForm(String name)
|
DynamicEntityFormInfo |
getDynamicFormInfo(String name)
|
Map<String,DynamicEntityFormInfo> |
getDynamicFormInfos()
|
Map<String,EntityForm> |
getDynamicForms()
|
String |
getEntityType()
|
Map<String,Field> |
getFields()
|
String |
getId()
|
String |
getIdProperty()
|
String |
getMainEntityName()
|
Boolean |
getReadOnly()
|
String |
getSectionKey()
|
Set<Tab> |
getTabs()
|
void |
putDynamicForm(String name,
EntityForm ef)
|
void |
putDynamicFormInfo(String name,
DynamicEntityFormInfo info)
|
void |
removeAction(EntityFormAction action)
|
void |
removeAllActions()
|
Field |
removeField(String fieldName)
|
ListGrid |
removeListGrid(String subCollectionFieldName)
|
void |
removeTab(Tab tab)
|
String |
sanitizeFieldName(String fieldName)
Since this field name could come from the frontend (where all fields are referenced like fields[name].value,
we need to strip that part out to look up the real field name in this entity |
void |
setActions(List<EntityFormAction> actions)
|
void |
setCeilingEntityClassname(String ceilingEntityClassname)
|
void |
setDynamicFormInfos(Map<String,DynamicEntityFormInfo> dynamicFormInfos)
|
void |
setDynamicForms(Map<String,EntityForm> dynamicForms)
|
void |
setEntityType(String entityType)
|
void |
setId(String id)
|
void |
setIdProperty(String idProperty)
|
void |
setMainEntityName(String mainEntityName)
|
void |
setReadOnly()
|
void |
setReadOnly(boolean readOnly)
|
void |
setSectionKey(String sectionKey)
|
void |
setTabs(Set<Tab> tabs)
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
LOG
protected static final org.apache.commons.logging.Log LOG
HIDDEN_GROUP
public static final String HIDDEN_GROUP
- See Also:
- Constant Field Values
MAP_KEY_GROUP
public static final String MAP_KEY_GROUP
- See Also:
- Constant Field Values
DEFAULT_GROUP_NAME
public static final String DEFAULT_GROUP_NAME
- See Also:
- Constant Field Values
DEFAULT_GROUP_ORDER
public static final Integer DEFAULT_GROUP_ORDER
DEFAULT_TAB_NAME
public static final String DEFAULT_TAB_NAME
- See Also:
- Constant Field Values
DEFAULT_TAB_ORDER
public static final Integer DEFAULT_TAB_ORDER
id
protected String id
idProperty
protected String idProperty
ceilingEntityClassname
protected String ceilingEntityClassname
entityType
protected String entityType
mainEntityName
protected String mainEntityName
sectionKey
protected String sectionKey
readOnly
protected Boolean readOnly
tabs
protected Set<Tab> tabs
fields
protected Map<String,Field> fields
dynamicForms
protected Map<String,EntityForm> dynamicForms
dynamicFormInfos
protected Map<String,DynamicEntityFormInfo> dynamicFormInfos
actions
protected List<EntityFormAction> actions
EntityForm
public EntityForm()
getFields
public Map<String,Field> getFields()
- Returns:
- a flattened, field name keyed representation of all of
the fields in all of the groups for this form. This set will also includes all of the dynamic form
fields.
Note that if there collisions between the dynamic form fields and the fields on this form (meaning that they
have the same name), then the dynamic form field will be excluded from the map and the preference will be given
to first-level entities
- See Also:
#getFields(boolean)}
clearFieldsMap
public void clearFieldsMap()
- Clears out the cached 'fields' variable which is used to render the form on the frontend. Use this method
if you want to force the entityForm to rebuild itself based on the tabs and groups that have been assigned and
populated
getAllListGrids
public List<ListGrid> getAllListGrids()
findListGrid
public ListGrid findListGrid(String collectionFieldName)
- Convenience method for grabbing a grid by its collection field name. This is very similar to
findField(String)
but differs in that this only searches through the sub collections for the current entity
- Parameters:
collectionFieldName - the field name of the collection on the top-level entity
- Returns:
findTab
public Tab findTab(String tabTitle)
findTabForField
public Tab findTabForField(String fieldName)
findField
public Field findField(String fieldName)
sanitizeFieldName
public String sanitizeFieldName(String fieldName)
- Since this field name could come from the frontend (where all fields are referenced like fields[name].value,
we need to strip that part out to look up the real field name in this entity
- Parameters:
fieldName -
- Returns:
removeField
public Field removeField(String fieldName)
removeTab
public void removeTab(Tab tab)
removeListGrid
public ListGrid removeListGrid(String subCollectionFieldName)
addHiddenField
public void addHiddenField(Field field)
addField
public void addField(Field field)
addMapKeyField
public void addMapKeyField(Field field)
addField
public void addField(Field field,
String groupName,
Integer groupOrder,
String tabName,
Integer tabOrder)
addListGrid
public void addListGrid(ListGrid listGrid,
String tabName,
Integer tabOrder)
addAction
public void addAction(EntityFormAction action)
removeAction
public void removeAction(EntityFormAction action)
removeAllActions
public void removeAllActions()
getDynamicForm
public EntityForm getDynamicForm(String name)
putDynamicForm
public void putDynamicForm(String name,
EntityForm ef)
getDynamicFormInfo
public DynamicEntityFormInfo getDynamicFormInfo(String name)
putDynamicFormInfo
public void putDynamicFormInfo(String name,
DynamicEntityFormInfo info)
getReadOnly
public Boolean getReadOnly()
setReadOnly
public void setReadOnly()
setReadOnly
public void setReadOnly(boolean readOnly)
getActions
public List<EntityFormAction> getActions()
getId
public String getId()
setId
public void setId(String id)
getIdProperty
public String getIdProperty()
setIdProperty
public void setIdProperty(String idProperty)
getCeilingEntityClassname
public String getCeilingEntityClassname()
setCeilingEntityClassname
public void setCeilingEntityClassname(String ceilingEntityClassname)
getEntityType
public String getEntityType()
setEntityType
public void setEntityType(String entityType)
getMainEntityName
public String getMainEntityName()
setMainEntityName
public void setMainEntityName(String mainEntityName)
getSectionKey
public String getSectionKey()
setSectionKey
public void setSectionKey(String sectionKey)
getTabs
public Set<Tab> getTabs()
setTabs
public void setTabs(Set<Tab> tabs)
getDynamicForms
public Map<String,EntityForm> getDynamicForms()
setDynamicForms
public void setDynamicForms(Map<String,EntityForm> dynamicForms)
getDynamicFormInfos
public Map<String,DynamicEntityFormInfo> getDynamicFormInfos()
setDynamicFormInfos
public void setDynamicFormInfos(Map<String,DynamicEntityFormInfo> dynamicFormInfos)
setActions
public void setActions(List<EntityFormAction> actions)
Copyright © 2013. All Rights Reserved.