TemplateServiceImpl (gCube Templates Portlet 4.5.0-SNAPSHOT API)
Date: 2013-12-11

org.gcube.portlets.user.templates.server

## Class TemplateServiceImpl

- java.lang.Object
- - javax.servlet.GenericServlet
  - - javax.servlet.http.HttpServlet
    - - com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet
      - - com.google.gwt.user.server.rpc.RemoteServiceServlet
        - - org.gcube.portlets.user.templates.server.TemplateServiceImpl

- All Implemented Interfaces:
    com.google.gwt.user.client.rpc.RemoteService, com.google.gwt.user.server.rpc.SerializationPolicyProvider, Serializable, javax.servlet.Servlet, javax.servlet.ServletConfig, TemplateService

      public class TemplateServiceImpl
      extends com.google.gwt.user.server.rpc.RemoteServiceServlet
      implements TemplateService

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

- - ### Field Summary

    - ### Fields inherited from class com.google.gwt.user.server.rpc.AbstractRemoteServiceServlet

      `perThreadRequest, perThreadResponse`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `TemplateServiceImpl()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `void` | `delTemplateDir(File dir)` recursively delete the templates folder of the dir dir
    `String[]` | `getUserAndScope()` 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
    `String` | `getVreName()`
    `protected org.gcube.common.homelibrary.home.workspace.Workspace` | `getWorkspaceArea()`
    `org.gcube.portlets.d4sreporting.common.shared.Model` | `readModel(String templateName, String templateObjectID, boolean isImporting)`
    `org.gcube.portlets.d4sreporting.common.shared.Model` | `readTemplateFromSession()`
    `void` | `renewHTTPSession()`
    `void` | `saveTemplate(String basketidToSaveIn, org.gcube.portlets.d4sreporting.common.shared.Model model)`
    `void` | `storeTemplateInSession(org.gcube.portlets.d4sreporting.common.shared.Model model)`

    - ### 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

    - #### TemplateServiceImpl

          public TemplateServiceImpl()

  - ### Method Detail

    - #### delTemplateDir

          public void delTemplateDir(File dir)

      recursively delete the templates folder of the dir dir
      Parameters:
        `dir` - the dir to delete

    - #### getUserAndScope

          public String[] getUserAndScope()

      each portlet instance runs in a scope each portlet instance is used by a unique username from within the portal
      Specified by:
        `getUserAndScope` in interface `TemplateService`
      Returns:
        a String[2] containing the username in [0] and the scope in [1]

    - #### getUsername

          public String getUsername()

      Returns:
        the shared session

    - #### getUserTemplateNames

          public String[] getUserTemplateNames()

      Retrieve the user saved template names
      Specified by:
        `getUserTemplateNames` in interface `TemplateService`
      Returns:
        a String[] containing the template names

    - #### getVreName

          public String getVreName()

      Returns:
        the shared session

    - #### 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:
        an instance of the user WorkspaceArea
      Throws:
        `org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException`
        `org.gcube.common.homelibrary.home.exceptions.InternalErrorException`
        `org.gcube.common.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException`
        `WorkspaceNotFoundException`
        `org.gcube.common.homelibrary.home.exceptions.InternalErrorException`
        `org.gcube.common.homelibrary.home.exceptions.HomeNotFoundException`

    - #### readModel

          public org.gcube.portlets.d4sreporting.common.shared.Model readModel(String templateName,
                                                                      String templateObjectID,
                                                                      boolean isImporting)

      Specified by:
        `readModel` in interface `TemplateService`
      Parameters:
        `templateName` - : the template to read from disk
        `isImporting` - says if your importing or youre loading a template in the UI
      Returns:
        a SerializableModel instance of the templatename passed as parameter

    - #### readTemplateFromSession

          public org.gcube.portlets.d4sreporting.common.shared.Model readTemplateFromSession()

      Specified by:
        `readTemplateFromSession` in interface `TemplateService`
      Returns:
        the model previously stored in the session

    - #### saveTemplate

          public void saveTemplate(String basketidToSaveIn,
                          org.gcube.portlets.d4sreporting.common.shared.Model model)

      Specified by:
        `saveTemplate` in interface `TemplateService`
      Parameters:
        `model` - to save

    - #### storeTemplateInSession

          public void storeTemplateInSession(org.gcube.portlets.d4sreporting.common.shared.Model model)

      Specified by:
        `storeTemplateInSession` in interface `TemplateService`
      Parameters:
        `model` - to store in the session

    - #### renewHTTPSession

          public void renewHTTPSession()

      Specified by:
        `renewHTTPSession` in interface `TemplateService`

Copyright © 2013. All Rights Reserved.