org.alfresco.web.ui.repo.component.property
Class UIAssociationEditor

java.lang.Object
  extended by javax.faces.component.UIComponent
      extended by javax.faces.component.UIComponentBase
          extended by javax.faces.component.UIOutput
              extended by javax.faces.component.UIInput
                  extended by org.alfresco.web.ui.repo.component.property.BaseAssociationEditor
                      extended by org.alfresco.web.ui.repo.component.property.UIAssociationEditor
All Implemented Interfaces:
javax.faces.component.EditableValueHolder, javax.faces.component.StateHolder, javax.faces.component.ValueHolder

public class UIAssociationEditor
extends BaseAssociationEditor

Component that allows associations to be edited i.e. new associations to be added, existing ones to be removed whilst following the rules in the data dictionary


Nested Class Summary
 
Nested classes/interfaces inherited from class org.alfresco.web.ui.repo.component.property.BaseAssociationEditor
BaseAssociationEditor.AssocEditorEvent
 
Field Summary
static java.lang.String MSG_WARN_CANNOT_VIEW_TARGET_DETAILS
           
static java.lang.String MSG_WARN_USER_WAS_DELETED
           
 
Fields inherited from class org.alfresco.web.ui.repo.component.property.BaseAssociationEditor
added, associationName, availableOptions, availableOptionsSize, changingAssociation, disabled, highlightedRow, noSelectedItemsMsg, originalAssocs, removed, searchTerm, selectedItemsMsg, selectItemMsg, selectItemsMsg, showAvailable
 
Fields inherited from class javax.faces.component.UIInput
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
 
Constructor Summary
UIAssociationEditor()
           
 
Method Summary
protected  void addTarget(Node node, java.lang.String[] toAdd)
          Updates the component and node state to reflect an association being added
 java.lang.String getFamily()
           
protected  void populateAssocationMaps(Node node, org.alfresco.service.cmr.repository.NodeService nodeService)
          Populates all the internal Maps with the appropriate association reference objects
protected  void removeTarget(Node node, java.lang.String targetRef)
          Updates the component and node state to reflect an association being removed
protected  void renderExistingAssociations(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter out, org.alfresco.service.cmr.repository.NodeService nodeService, boolean allowManyChildren)
          Renders the existing associations in an editable form
protected  void renderReadOnlyAssociations(javax.faces.context.FacesContext context, javax.faces.context.ResponseWriter out, org.alfresco.service.cmr.repository.NodeService nodeService)
          Renders the existing associations in a read-only form
 
Methods inherited from class org.alfresco.web.ui.repo.component.property.BaseAssociationEditor
broadcast, decode, encodeBegin, getAssociationDefinition, getAssociationName, getAvailableOptions, getAvailableOptionsSize, getNoSelectedItemsMsg, getSelectedItemsMsg, getSelectItemMsg, getSelectItemsMsg, isDisabled, renderAvailableOptions, renderExistingAssociation, renderNone, renderSearchField, restoreState, saveState, setAssociationName, setAvailableOptionsSize, setDisabled, setNoSelectedItemsMsg, setSelectedItemsMsg, setSelectItemMsg, setSelectItemsMsg
 
Methods inherited from class javax.faces.component.UIInput
addValidator, addValueChangeListener, compareValues, getConvertedValue, getSubmittedValue, getValidator, getValidators, getValue, getValueChangeListener, getValueChangeListeners, isImmediate, isLocalValueSet, isRequired, isValid, processDecodes, processUpdates, processValidators, removeValidator, removeValueChangeListener, setImmediate, setLocalValueSet, setRequired, setSubmittedValue, setValid, setValidator, setValue, setValueChangeListener, updateModel, validate, validateValue
 
Methods inherited from class javax.faces.component.UIOutput
getConverter, getLocalValue, setConverter
 
Methods inherited from class javax.faces.component.UIComponentBase
addFacesListener, encodeChildren, encodeEnd, findComponent, getAttributes, getChildCount, getChildren, getClientId, getFacesContext, getFacesListeners, getFacet, getFacets, getFacetsAndChildren, getId, getParent, getRenderer, getRendererType, getRendersChildren, getValueBinding, isRendered, isTransient, processRestoreState, processSaveState, queueEvent, removeFacesListener, restoreAttachedState, saveAttachedState, setId, setParent, setRendered, setRendererType, setTransient, setValueBinding
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface javax.faces.component.ValueHolder
getConverter, getLocalValue, setConverter
 

Field Detail

MSG_WARN_CANNOT_VIEW_TARGET_DETAILS

public static final java.lang.String MSG_WARN_CANNOT_VIEW_TARGET_DETAILS
See Also:
Constant Field Values

MSG_WARN_USER_WAS_DELETED

public static final java.lang.String MSG_WARN_USER_WAS_DELETED
See Also:
Constant Field Values
Constructor Detail

UIAssociationEditor

public UIAssociationEditor()
Method Detail

getFamily

public java.lang.String getFamily()
Overrides:
getFamily in class javax.faces.component.UIInput
See Also:
UIComponent.getFamily()

populateAssocationMaps

protected void populateAssocationMaps(Node node,
                                      org.alfresco.service.cmr.repository.NodeService nodeService)
Description copied from class: BaseAssociationEditor
Populates all the internal Maps with the appropriate association reference objects

Specified by:
populateAssocationMaps in class BaseAssociationEditor
Parameters:
node - The Node we are dealing with
nodeService - The NodeService
See Also:
BaseAssociationEditor.populateAssocationMaps(org.alfresco.web.bean.repository.Node, org.alfresco.service.cmr.repository.NodeService)

renderExistingAssociations

protected void renderExistingAssociations(javax.faces.context.FacesContext context,
                                          javax.faces.context.ResponseWriter out,
                                          org.alfresco.service.cmr.repository.NodeService nodeService,
                                          boolean allowManyChildren)
                                   throws java.io.IOException
Description copied from class: BaseAssociationEditor
Renders the existing associations in an editable form

Specified by:
renderExistingAssociations in class BaseAssociationEditor
Parameters:
context - FacesContext
out - ResponseWriter
nodeService - The NodeService
allowManyChildren - Whether multiple associations are allowed
Throws:
java.io.IOException
See Also:
BaseAssociationEditor.renderExistingAssociations(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, org.alfresco.service.cmr.repository.NodeService, boolean)

renderReadOnlyAssociations

protected void renderReadOnlyAssociations(javax.faces.context.FacesContext context,
                                          javax.faces.context.ResponseWriter out,
                                          org.alfresco.service.cmr.repository.NodeService nodeService)
                                   throws java.io.IOException
Description copied from class: BaseAssociationEditor
Renders the existing associations in a read-only form

Specified by:
renderReadOnlyAssociations in class BaseAssociationEditor
Parameters:
context - FacesContext
out - ResponseWriter
nodeService - The NodeService
Throws:
java.io.IOException
See Also:
BaseAssociationEditor.renderReadOnlyAssociations(javax.faces.context.FacesContext, javax.faces.context.ResponseWriter, org.alfresco.service.cmr.repository.NodeService)

removeTarget

protected void removeTarget(Node node,
                            java.lang.String targetRef)
Updates the component and node state to reflect an association being removed

Specified by:
removeTarget in class BaseAssociationEditor
Parameters:
node - The node we are dealing with
targetRef - The noderef of the child to remove

addTarget

protected void addTarget(Node node,
                         java.lang.String[] toAdd)
Updates the component and node state to reflect an association being added

Specified by:
addTarget in class BaseAssociationEditor
Parameters:
node - The node we are dealing with
toAdd - The noderefs of the children to add


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