org.olat.user
Class AbstractUserPropertyHandler

java.lang.Object
  extended by org.olat.user.AbstractUserPropertyHandler
All Implemented Interfaces:
ItemValidatorProvider, UserPropertyHandler
Direct Known Subclasses:
DatePropertyHandler, GenderPropertyHandler, Generic127CharTextPropertyHandler, GenericCheckboxPropertyHandler

public abstract class AbstractUserPropertyHandler
extends java.lang.Object
implements UserPropertyHandler

Desciption:

The user field represents an attribute of a known OLAT user.

Author:
Carsten Weisse, Florian Gnägi

Constructor Summary
AbstractUserPropertyHandler()
           
 
Method Summary
 ColumnDescriptor getColumnDescriptor(int position, java.lang.String action, java.util.Locale locale)
          Create a table column descriptor for this user field
 java.lang.String getGroup()
          Use the group identifyer to visually group user fields together when displaying them to users
 java.lang.String getName()
           
 java.lang.String getUserProperty(User user, java.util.Locale locale)
           
 java.lang.String getUserPropertyAsHTML(User user, java.util.Locale locale)
           
 java.lang.String i18nColumnDescriptorLabelKey()
           
 java.lang.String i18nFormElementGroupKey()
           
 java.lang.String i18nFormElementLabelKey()
           
 boolean isDeletable()
           
 void setDeletable(boolean deletable)
          Spring setter
 void setGroup(java.lang.String group)
          Spring setter
 void setName(java.lang.String name)
          Spring setter
 void setUserProperty(User user, java.lang.String value)
           
 java.lang.String toString()
          Returns the user field database key, name and value .
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.olat.user.propertyhandlers.UserPropertyHandler
addFormItem, getFormElement, getStringValue, getStringValue, getStringValue, isValid, isValid, isValidValue, updateFormElementFromUser, updateUserFromFormElement, updateUserFromFormItem
 

Constructor Detail

AbstractUserPropertyHandler

public AbstractUserPropertyHandler()
Method Detail

getUserProperty

public java.lang.String getUserProperty(User user,
                                        java.util.Locale locale)
Specified by:
getUserProperty in interface UserPropertyHandler
Parameters:
user - the user for which we want to get the value
locale - the current users locale or NULL if default locale should be used.
Returns:
The value or NULL if no value exists
See Also:
org.olat.core.id.UserField#getUserFieldValue(org.olat.core.id.User, java.util.Locale)

getUserPropertyAsHTML

public java.lang.String getUserPropertyAsHTML(User user,
                                              java.util.Locale locale)
Specified by:
getUserPropertyAsHTML in interface UserPropertyHandler
Parameters:
user - the user for which we want to get the value
locale - the current users locale or NULL if default locale should be used.
Returns:
The value formatted in HTML or an empty String if no value exists
See Also:
org.olat.core.id.UserField#getUserFieldValueAsHTML(org.olat.core.id.User, java.util.Locale)

setUserProperty

public void setUserProperty(User user,
                            java.lang.String value)
Specified by:
setUserProperty in interface UserPropertyHandler
Parameters:
user - The user for which we want to set the value
value - The new value or NULL to remove the value
See Also:
org.olat.core.id.UserField#setUserFieldValue(org.olat.core.id.User, java.lang.String)

getName

public java.lang.String getName()
Specified by:
getName in interface UserPropertyHandler
Returns:
The identifyer string of this UserPropertyHandler
See Also:
org.olat.core.id.UserField#getName()

getGroup

public java.lang.String getGroup()
Description copied from interface: UserPropertyHandler
Use the group identifyer to visually group user fields together when displaying them to users

Specified by:
getGroup in interface UserPropertyHandler
Returns:
The group identifyer string of this UserPropertyHandler
See Also:
org.olat.core.id.UserField#getGroup()

i18nFormElementLabelKey

public java.lang.String i18nFormElementLabelKey()
Specified by:
i18nFormElementLabelKey in interface UserPropertyHandler
Returns:
The i18n key for the UserPropertyHandler form label
See Also:
org.olat.core.id.UserField#i18nFormElementLabelKey()

i18nFormElementGroupKey

public java.lang.String i18nFormElementGroupKey()
Specified by:
i18nFormElementGroupKey in interface UserPropertyHandler
Returns:
The i18n group name key form label
See Also:
org.olat.core.id.UserField#i18nFormElementGroupKey()

i18nColumnDescriptorLabelKey

public java.lang.String i18nColumnDescriptorLabelKey()
Specified by:
i18nColumnDescriptorLabelKey in interface UserPropertyHandler
Returns:
The i18n key for the UserPropertyHandler column label
See Also:
org.olat.core.id.UserField#i18nColumnDescriptorLabelKey()

getColumnDescriptor

public ColumnDescriptor getColumnDescriptor(int position,
                                            java.lang.String action,
                                            java.util.Locale locale)
Description copied from interface: UserPropertyHandler
Create a table column descriptor for this user field

Specified by:
getColumnDescriptor in interface UserPropertyHandler
Returns:
See Also:
org.olat.core.id.UserField#getColumnDescriptor(int, java.lang.String, java.util.Locale)

isDeletable

public boolean isDeletable()
Specified by:
isDeletable in interface UserPropertyHandler
Returns:
true: this field can be deleted when deleting a user; false: this field should be archived when deleting a user
See Also:
UserPropertyHandler.isDeletable()

toString

public java.lang.String toString()
Returns the user field database key, name and value .

Overrides:
toString in class java.lang.Object
Returns:
String internal user field info
See Also:
Object.toString()

setGroup

public void setGroup(java.lang.String group)
Spring setter

Parameters:
group -

setDeletable

public void setDeletable(boolean deletable)
Spring setter

Parameters:
isDeletable -

setName

public void setName(java.lang.String name)
Spring setter

Parameters:
name -