|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.alfresco.web.bean.generator.BaseComponentGenerator
public abstract class BaseComponentGenerator
Nested Class Summary | |
---|---|
protected static class |
BaseComponentGenerator.ControlType
|
Constructor Summary | |
---|---|
BaseComponentGenerator()
|
Method Summary | |
---|---|
protected void |
addStringConstraintParam(java.util.List params,
java.lang.String param)
Adds the given string parameter to the list of parameters to be used for validating constraints on the client. |
protected void |
createAndSetConverter(javax.faces.context.FacesContext context,
java.lang.String converterId,
javax.faces.component.UIComponent component)
Creates the converter with the given id and adds it to the component. |
protected javax.faces.component.UIComponent |
createComponent(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item)
Creates the component for the given proerty sheet item. |
protected javax.faces.component.UIOutput |
createOutputTextComponent(javax.faces.context.FacesContext context,
java.lang.String id)
Creates an output text component. |
javax.faces.component.UIComponent |
generateAndAdd(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item)
Dynamically generates a component for the given property sheet item. |
protected org.alfresco.service.cmr.dictionary.AssociationDefinition |
getAssociationDefinition(javax.faces.context.FacesContext context,
Node node,
java.lang.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(javax.faces.context.FacesContext context,
Node node,
java.lang.String propertyName)
Retrieve the PropertyDefinition for the given property name on the given node |
boolean |
isEnabledInEditMode(javax.faces.context.FacesContext context,
javax.faces.component.UIComponent control,
org.alfresco.service.cmr.dictionary.PropertyDefinition propDef)
Determines whether the component will be enabled when rendered. |
protected void |
setupAssociation(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item,
org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef,
javax.faces.component.UIComponent component)
Sets up the association component i.e. |
protected void |
setupConstraints(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
Sets up client validation rules for any constraints the property has. |
protected void |
setupConverter(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem association,
org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef,
javax.faces.component.UIComponent component)
Sets up the appropriate converter for the given association |
protected void |
setupConverter(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
Sets up the appropriate converter for the given property |
protected void |
setupMandatoryAssociationIfNecessary(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem association,
org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef,
javax.faces.component.UIComponent component)
Sets up a mandatory validation rule for the given association. |
protected void |
setupMandatoryMarker(javax.faces.context.FacesContext context,
PropertySheetItem item)
Sets up the marker to show that the item is mandatory. |
protected void |
setupMandatoryPropertyIfNecessary(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
Sets up a mandatory validation rule for the given property. |
protected void |
setupMandatoryValidation(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item,
javax.faces.component.UIComponent component,
boolean realTimeChecking,
java.lang.String idSuffix)
Sets up a client mandatory validation rule with the property sheet for the given item. |
protected javax.faces.component.UIComponent |
setupMultiValuePropertyIfNecessary(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
Creates a wrapper component around the given component to enable the user to edit multiple values. |
protected void |
setupNumericRangeConstraint(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
javax.faces.component.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(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem item,
org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef,
javax.faces.component.UIComponent component)
Sets up the property component i.e. |
protected void |
setupRegexConstraint(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
javax.faces.component.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(javax.faces.context.FacesContext context,
UIPropertySheet propertySheet,
PropertySheetItem property,
javax.faces.component.UIComponent component,
org.alfresco.repo.dictionary.constraint.StringLengthConstraint constraint,
boolean realTimeChecking)
Sets up a default validation rule for the string length constraint |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.alfresco.web.bean.generator.IComponentGenerator |
---|
generate |
Constructor Detail |
---|
public BaseComponentGenerator()
Method Detail |
---|
public javax.faces.component.UIComponent generateAndAdd(javax.faces.context.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 association
protected javax.faces.component.UIComponent createComponent(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem item)
context
- FacesContextpropertySheet
- The property sheet being generateditem
- The property or association being generated
protected void createAndSetConverter(javax.faces.context.FacesContext context, java.lang.String converterId, javax.faces.component.UIComponent component)
context
- FacesContextconverterId
- The name of the converter to createcomponent
- The component to add the converter toprotected javax.faces.component.UIOutput createOutputTextComponent(javax.faces.context.FacesContext context, java.lang.String id)
context
- FacesContextid
- Optional id to set
protected void setupProperty(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem item, org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, javax.faces.component.UIComponent component)
context
- FacesContextpropertySheet
- The property sheetitem
- The parent componentpropertyDef
- The property definitioncomponent
- The component representing the propertyprotected void setupAssociation(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem item, org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef, javax.faces.component.UIComponent component)
context
- FacesContextpropertySheet
- The property sheetitem
- The parent componentassociationDef
- The association definitioncomponent
- The component representing the associationprotected javax.faces.component.UIComponent setupMultiValuePropertyIfNecessary(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, javax.faces.component.UIComponent component)
context
- FacesContextpropertySheet
- The property sheet being generatedproperty
- The property being generatedpropertyDef
- The data dictionary definition for the propertycomponent
- The component representing the property
protected void setupMandatoryPropertyIfNecessary(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, javax.faces.component.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(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem association, org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef, javax.faces.component.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(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem item, javax.faces.component.UIComponent component, boolean realTimeChecking, java.lang.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(javax.faces.context.FacesContext context, PropertySheetItem item)
context
- FacesContextitem
- The item being generatedprotected void setupConstraints(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, javax.faces.component.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(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, javax.faces.component.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(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, javax.faces.component.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(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, javax.faces.component.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(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem property, org.alfresco.service.cmr.dictionary.PropertyDefinition propertyDef, javax.faces.component.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(javax.faces.context.FacesContext context, UIPropertySheet propertySheet, PropertySheetItem association, org.alfresco.service.cmr.dictionary.AssociationDefinition associationDef, javax.faces.component.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(javax.faces.context.FacesContext context, Node node, java.lang.String propertyName)
node
- The node to get the property definition frompropertyName
- The name of the property
protected org.alfresco.service.cmr.dictionary.AssociationDefinition getAssociationDefinition(javax.faces.context.FacesContext context, Node node, java.lang.String associationName)
node
- The node to get the association definition fromassociationName
- The name of the property
protected void addStringConstraintParam(java.util.List params, java.lang.String param)
params
- The list of parameters for the constraintparam
- The string parameter to addpublic boolean isEnabledInEditMode(javax.faces.context.FacesContext context, javax.faces.component.UIComponent control, org.alfresco.service.cmr.dictionary.PropertyDefinition propDef)
IComponentGenerator
isEnabledInEditMode
in interface IComponentGenerator
context
- FacesContextcontrol
- The control being renderedpropDef
- The definition of the property
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |