# com.bea.p13n.content.adapter
ObjectClassOpsImpl Class

public class ObjectClassOpsImpl
extends `BaseOps`
implements `ObjectClassOps`

The object class ops for the WLP Content Repository-to-ContentManager adapter.

The uid of IDs of ObjectClasses from this will be the PropertySet name.

The uid of IDs of PropertyDefinition's from this will be the propertysetname/property name.

All adapter to DocumentManager ObjectClasses will have a primary content property called 'content' which refers to the result of calling getContentBlock() on the DocumentManager.

Hierarchy
  `Object`
  `BaseOps`
  `ObjectClassOpsImpl`

All Implemented Interfaces
  `ObjectClassOps`, `Serializable`

## Field Summary

Fields from com.bea.p13n.content.adapter`.`BaseOps``
``CONTENT_MANAGER_HOME`, `credentials`, `PATH_IS_ID`, `PATH_STARTS_WITH_SLASH`, `pathIsId`, `pathStartsWithSlash`, `properties``

## Constructor Summary

ObjectClassOpsImpl(`Credentials` credentials, `Properties` properties)

## Method Summary

`public `ObjectClass`` | `convert`(`String` reponame, `PropertySet` ps) Convert a PropertySet to an ObjectClass.
`public static `PropertyDefinition`` | `convert`(`String` reponame, `String` psName, `String` propname, `PropertyDefinition` pdef) Convert a PropertySet PropertyDefinition to an ObjectClass PropertyDefinition.
`public `PropertyDefinition`` | `createContentPropertyDefinition`(`String` reponame, `String` psName) Create the PropertyDefinition for the magic "content" property for DocumentManagers.
`public `ObjectClass`` | `createObjectClass`(`ObjectClass` objectClass) Creates the given ObjectClass.
`public static `PropertyChoice`` | `createPropertyChoice`(`ID` id, int type, `Object` val) Create a property choice from the given value.
`public `PropertyDefinition`` | `createPropertyDefinition`(`ID` objectClassId, `PropertyDefinition` propertyDefinition) Adds the given propertyDefinition to the ObjectClass with the given objectClassId.
`public `ObjectClass`` | `createStandardObjectClass`(`String` reponame) Create an ObjectClass for the "Standard" adapter properties.
`public void` | `deleteObjectClass`(`ID` objectClassId) Deletes the ObjectClass with the given objectClassId.
`public void` | `deletePropertyDefinition`(`ID` propertyDefinitionId) Deletes the given propertyDefinition.
`public `ObjectClass`` | `getObjectClass`(`ID` objectClassId) Gets the ObjectClass with the given objectClassId.
`public `ObjectClass`[]` | `getObjectClasses`() Gets all of the ObjectClasses available in the content repository.
`public `InputStream`` | `getPropertyChoiceBytes`(`ID` propertyChoiceId) Gets the bytes for the given PropertyChoice.
`public `PropertyDefinition`` | `getPropertyDefinition`(`ID` propertyDefinitionId) Gets the PropertyDefinition for the given id.
`public `PropertyDefinition`[]` | `getPropertyDefinitions`(`ID` objectClassId) Gets all PropertyDefinitions for the given ObjectClass.
`public `PropertyDefinition`[]` | `getPropertyDefinitions`(`String` reponame, `PropertySet` ps) Get the property definitions for a property set.
`public `PropertyDefinition`[]` | `getStandardPropertyDefinitions`(`String` reponame) Create the PropertyDefinitions for the "Standard" adapter properties.
`public `ObjectClass`` | `renameObjectClass`(`ID` id, `String` newName) Renames the given ObjectClass.
`public `PropertyDefinition`` | `updatePropertyDefinition`(`PropertyDefinition` propertyDefinition) Updates the given propertyDefinition.

Methods from `com.bea.p13n.content.adapter.`BaseOps``
``getContentManager`, `unsupported``

Methods from class `java.lang.`Object``
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Methods from interface `com.bea.content.spi.`ObjectClassOps``
``createObjectClass`, `createPropertyDefinition`, `deleteObjectClass`, `deletePropertyDefinition`, `getObjectClass`, `getObjectClasses`, `getPropertyChoiceBytes`, `getPropertyDefinition`, `getPropertyDefinitions`, `renameObjectClass`, `updatePropertyDefinition``

## Constructor Detail

### ObjectClassOpsImpl

    public ObjectClassOpsImpl(Credentials credentials,
                              Properties properties)

## Method Detail

### convert(String, PropertySet) Method

    public ObjectClass convert(String reponame,
                               PropertySet ps)

Convert a PropertySet to an ObjectClass.

### convert(String, String, String, PropertyDefinition) Method

    public static PropertyDefinition convert(String reponame,
                                             String psName,
                                             String propname,
                                             PropertyDefinition pdef)

Convert a PropertySet PropertyDefinition to an ObjectClass PropertyDefinition.

### createContentPropertyDefinition(String, String) Method

    public PropertyDefinition createContentPropertyDefinition(String reponame,
                                                              String psName)

Create the PropertyDefinition for the magic "content" property for DocumentManagers.

### createObjectClass(ObjectClass) Method

    public ObjectClass createObjectClass(ObjectClass objectClass)
         throws RepositoryException

Creates the given ObjectClass.

#### Parameters

objectClass
  - the ObjectClass to create, along with any PropertyDefinitions to create also.

#### Returns

ObjectClass - the new ObjectClass.

#### Exceptions

``RepositoryException``
  - if a system error occurs.

### createPropertyChoice(ID, int, Object) Method

    public static PropertyChoice createPropertyChoice(ID id,
                                                      int type,
                                                      Object val)

Create a property choice from the given value.

#### Parameters

id
  the property choice id

type
  the Property type constant

val
  the value (non-null) from the old PropertySet PropertyDefinition.

#### Returns

the PropertyChoice - null if invalid val for type

### createPropertyDefinition(ID, PropertyDefinition) Method

    public PropertyDefinition createPropertyDefinition(ID objectClassId,
                                                       PropertyDefinition propertyDefinition)

Adds the given propertyDefinition to the ObjectClass with the given objectClassId.

#### Parameters

objectClassId
  - the id of the ObjectClass to add the PropertyDefinition to.

propertyDefinition
  - the propertyDefinition to create and add to the ObjectClass.

#### Returns

PropertyDefinition - the PropertyDefinition that was added to the ObjectClass.

### createStandardObjectClass(String) Method

    public ObjectClass createStandardObjectClass(String reponame)

Create an ObjectClass for the "Standard" adapter properties.

### deleteObjectClass(ID) Method

    public void deleteObjectClass(ID objectClassId)

Deletes the ObjectClass with the given objectClassId. All of the ObjectClass PropertyDefinitions, their PropertyChocies are also deleted if present.

#### Parameters

objectClassId
  - the ID of the ObjectClass to delete.

### deletePropertyDefinition(ID) Method

    public void deletePropertyDefinition(ID propertyDefinitionId)

Deletes the given propertyDefinition.

#### Parameters

propertyDefinitionId
  - the ID of the propertyDefinition to delete.

### getObjectClass(ID) Method

    public ObjectClass getObjectClass(ID objectClassId)
         throws NoSuchObjectClassException

Gets the ObjectClass with the given objectClassId.

#### Parameters

objectClassId
  - the ID of the ObjectClass to get.

#### Returns

ObjectClass - the ObjectClass for the id passed in.

#### Exceptions

``NoSuchObjectClassException``
  - if the ObjectClass to get does not exist.

### getObjectClasses() Method

    public ObjectClass[] getObjectClasses()

Gets all of the ObjectClasses available in the content repository.

#### Returns

ObjectClass[] - an array of all ObjectClasses, an empty array if none are currently defined.

### getPropertyChoiceBytes(ID) Method

    public InputStream getPropertyChoiceBytes(ID propertyChoiceId)

Gets the bytes for the given PropertyChoice.

#### Parameters

propertyChoiceId
  - the ID of the propertyChoice to get the bytes for.

#### Returns

InputStream - the bytes for the PropertyChoice.

### getPropertyDefinition(ID) Method

    public PropertyDefinition getPropertyDefinition(ID propertyDefinitionId)
         throws NoSuchPropertyDefinitionException

Description copied from `ObjectClassOps.getPropertyDefinition(ID)`
Gets the PropertyDefinition for the given id.

#### Parameters

propertyDefinitionId
  - the ID the PropertyDefinition to get.

#### Returns

PropertyDefinition - the PropertyDefinition whose id matches propertyDefinitionId.

#### Exceptions

``NoSuchPropertyDefinitionException``

### getPropertyDefinitions(ID) Method

    public PropertyDefinition[] getPropertyDefinitions(ID objectClassId)
         throws NoSuchObjectClassException

Gets all PropertyDefinitions for the given ObjectClass.

#### Parameters

objectClassId
  - the ID for the ObjectClass to get its PropertyDefinitions.

#### Returns

PropertyDefinition[] - the array of PropertyDefinitions for the given ObjectClass - of an empty array of none are currently defined.

#### Exceptions

``NoSuchObjectClassException``
  - if the ObjectClass does not exist.

### getPropertyDefinitions(String, PropertySet) Method

    public PropertyDefinition[] getPropertyDefinitions(String reponame,
                                                     PropertySet ps)

Get the property definitions for a property set.

### getStandardPropertyDefinitions(String) Method

    public PropertyDefinition[] getStandardPropertyDefinitions(String reponame)

Create the PropertyDefinitions for the "Standard" adapter properties.

### renameObjectClass(ID, String) Method

    public ObjectClass renameObjectClass(ID id,
                                         String newName)
         throws RepositoryException

Renames the given ObjectClass.

#### Parameters

id
  - the ID of the objectClass to rename.

newName
  - the new name of the ObjectClass.

#### Returns

ObjectClass - the updated ObjectClass.

#### Exceptions

``RepositoryException``
  - if a system error occurs.

### updatePropertyDefinition(PropertyDefinition) Method

    public PropertyDefinition updatePropertyDefinition(PropertyDefinition propertyDefinition)

Updates the given propertyDefinition.

#### Parameters

propertyDefinition
  - the propertyDefinition to update.

#### Returns

PropertyDefinition - the updated PropertyDefinition.