org.gcube.portlets.user.reportgenerator.server.servlet
Class ReportServiceImpl

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

public class ReportServiceImpl
extends com.google.gwt.user.server.rpc.RemoteServiceServlet
implements ReportService

class implementing services

Author:
Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
See Also:
Serialized Form

Field Summary
static String CURRENT_REPORT_ID_ATTRIBUTE
           
static String CURRENT_REPORT_INSTANCE
           
static String PREVIOUS_REPORT_INSTANCE
           
static String RSG_WS_ADDRESS
           
 
Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
perThreadRequest, perThreadResponse
 
Constructor Summary
ReportServiceImpl()
           
 
Method Summary
 void delTemplateDir(File dir)
          recurdively delete the templates folder of the dir dir
 String getReportItemIDFromSession()
           
 String getRootFolder()
          reads from the file system and returns the user workspace as TreeNode object
 org.gcube.portlets.d4sreporting.common.shared.Table getSampleTimeSeries(org.gcube.portlets.d4sreporting.common.shared.RepTimeSeries sTS)
          return a sample of the given TS to the client
 SessionInfo getSessionInfo(String currentHost)
          each portlet instance runs in a scope each portlet instance is used by a unique username from within the portal
 String getUsername()
           
 String[] getUserTemplateNames()
          Retrieve the user saved template names
 org.gcube.portlets.d4sreporting.common.shared.Model getVMEReportRef2Associate(String id, VMETypeIdentifier refType)
           
 String getVreName()
           
 org.gcube.portlets.d4sreporting.common.shared.Model getWorkflowDocumentFromDocumentLibrary()
           
protected  org.gcube.common.homelibrary.home.workspace.Workspace getWorkspaceArea()
           
 org.gcube.portlets.d4sreporting.common.shared.Model importVMEReport(String id, String name, VMETypeIdentifier refType)
           
 org.gcube.portlets.d4sreporting.common.shared.Model importVMETemplate(VMETypeIdentifier refType)
           
 void init()
          Called then servlet is intialized
 ArrayList<VMEReportBean> listVMEReportRefByType(VMETypeIdentifier refType)
           
 ArrayList<VMEReportBean> listVMEReports()
           
 org.gcube.portlets.d4sreporting.common.shared.Model readImportedModel(String tempPath)
           
 org.gcube.portlets.d4sreporting.common.shared.Model readModel(String templateName, String templateObjectID, boolean isTemplate, boolean isImporting)
           
 org.gcube.portlets.d4sreporting.common.shared.Model readTemplateFromSession()
           
 void renewHTTPSession()
           
 void renewLock()
           
 String save(String filePath, String workspaceFolderId, String itemName, org.gcube.portlets.widgets.exporter.shared.TypeExporter type, boolean overwrite)
           
 void saveReport(org.gcube.portlets.d4sreporting.common.shared.Model toSave)
          used to save the report in the same folder
 void saveReport(org.gcube.portlets.d4sreporting.common.shared.Model toSave, String folderid, String newname)
          the report model is taken from the session
 void storeReportItemIDInSession(String reportItemid)
           
 void storeTemplateInSession(org.gcube.portlets.d4sreporting.common.shared.Model model)
           
 void updateWorkflowDocument(org.gcube.portlets.d4sreporting.common.shared.Model toSave, boolean update)
          update the Workflow Document in session
 
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

CURRENT_REPORT_ID_ATTRIBUTE

public static final String CURRENT_REPORT_ID_ATTRIBUTE
See Also:
Constant Field Values

CURRENT_REPORT_INSTANCE

public static final String CURRENT_REPORT_INSTANCE
See Also:
Constant Field Values

PREVIOUS_REPORT_INSTANCE

public static final String PREVIOUS_REPORT_INSTANCE
See Also:
Constant Field Values

RSG_WS_ADDRESS

public static final String RSG_WS_ADDRESS
See Also:
Constant Field Values
Constructor Detail

ReportServiceImpl

public ReportServiceImpl()
Method Detail

init

public void init()
Called then servlet is intialized

Overrides:
init in class javax.servlet.GenericServlet

getUserTemplateNames

public String[] getUserTemplateNames()
Retrieve the user saved template names

Specified by:
getUserTemplateNames in interface ReportService
Returns:
a String[] containing the template names

readImportedModel

public org.gcube.portlets.d4sreporting.common.shared.Model readImportedModel(String tempPath)
Specified by:
readImportedModel in interface ReportService
Returns:
a SerializableModel instance of the imported fimes xml

readModel

public org.gcube.portlets.d4sreporting.common.shared.Model readModel(String templateName,
                                                                     String templateObjectID,
                                                                     boolean isTemplate,
                                                                     boolean isImporting)
Specified by:
readModel in interface ReportService
Parameters:
templateName - : the template to read from disk
templateObjectID - the id in the basket
isTemplate - says if you're opening a template or a report
isImporting - says if your importing or youre loading a template in the UI
Returns:
a SerializableModel instance of the templatename passed as parameter

getUsername

public String getUsername()
Returns:
the shared session

getVreName

public String getVreName()
Returns:
the current scope

getWorkspaceArea

protected org.gcube.common.homelibrary.home.workspace.Workspace getWorkspaceArea()
                                                                          throws org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException,
                                                                                 org.gcube.common.homelibrary.home.exceptions.InternalErrorException,
                                                                                 org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException
Returns:
Throws:
org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException
org.gcube.common.homelibrary.home.exceptions.InternalErrorException
org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException

getRootFolder

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

Returns:
the Default folder if if there is no basket in session, else the folder in session id

readTemplateFromSession

public org.gcube.portlets.d4sreporting.common.shared.Model readTemplateFromSession()
Specified by:
readTemplateFromSession in interface ReportService
Returns:
the model previously stored in the session

delTemplateDir

public void delTemplateDir(File dir)
recurdively delete the templates folder of the dir dir

Parameters:
dir - the dir to delete

storeTemplateInSession

public void storeTemplateInSession(org.gcube.portlets.d4sreporting.common.shared.Model model)
Specified by:
storeTemplateInSession in interface ReportService
Parameters:
model - to store in the session

storeReportItemIDInSession

public void storeReportItemIDInSession(String reportItemid)
Parameters:
reportItemid - the report itemd id in basket to store in the session

getReportItemIDFromSession

public String getReportItemIDFromSession()
Returns:
the report item id in basket, or "" if doesn't exist

saveReport

public void saveReport(org.gcube.portlets.d4sreporting.common.shared.Model toSave)
used to save the report in the same folder

Specified by:
saveReport in interface ReportService

saveReport

public void saveReport(org.gcube.portlets.d4sreporting.common.shared.Model toSave,
                       String folderid,
                       String newname)
Description copied from interface: ReportService
the report model is taken from the session

Specified by:
saveReport in interface ReportService
Parameters:
save - a report in another folder .

getSampleTimeSeries

public org.gcube.portlets.d4sreporting.common.shared.Table getSampleTimeSeries(org.gcube.portlets.d4sreporting.common.shared.RepTimeSeries sTS)
return a sample of the given TS to the client

Specified by:
getSampleTimeSeries in interface ReportService
Parameters:
sTS - .
Returns:
.

getSessionInfo

public SessionInfo getSessionInfo(String currentHost)
each portlet instance runs in a scope each portlet instance is used by a unique username from within the portal

Specified by:
getSessionInfo in interface ReportService
Parameters:
currentHost - .
Returns:
a SessionInfo bean containing the username the scope andis opening a workflow document or not

getWorkflowDocumentFromDocumentLibrary

public org.gcube.portlets.d4sreporting.common.shared.Model getWorkflowDocumentFromDocumentLibrary()
Specified by:
getWorkflowDocumentFromDocumentLibrary in interface ReportService

updateWorkflowDocument

public void updateWorkflowDocument(org.gcube.portlets.d4sreporting.common.shared.Model toSave,
                                   boolean update)
update the Workflow Document in session

Specified by:
updateWorkflowDocument in interface ReportService

renewLock

public void renewLock()
Specified by:
renewLock in interface ReportService

save

public String save(String filePath,
                   String workspaceFolderId,
                   String itemName,
                   org.gcube.portlets.widgets.exporter.shared.TypeExporter type,
                   boolean overwrite)
            throws org.gcube.portlets.widgets.exporter.shared.SaveReportFileException,
                   org.gcube.portlets.widgets.exporter.shared.SaveReportFileExistException
Specified by:
save in interface ReportService
Throws:
org.gcube.portlets.widgets.exporter.shared.SaveReportFileException
org.gcube.portlets.widgets.exporter.shared.SaveReportFileExistException

renewHTTPSession

public void renewHTTPSession()
Specified by:
renewHTTPSession in interface ReportService

listVMEReports

public ArrayList<VMEReportBean> listVMEReports()
Specified by:
listVMEReports in interface ReportService

listVMEReportRefByType

public ArrayList<VMEReportBean> listVMEReportRefByType(VMETypeIdentifier refType)
Specified by:
listVMEReportRefByType in interface ReportService

importVMEReport

public org.gcube.portlets.d4sreporting.common.shared.Model importVMEReport(String id,
                                                                           String name,
                                                                           VMETypeIdentifier refType)
Specified by:
importVMEReport in interface ReportService

getVMEReportRef2Associate

public org.gcube.portlets.d4sreporting.common.shared.Model getVMEReportRef2Associate(String id,
                                                                                     VMETypeIdentifier refType)
Specified by:
getVMEReportRef2Associate in interface ReportService

importVMETemplate

public org.gcube.portlets.d4sreporting.common.shared.Model importVMETemplate(VMETypeIdentifier refType)
Specified by:
importVMETemplate in interface ReportService


Copyright © 2014. All Rights Reserved.