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

java.lang.Object
  extended by org.gcube.portlets.user.reportgenerator.server.servlet.DocLibraryUtil

public class DocLibraryUtil
extends Object


Field Summary
static String WORKFLOWS_FOLDER
           
 
Constructor Summary
DocLibraryUtil()
           
 
Method Summary
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 InputStream getFileEntryAsStream(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 String[] getPermissionsFromWfStep(com.liferay.portal.model.Role role, org.gcube.portlets.admin.wfdocslibrary.shared.Step step)
           
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 com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileIntoDocLibrary(org.gcube.application.framework.core.session.ASLSession session, String workflowid, byte[] buffer)
           
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

updateFileIntoDocLibrary

public static com.liferay.portlet.documentlibrary.model.DLFileEntry updateFileIntoDocLibrary(org.gcube.application.framework.core.session.ASLSession session,
                                                                                             String workflowid,
                                                                                             byte[] buffer)

deleteFileFromDocLibrary

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

getFileEntryAsStream

public static InputStream getFileEntryAsStream(org.gcube.application.framework.core.session.ASLSession session,
                                               String workflowid)
                                        throws Exception
Parameters:
session -
workflowid -
Returns:
Throws:
Exception
com.liferay.portal.kernel.exception.SystemException
com.liferay.portal.kernel.exception.PortalException

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
Throws:
com.liferay.portal.kernel.exception.PortalException
com.liferay.portal.kernel.exception.SystemException
Exception

getPermissionsFromWfStep

public static String[] getPermissionsFromWfStep(com.liferay.portal.model.Role role,
                                                org.gcube.portlets.admin.wfdocslibrary.shared.Step step)
Parameters:
role - is the liferay role, for convention is created as ROLENAME_WFID e.g. EDITOR_123
step - containts the permissions attached to each role (just the name, e.g. EDITOR)
Returns:
the permissions to apply

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 © 2014. All Rights Reserved.