ServiceUtil (gCube Document Reporting Library 3.0.4-SNAPSHOT API)
Date: 2013-02-26

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.gcube.portlets.d4sreporting.common.server
Class ServiceUtil

    java.lang.Object
      org.gcube.portlets.d4sreporting.common.server.ServiceUtil

    public class ServiceUtil

extends Object

`ServiceUtil` contains utility methods for the servlet SERVICES

Author:
  Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it

Constructor Summary
`ServiceUtil(org.gcube.application.framework.core.session.ASLSession session)`

Method Summary
`void` | `copyFile(File from, File to, String folder)` just copies files using buffered input stream
`org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder` | `getReportsFolder(org.gcube.application.framework.core.session.ASLSession session)`
`String` | `getReportsPath(String templateName, String currentDL, String currentUser)` Return the server path of the templatename passed
`String` | `getTemplateFolder(String currentDL, String currentUser)` return the user template folder
`String` | `getTemplatePath(String templateName, String currentDL, String currentUser)` Return the server path of the templatename passed
`protected org.gcube.portlets.user.homelibrary.home.workspace.Workspace` | `getWorkspaceArea(org.gcube.application.framework.core.session.ASLSession session)`
`SerializableModel` | `readRawModel(String pathToModel)`
`boolean` | `writeModel(SerializableModel model, String templateName, String currentDL, String currentUser)`

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### ServiceUtil

    public ServiceUtil(org.gcube.application.framework.core.session.ASLSession session)

Method Detail

### getReportsFolder

    public org.gcube.portlets.user.homelibrary.home.workspace.WorkspaceFolder getReportsFolder(org.gcube.application.framework.core.session.ASLSession session)
                                                                                        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

  Parameters:
    `session` - the ASL session
  Returns:
    the reports workspace folder
  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` - .

### getWorkspaceArea

    protected org.gcube.portlets.user.homelibrary.home.workspace.Workspace getWorkspaceArea(org.gcube.application.framework.core.session.ASLSession session)
                                                                                     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

  Returns:
    an instance of the user WorkspaceArea
  Throws:
    `org.gcube.portlets.user.homelibrary.home.exceptions.HomeNotFoundException`
    `org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException`
    `org.gcube.portlets.user.homelibrary.home.workspace.exceptions.WorkspaceFolderNotFoundException`
    `WorkspaceNotFoundException`
    `org.gcube.portlets.user.homelibrary.home.exceptions.InternalErrorException`
    `org.gcube.portlets.user.homelibrary.home.exceptions.HomeNotFoundException`

### getTemplatePath

    public String getTemplatePath(String templateName,
                                  String currentDL,
                                  String currentUser)

  Return the server path of the templatename passed

  Parameters:
    `templateName` - .
    `currentDL` - .
    `currentUser` - .
  Returns:
    .

### getReportsPath

    public String getReportsPath(String templateName,
                                 String currentDL,
                                 String currentUser)

  Return the server path of the templatename passed

  Parameters:
    `templateName` - .
    `currentDL` - .
    `currentUser` - .
  Returns:
    .

### getTemplateFolder

    public String getTemplateFolder(String currentDL,
                                    String currentUser)

  return the user template folder

  Parameters:
    `templateName` -
    `currentDL` - .
    `currentUser` - .
  Returns:
    .

### writeModel

    public boolean writeModel(SerializableModel model,
                              String templateName,
                              String currentDL,
                              String currentUser)

  Parameters:
    `gwtModel` - .
    `templateName` - .
    `currentDL` - .
    `currentUser` - .
  Returns:
    true if everything's fine

### readRawModel

    public SerializableModel readRawModel(String pathToModel)

  Parameters:
    `pathToModel` - e.g. /home/massi/templates/massimiliano.assante/PROVA1/PROVA1.d4st
  Returns:
    the Model Instance

### copyFile

    public void copyFile(File from,
                         File to,
                         String folder)
                  throws Exception

  just copies files using buffered input stream

  Parameters:
    `from` - .
    `to` - .
    `folder` - the folder in which the image has to be copied, (it creates it if not exist)
  Throws:
    `Exception` - .

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

Copyright © 2013. All Rights Reserved.