org.gcube.application.framework.userprofiles.library.impl
Class UserProfile

java.lang.Object
  extended by org.gcube.application.framework.userprofiles.library.impl.UserProfile
All Implemented Interfaces:
UserProfileInfoI

public class UserProfile
extends java.lang.Object
implements UserProfileInfoI


Constructor Summary
UserProfile(ASLSession session)
           
UserProfile(java.lang.String extrenalSessionID, java.lang.String username)
           
 
Method Summary
 void createUserProfile(java.lang.String username)
          Creates a default profile for this user
 boolean deleteElement(java.lang.String username, java.lang.String elementName)
           
 void dropUserProfile(java.lang.String username)
          Drops the profile of this user
 java.lang.String[] getElement(java.lang.String username, java.lang.String element)
          
 java.lang.String getElementValue(java.lang.String username, java.lang.String element)
          
 java.util.HashMap<java.lang.String,java.lang.String> getMetadataXSLTs(java.lang.String username)
          
 java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> getPresentationFields(java.lang.String username)
          
 java.lang.String getUserProfile(java.lang.String username)
          
 void setDefaultProfile(java.lang.String defaultProfile)
          
 void setElement(java.lang.String username, java.lang.String path, java.lang.String elementName, java.lang.String elementValue)
           
 void setElementValue(java.lang.String username, java.lang.String element, java.lang.String value)
          
 void setUserProfile(java.lang.String username, java.lang.String profile)
          Sets user's profile
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserProfile

public UserProfile(java.lang.String extrenalSessionID,
                   java.lang.String username)
Parameters:
extrenalSessionID - the external session ID. In case of a web application using ASL, this is the http session ID
username - the username of the user that makes the request

UserProfile

public UserProfile(ASLSession session)
Parameters:
session - the D4SSession
Method Detail

getMetadataXSLTs

public java.util.HashMap<java.lang.String,java.lang.String> getMetadataXSLTs(java.lang.String username)

Specified by:
getMetadataXSLTs in interface UserProfileInfoI
Parameters:
username - the username
Returns:
a hashmap containing the metadata schemata and the IDs of the corresponding generic resources that represent the XSLTs to transform metadata to html

getPresentationFields

public java.util.HashMap<java.lang.String,java.util.ArrayList<java.lang.String>> getPresentationFields(java.lang.String username)

Specified by:
getPresentationFields in interface UserProfileInfoI
Parameters:
username - the username
Returns:
a hashmap containing the ids of the presentation fields selected by the user per collection

getUserProfile

public java.lang.String getUserProfile(java.lang.String username)

Specified by:
getUserProfile in interface UserProfileInfoI
Parameters:
username - the username
Returns:
the Profile serialized as a string

setUserProfile

public void setUserProfile(java.lang.String username,
                           java.lang.String profile)
Sets user's profile

Specified by:
setUserProfile in interface UserProfileInfoI
Parameters:
username - the username
profile - the Profile serialized as a string

createUserProfile

public void createUserProfile(java.lang.String username)
Creates a default profile for this user

Specified by:
createUserProfile in interface UserProfileInfoI
Parameters:
username - the username

dropUserProfile

public void dropUserProfile(java.lang.String username)
Drops the profile of this user

Specified by:
dropUserProfile in interface UserProfileInfoI
Parameters:
username - the username

getElement

public java.lang.String[] getElement(java.lang.String username,
                                     java.lang.String element)

Specified by:
getElement in interface UserProfileInfoI
Parameters:
username - the username
element - the element node to be retrieved from the profile
Returns:
the values

getElementValue

public java.lang.String getElementValue(java.lang.String username,
                                        java.lang.String element)

Specified by:
getElementValue in interface UserProfileInfoI
Parameters:
username - the username
element - the element value to be retrieved from the profile
Returns:
the values

setDefaultProfile

public void setDefaultProfile(java.lang.String defaultProfile)

Specified by:
setDefaultProfile in interface UserProfileInfoI
Parameters:
defaultProfile - the default profile xml

setElementValue

public void setElementValue(java.lang.String username,
                            java.lang.String element,
                            java.lang.String value)

Specified by:
setElementValue in interface UserProfileInfoI
Parameters:
username - the username
element - the element node to be set from the profile

deleteElement

public boolean deleteElement(java.lang.String username,
                             java.lang.String elementName)

setElement

public void setElement(java.lang.String username,
                       java.lang.String path,
                       java.lang.String elementName,
                       java.lang.String elementValue)
                throws java.lang.Exception
Throws:
java.lang.Exception