org.olat.user.propertyhandlers
Class UserPropertiesConfigImpl

java.lang.Object
  extended by org.olat.core.logging.LogDelegator
      extended by org.olat.user.propertyhandlers.UserPropertiesConfigImpl
All Implemented Interfaces:
UserPropertiesConfig

public class UserPropertiesConfigImpl
extends LogDelegator
implements UserPropertiesConfig

Description:

This class implements the user properties configuration

Initial Date: 31.07.2007

Author:
Florian Gnaegi, frentix GmbH, http://www.frentix.com

Field Summary
static java.lang.String PACKAGE
           
 
Constructor Summary
UserPropertiesConfigImpl()
           
 
Method Summary
 java.util.List<UserPropertyHandler> getAllUserPropertyHandlers()
          Get all available property handlers.
 UserPropertyHandler getPropertyHandler(java.lang.String handlerName)
          Get the property handler with the given name
 Translator getTranslator(Translator fallBack)
          Factory method to create a translator that can translate the user properties.
 java.util.List<UserPropertyHandler> getUserPropertyHandlersFor(java.lang.String usageIdentifyer, boolean isAdministrativeUser)
          Get the user property handlers for the context of the usageIdentifyer.
 void init()
           
 boolean isMandatoryUserProperty(java.lang.String usageIdentifyer, UserPropertyHandler propertyHandler)
          Checks if the given property is mandatory in the context of the usageIdentifyer.
 boolean isUserViewReadOnly(java.lang.String usageIdentifyer, UserPropertyHandler propertyHandler)
          Checks if the given property can be edited by the regular user in the context of the usageIdentifyer.
 void setUserPropertyHandlers(java.util.List<UserPropertyHandler> userPropertyHandlers)
          Spring setter
 void setUserPropertyUsageContexts(java.util.Map<java.lang.String,UserPropertyUsageContext> userPropertyUsageContexts)
          Spring setter
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PACKAGE

public static final java.lang.String PACKAGE
Constructor Detail

UserPropertiesConfigImpl

public UserPropertiesConfigImpl()
Method Detail

init

public void init()

setUserPropertyUsageContexts

public void setUserPropertyUsageContexts(java.util.Map<java.lang.String,UserPropertyUsageContext> userPropertyUsageContexts)
Spring setter

Parameters:
userPropertyUsageContexts -

setUserPropertyHandlers

public void setUserPropertyHandlers(java.util.List<UserPropertyHandler> userPropertyHandlers)
Spring setter

Parameters:
userPropertyHandlers -

getPropertyHandler

public UserPropertyHandler getPropertyHandler(java.lang.String handlerName)
Description copied from interface: UserPropertiesConfig
Get the property handler with the given name

Specified by:
getPropertyHandler in interface UserPropertiesConfig
Returns:
See Also:
UserPropertiesConfig.getPropertyHandler(java.lang.String)

getTranslator

public Translator getTranslator(Translator fallBack)
Description copied from interface: UserPropertiesConfig
Factory method to create a translator that can translate the user properties. E.g. gender is translated.

Specified by:
getTranslator in interface UserPropertiesConfig
Returns:
See Also:
UserPropertiesConfig.getTranslator(org.olat.core.gui.translator.Translator)

getAllUserPropertyHandlers

public java.util.List<UserPropertyHandler> getAllUserPropertyHandlers()
Description copied from interface: UserPropertiesConfig
Get all available property handlers. Do not use this for forms or tables, use this only to cleanup things

Specified by:
getAllUserPropertyHandlers in interface UserPropertiesConfig
Returns:
See Also:
UserPropertiesConfig.getAllUserPropertyHandlers()

getUserPropertyHandlersFor

public java.util.List<UserPropertyHandler> getUserPropertyHandlersFor(java.lang.String usageIdentifyer,
                                                                      boolean isAdministrativeUser)
Description copied from interface: UserPropertiesConfig
Get the user property handlers for the context of the usageIdentifyer. When the isAdminstrativeUser flag is set, all the configured properties are returned

Specified by:
getUserPropertyHandlersFor in interface UserPropertiesConfig
Returns:
See Also:
UserPropertiesConfig.getUserPropertyHandlersFor(java.lang.String, boolean)

isMandatoryUserProperty

public boolean isMandatoryUserProperty(java.lang.String usageIdentifyer,
                                       UserPropertyHandler propertyHandler)
Description copied from interface: UserPropertiesConfig
Checks if the given property is mandatory in the context of the usageIdentifyer. In forms this means that the field is rendered as mandatory, in tables it means that the table column is displayed as default configuration if user has a configurable table.

Specified by:
isMandatoryUserProperty in interface UserPropertiesConfig
Returns:
See Also:
UserPropertiesConfig.isMandatoryUserProperty(java.lang.String, org.olat.user.propertyhandlers.UserPropertyHandler)

isUserViewReadOnly

public boolean isUserViewReadOnly(java.lang.String usageIdentifyer,
                                  UserPropertyHandler propertyHandler)
Description copied from interface: UserPropertiesConfig
Checks if the given property can be edited by the regular user in the context of the usageIdentifyer. Admin users will override this setting.

Specified by:
isUserViewReadOnly in interface UserPropertiesConfig
Returns:
See Also:
UserPropertiesConfig.isUserViewReadOnly(java.lang.String, org.olat.user.propertyhandlers.UserPropertyHandler)