org.alfresco.repo.forms.processor.node
Class QNameFieldProcessor

java.lang.Object
  extended by org.alfresco.repo.forms.processor.AbstractFieldProcessor
      extended by org.alfresco.repo.forms.processor.node.QNameFieldProcessor
All Implemented Interfaces:
FieldProcessor
Direct Known Subclasses:
AssociationFieldProcessor, DefaultFieldProcessor, PropertyFieldProcessor

public abstract class QNameFieldProcessor
extends AbstractFieldProcessor

FieldProcessor implementation that handles QName fields.

Since:
3.4

Field Summary
protected  org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
           
protected  org.alfresco.service.namespace.NamespaceService namespaceService
           
 
Constructor Summary
QNameFieldProcessor()
           
QNameFieldProcessor(org.alfresco.service.namespace.NamespaceService namespaceService, org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
           
 
Method Summary
 Field generateField(org.alfresco.service.namespace.QName fullName, ContentModelItemData itemData, boolean isForcedField)
           
protected  Field generateTypedField(java.lang.String fieldName, FormCreationData formData, ContentModelItemData typedData)
          The method which actually creates the Field.
protected  java.lang.Class getExpectedDataType()
           
protected  org.alfresco.service.namespace.QName getFullName(java.lang.String name)
           
protected abstract  FieldGroup getGroup(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition typeDef)
           
protected  java.lang.String getPrefixedName(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition attribDef)
           
protected abstract  org.alfresco.service.cmr.dictionary.ClassAttributeDefinition getTypeDefinition(org.alfresco.service.namespace.QName fullName, ContentModelItemData itemData, boolean isForcedField)
           
protected abstract  java.lang.Object getValue(org.alfresco.service.namespace.QName fullName, ContentModelItemData itemData)
           
protected  java.lang.String makeDataKeyForName(java.lang.String propName, java.lang.String prefix)
           
protected abstract  Field makeField(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition typeDef, java.lang.Object value, FieldGroup group)
           
protected  void populateFieldDefinition(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition attribDef, FieldDefinition fieldDef, FieldGroup group, java.lang.String dataKeyPrefix)
          Sets several properties on the FieldDefinition, including name, label, description, dataKeyName and whether the field is protected.
 void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
           
 void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
           
 
Methods inherited from class org.alfresco.repo.forms.processor.AbstractFieldProcessor
generateField, getLogger, getRegistryKey, setFieldProcessorRegistry
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

namespaceService

protected org.alfresco.service.namespace.NamespaceService namespaceService

dictionaryService

protected org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService
Constructor Detail

QNameFieldProcessor

public QNameFieldProcessor()

QNameFieldProcessor

public QNameFieldProcessor(org.alfresco.service.namespace.NamespaceService namespaceService,
                           org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Method Detail

generateTypedField

protected Field generateTypedField(java.lang.String fieldName,
                                   FormCreationData formData,
                                   ContentModelItemData typedData)
Description copied from class: AbstractFieldProcessor
The method which actually creates the Field.

Specified by:
generateTypedField in class AbstractFieldProcessor
Parameters:
fieldName - the name of the Field to be genereated.
formData - TODO
typedData - the data used to create the field.
Returns:
a Field or null.

getFullName

protected org.alfresco.service.namespace.QName getFullName(java.lang.String name)

getPrefixedName

protected java.lang.String getPrefixedName(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition attribDef)

generateField

public Field generateField(org.alfresco.service.namespace.QName fullName,
                           ContentModelItemData itemData,
                           boolean isForcedField)

populateFieldDefinition

protected void populateFieldDefinition(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition attribDef,
                                       FieldDefinition fieldDef,
                                       FieldGroup group,
                                       java.lang.String dataKeyPrefix)
Sets several properties on the FieldDefinition, including name, label, description, dataKeyName and whether the field is protected. These values are derived from the attribDef parameter.

Parameters:
attribDef - Used to set the values of name, description, label, dataKeyName and isProtected properties on the returned object.
fieldDef - A factory object used to create the FieldDefinition to be returned.
group - Used to set the group on the returned FieldDefinition.

makeDataKeyForName

protected java.lang.String makeDataKeyForName(java.lang.String propName,
                                              java.lang.String prefix)

getExpectedDataType

protected java.lang.Class getExpectedDataType()
Specified by:
getExpectedDataType in class AbstractFieldProcessor
Returns:
the expected Class of the data parameter for the method generateField.

setNamespaceService

public void setNamespaceService(org.alfresco.service.namespace.NamespaceService namespaceService)
Parameters:
namespaceService - the namespaceService to set

setDictionaryService

public void setDictionaryService(org.alfresco.service.cmr.dictionary.DictionaryService dictionaryService)
Parameters:
dictionaryService - the dictionaryService to set

makeField

protected abstract Field makeField(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition typeDef,
                                   java.lang.Object value,
                                   FieldGroup group)

getGroup

protected abstract FieldGroup getGroup(org.alfresco.service.cmr.dictionary.ClassAttributeDefinition typeDef)

getValue

protected abstract java.lang.Object getValue(org.alfresco.service.namespace.QName fullName,
                                             ContentModelItemData itemData)

getTypeDefinition

protected abstract org.alfresco.service.cmr.dictionary.ClassAttributeDefinition getTypeDefinition(org.alfresco.service.namespace.QName fullName,
                                                                                                  ContentModelItemData itemData,
                                                                                                  boolean isForcedField)


Copyright © 2005 - 2010 Alfresco Software, Inc. All Rights Reserved.