com.ibm.ram.client
Class RAMCategorySchema

java.lang.Object
  extended by com.ibm.ram.common.data.CategorySchema
      extended by com.ibm.ram.client.RAMCategorySchema

public class RAMCategorySchema
extends CategorySchema

Defines a category schema, which is a collection of categories that can be applied to assets to categorize the assets. This object can be a modifiable instance that is obtained from the session or a read-only instance that is obtained from a specific asset.

Since:
7.1
Author:
kbauer

Method Summary
 void clear()
          Clears out any cached category schema objects so that it can be rebuilt based on the maifest
 RAMCategory createCategory(java.lang.String name)
          Create a new category to populate for upload.
 RAMAction getAction()
          Set the action to be performed on the session object.
 Category[] getCategories()
           
 Category getCategory(java.lang.String name)
          Returns a category by name
 java.lang.String getDescription()
          Return the description of the category schema
 java.lang.String getName()
           
 RAMCommunity[] getRestrictedCommunities()
          If this category schema is restricted to specific communities this returns all restricted communities if not restricted all communities are returned.
 RAMSubCategory getSubCategoryById(java.lang.String id)
          Given an id fetch a sub category within the category schema
 java.lang.String getURI()
           
 boolean isDirty()
          Returns true if the Object has been modified from the copy on the server
 boolean isRestricted()
          Is the category schema restricted to a set of communities
 void setAction(RAMAction action)
          Set the action to be performed when passed to RAMSession#put(IRAMSessionObject, org.eclipse.core.runtime.IProgressMonitor) Accepts RAMAction.CREATE RAMAction.UPDATE RAMAction.DELETE
 void setCategories(Category[] categories)
           
 void setDescription(java.lang.String desciption)
           
 void setName(java.lang.String name)
           
 void setRestricted(boolean restricted)
          Set that this set of category schemas is restricted to a set of communities.
 void setRestrictedCommunities(CommunityInformation[] communities)
          Set the communities explicitly set to be restricted to.
 void setURI(java.lang.String uri)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Method Detail

getCategories

public Category[] getCategories()
Overrides:
getCategories in class CategorySchema
Returns:
The list of categories.

clear

public void clear()
Clears out any cached category schema objects so that it can be rebuilt based on the maifest

Since:
7.5

getCategory

public Category getCategory(java.lang.String name)
Description copied from class: CategorySchema
Returns a category by name

Overrides:
getCategory in class CategorySchema

getSubCategoryById

public RAMSubCategory getSubCategoryById(java.lang.String id)
Given an id fetch a sub category within the category schema

Parameters:
id -
Returns:
Since:
7.1.1

getName

public java.lang.String getName()
Overrides:
getName in class CategorySchema
Returns:
The name of the Category Schema.

setName

public void setName(java.lang.String name)
Overrides:
setName in class CategorySchema
Parameters:
name - The name of the Category Schema.

getDescription

public java.lang.String getDescription()
Return the description of the category schema

Since:
7.1

setDescription

public void setDescription(java.lang.String desciption)
Parameters:
name -
Since:
7.1

getURI

public java.lang.String getURI()
Overrides:
getURI in class CategorySchema
Returns:
The URI of the category schema.

setURI

public void setURI(java.lang.String uri)
Overrides:
setURI in class CategorySchema
Parameters:
uri - The URI of this Category Schema.

isDirty

public boolean isDirty()
Returns true if the Object has been modified from the copy on the server

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setCategories

public void setCategories(Category[] categories)
Overrides:
setCategories in class CategorySchema
Parameters:
categories - The list of child categories.

createCategory

public RAMCategory createCategory(java.lang.String name)
Create a new category to populate for upload. This method may only be called on Category Schemas obtained from the session.

Since:
7.1

getAction

public RAMAction getAction()
Set the action to be performed on the session object. Each object will have it's own set of actions it will accept

Returns:

setAction

public void setAction(RAMAction action)
Set the action to be performed when passed to RAMSession#put(IRAMSessionObject, org.eclipse.core.runtime.IProgressMonitor) Accepts RAMAction.CREATE RAMAction.UPDATE RAMAction.DELETE

Parameters:
action -
Since:
7.1

isRestricted

public boolean isRestricted()
Is the category schema restricted to a set of communities

Returns:
the restricted
Since:
7.1

setRestricted

public void setRestricted(boolean restricted)
Set that this set of category schemas is restricted to a set of communities. Setting to restricted will default the list of restricted communities to the list of communities the session user has administration athority

Parameters:
restricted - the restricted to set
Since:
7.1

getRestrictedCommunities

public RAMCommunity[] getRestrictedCommunities()
                                        throws RAMRuntimeException
If this category schema is restricted to specific communities this returns all restricted communities if not restricted all communities are returned.

Throws:
RAMRuntimeException
Since:
7.5.0.1

setRestrictedCommunities

public void setRestrictedCommunities(CommunityInformation[] communities)
Set the communities explicitly set to be restricted to. if this is not an empty list the restricted flag will be set to true. if this is an empty list the restricted flag will be set to false. Used session.put(schema, monitor) to commit this change.

Parameters:
communities - The communities this schema is restricted to
Since:
7.5.0.1