org.gcube.portlets.user.userprofileeditingportlet.server
Class UserProfileEditingServlet

java.lang.Object
  extended by javax.servlet.GenericServlet
      extended by javax.servlet.http.HttpServlet
          extended by com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
              extended by com.google.gwt.user.server.rpc.RemoteServiceServlet
                  extended by org.gcube.portlets.user.userprofileeditingportlet.server.UserProfileEditingServlet
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, UserProfileEditingService

public class UserProfileEditingServlet
extends com.google.gwt.user.server.rpc.RemoteServiceServlet
implements UserProfileEditingService

Servlet class

Author:
Panagiota Koltsida, NKUA
See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse
 
Constructor Summary
UserProfileEditingServlet()
          Class constructor
 
Method Summary
protected static String createStringFromDomTree(Node tree)
          This method converts a node of a tree to a string representation.
 void createUserProfile()
           
 HashMap<CollectionInfoBean,ArrayList<CollectionInfoBean>> getAvailableCollections()
          This method returns all the available collections of a VRE with their structure Each element of the returned array is a List, where the first element of the List is the collection group and all the other members are the the real collections
 HashMap<String,ArrayList<PresentableFieldInfoBean>> getAvailablePresentableFieldsPerCollection()
           
 HashMap<String,Vector<String[]>> getAvailableXSLTsFromIS(String xsltType)
          This method returns a hash map that contains all the available xslts per metadata schema
 UserPersonalInformation getPersonalInformation()
          This method returns the personal information of the current user.
 HashMap<String,ArrayList<String>> getPresentableFieldsFromProfile()
           
 String[][] getProfileMetadataXSLTs()
          This method returns a hash map that contains the metadata xslts that exist at user's profile
 SearchPreferencesInformation getSearchPreferences()
          This method returns the search preferences of the current user.
 String[] getUsersFavoriteCollections()
          This method returns the IDs of the collections in the user's profile
 void setEmailToSession(String email)
           
 void setFullnameToSession(String fullname)
           
 void setLanguageToSession(String newLanguage)
           
 void setPersistenceToSession(String persistence)
           
 void setSearchEngineToSession(String newEngine)
           
 void setToleranceToSession(String tolerance)
           
 Boolean updatePresentableFieldsToProfile(HashMap<String,ArrayList<PresentableFieldInfoBean>> collectionsAndFields)
           
 Boolean updateUserProfile(HashMap<String,ArrayList<PresentableFieldInfoBean>> selectedFieldsPerCollection)
          This method updates the user profile of the current user It updates the profile that is stored in CMS
 void updateXSLT(String xsltType, String schemaName, String schemaValue, String schemaID)
          This method is used to update the XSLTs of the user in his profile
 
Methods inherited from class com.google.gwt.user.server.rpc.RemoteServiceServlet
checkPermutationStrongName, doGetSerializationPolicy, getSerializationPolicy, onAfterResponseSerialized, onBeforeRequestDeserialized, processCall, processPost, shouldCompressResponse
 
Methods inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
doPost, doUnexpectedFailure, getPermutationStrongName, getThreadLocalRequest, getThreadLocalResponse, onAfterRequestDeserialized, readContent
 
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPut, doTrace, getLastModified, service, service
 
Methods inherited from class javax.servlet.GenericServlet
destroy, getInitParameter, getInitParameterNames, getServletConfig, getServletContext, getServletInfo, getServletName, init, init, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UserProfileEditingServlet

public UserProfileEditingServlet()
Class constructor

Method Detail

createStringFromDomTree

protected static String createStringFromDomTree(Node tree)
                                         throws TransformerException
This method converts a node of a tree to a string representation.

Parameters:
tree - The node of a document that will be transformed
Returns:
A string representation of the node
Throws:
TransformerException - failed to transform the DOMTree to String

createUserProfile

public void createUserProfile()
Specified by:
createUserProfile in interface UserProfileEditingService

getAvailableCollections

public HashMap<CollectionInfoBean,ArrayList<CollectionInfoBean>> getAvailableCollections()
This method returns all the available collections of a VRE with their structure Each element of the returned array is a List, where the first element of the List is the collection group and all the other members are the the real collections

Specified by:
getAvailableCollections in interface UserProfileEditingService
Returns:
An array of Lists

getAvailableXSLTsFromIS

public HashMap<String,Vector<String[]>> getAvailableXSLTsFromIS(String xsltType)
This method returns a hash map that contains all the available xslts per metadata schema

Specified by:
getAvailableXSLTsFromIS in interface UserProfileEditingService
Parameters:
The - type of xslts to return (Metadata or Presentation)
Returns:
The available xslts from IS

getPersonalInformation

public UserPersonalInformation getPersonalInformation()
This method returns the personal information of the current user. These information are retrieved from the user's profile

Specified by:
getPersonalInformation in interface UserProfileEditingService
Returns:
All personal information

getPresentableFieldsFromProfile

public HashMap<String,ArrayList<String>> getPresentableFieldsFromProfile()
Specified by:
getPresentableFieldsFromProfile in interface UserProfileEditingService

getAvailablePresentableFieldsPerCollection

public HashMap<String,ArrayList<PresentableFieldInfoBean>> getAvailablePresentableFieldsPerCollection()
Specified by:
getAvailablePresentableFieldsPerCollection in interface UserProfileEditingService

getProfileMetadataXSLTs

public String[][] getProfileMetadataXSLTs()
This method returns a hash map that contains the metadata xslts that exist at user's profile

Specified by:
getProfileMetadataXSLTs in interface UserProfileEditingService
Returns:
The metadata profile XSLTs.

getSearchPreferences

public SearchPreferencesInformation getSearchPreferences()
This method returns the search preferences of the current user. These information are retrieved from the user's profile

Specified by:
getSearchPreferences in interface UserProfileEditingService
Returns:
Search preferences (language, engineType, fault tolerance, persistence)

getUsersFavoriteCollections

public String[] getUsersFavoriteCollections()
This method returns the IDs of the collections in the user's profile

Specified by:
getUsersFavoriteCollections in interface UserProfileEditingService
Returns:
An array with the IDs of the collections or null if an error occurred

setEmailToSession

public void setEmailToSession(String email)
Specified by:
setEmailToSession in interface UserProfileEditingService

setFullnameToSession

public void setFullnameToSession(String fullname)
Specified by:
setFullnameToSession in interface UserProfileEditingService

setLanguageToSession

public void setLanguageToSession(String newLanguage)
Specified by:
setLanguageToSession in interface UserProfileEditingService

setPersistenceToSession

public void setPersistenceToSession(String persistence)
Specified by:
setPersistenceToSession in interface UserProfileEditingService

setSearchEngineToSession

public void setSearchEngineToSession(String newEngine)
Specified by:
setSearchEngineToSession in interface UserProfileEditingService

setToleranceToSession

public void setToleranceToSession(String tolerance)
Specified by:
setToleranceToSession in interface UserProfileEditingService

updatePresentableFieldsToProfile

public Boolean updatePresentableFieldsToProfile(HashMap<String,ArrayList<PresentableFieldInfoBean>> collectionsAndFields)

updateUserProfile

public Boolean updateUserProfile(HashMap<String,ArrayList<PresentableFieldInfoBean>> selectedFieldsPerCollection)
This method updates the user profile of the current user It updates the profile that is stored in CMS

Specified by:
updateUserProfile in interface UserProfileEditingService
Returns:
TRUE: if the profile is updated, else FALSE

updateXSLT

public void updateXSLT(String xsltType,
                       String schemaName,
                       String schemaValue,
                       String schemaID)
This method is used to update the XSLTs of the user in his profile

Specified by:
updateXSLT in interface UserProfileEditingService
Parameters:
xsltType - The type of xslt: Presentation or Metadata
schemaName - The name of the metadata schema
schemaValue - The name of the xslt to be used
schemaID - The id of the xslt


Copyright © 2014. All Rights Reserved.