DocLibraryUtil (gCube Workflow Documents Manager Portlet 2.4.0-SNAPSHOT API)
Date: 2015-11-01

org.gcube.portlets.admin.wfdocviewer.server

## Class DocLibraryUtil

- java.lang.Object
- - org.gcube.portlets.admin.wfdocviewer.server.DocLibraryUtil

-     public class DocLibraryUtil
      extends Object

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static String` | `WORKFLOWS_FOLDER`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DocLibraryUtil()`

  - ### Method Summary

    Methods
    Modifier and Type | Method and Description
    --- | ---
    `static boolean` | `deleteFileFromDocLibrary(org.gcube.application.framework.core.session.ASLSession session, String workflowid)`
    `static long` | `getCompanyID()`
    `static com.liferay.portlet.documentlibrary.model.DLFileEntry` | `getFileEntry(org.gcube.application.framework.core.session.ASLSession session, String workflowid)`
    `static List<com.liferay.portlet.documentlibrary.model.DLFolder>` | `getFolders(org.gcube.application.framework.core.session.ASLSession session)`
    `static long` | `getGroupID(org.gcube.application.framework.core.session.ASLSession session)`
    `static long` | `getUserId(org.gcube.application.framework.core.session.ASLSession session)`
    `static long` | `getWfFolder(org.gcube.application.framework.core.session.ASLSession session)` check the existence of the WFFolder or create it if not exists
    `static boolean` | `wfFolderExists(org.gcube.application.framework.core.session.ASLSession session)`
    `static boolean` | `writeFileIntoDocLibrary(org.gcube.application.framework.core.session.ASLSession session, List<com.liferay.portal.model.Role> roles, org.gcube.portlets.admin.wfdocslibrary.shared.Step start, String fileName, byte[] buffer)` write the Report File (payload) into Liferay DocLibrary in the workflowdocs folder

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Field Detail

    - #### WORKFLOWS_FOLDER

          public static final String WORKFLOWS_FOLDER

      See Also:
        Constant Field Values

  - ### Constructor Detail

    - #### DocLibraryUtil

          public DocLibraryUtil()

  - ### Method Detail

    - #### writeFileIntoDocLibrary

          public static boolean writeFileIntoDocLibrary(org.gcube.application.framework.core.session.ASLSession session,
                                        List<com.liferay.portal.model.Role> roles,
                                        org.gcube.portlets.admin.wfdocslibrary.shared.Step start,
                                        String fileName,
                                        byte[] buffer)

      write the Report File (payload) into Liferay DocLibrary in the workflowdocs folder
      Parameters:
        `roles` -
        `start` - each Step contains a Map> that is needed in the writeFileIntoDocLibrary
        `fileName` -
        `buffer` - the payload as byte array

    - #### deleteFileFromDocLibrary

          public static boolean deleteFileFromDocLibrary(org.gcube.application.framework.core.session.ASLSession session,
                                         String workflowid)

      Parameters:
        `session` -
        `workflowid` -
      Returns:

    - #### getFileEntry

          public static com.liferay.portlet.documentlibrary.model.DLFileEntry getFileEntry(org.gcube.application.framework.core.session.ASLSession session,
                                                                           String workflowid)
                                                                                    throws com.liferay.portal.kernel.exception.PortalException,
                                                                                           com.liferay.portal.kernel.exception.SystemException,
                                                                                           Exception

      Parameters:
        `session` -
        `workflowid` -
      Returns:
      Throws:
        `com.liferay.portal.kernel.exception.PortalException`
        `com.liferay.portal.kernel.exception.SystemException`
        `Exception`

    - #### getWfFolder

          public static long getWfFolder(org.gcube.application.framework.core.session.ASLSession session)
                                  throws Exception

      check the existence of the WFFolder or create it if not exists
      Parameters:
        `session` -
      Returns:
        true is everything goes ok
      Throws:
        `com.liferay.portal.kernel.exception.PortalException`
        `com.liferay.portal.kernel.exception.SystemException`
        `Exception`

    - #### wfFolderExists

          public static boolean wfFolderExists(org.gcube.application.framework.core.session.ASLSession session)

      Parameters:
        `session` - the ASL Session instance
      Returns:
        true if the workflow docs exists

    - #### getGroupID

          public static long getGroupID(org.gcube.application.framework.core.session.ASLSession session)
                                 throws com.liferay.portal.kernel.exception.PortalException,
                                        com.liferay.portal.kernel.exception.SystemException

      Parameters:
        `session` -
      Returns:
      Throws:
        `com.liferay.portal.kernel.exception.PortalException`
        `com.liferay.portal.kernel.exception.SystemException`

    - #### getCompanyID

          public static long getCompanyID()
                                   throws com.liferay.portal.kernel.exception.PortalException,
                                          com.liferay.portal.kernel.exception.SystemException

      Returns:
        the company webid
      Throws:
        `com.liferay.portal.kernel.exception.PortalException`
        `com.liferay.portal.kernel.exception.SystemException`

    - #### getFolders

          public static List<com.liferay.portlet.documentlibrary.model.DLFolder> getFolders(org.gcube.application.framework.core.session.ASLSession session)
                                                                                     throws com.liferay.portal.kernel.exception.SystemException,
                                                                                            com.liferay.portal.kernel.exception.PortalException

      Parameters:
        `session` - the ASL Session instance
      Returns:
        the list of the root folders
      Throws:
        `com.liferay.portal.kernel.exception.SystemException` - .
        `com.liferay.portal.kernel.exception.PortalException` - .

    - #### getUserId

          public static long getUserId(org.gcube.application.framework.core.session.ASLSession session)

      Parameters:
        `session` - the ASL Session instance
      Returns:
        the userid in the liferay system

Copyright © 2015. All Rights Reserved.