public class ToggleRelationAction extends CreateRelationAction
CreateRelationAction, 'relate'. When this field is
set (with 'true') A relation if type 'role' is created between the source and destination. If 'relate' has any other
or no value, and there is a relation of given role between the source and destination node, it is deleted. This
action can be is used by the CheckboxRelation and RadiobuttonRelation tags. This action is a bit of a strange
specialization of the CreateRelationAction class, because not all things you can do to that action (like
setting fields) is useful for this action. This is not briliant design, but to make it a little bit more solid all
unsupported setters have been overridden, and do no throw an UnsupportedOperationExceptionSORT_POSITION_BEGIN, SORT_POSITION_ENDdestinationNode, destinationNodeNumber, destinationNodeRef, relationManager, relationValues, role, sourceNode, sourceNodeNumber, sourceNodeRef| Constructor and Description |
|---|
ToggleRelationAction() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
createCacheFlushHints()
This template method is called when the node to edit is changed.
|
protected Node |
createRelation(Transaction transaction,
Map<String,Node> idMap,
javax.servlet.http.HttpServletRequest request)
This template method should be implemented by concrete implementations of
this class.
|
String |
getRelate() |
protected boolean |
isNodeNullIllegal()
for this action node can actually be null
|
void |
setDateFields(Map<String,DateTime> dateFields) |
void |
setFields(Map<String,String> fields) |
void |
setFile(org.springframework.web.multipart.MultipartFile file) |
void |
setId(String id) |
void |
setRelate(String relate)
when this is set to 'true' and the relation does not exist yet, the relation is created.
|
void |
setSortField(String sortField) |
void |
setSortPosition(String sortPosition) |
getSortField, getSortPosition, processNode, resolvePositioncreateNode, getDestinationNodeNumber, getDestinationNodeRef, getRelationValues, getRole, getSourceNodeNumber, getSourceNodeRef, putValues, resolveNode, resolveSourceAndDestination, setDestinationNodeNumber, setDestinationNodeRef, setRelationValues, setRole, setSourceNodeNumber, setSourceNodeRefaddCachFlushHint, addFieldError, addFieldError, addFieldErrorTypeMessage, addFieldErrorTypeValue, addGlobalError, addGlobalError, addNodeParam, addParam, getDateFields, getFields, getFile, getId, getLocale, getNode, hasChanged, hasErrors, mayCreate, mayDelete, mayWrite, process, setChanged, setHtmlField, shouldProcess, toStringpublic String getRelate()
public void setRelate(String relate)
relate - protected Node createRelation(Transaction transaction, Map<String,Node> idMap, javax.servlet.http.HttpServletRequest request)
AbstractRelationActionAbstractRelationAction.createNode(Transaction, Map, HttpServletRequest) after all
the preliminary checks.createRelation in class CreateRelationActionprotected void createCacheFlushHints()
AbstractNodeActioncreateCacheFlushHints in class CreateRelationActionprotected boolean isNodeNullIllegal()
isNodeNullIllegal in class AbstractNodeActionpublic void setSortField(String sortField) throws UnsupportedOperationException
setSortField in class CreateRelationActionUnsupportedOperationExceptionpublic void setSortPosition(String sortPosition) throws UnsupportedOperationException
setSortPosition in class CreateRelationActionUnsupportedOperationExceptionpublic void setDateFields(Map<String,DateTime> dateFields) throws UnsupportedOperationException
setDateFields in class AbstractNodeActionUnsupportedOperationExceptionpublic void setFields(Map<String,String> fields) throws UnsupportedOperationException
setFields in class AbstractNodeActionUnsupportedOperationExceptionpublic void setFile(org.springframework.web.multipart.MultipartFile file)
throws UnsupportedOperationException
setFile in class AbstractNodeActionUnsupportedOperationExceptionpublic void setId(String id) throws UnsupportedOperationException
setId in class AbstractNodeActionUnsupportedOperationExceptionMMBase 1.9-SNAPSHOT - ${javadoctimestamp}