org.mmbase.applications.vprowizards.spring.action
Class AbstractRelationAction

java.lang.Object
  extended by org.mmbase.applications.vprowizards.spring.action.Action
      extended by org.mmbase.applications.vprowizards.spring.action.AbstractNodeAction
          extended by org.mmbase.applications.vprowizards.spring.action.AbstractRelationAction
Direct Known Subclasses:
CreateRelationAction, SortRelationAction

public abstract class AbstractRelationAction
extends AbstractNodeAction

Author:
Ernst Bunders
Javadoc:

Field Summary
protected  Node destinationNode
           
protected  String destinationNodeNumber
           
protected  String destinationNodeRef
           
protected  RelationManager relationManager
           
protected  String relationValues
           
protected  String role
           
protected  String searchDir
           
protected  Node sourceNode
           
protected  String sourceNodeNumber
           
protected  String sourceNodeRef
           
 
Fields inherited from class org.mmbase.applications.vprowizards.spring.action.AbstractNodeAction
securityContext
 
Constructor Summary
AbstractRelationAction()
           
 
Method Summary
protected  Node createNode(Transaction transaction, Map<String,Node> idMap, HttpServletRequest request)
          This template method implementation handles all the preconditions for relation actions.
protected abstract  Node createRelation(Transaction transaction, Map<String,Node> idMap, HttpServletRequest request)
          This template method should be implemented by concrete implementations of this class.
 String getDestinationNodeNumber()
           
 String getDestinationNodeRef()
           
protected  Map<String,Object> getRelationValues()
          TODO.
 String getRole()
           
 String getSearchDir()
           
 String getSourceNodeNumber()
           
 String getSourceNodeRef()
           
protected  void putValues(Step relationStep, Constraint constraint, Map<String,Object> values)
           
protected  Node resolveNode(String refNotFoundErrorKey, String nodeRef, String nodenr, Map<String,Node> idMap, Transaction transaction)
          Try to resolve a node, by trying either the nodenr or node ref.
protected  boolean resolveSourceAndDestination(Transaction transaction, Map<String,Node> idMap)
          (try to) resolve the source and destination nodes for this relation.
 void setDestinationNodeNumber(String destinationNodeNumber)
           
 void setDestinationNodeRef(String destinationNodeRef)
           
 void setRelationValues(String s)
          Sets the values which must be set in the relation.
 void setRole(String role)
           
 void setSearchDir(String sd)
           
 void setSourceNodeNumber(String sourceNodeNumber)
           
 void setSourceNodeRef(String sourceNodeRef)
           
 
Methods inherited from class org.mmbase.applications.vprowizards.spring.action.AbstractNodeAction
addCachFlushHint, addFieldError, addFieldError, addFieldErrorTypeMessage, addFieldErrorTypeMessage, addFieldErrorTypeValue, addGlobalError, addGlobalError, addGlobalError, addNodeParam, addParam, createCacheFlushHints, getDateFields, getFields, getFile, getId, getLocale, getNode, hasChanged, hasErrors, isNodeNullIllegal, mayCreate, mayDelete, mayWrite, process, processNode, setChanged, setDateFields, setFields, setFile, setHtmlField, setId, setSecurityContext, shouldProcess, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

sourceNode

protected Node sourceNode

destinationNode

protected Node destinationNode

sourceNodeNumber

protected String sourceNodeNumber

destinationNodeNumber

protected String destinationNodeNumber

sourceNodeRef

protected String sourceNodeRef

destinationNodeRef

protected String destinationNodeRef

role

protected String role

relationManager

protected RelationManager relationManager

relationValues

protected String relationValues

searchDir

protected String searchDir
Constructor Detail

AbstractRelationAction

public AbstractRelationAction()
Method Detail

createNode

protected final Node createNode(Transaction transaction,
                                Map<String,Node> idMap,
                                HttpServletRequest request)
This template method implementation handles all the preconditions for relation actions. When these are met, a new template method is called, this#doCreateNode(Transaction, Map, HttpServletRequest) When you create specific relation actions, you extend this class and implement that method.

Specified by:
createNode in class AbstractNodeAction
Parameters:
transaction - the mmmbase transaction
Returns:
the node this action should handle or null if an error occurs

createRelation

protected abstract Node createRelation(Transaction transaction,
                                       Map<String,Node> idMap,
                                       HttpServletRequest request)
This template method should be implemented by concrete implementations of this class. It is called by createNode(Transaction, Map, HttpServletRequest) after all the preliminary checks.

Parameters:
transaction -
idMap -
request -
Returns:

resolveNode

protected final Node resolveNode(String refNotFoundErrorKey,
                                 String nodeRef,
                                 String nodenr,
                                 Map<String,Node> idMap,
                                 Transaction transaction)
Try to resolve a node, by trying either the nodenr or node ref. If there are problems, relevant global errors are created.

Parameters:
refNotFoundErrorKey -
nodeRef -
nodenr -
idMap -
transaction -
Returns:
the node

resolveSourceAndDestination

protected final boolean resolveSourceAndDestination(Transaction transaction,
                                                    Map<String,Node> idMap)
(try to) resolve the source and destination nodes for this relation. Set global errors when fail.

Returns:
true when source and destination nodes are found

setSourceNodeNumber

public void setSourceNodeNumber(String sourceNodeNumber)

getDestinationNodeNumber

public String getDestinationNodeNumber()

setDestinationNodeNumber

public void setDestinationNodeNumber(String destinationNodeNumber)

getSourceNodeRef

public String getSourceNodeRef()

setSourceNodeRef

public void setSourceNodeRef(String sourceNodeRef)

getDestinationNodeRef

public String getDestinationNodeRef()

setDestinationNodeRef

public void setDestinationNodeRef(String destinationNodeRef)

getSourceNodeNumber

public String getSourceNodeNumber()

getRole

public String getRole()

setRole

public void setRole(String role)

getSearchDir

public String getSearchDir()

setSearchDir

public void setSearchDir(String sd)

setRelationValues

public void setRelationValues(String s)
Sets the values which must be set in the relation. This must be done in the syntax of a legacy constraint.


putValues

protected void putValues(Step relationStep,
                         Constraint constraint,
                         Map<String,Object> values)

getRelationValues

protected Map<String,Object> getRelationValues()
TODO. This functionality may be moved to Queries



MMBase 2.0-SNAPSHOT - null