|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.bea.content.ContentEntity
com.bea.content.Node
public class Node
A Node represents an element in a hieararchy.
WARNING: If using this interface to retrieve binary content from
a BEA Repository, please read the javadoc for
RepositoryConfig
.
The concept of a 'node type' is deprecated. It was previously defined as follows: A Node can either be a Hierarchy or Content Node. A Hierarchy Node can contain both other Hierarchy and Content Nodes while a Content Node can only contain other Content Nodes.
Nodes have a few system properties that are set by the repository. Nodes also may contain Properties based on the ObjectClass (type) defined for it. Both Content and Hierarchy Nodes may contain an ObjectClass and Properties.
Nodes are uniquely identified in a repository by the uid on their ID. The uid could be a uuid, database id, the path, etc. All nodes also have a path that uniquely identifies it within the repository. The path should be in unix-like format such as /a/b/c where / is the root and a is the root's child. The path must always begin with / and never end with it. So neither of the following are valid: a/b/c/d or /a/b/d/d/.
Node names must not contain either forward, or backslashes.
A Node's Properties may be lazy loaded, depending on the implementation of the underyling operation that retrieved the Node.
Methods which return an com.bea.content.paging.ISortableFilterablePagedList
from
INodeManager
can sort and filter the responses. For a discussion on paging,
sorting and filtering, see com.bea.content.paging
and ContentListKeys
.
Native sortable properties for the BEA Repository are found via the
ISortablePagedList.getNativeSortableProperties()
method on a paged list of
Node objects.
For Nodes in the BEA Repository, the current list of native sortable and filterable properties is:
PathHelper#SEPARATOR}
,
Serialized FormField Summary | |
---|---|
static int |
CONTENT
Deprecated |
static int |
HIERARCHY
Deprecated |
static int |
NODE
Deprecated |
Fields inherited from class com.bea.content.ContentEntity |
---|
id |
Constructor Summary | |
---|---|
Node(Calendar createdDate,
String createdBy,
boolean hasChildren,
ID id,
String modifiedBy,
Calendar modifiedDate,
ObjectClass objectClass,
ID parentId,
String path,
Property[] properties)
Constructor with all attributes. |
|
Node(Calendar createdDate,
String createdBy,
boolean hasChildren,
ID id,
String modifiedBy,
Calendar modifiedDate,
ObjectClass objectClass,
ID parentId,
String path,
Property[] properties,
int type)
Deprecated due to the deprecated type parameter. |
Method Summary | |
---|---|
Object |
clone()
Clones a node with its properties and values. |
Node[] |
getChildren()
Deprecated This method does not perform security check before returning results, therefore it may not return correct results. |
Node[] |
getContentChildren()
Deprecated This method does not perform security check before returning results, therefore it may not return correct results. |
String |
getCreatedBy()
The user who created this node. |
Calendar |
getCreatedDate()
The date this node was created on. |
Node[] |
getHierarchyChildren()
Deprecated This method does not perform security check before returning results, therefore it may not return correct results. |
int |
getLifeCycleStatus()
Deprecated Please use getWorkflowStatus() |
String |
getModifiedBy()
The user who last modified this Node. |
Calendar |
getModifiedDate()
The Date when this Node was last modified. |
String |
getName()
The Node name. |
ObjectClass |
getObjectClass()
The ObjectClass to which this Node is associated. |
ID |
getParentId()
Gets the id for the parent of this node. |
String |
getPath()
The path where this Node resides. |
Property |
getPrimaryProperty()
Gets the primary property for this Node, or null if there isn't one or when the node doesn't have an object class |
Property[] |
getProperties()
Gets the Properties for this node. |
Property |
getProperty(String name)
Returns the property referenced by name or null if the property does not exist. |
InputStream |
getPropertyBytes(ID propertyId)
Returns the bytes for the given property. |
int |
getType()
Deprecated |
Workflow |
getWorkflow()
Return the workflow associated with the node. |
ID |
getWorkflowId()
Return the workflow ID set on the node. |
int |
getWorkflowStatus()
Returns the status for this node. |
boolean |
hasChildren()
True if this node has children. |
void |
hasChildren(boolean hasChildren)
Set true if the node has children, false if not. |
boolean |
isPropertiesNull()
Returns true if the properties have not been set in memory. |
boolean |
isRetired()
Returns true if the node is retired. |
void |
isRetired(boolean isRetired)
Sets the retired status for the node. |
void |
setCreatedBy(String createdBy)
Sets the user who created this node. |
void |
setCreatedDate(Calendar createdDate)
Sets the date this node was created on. |
void |
setLifeCycleStataus(int lifeCycleStatus)
Deprecated Please use setWorkflowStatus(int) |
void |
setModifiedBy(String modifiedBy)
Sets the user who last modified this Node. |
void |
setModifiedDate(Calendar modifiedDate)
Sets the Date when this Node was last modified. |
void |
setName(String name)
Set the node's name for a save operation. |
void |
setNodeOps(NodeOps nodeOps)
Sets the NodeOps to perform operations on the repository. |
void |
setObjectClass(ObjectClass objectClass)
Sets the ObjectClass to which this Node is associated. |
void |
setParentId(ID parentId)
Sets this Node's parent id. |
void |
setPath(String path)
Sets the path of this Node. |
void |
setProperties(Property[] properties)
Sets all properties for this node as specified. |
void |
setType(int type)
Deprecated |
void |
setWorkflowId(ID workflowId)
Sets the workflowId for the node. |
void |
setWorkflowOps(WorkflowOps workflowOps)
Sets the WorkflowOps to perform workflow lookup on the repository. |
void |
setWorkflowStatus(int workflowStatus)
Sets the lifecycle status. |
String |
toString()
Returns the attributes of this Node in a String. |
Methods inherited from class com.bea.content.ContentEntity |
---|
getId, setId |
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int HIERARCHY
public static final int CONTENT
public static final int NODE
HIERARCHY
or CONTENT
Node.
This is not a valid definition for a Node (getType()
should never return this value), but may be used as a description.
Constructor Detail |
---|
public Node(Calendar createdDate, String createdBy, boolean hasChildren, ID id, String modifiedBy, Calendar modifiedDate, ObjectClass objectClass, ID parentId, String path, Property[] properties, int type)
createdDate
- - the date the Node was created, as defined by the Repository.createdBy
- - the user id who created this NodehasChildren
- - true if this Node hasChildren, false otherwise.id
- - the id for the Node.modifiedBy
- - the user id who last modified this Node.objectClass
- - the ObjectClass associated with this Node, null if an
ObjectClass is not associated with this Node.parentId
- - the Id for the parent of this Node, null if Node resides
at root.path
- - the path of the Node in unix-like format. For example, /foo/foo2properties
- - Properties for this Node, null if none are defined.type
- - the type of Node, either HIERARCHY
or CONTENT
.public Node(Calendar createdDate, String createdBy, boolean hasChildren, ID id, String modifiedBy, Calendar modifiedDate, ObjectClass objectClass, ID parentId, String path, Property[] properties)
createdDate
- - the date the Node was created, as defined by the Repository.createdBy
- - the user id who created this NodehasChildren
- - true if this Node hasChildren, false otherwise.id
- - the id for the Node.modifiedBy
- - the user id who last modified this Node.objectClass
- - the ObjectClass associated with this Node, null if an
ObjectClass is not associated with this Node.parentId
- - the Id for the parent of this Node, null if Node resides
at root.path
- - the path of the Node in unix-like format. For example, /foo/foo2properties
- - Properties for this Node, null if none are defined.Method Detail |
---|
public Calendar getCreatedDate()
public void setCreatedDate(Calendar createdDate)
public String getCreatedBy()
public void setCreatedBy(String createdBy)
public String getModifiedBy()
public void setModifiedBy(String modifiedBy)
public Calendar getModifiedDate()
public void setModifiedDate(Calendar modifiedDate)
public String getName()
public void setName(String name)
name
- The new node namepublic void setNodeOps(NodeOps nodeOps)
public void setWorkflowOps(WorkflowOps workflowOps)
workflowOps
- public ObjectClass getObjectClass()
public void setObjectClass(ObjectClass objectClass)
public ID getParentId()
public void setParentId(ID parentId)
public String getPath()
public void setPath(String path)
public int getLifeCycleStatus()
getWorkflowStatus()
Workflow.PUBLISHED
or Workflow.RETIRED
.
public int getWorkflowStatus()
Workflow.PUBLISHED
or Workflow.RETIRED
.
public void setLifeCycleStataus(int lifeCycleStatus)
setWorkflowStatus(int)
Workflow.PUBLISHED
or Workflow.RETIRED
.
public void setWorkflowStatus(int workflowStatus)
Workflow.PUBLISHED
or Workflow.RETIRED
.
workflowStatus
- The workflow status as defined in the Workflow
object.public boolean isRetired()
public void isRetired(boolean isRetired)
isRetired
- True if the node should be retired.public Property getPrimaryProperty() throws RepositoryException
RepositoryException
public Property getProperty(String name) throws AuthorizationException
isPropertiesNull()
.
name
- The name of the property to retrieve.
AuthorizationException
- - if the user attempting the operation is not authrorized.
For nested type properties, the name must reflect the nested hierarchy using
NESTED_DELIMITER
between each parent and child property name.
The delimiter is not valid for use within the actual name, only to seperate the parent/child names.
If the Property
returned is that of a nested type, it will return Property
with a
Value
that is an array of Property
objects.
If the Property
returned is that of a multi valued nested type, it will return
Property
with an array of Value
objects, of which each is an array of
Property
objects.
A nested Property can be retrieved directly by using the proper name with delimiter (ie. myAddress.city).
If a nested Property is multivalued, the index of that multivalued property will have to be reflected in
the name, if you retrieve it directly (ie myAddresses[0].city will retrieve the first address's city in a
multivalued nested property, or myAddresses[1].city will retrieve the second address's city. If the indexedName
is not used to retrieve a property that is nested by a multivalued nested type, then only the first instance
found, with that property name will be returned. The nesting tree will not be walked to find all properties of
that name.
See Property.getIndexedName()
If the specified property does not exist in the node, it will return null.public Property[] getProperties() throws AuthorizationException
isPropertiesNull()
.
AuthorizationException
- - if the user attempting the operation is not authrorized.public void setProperties(Property[] properties)
public boolean isPropertiesNull()
public int getType()
HIERARCHY
or CONTENT
.
public void setType(int type)
HIERARCHY
or CONTENT
.
public boolean hasChildren()
public void hasChildren(boolean hasChildren)
public Node[] getChildren() throws AuthorizationException
AuthorizationException
- - if the user attempting the operation is not authrorized.public Node[] getContentChildren() throws AuthorizationException
AuthorizationException
- - if the user attempting the operation is not authrorized.public Node[] getHierarchyChildren() throws AuthorizationException
AuthorizationException
- - if the user attempting the operation is not authrorized.public ID getWorkflowId()
public void setWorkflowId(ID workflowId)
workflowId
- Set the workflowId for the node.public Workflow getWorkflow() throws RepositoryException
RepositoryException
WorkflowManagerImpl.getWorkflowForNode(ContentContext, ID)
public InputStream getPropertyBytes(ID propertyId) throws AuthorizationException, NoSuchPropertyException
WARNING: If using this interface to retrieve binary content from
a BEA Repository, please read the javadoc for
RepositoryConfig
.
This is a convenience method to NodeOps.getPropertyBytes() and does not keep the retrieved values in memory as part of this instance.
AuthorizationException
- - if the user attempting the operation is not authrorized.
NoSuchPropertyException
- - if the propertyId is not a valid one.public String toString()
toString
in class ContentEntity
public Object clone() throws CloneNotSupportedException
clone
in class Object
CloneNotSupportedException
- If the clone fails.
|
Copyright © 2006 BEA Systems, Inc. All Rights Reserved | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |