Overview | Package | Class | Tree | Deprecated | Index | Help
| Copyright © 2006 BEA Systems, Inc. All Rights Reserved
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## com.bea.content
Class ObjectClass

    java.lang.Object
      com.bea.content.ContentEntity
          com.bea.content.ObjectClass

All Implemented Interfaces
  Serializable

    public class ObjectClass

extends ContentEntity

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 `com.bea.content.paging.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 BEA Repository are found via the `ISortablePagedList.getNativeSortableProperties()` method on a paged list of Node objects.

For Types in the BEA Repository, the current list of native sortable and filterable properties is:

- name
- path
- workflowId

See Also
  Serialized Form

Field Summary
`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.
`String` | `getDescription()` Returns the description for 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.
`ID` | `getWorkflowId()` Return the workflowID if it has been set on the objectclass.
`boolean` | `hasNested()` Returns true if this ObjectClass has any PropertyDefinitions of type `Property.NESTED`
`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.
`void` | `setAbstract(boolean isAbstract)` Setter to set whether or not this `ObjectClass` is abstract.
`void` | `setDescription(String description)` Sets the description for 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
`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
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait`

Field Detail

### PATH_DELIMITER

    public static final String PATH_DELIMITER

  The delimiter used to separate path components for Object Class paths. This is equivalent to `PathHelper.SEPARATOR`.

  See Also
    Constants Summary

Constructor Detail

### ObjectClass

    public ObjectClass(ID id,
                       String name)

  Basic constructor.

  Parameters
    `id` - - the id for this ObjectClass
    `name` - - a name that uniquely identifies this ObjectClass in the Repository.

### ObjectClass

    public ObjectClass(ID id,
                       String name,
                       PropertyDefinition primaryPropertyDefinition,
                       PropertyDefinition[] propertyDefinitions)

  Constructor without hasPropertyDefinitions. If the propertyDefinitions passed in is not null and size > 0 then hasPropertyDefinitions will be set to true, otherwise it will be set to false.

  Parameters
    `id` - - the id for this ObjectClass
    `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.

### ObjectClass

    public ObjectClass(ID id,
                       String name,
                       PropertyDefinition primaryPropertyDefinition,
                       PropertyDefinition[] propertyDefinitions,
                       boolean hasPropertyDefinitions)

  Constructor without propertyDefinitions. Useful for when the PropertyDefinitions will be lazy loaded (if they exist).

  Parameters
    `id` - - the id for this ObjectClass
    `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

### getName

    public String getName()

  Returns a name that uniquely identifies this ObjectClass within a repository.

  Returns
    The name of this `ObjectClass`

### setName

    public void setName(String name)

  Sets the name for this ObjectClass.

  Parameters
    `name` - The name to set

### getPrimaryPropertyDefinition

    public PropertyDefinition getPrimaryPropertyDefinition()

  Returns the primary PropertyDefinition, or null if one does not exist.

  Returns
    The primary `PropertyDefinition` or null if one is not specified for this `ObjectClass`.

### setPrimaryPropertyDefinition

    public void setPrimaryPropertyDefinition(PropertyDefinition propertyDefinition)

  Sets the primary PropertyDefinition. The property defintion supplied should have already been added using `addPropertyDefinition(PropertyDefinition)`, `setPropertyDefinitions(PropertyDefinition[])` or via one of the constructors.

  Parameters
    `propertyDefinition` - The primary `PropertyDefinition`for this `ObjectClass```

### isAbstract

    public boolean isAbstract()

  Returns true if this `ObjectClass` is abstract and therefore may not but used as a type for nodes.

  Returns
    true if abstract

### setAbstract

    public void setAbstract(boolean isAbstract)

  Setter to set whether or not this `ObjectClass` is abstract.

  Parameters
    `isAbstract` - true if abstract

### getParentObjectClassId

    public ID getParentObjectClassId()

  Returns the `ID` of this `ObjectClass`'s parent if this class is extending another `ObjectClass`.

  ``
  Returns
    The `ID` of the parent `ObjectClass`.

### setParentObjectClassId

    public void setParentObjectClassId(ID parentId)

  Sets the parent `ObjectClass` `ID`. This is used to allow this class to extend another `ObjectClass`.

  ``
  Parameters
    `parentId` - The `ID` of the parent `ObjectClass`.

### getPath

    public String getPath()

  Returns the inheritance path for this `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.

  Returns
    The inheritance path for this `ObjectClass`.

### setPath

    public void setPath(String path)

  Set's the `ObjectClass` inheritance path. This value is computed and therefore is ignored during update operations.

  Parameters
    `path` - The path to set.

### getPropertyDefinitions

    public PropertyDefinition[] getPropertyDefinitions()
                                                throws AuthorizationException

  Gets the PropertyDefinitions for this ObjectClass. If they aren't currently set on this ObjectClass, then they will be retrieved. If you need to check if the ObjectClass instance in memory has its ProperetyDefinitions set, use isPropertyDefinitionsNull(). If you need to know if the ObjectClass has PropertyDefinitions (they may not be loaded in memory, but actually exist), use hasPropertyDefinitions().

  Returns
    An array of `PropertyDefinition` objects for this `ObjectClass`.
  Throws
    `AuthorizationException` - - if the user attempting the get is not authorized.

### setPropertyDefinitions

    public void setPropertyDefinitions(PropertyDefinition[] propertyDefinitions)

  Sets the PropertyDefinitions for this ObjectClass.

  Parameters
    `propertyDefinitions` - The array of `PropertyDefinition` objects to set for this `ObjectClass`.

### addPropertyDefinition

    public void addPropertyDefinition(PropertyDefinition propertyDefinition)
                               throws AuthorizationException

  Add a property definition to the object class. Do not use this method if the property definition already exists for this object class. Instead use `setPropertyDefinitions(PropertyDefinition[])`

  Parameters
    `propertyDefinition` - The definition to add.
  Throws
    `AuthorizationException` - if the user is not authorized

### removePropertyDefinition

    public void removePropertyDefinition(String name)
                                  throws AuthorizationException

  Remove a property definition from the object class.

  Parameters
    `name` - The name of the definition to remove.
  Throws
    `AuthorizationException` - if the user is not authorized

### hasPropertyDefinitions

    public boolean hasPropertyDefinitions()

  Returns true if this ObjectClass has PropertyDefinitions. This does not indicate if it currently has them as part of the instance (in memory), or if they will be lazy loaded, but rather simply that they exist.

  Returns
    true if this `ObjectClass` has `PropertyDefinition` objects.

### hasPropertyDefinitions

    public void hasPropertyDefinitions(boolean hasPropertyDefinitions)

  Sets if this ObjectClass has PropertyDefinitions. This does not indicate if it currently has them as part of the instance (in memory), or if they will be lazy loaded, but rather simply that they exist.

  Parameters
    `hasPropertyDefinitions` - True if this `ObjectClass` has `PropertyDefinition` objects.

### hasNested

    public boolean hasNested()

  Returns true if this ObjectClass has any PropertyDefinitions of type `Property.NESTED`

  Returns
    true if this `ObjectClass` has any nested `ObjectClass`'s.

### isPropertyDefinitionsNull

    public boolean isPropertyDefinitionsNull()

  Returns true if the propertyDefitions is null, false otherwise. This does not indicate whether PropertyDefinitions exist for this ObjectClass, but rather if they are currently part of the instance.

  Returns
    true if the property definitions for this object class are null.

### setObjectClassOps

    public void setObjectClassOps(ObjectClassOps objectClassOps)

  Sets the ObjectClassOps for the repository.

  Parameters
    `objectClassOps` - the implementation for this `ObjectClass`.

### getPropertyDefinition

    public PropertyDefinition getPropertyDefinition(String name)
                                             throws RepositoryException

  Gets the named PropertyDefinition for this ObjectClass. If this is a nested property definition type, the name will reflect the nested hierarchy with `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.

  Parameters
    `name` - - the name of the property definition to get.
  Returns
    PropertyDefinition - that matches the name passed in, or null if none.
  Throws
    `RepositoryException` - - if an error occurs getting the property definition.

### validateProperties

    public void validateProperties(Property[] properties)
                            throws RepositoryException

  Validates that each property passed in as part of the properties array is valid according to its PropertyDefinition. Note that this method does not validate Link property node targets -- these are verified when a node is created/updated.

  Parameters
    `properties` -
  Throws
    `RepositoryException`

### validateProperty

    public void validateProperty(Property property,
                                 PropertyDefinition definition)
                          throws RepositoryException

  Validates that the property passed in is valid according to the property definition passed in. Note that this method does not validate Link property node targets -- these are verified when a node is created/updated.

  Parameters
    `property` -
    `definition` -
  Throws
    `RepositoryException`

### getWorkflowId

    public ID getWorkflowId()

  Return the workflowID if it has been set on the objectclass.

  Returns
    ID of the workflow or null

### setWorkflowId

    public void setWorkflowId(ID workflowId)

  Set the workflowID for the type

  Parameters
    `workflowId` - The ID of the workflow to set.

### toString

    public String toString()

  Returns the ObjectClass attributes as a String.

  Overrides:
    `toString` in class `ContentEntity`

### getDescription

    public String getDescription()

  Returns the description for this ObjectClass. Only populated by repositories implementing the ExtendedObjectClassOps SPI.

  Returns
    The description.

### setDescription

    public void setDescription(String description)

  Sets the description for this ObjectClass. Only used by repositories implementing the ExtendedObjectClassOps SPI.

  Parameters
    `description` - The description.

### isSearchable

    public boolean isSearchable()

  Returns true when nodes of this type are indexed in the search engine.

### setSearchable

    public void setSearchable(boolean isSearchable)

  Set to true if nodes of this type should be searchable, false otherwise.

Overview | Package | Class | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2006 BEA Systems, Inc. All Rights Reserved