|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.bea.content.ContentEntity com.bea.content.ObjectClass
public class ObjectClass
ObjectClass is the type for a Node. It has both an id and a name that uniquely identifies it within a content repository.
An ObjectClass may have PropertyDefinitions associated with it that define the shape of Properties required for a Node. This does not mean that the Property must contain a value, but simply that the Property must exist for the Node.
The ObjectClass may have PropertyDefinitions without them actually being attached in memory. In this case, hasPropertyDefinitions would be true and a call to get the PropertyDefinitions would lazy load them. If there is a need to check if the PropertyDefinitions are currently set then a call to isPropertyDefinitionsNull() is appropriate as it will not try to load the PropertyDefinitions.
It may also have a primary PropertyDefinition that defines the primary content Property for a Node. This allows for the definition of content in the type since the api does not distinguish between content and meta-content.
A Node is only considered valid in the repository if its Properties conform to its ObjectClass PropertyDefinitions.
ObjectClass PropertyDefinitions may be lazy loaded, depending on the implementation of the underyling operation that retrieved the ObjectClass.
Methods which return an ISortableFilterablePagedList
from
ITypeManager
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 WLP Repository are found via the
ISortablePagedList.getNativeSortableProperties()
method on a paged list of
Node objects.
For Types in the WLP Repository, the current list of native sortable and filterable properties is:
Field Summary | |
---|---|
static String |
FOLDER
|
static String |
PATH_DELIMITER
The delimiter used to separate path components for Object Class paths. |
Fields inherited from class com.bea.content.ContentEntity |
---|
id |
Constructor Summary | |
---|---|
ObjectClass(ID id,
String name)
Basic constructor. |
|
ObjectClass(ID id,
String name,
PropertyDefinition primaryPropertyDefinition,
PropertyDefinition[] propertyDefinitions)
Constructor without hasPropertyDefinitions. |
|
ObjectClass(ID id,
String name,
PropertyDefinition primaryPropertyDefinition,
PropertyDefinition[] propertyDefinitions,
boolean hasPropertyDefinitions)
Constructor without propertyDefinitions. |
Method Summary | |
---|---|
void |
addPropertyDefinition(PropertyDefinition propertyDefinition)
Add a property definition to the object class. |
Object |
clone()
Clones an ObjectClass with its property definitions and property choices. |
Calendar |
getCreationDate()
Returns the creation date of this ObjectClass. |
String |
getDescription()
Returns the description for this ObjectClass. |
Calendar |
getModifiedDate()
Returns the modified date of this ObjectClass. |
String |
getName()
Returns a name that uniquely identifies this ObjectClass within a repository. |
ID |
getParentObjectClassId()
Returns the ID of this ObjectClass 's parent
if this class is extending another ObjectClass |
String |
getPath()
Returns the inheritance path for this ObjectClass . |
PropertyDefinition |
getPrimaryPropertyDefinition()
Returns the primary PropertyDefinition, or null if one does not exist. |
PropertyDefinition |
getPropertyDefinition(String name)
Gets the named PropertyDefinition for this ObjectClass. |
PropertyDefinition[] |
getPropertyDefinitions()
Gets the PropertyDefinitions for this ObjectClass. |
Workflow |
getWorkflow()
Return the workflow associated with the node. |
ID |
getWorkflowId()
Return the workflow ID set on the ObjectClass. |
boolean |
hasNested()
Returns true if this ObjectClass has any PropertyDefinitions of type Property.NESTED |
boolean |
hasOrderableChildNodes()
Returns true if nodes of this type support ordering their children. |
boolean |
hasPropertyDefinitions()
Returns true if this ObjectClass has PropertyDefinitions. |
void |
hasPropertyDefinitions(boolean hasPropertyDefinitions)
Sets if this ObjectClass has PropertyDefinitions. |
boolean |
isAbstract()
Returns true if this ObjectClass is abstract and therefore
may not but used as a type for nodes. |
boolean |
isPropertyDefinitionsNull()
Returns true if the propertyDefitions is null, false otherwise. |
boolean |
isSearchable()
Returns true when nodes of this type are indexed in the search engine. |
void |
removePropertyDefinition(String name)
Remove a property definition from the object class if it exists. |
void |
setAbstract(boolean isAbstract)
Setter to set whether or not this ObjectClass is abstract. |
void |
setCreationDate(Calendar creationDate)
Sets the creation date of this ObjectClass. |
void |
setDescription(String description)
Sets the description for this ObjectClass. |
void |
setModifiedDate(Calendar modifiedDate)
Sets the modified date of this ObjectClass. |
void |
setName(String name)
Sets the name for this ObjectClass. |
void |
setObjectClassOps(ObjectClassOps objectClassOps)
Sets the ObjectClassOps for the repository. |
void |
setParentObjectClassId(ID parentId)
Sets the parent ObjectClass ID . |
void |
setPath(String path)
Set's the ObjectClass inheritance path. |
void |
setPrimaryPropertyDefinition(PropertyDefinition propertyDefinition)
Sets the primary PropertyDefinition. |
void |
setPropertyDefinitions(PropertyDefinition[] propertyDefinitions)
Sets the PropertyDefinitions for this ObjectClass. |
void |
setSearchable(boolean isSearchable)
Set to true if nodes of this type should be searchable, false otherwise. |
void |
setWorkflowId(ID workflowId)
Set the workflowID for the type |
void |
setWorkflowOps(WorkflowOps workflowOps)
Sets the WorkflowOps to perform workflow lookup on the repository. |
String |
toString()
Returns the ObjectClass attributes as a String. |
void |
validateProperties(Property[] properties)
Validates that each property passed in as part of the properties array is valid according to its PropertyDefinition. |
void |
validateProperty(Property property,
PropertyDefinition definition)
Validates that the property passed in is valid according to the property definition passed in. |
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 String FOLDER
public static final String PATH_DELIMITER
PathHelper.SEPARATOR
.
Constructor Detail |
---|
public ObjectClass(ID id, String name)
id
- - the id for this ObjectClass. The ID must include a repository name which indicates to the VCR which
repository the ObjectClass belongs to. The underlying repository will generate the ID's uid when the ObjectClass
is persisted.name
- - a name that uniquely identifies this ObjectClass in the Repository.public ObjectClass(ID id, String name, PropertyDefinition primaryPropertyDefinition, PropertyDefinition[] propertyDefinitions)
id
- - the id for this ObjectClass. The ID must include a repository name which indicates to the VCR which
repository the ObjectClass belongs to. The underlying repository will generate the ID's uid when the ObjectClass
is persisted.name
- - a name that uniquely identifies this ObjectClass in the Repository.primaryPropertyDefinition
- - the primary Property for this ObjectClass,
null if there isn't one. This primary PropertyDefintion should also be
included in the array of PropertyDefintions in the propertyDefinitions param.propertyDefinitions
- - the PropertyDefinitions for this ObjectClass,
may be null if none exist, or if they do exist but are intended to be
lazy loaded. This param includes the primary PropertyDefinition, if there is one.public ObjectClass(ID id, String name, PropertyDefinition primaryPropertyDefinition, PropertyDefinition[] propertyDefinitions, boolean hasPropertyDefinitions)
id
- - the id for this ObjectClass. The ID must include a repository name which indicates to the VCR which
repository the ObjectClass belongs to. The underlying repository will generate the ID's uid when the ObjectClass
is persisted.name
- - a name that uniquely identifies this ObjectClass in
the Repository.primaryPropertyDefinition
- - the primary Property for this ObjectClass,
null if there isn't one. This primary PropertyDefintion should also be
included in the array of PropertyDefintions in the propertyDefinitions param.propertyDefinitions
- - the PropertyDefinitions for this ObjectClass,
may be null if none exist, or if they do exist but are intended to be
lazy loaded. This param includes the primary PropertyDefinition, if there is one.hasPropertyDefinitions
- - true if this ObjectClass has PropertyDefinitions
or false otherwise. This does not mean it has them in memory, but rather that
that they do exist.Method Detail |
---|
public String getName()
ObjectClass
public void setName(String name)
name
- The name to setpublic PropertyDefinition getPrimaryPropertyDefinition()
PropertyDefinition
or null if one is
not specified for this ObjectClass
.public void setPrimaryPropertyDefinition(PropertyDefinition propertyDefinition)
addPropertyDefinition(PropertyDefinition)
,
setPropertyDefinitions(PropertyDefinition[])
or via one of
the constructors.
propertyDefinition
- The primary PropertyDefinition for
this ObjectClass
public boolean isAbstract()
ObjectClass
is abstract and therefore
may not but used as a type for nodes.
public void setAbstract(boolean isAbstract)
ObjectClass
is abstract.
isAbstract
- true if abstractpublic ID getParentObjectClassId()
ID
of this ObjectClass
's parent
if this class is extending another ObjectClass, or NULL if it does not extend another ObjectClass.
- Returns
- The
ID
of the parent ObjectClass
.
public void setParentObjectClassId(ID parentId)
ObjectClass
ID
. This is used
to allow this class to extend another ObjectClass.
- Parameters
parentId
- The ID
of the parent ObjectClass
.
public String getPath()
ObjectClass
. If this class extends another, then the path
will include the parent object class each type in the inheritance chain. For example, if this type extends typeB
and it extends typeA, then the path returned would be /repositoryName/typeA/typeB. If this type does not extend
another, then /repositoryName/type is returned.
This value is system generated and therefore is not settable on this object.
ObjectClass
.public void setPath(String path)
ObjectClass
inheritance path. This value is
computed and therefore is ignored during update operations.
path
- The path to set.public PropertyDefinition[] getPropertyDefinitions() throws AuthorizationException
PropertyDefinition
objects for this
ObjectClass
.
AuthorizationException
- - if the user attempting the get is not authorized.public void setPropertyDefinitions(PropertyDefinition[] propertyDefinitions)
propertyDefinitions
- The array of PropertyDefinition
objects to set for this ObjectClass
.public void addPropertyDefinition(PropertyDefinition propertyDefinition) throws AuthorizationException
setPropertyDefinitions(PropertyDefinition[])
propertyDefinition
- The definition to add.
AuthorizationException
- if the user is not authorizedpublic void removePropertyDefinition(String name) throws AuthorizationException
name
- The name of the definition to remove.
AuthorizationException
- if the user is not authorizedpublic boolean hasPropertyDefinitions()
ObjectClass
has PropertyDefinition
objects.public void hasPropertyDefinitions(boolean hasPropertyDefinitions)
hasPropertyDefinitions
- True if this ObjectClass
has
PropertyDefinition
objects.public boolean hasNested()
Property.NESTED
ObjectClass
has any nested ObjectClass
's.public boolean isPropertyDefinitionsNull()
public void setObjectClassOps(ObjectClassOps objectClassOps)
objectClassOps
- the implementation for this ObjectClass
.public PropertyDefinition getPropertyDefinition(String name) throws RepositoryException
NESTED_DELIMITER
between each parent and child property definition name.
The delimiter is not valid for use within the actual name, only to seperate the parent/child names.
name
- - the name of the property definition to get.
RepositoryException
- - if an error occurs getting the property definition.public void validateProperties(Property[] properties) throws RepositoryException
properties
- The properties to validate.
RepositoryException
- If validation fails.public void validateProperty(Property property, PropertyDefinition definition) throws RepositoryException
property
- The property to validate.definition
- The property definition to validate against.
RepositoryException
- If this validation fails.public ID getWorkflowId()
public void setWorkflowId(ID workflowId)
workflowId
- The ID of the workflow to set.public void setWorkflowOps(WorkflowOps workflowOps)
workflowOps
- The workflow ops for this ObjectClass.public Workflow getWorkflow() throws RepositoryException
RepositoryException
- If this operation fails.WorkflowManagerImpl.getWorkflowForNode(ContentContext, ID)
public String toString()
toString
in class ContentEntity
public String getDescription()
public void setDescription(String description)
description
- The description.public boolean isSearchable()
public void setSearchable(boolean isSearchable)
isSearchable
- The searchable value to set.public Calendar getCreationDate()
public void setCreationDate(Calendar creationDate)
creationDate
- The creation date.public Calendar getModifiedDate()
public void setModifiedDate(Calendar modifiedDate)
modifiedDate
- The modified date.public boolean hasOrderableChildNodes()
true
if nodes of this type must support orderable child nodes; returns
false
otherwise.public Object clone() throws CloneNotSupportedException
clone
in class ContentEntity
CloneNotSupportedException
- If the clone fails.
|
Copyright © 2000, 2009, Oracle and/or its affiliates. All rights reserved. | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |