com.stratelia.webactiv.util.node.control
Class NodeBmEJB

java.lang.Object
  extended by com.stratelia.webactiv.util.node.control.NodeBmEJB
All Implemented Interfaces:
NodeBm

public class NodeBmEJB
extends Object
implements NodeBm

This is the NodeBM EJB-tier controller. A node is composed by some another nodes (children) and have got one and only one father. It describes a tree. It is implemented as a session EJB.

Author:
Nicolas Eysseric

Constructor Summary
NodeBmEJB()
           
 
Method Summary
 void createIndex(NodeDetail nodeDetail)
          Method declaration
 NodePK createNode(NodeDetail node)
          Create a new Node object
 NodePK createNode(NodeDetail nd, NodeDetail fatherDetail)
          Create a new Node object
 void deleteIndex(NodePK pk)
          Called on : - removeNode()
 Collection<NodeDetail> getAllNodes(NodePK nodePK)
          Method declaration
 Collection<NodeDetail> getAnotherPath(NodePK nodePK)
          Deprecated.  
 Collection<NodeDetail> getChildrenDetails(NodePK pk)
          Get the header of each child of the node
 int getChildrenNumber(NodePK pk)
          Get the children number of this node
 Collection<NodePK> getChildrenPKs(NodePK nodePK)
          Get children node PKs of a node
 List<NodeDetail> getDescendantDetails(NodeDetail node)
          Get descendant node details of a node
 List<NodeDetail> getDescendantDetails(NodePK nodePK)
          Get descendant node details of a node
 Collection<NodePK> getDescendantPKs(NodePK nodePK)
          Get descendant node PKs of a node
 NodeDetail getDetail(NodePK pk)
          Get the attributes of a node and of its children
 NodeDetail getDetailByNameAndFatherId(NodePK pk, String name, int nodeFatherId)
           
 NodeDetail getDetailTransactionally(NodePK pk)
          Get the attributes of a node and of its children with transaction support
 Collection<NodeDetail> getFrequentlyAskedChildrenDetails(NodePK pk)
          Get the header of each child of the node this method is to be used on frequently asked nodes (next to the root), because all ejb will be instanciated
 NodeDetail getFrequentlyAskedDetail(NodePK pk)
          Method declaration
 NodeDetail getHeader(NodePK pk)
          Get the attributes of THIS node
 NodeDetail getHeader(NodePK pk, boolean getTranslations)
           
 List<NodeDetail> getHeadersByLevel(NodePK pk, int level)
          Method declaration
 Collection<NodeDetail> getPath(NodePK pk)
          Get the path of this node from this node to root
 ArrayList<NodeDetail> getSubTree(NodePK pk)
           
 ArrayList<NodeDetail> getSubTree(NodePK pk, String sorting)
           
 ArrayList<NodeDetail> getSubTree(NodePK pk, String status, int level, String sorting)
           
 ArrayList<NodeDetail> getSubTreeByLevel(NodePK pk, int level)
           
 ArrayList<NodeDetail> getSubTreeByLevel(NodePK pk, int level, String sorting)
           
 ArrayList<NodeDetail> getSubTreeByStatus(NodePK pk, String status)
           
 ArrayList<NodeDetail> getSubTreeByStatus(NodePK pk, String status, String sorting)
           
 ArrayList<NodeDetail> getTree(NodePK pk)
           
 NodeDetail getTwoLevelDetails(NodePK pk)
          Method declaration
 boolean isSameNameSameLevelOnCreation(NodeDetail nd)
          On node creation, check if another node have got the same name with same father
 boolean isSameNameSameLevelOnUpdate(NodeDetail nd)
          On node update, check if another node have got the same name with same father
 void moveNode(NodePK nodePK, NodePK toNode)
           
 void processWysiwyg(NodePK nodePK)
          A wysiwyg's content has been added or modified to a node.
 void removeNode(NodePK pk)
          Remove a node and its descendants
 void setDetail(NodeDetail nd)
          Update the attributes of the node
 void sortNodes(List<NodePK> nodePKs)
           
 void updateRightsDependency(NodeDetail nodeDetail)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NodeBmEJB

public NodeBmEJB()
Method Detail

getDetailByNameAndFatherId

public NodeDetail getDetailByNameAndFatherId(NodePK pk,
                                             String name,
                                             int nodeFatherId)
Specified by:
getDetailByNameAndFatherId in interface NodeBm

getDetail

public NodeDetail getDetail(NodePK pk)
Get the attributes of a node and of its children

Specified by:
getDetail in interface NodeBm
Parameters:
pk - the node primary key.
Returns:
a NodeDetail
Since:
1.0
See Also:
NodeDetail

getDetailTransactionally

public NodeDetail getDetailTransactionally(NodePK pk)
Get the attributes of a node and of its children with transaction support

Specified by:
getDetailTransactionally in interface NodeBm
Returns:
a NodeDetail

getTree

public ArrayList<NodeDetail> getTree(NodePK pk)
Specified by:
getTree in interface NodeBm

getSubTree

public ArrayList<NodeDetail> getSubTree(NodePK pk)
Specified by:
getSubTree in interface NodeBm

getSubTree

public ArrayList<NodeDetail> getSubTree(NodePK pk,
                                        String sorting)
Specified by:
getSubTree in interface NodeBm

getSubTreeByStatus

public ArrayList<NodeDetail> getSubTreeByStatus(NodePK pk,
                                                String status)
Specified by:
getSubTreeByStatus in interface NodeBm

getSubTreeByStatus

public ArrayList<NodeDetail> getSubTreeByStatus(NodePK pk,
                                                String status,
                                                String sorting)
Specified by:
getSubTreeByStatus in interface NodeBm

getSubTreeByLevel

public ArrayList<NodeDetail> getSubTreeByLevel(NodePK pk,
                                               int level)
Specified by:
getSubTreeByLevel in interface NodeBm

getSubTreeByLevel

public ArrayList<NodeDetail> getSubTreeByLevel(NodePK pk,
                                               int level,
                                               String sorting)
Specified by:
getSubTreeByLevel in interface NodeBm

getSubTree

public ArrayList<NodeDetail> getSubTree(NodePK pk,
                                        String status,
                                        int level,
                                        String sorting)
Specified by:
getSubTree in interface NodeBm

moveNode

public void moveNode(NodePK nodePK,
                     NodePK toNode)
Specified by:
moveNode in interface NodeBm

getFrequentlyAskedDetail

public NodeDetail getFrequentlyAskedDetail(NodePK pk)
Method declaration

Specified by:
getFrequentlyAskedDetail in interface NodeBm
Parameters:
pk -
Returns:
See Also:

getTwoLevelDetails

public NodeDetail getTwoLevelDetails(NodePK pk)
Method declaration

Specified by:
getTwoLevelDetails in interface NodeBm
Parameters:
pk -
Returns:
See Also:

getHeader

public NodeDetail getHeader(NodePK pk,
                            boolean getTranslations)
Specified by:
getHeader in interface NodeBm

getHeader

public NodeDetail getHeader(NodePK pk)
Get the attributes of THIS node

Specified by:
getHeader in interface NodeBm
Parameters:
pk - the node primary key.
Returns:
a NodeDetail
Since:
1.0
See Also:
NodeDetail

setDetail

public void setDetail(NodeDetail nd)
Update the attributes of the node

Specified by:
setDetail in interface NodeBm
Parameters:
nd - the NodeDetail which contains updated data
Since:
1.0
See Also:
NodeDetail

removeNode

public void removeNode(NodePK pk)
Remove a node and its descendants

Specified by:
removeNode in interface NodeBm
Parameters:
pk - the node PK to delete
Since:
1.0
See Also:
NodePK

getPath

public Collection<NodeDetail> getPath(NodePK pk)
Get the path of this node from this node to root

Specified by:
getPath in interface NodeBm
Parameters:
pk - The PK of the node
Returns:
a NodeDetail Collection (only header)
Since:
1.0
See Also:
NodeDetail, Collection

getChildrenDetails

public Collection<NodeDetail> getChildrenDetails(NodePK pk)
Get the header of each child of the node

Specified by:
getChildrenDetails in interface NodeBm
Parameters:
pk - the node primary key.
Returns:
a NodeDetail collection
Since:
1.0
See Also:
NodeDetail

getFrequentlyAskedChildrenDetails

public Collection<NodeDetail> getFrequentlyAskedChildrenDetails(NodePK pk)
Get the header of each child of the node this method is to be used on frequently asked nodes (next to the root), because all ejb will be instanciated

Specified by:
getFrequentlyAskedChildrenDetails in interface NodeBm
Parameters:
pk - the node primary key.
Returns:
a NodeDetail collection
Since:
1.0
See Also:
NodeDetail

getHeadersByLevel

public List<NodeDetail> getHeadersByLevel(NodePK pk,
                                          int level)
Method declaration

Specified by:
getHeadersByLevel in interface NodeBm
Parameters:
pk -
level -
Returns:
See Also:

getAllNodes

public Collection<NodeDetail> getAllNodes(NodePK nodePK)
Method declaration

Specified by:
getAllNodes in interface NodeBm
Parameters:
nodePK -
Returns:
See Also:

getChildrenNumber

public int getChildrenNumber(NodePK pk)
Get the children number of this node

Specified by:
getChildrenNumber in interface NodeBm
Parameters:
pk - the node primary key.
Returns:
a int
Since:
1.0

createNode

public NodePK createNode(NodeDetail node)
Description copied from interface: NodeBm
Create a new Node object

Specified by:
createNode in interface NodeBm
Parameters:
node - the NodeDetail which contains data
Returns:
the NodePK of the new Node

createNode

public NodePK createNode(NodeDetail nd,
                         NodeDetail fatherDetail)
Create a new Node object

Specified by:
createNode in interface NodeBm
Parameters:
nd - the NodeDetail which contains data
fatherDetail - the PK of the user who have create this node
Returns:
the NodePK of the new Node
Since:
1.0
See Also:
NodeDetail

isSameNameSameLevelOnCreation

public boolean isSameNameSameLevelOnCreation(NodeDetail nd)
On node creation, check if another node have got the same name with same father

Specified by:
isSameNameSameLevelOnCreation in interface NodeBm
Parameters:
nd - A NodeDetail contains new node data to compare
Returns:
true if there is already a node with same name with same father false else
Since:
1.0
See Also:
NodeDetail

isSameNameSameLevelOnUpdate

public boolean isSameNameSameLevelOnUpdate(NodeDetail nd)
On node update, check if another node have got the same name with same father

Specified by:
isSameNameSameLevelOnUpdate in interface NodeBm
Parameters:
nd - A NodeDetail contains new node data to compare
Returns:
true if there is already a node with same name with same father false else
Since:
1.0
See Also:
NodeDetail

getChildrenPKs

public Collection<NodePK> getChildrenPKs(NodePK nodePK)
Get children node PKs of a node

Specified by:
getChildrenPKs in interface NodeBm
Parameters:
nodePK - A NodePK
Returns:
A collection of NodePK
Since:
1.0
See Also:
NodePK

getDescendantPKs

public Collection<NodePK> getDescendantPKs(NodePK nodePK)
Get descendant node PKs of a node

Specified by:
getDescendantPKs in interface NodeBm
Parameters:
nodePK - A NodePK
Returns:
A collection of NodePK
Since:
1.0
See Also:
NodePK

getDescendantDetails

public List<NodeDetail> getDescendantDetails(NodePK nodePK)
Get descendant node details of a node

Specified by:
getDescendantDetails in interface NodeBm
Parameters:
nodePK - A NodePK
Returns:
A List of NodeDetail
Since:
1.0
See Also:
NodePK

getDescendantDetails

public List<NodeDetail> getDescendantDetails(NodeDetail node)
Get descendant node details of a node

Specified by:
getDescendantDetails in interface NodeBm
Parameters:
node - A NodeDetail
Returns:
A List of NodeDetail
Since:
4.07

getAnotherPath

public Collection<NodeDetail> getAnotherPath(NodePK nodePK)
Deprecated. 

Get the path from root to a node

Specified by:
getAnotherPath in interface NodeBm
Parameters:
nodePK - A NodePK
Returns:
A collection of NodeDetail
Since:
1.0
See Also:
NodePK, NodeDetail

processWysiwyg

public void processWysiwyg(NodePK nodePK)
Description copied from interface: NodeBm
A wysiwyg's content has been added or modified to a node. Its content must be added to the indexed content of the node

Specified by:
processWysiwyg in interface NodeBm
Parameters:
nodePK - the identifier of the node associated to the wysiwyg

updateRightsDependency

public void updateRightsDependency(NodeDetail nodeDetail)
Specified by:
updateRightsDependency in interface NodeBm

sortNodes

public void sortNodes(List<NodePK> nodePKs)
Specified by:
sortNodes in interface NodeBm

createIndex

public void createIndex(NodeDetail nodeDetail)
Description copied from interface: NodeBm
Method declaration

Specified by:
createIndex in interface NodeBm

deleteIndex

public void deleteIndex(NodePK pk)
Called on : - removeNode()

Specified by:
deleteIndex in interface NodeBm


Copyright © 2016 Silverpeas. All Rights Reserved.