com.anabas.sharedlet
Class SharedletRCUtil

java.lang.Object
  |
  +--com.anabas.sharedlet.SharedletRCUtil

public class SharedletRCUtil
extends java.lang.Object

A convenience class for Sharedlet developers that implements functionality necessary for SharedletRoleInfo, ModeratableElementInfo, and Capability Infos. SharedletInfo can extends this class and setup the roles, capabilities & moderatable elements without having to implement the internal tables need to store it.. Should eventually be replaced by the XML version.


Constructor Summary
SharedletRCUtil()
           
 
Method Summary
 java.util.Vector getCapabilities()
           
 ModeratableElementInfo getModeratableInfo(java.lang.String name)
           
 java.util.Vector getModeratableInfos()
           
 java.util.Vector getRoleInfos()
           
 java.util.Vector getRoles()
           
 java.util.Vector getRoleViews(java.lang.String role)
           
protected  void setCapabilities(java.lang.String capabilities)
          Set all of the possible capabilities that this sharedlet has.
protected  void setModeratable(java.lang.String moderatable, java.lang.String capabilities)
          Add a moderatable element.
protected  void setRole(java.lang.String role, java.lang.String capabilities, java.lang.String views)
          Add a role definition with an empty visible moderatable element list.
protected  void setRole(java.lang.String role, java.lang.String capabilities, java.lang.String views, java.lang.String moderatableElements)
          Add a role definition.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SharedletRCUtil

public SharedletRCUtil()
Method Detail

setModeratable

protected void setModeratable(java.lang.String moderatable,
                              java.lang.String capabilities)
Add a moderatable element. For example:

setModeratable("Draw","dtext,dcircle");

Parameters:
moderatable - A moderatable element name
capabilities - A comma separated list of capabilitity names that define this moderatable element.

setRole

protected void setRole(java.lang.String role,
                       java.lang.String capabilities,
                       java.lang.String views)
Add a role definition with an empty visible moderatable element list. For example:

setRole("Host","cap1,cap2,cap3","view1,view2")

Parameters:
role - The role name
capabilities - A comma separated list of capabilities
views - A comma separated view ID list. Same as that returned by SharedletViewInfo.getID().

setRole

protected void setRole(java.lang.String role,
                       java.lang.String capabilities,
                       java.lang.String views,
                       java.lang.String moderatableElements)
Add a role definition. For example:

setRole("Host","cap1,cap2,cap3","view1,view2","moderatable element1,...")

Parameters:
role - The role name
capabilities - A comma separated list of capabilities
moderatableElements - A comman separate list of moderatable elements that will be visible and hence remotely settabe from the capabilityManager.
views - A comma separated view ID list. Same as that returned by SharedletViewInfo.getID().

setCapabilities

protected void setCapabilities(java.lang.String capabilities)
Set all of the possible capabilities that this sharedlet has. For example:

"cap1,cap2,cap3"

Parameters:
A - comma separate list of unique capability names.

getModeratableInfos

public java.util.Vector getModeratableInfos()
Returns:
A enumerated list of ModeratableElementInfos

getModeratableInfo

public ModeratableElementInfo getModeratableInfo(java.lang.String name)
Parameters:
The - name of the moderatable info element to retrieve.
Returns:
The moderatable element info corresponding to a moderatable name. null if there is no match.

getRoles

public java.util.Vector getRoles()
Returns:
A enumerated list of role names

getRoleInfos

public java.util.Vector getRoleInfos()
Returns:
A list of SharedletRoleInfos of all the roles it manages.

getRoleViews

public java.util.Vector getRoleViews(java.lang.String role)
Returns:
A list of view ID's that this a particular role is allowed to see.

getCapabilities

public java.util.Vector getCapabilities()
Returns:
A list of unique capabilities that this sharedlet has.