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

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

public class AttributeModel
extends Object
implements Serializable

A model used to access an attribute's value and title, based on the principal URI, provider thing Id, and attribute name.

See Also:
Serialized Form

Field Summary
protected  String fAttributeName
           
protected  String fDisplayName
           
protected  IPrincipalAttributeBizPolicy fPapBizPolicy
           
protected  IContext fPortalContext
           
protected  IURI fPrincipalURI
           
protected  IThingID fProviderThingID
           
 
Constructor Summary
AttributeModel()
          Default constructor.
AttributeModel(IThingID providerThingID, IURI principalURI, String attributeName)
          Create an attribute model from a provider thing Id, principal URI, and the attribute's name.
 
Method Summary
 String getAttributeName()
          Get the name of the attribute to reference by the biz policy.
 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()
          Get the provider thing Id.
 Object getValue()
          Get the attribute from the biz policy using this principal URI, thing Id, and attribute name.
protected  void initialize(IThingID providerThingID, IURI principalURI, String attributeName)
          Copies the supplied values into the classes members.
 void setAttributeName(String attrName)
          Set the name of the attribute to reference by the biz policy.
 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

fAttributeName

protected String fAttributeName

fDisplayName

protected String fDisplayName

fPortalContext

protected transient IContext fPortalContext

fPapBizPolicy

protected transient IPrincipalAttributeBizPolicy fPapBizPolicy
Constructor Detail

AttributeModel

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


AttributeModel

public AttributeModel(IThingID providerThingID,
                      IURI principalURI,
                      String attributeName)
Create an attribute model from a provider thing Id, principal URI, and the attribute's name.

Parameters:
providerThingID - The provider thing Id.
principalURI - The principal URI.
attributeName - The name of the attribute to reference by the biz policy.
Method Detail

initialize

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

Parameters:
providerThingID - The provider thing Id.
principalURI - The principal URI
attributeName - The name of the attribute to reference by the biz policy.

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()
Get the provider thing Id.

Returns:
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.

getAttributeName

public String getAttributeName()
Get the name of the attribute to reference by the biz policy.

Returns:
The attribute reference name. IE. "lastName"

setAttributeName

public void setAttributeName(String attrName)
Set the name of the attribute to reference by the biz policy. Clears the cache when the name changes.

Parameters:
attrName - The attribute reference name. IE. "lastName"

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.

getValue

public Object getValue()
Get the attribute from the biz policy using this principal URI, thing Id, and attribute name.

Returns:
The attribute value.

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