public abstract class BaseComponentGenerator extends Object implements IComponentGenerator
Modifier and Type | Class and Description |
---|---|
protected static class |
BaseComponentGenerator.ControlType |
Modifier and Type | Field and Description |
---|---|
protected DataDictionary |
dataDictionary |
Constructor and Description |
---|
BaseComponentGenerator() |
Modifier and Type | Method and Description |
---|---|
protected void |
addStringConstraintParam(List<String> params,
String param)
Adds the given string parameter to the list of parameters to be used for
validating constraints on the client.
|
protected void |
createAndSetConverter(FacesContext context,
String converterId,
UIComponent component)
Creates the converter with the given id and adds it to the component.
|
protected UIComponent |
createComponent(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item)
Creates the component for the given proerty sheet item.
|
protected UIOutput |
createOutputTextComponent(FacesContext context,
String id)
Creates an output text component.
|
UIComponent |
generateAndAdd(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item)
Dynamically generates a component for the given property sheet item.
|
protected org.alfresco.service.cmr.dictionary.AssociationDefinition |
getAssociationDefinition(FacesContext context,
Node node,
String associationName)
Retrieve the AssociationDefinition for the given property name on the given node
|
protected BaseComponentGenerator.ControlType |
getControlType()
Returns the type of the control being generated
|
protected org.alfresco.service.cmr.dictionary.PropertyDefinition |
getPropertyDefinition(FacesContext context,
Node node,
String propertyName)
Retrieve the PropertyDefinition for the given property name on the given node
|
boolean |
isEnabledInEditMode(FacesContext context,
UIComponent control,
org.alfresco.service.cmr.dictionary.PropertyDefinition propDef)
Determines whether the component will be enabled when rendered.
|
protected void |
setupAssociation(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item,
org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef,
UIComponent component)
Sets up the association component i.e.
|
protected void |
setupConstraints(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
UIComponent component)
Sets up client validation rules for any constraints the property has.
|
protected void |
setupConverter(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem association,
org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef,
UIComponent component)
Sets up the appropriate converter for the given association
|
protected void |
setupConverter(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
UIComponent component)
Sets up the appropriate converter for the given property
|
protected void |
setupMandatoryAssociationIfNecessary(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem association,
org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef,
UIComponent component)
Sets up a mandatory validation rule for the given association.
|
protected void |
setupMandatoryMarker(FacesContext context,
PropertySheetItem item)
Sets up the marker to show that the item is mandatory.
|
protected void |
setupMandatoryPropertyIfNecessary(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
UIComponent component)
Sets up a mandatory validation rule for the given property.
|
protected void |
setupMandatoryValidation(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item,
UIComponent component,
boolean realTimeChecking,
String idSuffix)
Sets up a client mandatory validation rule with the property
sheet for the given item.
|
protected UIComponent |
setupMultiValuePropertyIfNecessary(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
UIComponent component)
Creates a wrapper component around the given component to enable the user
to edit multiple values.
|
protected void |
setupNumericRangeConstraint(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
UIComponent component,
org.alfresco.repo.dictionary.constraint.NumericRangeConstraint constraint,
boolean realTimeChecking)
Sets up a default validation rule for the numeric range constraint
|
protected void |
setupProperty(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
UIComponent component)
Sets up the property component i.e.
|
protected void |
setupRegexConstraint(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
UIComponent component,
org.alfresco.repo.dictionary.constraint.RegexConstraint constraint,
boolean realTimeChecking)
Sets up a default validation rule for the regular expression constraint
|
protected void |
setupStringLengthConstraint(FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
UIComponent component,
org.alfresco.repo.dictionary.constraint.StringLengthConstraint constraint,
boolean realTimeChecking)
Sets up a default validation rule for the string length constraint
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
generate
protected DataDictionary dataDictionary
public UIComponent generateAndAdd(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem item)
IComponentGenerator
generateAndAdd
in interface IComponentGenerator
context
- FacesContextpropertySheet
- The property sheet componentitem
- The wrappper component representing the item to generate,
either a property, association or child associationprotected UIComponent createComponent(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem item)
context
- FacesContextpropertySheet
- The property sheet being generateditem
- The property or association being generatedprotected void createAndSetConverter(FacesContext context, String converterId, UIComponent component)
context
- FacesContextconverterId
- The name of the converter to createcomponent
- The component to add the converter toprotected UIOutput createOutputTextComponent(FacesContext context, String id)
context
- FacesContextid
- Optional id to setprotected void setupProperty(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem item, org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, UIComponent component)
context
- FacesContextpropertySheet
- The property sheetitem
- The parent componentpropertyDef
- The property definitioncomponent
- The component representing the propertyprotected void setupAssociation(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem item, org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef, UIComponent component)
context
- FacesContextpropertySheet
- The property sheetitem
- The parent componentassociationDef
- The association definitioncomponent
- The component representing the associationprotected UIComponent setupMultiValuePropertyIfNecessary(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, UIComponent component)
context
- FacesContextpropertySheet
- The property sheet being generatedproperty
- The property being generatedpropertyDef
- The data dictionary definition for the propertycomponent
- The component representing the propertyprotected void setupMandatoryPropertyIfNecessary(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, UIComponent component)
context
- FacesContextpropertySheet
- The property sheet being generatedproperty
- The property being generatedpropertyDef
- The data dictionary definition of the propertycomponent
- The component representing the propertyprotected void setupMandatoryAssociationIfNecessary(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem association, org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef, UIComponent component)
context
- FacesContextpropertySheet
- The property sheet being generatedassociation
- The association being generatedassociationDef
- The data dictionary definition of the associationcomponent
- The component representing the associationprotected void setupMandatoryValidation(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem item, UIComponent component, boolean realTimeChecking, String idSuffix)
context
- FacesContextpropertySheet
- The property sheet to add the validation rule toitem
- The item being generatedcomponent
- The component representing the itemrealTimeChecking
- true to make the client validate as the user typesidSuffix
- An optional suffix to add to the client idprotected void setupMandatoryMarker(FacesContext context, PropertySheetItem item)
context
- FacesContextitem
- The item being generatedprotected void setupConstraints(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, UIComponent component)
context
- FacesContext
propertySheet The property sheet being generatedproperty
- The property being generatedpropertyDef
- The data dictionary definition of the propertycomponent
- The component representing the propertyprotected void setupRegexConstraint(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, UIComponent component, org.alfresco.repo.dictionary.constraint.RegexConstraint constraint, boolean realTimeChecking)
context
- FacesContextpropertySheet
- The property sheet to add the validation rule toproperty
- The property being generatedcomponent
- The component representing the propertyconstraint
- The constraint to setuprealTimeChecking
- true to make the client validate as the user typesprotected void setupStringLengthConstraint(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, UIComponent component, org.alfresco.repo.dictionary.constraint.StringLengthConstraint constraint, boolean realTimeChecking)
context
- FacesContextpropertySheet
- The property sheet to add the validation rule toproperty
- The property being generatedcomponent
- The component representing the propertyconstraint
- The constraint to setuprealTimeChecking
- true to make the client validate as the user typesprotected void setupNumericRangeConstraint(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, UIComponent component, org.alfresco.repo.dictionary.constraint.NumericRangeConstraint constraint, boolean realTimeChecking)
context
- FacesContextpropertySheet
- The property sheet to add the validation rule toproperty
- The property being generatedcomponent
- The component representing the propertyconstraint
- The constraint to setuprealTimeChecking
- true to make the client validate as the user typesprotected void setupConverter(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, UIComponent component)
context
- FacesContextpropertySheet
- The property sheet being generatedproperty
- The property being generatedpropertyDef
- The data dictionary definition of the propertycomponent
- The component representing the propertyprotected void setupConverter(FacesContext context, UIPropertySheet propertySheet, PropertySheetItem association, org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef, UIComponent component)
context
- FacesContextpropertySheet
- The property sheet being generatedassociation
- The association being generatedassociationDef
- The data dictionary definition of the propertycomponent
- The component representing the associationprotected BaseComponentGenerator.ControlType getControlType()
protected org.alfresco.service.cmr.dictionary.PropertyDefinition getPropertyDefinition(FacesContext context, Node node, String propertyName)
node
- The node to get the property definition frompropertyName
- The name of the propertyprotected org.alfresco.service.cmr.dictionary.AssociationDefinition getAssociationDefinition(FacesContext context, Node node, String associationName)
node
- The node to get the association definition fromassociationName
- The name of the propertyprotected void addStringConstraintParam(List<String> params, String param)
params
- The list of parameters for the constraintparam
- The string parameter to addpublic boolean isEnabledInEditMode(FacesContext context, UIComponent control, org.alfresco.service.cmr.dictionary.PropertyDefinition propDef)
IComponentGenerator
isEnabledInEditMode
in interface IComponentGenerator
context
- FacesContextcontrol
- The control being renderedpropDef
- The definition of the propertyCopyright © 2005–2017 Alfresco Software. All rights reserved.