org.gcube.portlets.user.workflowdocuments.server
Class DocLibraryUtil

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

public class DocLibraryUtil
extends Object


Field Summary
static String WF_DOCUMENT_EXTENSION
           
static String WORKFLOWS_FOLDER
           
 
Constructor Summary
DocLibraryUtil()
           
 
Method Summary
static long getCompanyID()
           
static String getFileNameWithoutExt(String fileTitle)
           
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 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

WF_DOCUMENT_EXTENSION

public static String WF_DOCUMENT_EXTENSION
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

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

getFileNameWithoutExt

public static String getFileNameWithoutExt(String fileTitle)
Parameters:
fileTitle -
Returns:

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