org.gcube.portlets.user.results.server.servlet
Class NewresultsetServiceImpl

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.results.server.servlet.NewresultsetServiceImpl
All Implemented Interfaces:
com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, ResultsetService

public class NewresultsetServiceImpl
extends com.google.gwt.user.server.rpc.RemoteServiceServlet
implements ResultsetService

The NewresultsetServiceImpl Implementation of the services for the portlet

Version:
May 2012 (2.0)
Author:
Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
See Also:
Serialized Form

Field Summary
static String ANN_COLS_SCOPED_IDS_ATTRIBUTE_NAME
           
static String CURRENT_OPEN_BASKET_ATTRIBUTE_NAME
           
static String CURRENT_QUERY
           
static String CURRENT_RESULTS_NO
           
protected static Date lastCall
          used to avoid multiple IS request for the Storage EPR discovery, if multiple request come within 1 minute it uses the same EPR
static String RESULTS_PER_PAGE_ATTRIBUTE_NAME
           
protected  String SERVICE_URI
          used to avoid multiple IS request for the Storage EPR discovery, if multiple request come within 1 minute it uses the same EPR
static String WORKSPACE_AREA_ATTRIBUTE_NAME
           
 
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse
 
Constructor Summary
NewresultsetServiceImpl()
           
 
Method Summary
 void decreaseStartingPoint()
           
 List<BasketModelItem> getBasketContent(String basketId)
           
 String[] getCollectionNames()
          If you have search for each collection, you request the available collection names in order to present them in the drop down menu.
 String getDefaultBasket()
          reads from the file system and returns the user workspace as TreeNode object returns the Default basket if if there is no basket in session, else the basket in session id
 Client_DigiObjectInfo getDigitalObjectInitialInfo(int currPosition)
          used to get the additional info for the digital objects,
 String getObjectsPayload(String objectURI)
           
 QueryDescriptor getQueryDescFromSession()
           
protected  String getRealPath()
           
 ResultsContainer getResultFromSearchService(int mode)
          Queries the search service and get the results
 ResultsContainer getResultsFromSession()
          reads the records from the session
 ResultNumber getResultsNo()
           
protected  org.gcube.portlets.user.homelibrary.home.workspace.Workspace getWorkspaceArea()
          read the external links from the session, transform the ones that matches the properties file into the actual links to use for redirecting
 TreeNode getWorkspaceTree()
          reads from the file system and returns the user workspace as TreeNode object
 void increaseStartingPoint()
           
 void init()
          
 boolean isSearchActive()
          Check whether the porlet has been loaded after a search or not
 void loadResults(String qid)
          Changes the internal query (in the query group) to be presented - based on collection name
 BasketSerializable readBasketFromSession()
          need to get the saved elements from HL and the new elements from the session
 Boolean removeBasketItemFromSession(BasketModelItem item)
          remove a single item in session
 Integer retrieveStartingPoint()
          From where in the results to start presenting
 boolean saveBasket()
          Calls the home library to save the current basket in session permanently *
protected  void storeBasketInSession(BasketSerializable basket)
           
 Boolean storeBasketItemInSession(BasketModelItem item)
          add a single item in session
 void storeStartingPoint(Integer start)
          From where in the results to start presenting
 void submitSimpleQuery(String queryTerm)
           
 
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, log, log
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

WORKSPACE_AREA_ATTRIBUTE_NAME

public static final String WORKSPACE_AREA_ATTRIBUTE_NAME
See Also:
Constant Field Values

CURRENT_OPEN_BASKET_ATTRIBUTE_NAME

public static final String CURRENT_OPEN_BASKET_ATTRIBUTE_NAME
See Also:
Constant Field Values

ANN_COLS_SCOPED_IDS_ATTRIBUTE_NAME

public static final String ANN_COLS_SCOPED_IDS_ATTRIBUTE_NAME
See Also:
Constant Field Values

CURRENT_QUERY

public static final String CURRENT_QUERY
See Also:
Constant Field Values

CURRENT_RESULTS_NO

public static final String CURRENT_RESULTS_NO
See Also:
Constant Field Values

RESULTS_PER_PAGE_ATTRIBUTE_NAME

public static final String RESULTS_PER_PAGE_ATTRIBUTE_NAME
See Also:
Constant Field Values

lastCall

protected static Date lastCall
used to avoid multiple IS request for the Storage EPR discovery, if multiple request come within 1 minute it uses the same EPR


SERVICE_URI

protected String SERVICE_URI
used to avoid multiple IS request for the Storage EPR discovery, if multiple request come within 1 minute it uses the same EPR

Constructor Detail

NewresultsetServiceImpl

public NewresultsetServiceImpl()
Method Detail

decreaseStartingPoint

public void decreaseStartingPoint()

getBasketContent

public List<BasketModelItem> getBasketContent(String basketId)
Specified by:
getBasketContent in interface ResultsetService
Returns:

getCollectionNames

public String[] getCollectionNames()
If you have search for each collection, you request the available collection names in order to present them in the drop down menu.

Specified by:
getCollectionNames in interface ResultsetService
Returns:

getQueryDescFromSession

public QueryDescriptor getQueryDescFromSession()
Specified by:
getQueryDescFromSession in interface ResultsetService
Parameters:
querDescription - the query description
Returns:

getDefaultBasket

public String getDefaultBasket()
reads from the file system and returns the user workspace as TreeNode object returns the Default basket if if there is no basket in session, else the basket in session id

Specified by:
getDefaultBasket in interface ResultsetService
Returns:
the default basket

getDigitalObjectInitialInfo

public Client_DigiObjectInfo getDigitalObjectInitialInfo(int currPosition)
used to get the additional info for the digital objects,

Specified by:
getDigitalObjectInitialInfo in interface ResultsetService
Parameters:
currPosition - in resultset object's mime type object's length (in bytes) amount of available annotations
Returns:
additional info (name, MimeType.....)

getResultFromSearchService

public ResultsContainer getResultFromSearchService(int mode)
Queries the search service and get the results

Specified by:
getResultFromSearchService in interface ResultsetService
Parameters:
mode - if mode == 0 get the first record of the resultset, mode == 1 get the previous, mode = 2 get the next
Returns:
a Vector containing the html representation of each record.

getObjectsPayload

public String getObjectsPayload(String objectURI)
Specified by:
getObjectsPayload in interface ResultsetService

getResultsFromSession

public ResultsContainer getResultsFromSession()
reads the records from the session

Specified by:
getResultsFromSession in interface ResultsetService
Returns:
A ResultsContainer (Vector, Optional paramters) which contains all the information

getWorkspaceArea

protected org.gcube.portlets.user.homelibrary.home.workspace.Workspace getWorkspaceArea()
                                                                                 throws org.gcube.portlets.user.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException,
                                                                                        org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException,
                                                                                        org.gcube.portlets.user.homelibrary.home.exceptions.HomeNotFoundException
read the external links from the session, transform the ones that matches the properties file into the actual links to use for redirecting

Returns:
the HashMap containing the external links for the existent portlets
Throws:
org.gcube.portlets.user.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException
org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException
org.gcube.portlets.user.homelibrary.home.exceptions.HomeNotFoundException

getWorkspaceTree

public TreeNode getWorkspaceTree()
reads from the file system and returns the user workspace as TreeNode object

Specified by:
getWorkspaceTree in interface ResultsetService
Returns:

increaseStartingPoint

public void increaseStartingPoint()

init

public void init()

Overrides:
init in class javax.servlet.GenericServlet

isSearchActive

public boolean isSearchActive()
Check whether the porlet has been loaded after a search or not

Specified by:
isSearchActive in interface ResultsetService
Returns:
true if the user performed a search, false otherwise

loadResults

public void loadResults(String qid)
Changes the internal query (in the query group) to be presented - based on collection name

Specified by:
loadResults in interface ResultsetService
Parameters:
qid - .

readBasketFromSession

public BasketSerializable readBasketFromSession()
need to get the saved elements from HL and the new elements from the session

Specified by:
readBasketFromSession in interface ResultsetService
Parameters:
basket -
Returns:

removeBasketItemFromSession

public Boolean removeBasketItemFromSession(BasketModelItem item)
remove a single item in session

Specified by:
removeBasketItemFromSession in interface ResultsetService
Parameters:
item - TODO: check if any error
Returns:
remove result

retrieveStartingPoint

public Integer retrieveStartingPoint()
From where in the results to start presenting


saveBasket

public boolean saveBasket()
Calls the home library to save the current basket in session permanently *

Specified by:
saveBasket in interface ResultsetService

storeBasketInSession

protected void storeBasketInSession(BasketSerializable basket)
Parameters:
basket -

storeBasketItemInSession

public Boolean storeBasketItemInSession(BasketModelItem item)
add a single item in session

Specified by:
storeBasketItemInSession in interface ResultsetService
Parameters:
item - TODO: check if any error

storeStartingPoint

public void storeStartingPoint(Integer start)
From where in the results to start presenting


getResultsNo

public ResultNumber getResultsNo()
Specified by:
getResultsNo in interface ResultsetService
Returns:
a ResultNumber instance containing the num of results found so far plus a boolean that say if is still counting or not

submitSimpleQuery

public void submitSimpleQuery(String queryTerm)
Specified by:
submitSimpleQuery in interface ResultsetService
Parameters:
queryTerm - the query term to search

getRealPath

protected String getRealPath()


Copyright © 2013. All Rights Reserved.