public abstract class BaseAssociationEditor extends UIInput
Modifier and Type | Class and Description |
---|---|
static class |
BaseAssociationEditor.AssocEditorEvent
Class representing an action relevant to the AssociationEditor component.
|
Modifier and Type | Field and Description |
---|---|
protected Map<String,Object> |
added |
protected String |
associationName |
protected List<org.alfresco.service.cmr.repository.NodeRef> |
availableOptions
List containing the currently available options
|
protected String |
availableOptionsSize |
protected String |
changingAssociation |
protected Boolean |
disabled |
protected boolean |
highlightedRow |
protected String |
noSelectedItemsMsg |
protected Map<String,Object> |
originalAssocs
Map of the original associations keyed by the noderef of the child
|
protected Map<String,Object> |
removed |
protected String |
searchTerm |
protected String |
selectedItemsMsg |
protected String |
selectItemMsg |
protected String |
selectItemsMsg |
protected boolean |
showAvailable |
COMPONENT_FAMILY, COMPONENT_TYPE, CONVERSION_MESSAGE_ID, REQUIRED_MESSAGE_ID
Constructor and Description |
---|
BaseAssociationEditor()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
protected abstract void |
addTarget(Node node,
String[] toAdd)
Updates the component and node state to reflect an association being added
|
void |
broadcast(FacesEvent event) |
void |
decode(FacesContext context) |
void |
encodeBegin(FacesContext context) |
protected String |
generateFormSubmit(FacesContext context,
String action)
Generate FORM submit JavaScript for the specified action
|
protected org.alfresco.service.cmr.dictionary.AssociationDefinition |
getAssociationDefinition(FacesContext context)
Retrieves the AssociationDefinition for the association we are representing
|
String |
getAssociationName()
Returns the name of the association this component is editing
|
protected void |
getAvailableOptions(FacesContext context,
String contains)
Retrieves the available options for the current association
|
String |
getAvailableOptionsSize()
Returns the size of the select control
|
protected String |
getHiddenFieldName()
We use a hidden field per picker instance on the page.
|
String |
getNoSelectedItemsMsg()
Returns the message to display when no items have been selected, if one hasn't been
set it defaults to the message in the bundle under key 'no_selected_items'.
|
String |
getSelectedItemsMsg()
Returns the message to display for the selected items, if one hasn't been
set it defaults to the message in the bundle under key 'selected_items'.
|
String |
getSelectItemMsg()
Returns the message to display for select an item, if one hasn't been
set it defaults to the message in the bundle under key 'search_select_item'.
|
String |
getSelectItemsMsg()
Returns the message to display for select items, if one hasn't been
set it defaults to the message in the bundle under key 'search_select_items'.
|
boolean |
isDisabled()
Determines whether the component should be rendered in a disabled state
|
protected abstract void |
populateAssocationMaps(Node node,
org.alfresco.service.cmr.repository.NodeService nodeService)
Populates all the internal Maps with the appropriate association reference objects
|
protected abstract void |
removeTarget(Node node,
String targetRef)
Updates the component and node state to reflect an association being removed
|
protected void |
renderAvailableOptions(FacesContext context,
ResponseWriter out,
org.alfresco.service.cmr.repository.NodeService nodeService,
String targetType,
boolean allowMany)
Renders the list of available options for a new association
|
protected void |
renderExistingAssociation(FacesContext context,
ResponseWriter out,
org.alfresco.service.cmr.repository.NodeService nodeService,
org.alfresco.service.cmr.repository.NodeRef targetRef,
boolean allowMany)
Renders an existing association with the appropriate options
|
protected abstract void |
renderExistingAssociations(FacesContext context,
ResponseWriter out,
org.alfresco.service.cmr.repository.NodeService nodeService,
boolean allowMany)
Renders the existing associations in an editable form
|
protected void |
renderNone(FacesContext context,
ResponseWriter out)
Renders the
|
protected abstract void |
renderReadOnlyAssociations(FacesContext context,
ResponseWriter out,
org.alfresco.service.cmr.repository.NodeService nodeService)
Renders the existing associations in a read-only form
|
protected void |
renderSearchField(FacesContext context,
ResponseWriter out)
Renders the search fields
|
void |
restoreState(FacesContext context,
Object state) |
Object |
saveState(FacesContext context) |
void |
setAssociationName(String associationName)
Sets the name of the association this component will edit
|
void |
setAvailableOptionsSize(String availableOptionsSize)
Sets the size of the select control
|
void |
setDisabled(boolean disabled)
Determines whether the component should be rendered in a disabled state
|
void |
setNoSelectedItemsMsg(String noSelectedItemsMsg)
Sets the no selected items message to display in the UI
|
void |
setSelectedItemsMsg(String selectedItemsMsg)
Sets the selected items message to display in the UI
|
void |
setSelectItemMsg(String selectItemMsg)
Sets the select an item message to display in the UI
|
void |
setSelectItemsMsg(String selectItemsMsg)
Sets the select items message to display in the UI
|
addValidator, addValueChangeListener, compareValues, getConvertedValue, getFamily, 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
getConverter, getLocalValue, setConverter
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
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getConverter, getLocalValue, setConverter
protected String associationName
protected String availableOptionsSize
protected String selectItemMsg
protected String selectItemsMsg
protected String selectedItemsMsg
protected String noSelectedItemsMsg
protected String searchTerm
protected Boolean disabled
protected boolean showAvailable
protected Map<String,Object> originalAssocs
protected List<org.alfresco.service.cmr.repository.NodeRef> availableOptions
protected String changingAssociation
protected boolean highlightedRow
public void restoreState(FacesContext context, Object state)
restoreState
in interface StateHolder
restoreState
in class UIInput
StateHolder.restoreState(javax.faces.context.FacesContext, java.lang.Object)
public Object saveState(FacesContext context)
saveState
in interface StateHolder
saveState
in class UIInput
StateHolder.saveState(javax.faces.context.FacesContext)
public void decode(FacesContext context)
decode
in class UIInput
UIComponent.decode(javax.faces.context.FacesContext)
public void broadcast(FacesEvent event) throws AbortProcessingException
broadcast
in class UIInput
AbortProcessingException
UIComponent.broadcast(javax.faces.event.FacesEvent)
public void encodeBegin(FacesContext context) throws IOException
encodeBegin
in class UIComponentBase
IOException
UIComponent.encodeBegin(javax.faces.context.FacesContext)
public String getAssociationName()
public void setAssociationName(String associationName)
associationName
- Name of the association to editpublic boolean isDisabled()
public void setDisabled(boolean disabled)
disabled
- true to disable the componentpublic String getAvailableOptionsSize()
public void setAvailableOptionsSize(String availableOptionsSize)
availableOptionsSize
- The sizepublic String getNoSelectedItemsMsg()
public void setNoSelectedItemsMsg(String noSelectedItemsMsg)
noSelectedItemsMsg
- The messagepublic String getSelectedItemsMsg()
public void setSelectedItemsMsg(String selectedItemsMsg)
selectedItemsMsg
- The messagepublic String getSelectItemMsg()
public void setSelectItemMsg(String selectItemMsg)
selectItemMsg
- The messagepublic String getSelectItemsMsg()
public void setSelectItemsMsg(String selectItemsMsg)
selectItemsMsg
- The messageprotected abstract void populateAssocationMaps(Node node, org.alfresco.service.cmr.repository.NodeService nodeService)
node
- The Node we are dealing withnodeService
- The NodeServiceprotected abstract void renderReadOnlyAssociations(FacesContext context, ResponseWriter out, org.alfresco.service.cmr.repository.NodeService nodeService) throws IOException
context
- FacesContextout
- ResponseWriternodeService
- The NodeServiceIOException
protected abstract void renderExistingAssociations(FacesContext context, ResponseWriter out, org.alfresco.service.cmr.repository.NodeService nodeService, boolean allowMany) throws IOException
context
- FacesContextout
- ResponseWriternodeService
- The NodeServiceallowMany
- Whether multiple associations are allowedIOException
protected abstract void removeTarget(Node node, String targetRef)
node
- The node we are dealing withtargetRef
- The noderef of the child to removeprotected abstract void addTarget(Node node, String[] toAdd)
node
- The node we are dealing withtoAdd
- The noderefs of the children to addprotected void renderExistingAssociation(FacesContext context, ResponseWriter out, org.alfresco.service.cmr.repository.NodeService nodeService, org.alfresco.service.cmr.repository.NodeRef targetRef, boolean allowMany) throws IOException
context
- FacesContextout
- Writer to write output tonodeService
- The NodeServicetargetRef
- The node at the end of the association being renderedallowMany
- Whether the current association allows multiple childrenIOException
protected void renderSearchField(FacesContext context, ResponseWriter out) throws IOException
context
- Faces Contextout
- The Response WriterIOException
protected void renderNone(FacesContext context, ResponseWriter out) throws IOException
context
- Faces Contextout
- Response WriterIOException
protected void renderAvailableOptions(FacesContext context, ResponseWriter out, org.alfresco.service.cmr.repository.NodeService nodeService, String targetType, boolean allowMany) throws IOException
context
- FacesContextout
- Writer to write output tonodeService
- The NodeServicetargetType
- The type of the child at the end of the associationallowMany
- Whether the current association allows multiple childrenIOException
protected org.alfresco.service.cmr.dictionary.AssociationDefinition getAssociationDefinition(FacesContext context)
context
- Faces Contextprotected void getAvailableOptions(FacesContext context, String contains)
context
- Faces Contextcontains
- The contains part of the queryprotected String getHiddenFieldName()
protected String generateFormSubmit(FacesContext context, String action)
context
- FacesContextaction
- Action stringCopyright © 2005–2017 Alfresco Software. All rights reserved.