org.jasig.portal.portlets.swapper
Class AttributeSwapperHelperImpl

java.lang.Object
  extended by org.jasig.portal.portlets.swapper.AttributeSwapperHelperImpl
All Implemented Interfaces:
IAttributeSwapperHelper

public class AttributeSwapperHelperImpl
extends Object
implements IAttributeSwapperHelper

Version:
$Revision$
Author:
Eric Dalquist

Field Summary
protected  org.apache.commons.logging.Log logger
           
 
Fields inherited from interface org.jasig.portal.portlets.swapper.IAttributeSwapperHelper
ATTRIBUTE_SWAPPER_ATTRIBUTES_FORM_SWAPPABLE_ATTRIBUTES, ATTRIBUTE_SWAPPER_ATTRIBUTES_FORM_SWAPPABLE_ATTRIBUTES_EXCLUDES
 
Constructor Summary
AttributeSwapperHelperImpl()
           
 
Method Summary
protected  void copyAttributes(Map<String,Object> destination, Map<String,Attribute> source)
           
 org.jasig.services.persondir.IPersonAttributes getOriginalUserAttributes(String uid)
          Get the base attributes for a person, this bypasses the overwriting dao.
 OverwritingPersonAttributeDao getPersonAttributeDao()
           
 IPersonManager getPersonManager()
           
 IPortalRequestUtils getPortalRequestUtils()
           
 Set<String> getSwappableAttributes(org.springframework.webflow.context.ExternalContext externalContext)
          Gets the Set of attribtues to allow the user to swap values for.
 void populateSwapRequest(org.springframework.webflow.context.ExternalContext externalContext, AttributeSwapRequest attributeSwapRequest)
          Initialize the command object used for the swapper form.
 void resetAttributes(org.springframework.webflow.context.ExternalContext externalContext)
          Removes the swapped attributes for the specified user
 void setPersonAttributeDao(OverwritingPersonAttributeDao personAttributeDao)
          The OverwritingPersonAttributeDao instance to use to override attributes
 void setPersonManager(IPersonManager personManager)
          The IPersonManager to use to access the current IPerson
 void setPortalRequestUtils(IPortalRequestUtils portalRequestUtils)
          Utility class to access the original portal request
 void swapAttributes(org.springframework.webflow.context.ExternalContext externalContext, AttributeSwapRequest attributeSwapRequest)
          Perform the attribute swap request.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected final org.apache.commons.logging.Log logger
Constructor Detail

AttributeSwapperHelperImpl

public AttributeSwapperHelperImpl()
Method Detail

getPersonAttributeDao

public OverwritingPersonAttributeDao getPersonAttributeDao()

setPersonAttributeDao

public void setPersonAttributeDao(OverwritingPersonAttributeDao personAttributeDao)
The OverwritingPersonAttributeDao instance to use to override attributes


getPersonManager

public IPersonManager getPersonManager()

setPersonManager

public void setPersonManager(IPersonManager personManager)
The IPersonManager to use to access the current IPerson


getPortalRequestUtils

public IPortalRequestUtils getPortalRequestUtils()

setPortalRequestUtils

public void setPortalRequestUtils(IPortalRequestUtils portalRequestUtils)
Utility class to access the original portal request


getSwappableAttributes

public Set<String> getSwappableAttributes(org.springframework.webflow.context.ExternalContext externalContext)
Description copied from interface: IAttributeSwapperHelper
Gets the Set of attribtues to allow the user to swap values for.

Specified by:
getSwappableAttributes in interface IAttributeSwapperHelper
Parameters:
externalContext - The ExternalContext to get the flows's configuration from
Returns:
Set of attributes that can be swapped

getOriginalUserAttributes

public org.jasig.services.persondir.IPersonAttributes getOriginalUserAttributes(String uid)
Description copied from interface: IAttributeSwapperHelper
Get the base attributes for a person, this bypasses the overwriting dao.

Specified by:
getOriginalUserAttributes in interface IAttributeSwapperHelper
Parameters:
uid - The user name of the user to get the attributes for.
Returns:
The original (non overwritten) attributes.

populateSwapRequest

public void populateSwapRequest(org.springframework.webflow.context.ExternalContext externalContext,
                                AttributeSwapRequest attributeSwapRequest)
Description copied from interface: IAttributeSwapperHelper
Initialize the command object used for the swapper form.

Specified by:
populateSwapRequest in interface IAttributeSwapperHelper
Parameters:
externalContext - The ExternalContext to get the flows's configuration from
attributeSwapRequest - The command object to initialize

swapAttributes

public void swapAttributes(org.springframework.webflow.context.ExternalContext externalContext,
                           AttributeSwapRequest attributeSwapRequest)
Description copied from interface: IAttributeSwapperHelper
Perform the attribute swap request.

Specified by:
swapAttributes in interface IAttributeSwapperHelper
Parameters:
externalContext - The ExternalContext to get the current user from
attributeSwapRequest - The swap request with the new attributes

resetAttributes

public void resetAttributes(org.springframework.webflow.context.ExternalContext externalContext)
Description copied from interface: IAttributeSwapperHelper
Removes the swapped attributes for the specified user

Specified by:
resetAttributes in interface IAttributeSwapperHelper
Parameters:
externalContext - The ExternalContext to get the current user from

copyAttributes

protected void copyAttributes(Map<String,Object> destination,
                              Map<String,Attribute> source)


Copyright © 2010 Jasig. All Rights Reserved.