com.webmethods.caf.faces.data.dir
Class AttributeProviderModel

java.lang.Object
  extended by com.webmethods.caf.faces.data.dir.AttributeProviderModel
All Implemented Interfaces:
Serializable

public class AttributeProviderModel
extends Object
implements Serializable

A provider for a map of attribute models. Used to access an attribute models, based on the principal URI and provider thing Id.

See Also:
Serialized Form

Field Summary
protected  Map fAttrsMap
           
protected  IPrincipalAttributeBizPolicy fPapBizPolicy
           
protected  IContext fPortalContext
           
protected  IURI fPrincipalURI
           
protected  IThingID fProviderThingID
           
 
Constructor Summary
AttributeProviderModel()
          Default constructor.
AttributeProviderModel(IThingID providerThingID, IURI principalURI)
          Create an attribute provider model from a provider thing Id and principal URI.
 
Method Summary
 AttributeModel getAttributeModel(String attributeName)
          Get the attribute model by its name.
 AttributeModel[] getAttributeModels()
          Get the array of attribute models stored in this provider.
 String[] getAttributeNames()
          Get an array of names for all the attribute models in this provider.
protected  Map getAttributesMap()
          Get the map of attribute models stored in this provider.
 String getDisplayName()
          Get the display name for this attribute.
protected  IContext getPortalContext()
          Acquire a portal context and cache it.
protected  IPrincipalAttributeBizPolicy getPrincipalAttributeBizPolicy()
          Get the biz policy for handling principal attributes.
 IURI getPrincipalURI()
          Get the principal URI.
 IThingID getProviderThingID()
          Set the provider thing Id.
protected  void initialize(IThingID providerThingID, IURI principalURI)
          Copies the supplied values into the classes members.
 void setPrincipalURI(IURI principalURI)
          Set the principal URI.
 void setProviderThingID(IThingID providerThingID)
          Set the provider thing Id.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

fProviderThingID

protected IThingID fProviderThingID

fPrincipalURI

protected IURI fPrincipalURI

fAttrsMap

protected Map fAttrsMap

fPortalContext

protected transient IContext fPortalContext

fPapBizPolicy

protected transient IPrincipalAttributeBizPolicy fPapBizPolicy
Constructor Detail

AttributeProviderModel

public AttributeProviderModel()
Default constructor. Create an attribute provider model from the current user's Directory URI. Use the Directory URI as principal URI.


AttributeProviderModel

public AttributeProviderModel(IThingID providerThingID,
                              IURI principalURI)
Create an attribute provider model from a provider thing Id and principal URI.

Parameters:
providerThingID - The provider thing Id.
principalURI - The principal URI.
Method Detail

initialize

protected void initialize(IThingID providerThingID,
                          IURI principalURI)
Copies the supplied values into the classes members.

Parameters:
providerThingID - The provider thing Id.
principalURI - The principal URI

getPrincipalURI

public IURI getPrincipalURI()
Get the principal URI.

Returns:
The principal URI.

setPrincipalURI

public void setPrincipalURI(IURI principalURI)
Set the principal URI. Clears the cache when the URI changes.

Parameters:
principalURI - The principal URI.

getProviderThingID

public IThingID getProviderThingID()
Set the provider thing Id. Clears the cache when the provider changes.

Parameters:
providerThingID - The provider thing Id.

setProviderThingID

public void setProviderThingID(IThingID providerThingID)
Set the provider thing Id. Clears the cache when the provider changes.

Parameters:
providerThingID - The provider thing Id.

getDisplayName

public String getDisplayName()
Get the display name for this attribute. If attribute name or principalURI are null then null is returned.

Returns:
The title for this attribute based on the current local.

getPortalContext

protected IContext getPortalContext()
Acquire a portal context and cache it. Cache the results.

Returns:
The portal context.

getPrincipalAttributeBizPolicy

protected IPrincipalAttributeBizPolicy getPrincipalAttributeBizPolicy()
                                                               throws BizException
Get the biz policy for handling principal attributes. Cache the results.

Returns:
The biz policy for principal attributes.
Throws:
BizException

getAttributeNames

public String[] getAttributeNames()
Get an array of names for all the attribute models in this provider.

Returns:
An array of name for all the attribute models.

getAttributeModels

public AttributeModel[] getAttributeModels()
Get the array of attribute models stored in this provider.

Returns:
An array of attribute models.

getAttributeModel

public AttributeModel getAttributeModel(String attributeName)
Get the attribute model by its name.

Parameters:
attributeName - The name of the attribute.
Returns:
The attribute model.

getAttributesMap

protected Map getAttributesMap()
Get the map of attribute models stored in this provider. Cache the results.

Returns:
A map of attribute models.