com.liferay.portlet.documentlibrary.util
Class DLUtil

java.lang.Object
  extended by com.liferay.portlet.documentlibrary.util.DLUtil

public class DLUtil
extends java.lang.Object

Author:
Brian Wing Shun Chan, Julio Camarero

Constructor Summary
DLUtil()
           
 
Method Summary
static void addPortletBreadcrumbEntries(DLFileShortcut dlFileShortcut, javax.servlet.http.HttpServletRequest request, javax.portlet.RenderResponse renderResponse)
           
static void addPortletBreadcrumbEntries(FileEntry fileEntry, javax.servlet.http.HttpServletRequest request, javax.portlet.RenderResponse renderResponse)
           
static void addPortletBreadcrumbEntries(Folder folder, javax.servlet.http.HttpServletRequest request, LiferayPortletResponse liferayPortletResponse)
           
static void addPortletBreadcrumbEntries(Folder folder, javax.servlet.http.HttpServletRequest request, javax.portlet.PortletURL portletURL)
           
static void addPortletBreadcrumbEntries(Folder folder, javax.servlet.http.HttpServletRequest request, javax.portlet.RenderResponse renderResponse)
           
static void addPortletBreadcrumbEntries(long folderId, javax.servlet.http.HttpServletRequest request, javax.portlet.RenderResponse renderResponse)
           
static int compareVersions(java.lang.String version1, java.lang.String version2)
           
static java.lang.String getAbsolutePath(javax.portlet.PortletRequest portletRequest, long folderId)
           
static java.util.Set<java.lang.String> getAllMediaGalleryMimeTypes()
           
static java.lang.String getDDMStructureKey(DLFileEntryType dlFileEntryType)
           
static java.lang.String getDDMStructureKey(java.lang.String fileEntryTypeUuid)
           
static java.lang.String getDeprecatedDDMStructureKey(DLFileEntryType dlFileEntryType)
           
static java.lang.String getDeprecatedDDMStructureKey(long fileEntryTypeId)
           
static java.lang.String getDividedPath(long id)
           
static DL getDL()
           
static java.lang.String getDLFileEntryControlPanelLink(javax.portlet.PortletRequest portletRequest, long fileEntryId)
           
static java.lang.String getDLFolderControlPanelLink(javax.portlet.PortletRequest portletRequest, long folderId)
           
static java.util.Map<java.util.Locale,java.lang.String> getEmailFileEntryAddedBodyMap(javax.portlet.PortletPreferences preferences)
           
static boolean getEmailFileEntryAddedEnabled(javax.portlet.PortletPreferences preferences)
           
static java.util.Map<java.util.Locale,java.lang.String> getEmailFileEntryAddedSubjectMap(javax.portlet.PortletPreferences preferences)
           
static java.util.Map<java.util.Locale,java.lang.String> getEmailFileEntryUpdatedBodyMap(javax.portlet.PortletPreferences preferences)
           
static boolean getEmailFileEntryUpdatedEnabled(javax.portlet.PortletPreferences preferences)
           
static java.util.Map<java.util.Locale,java.lang.String> getEmailFileEntryUpdatedSubjectMap(javax.portlet.PortletPreferences preferences)
           
static java.lang.String getEmailFromAddress(javax.portlet.PortletPreferences preferences, long companyId)
           
static java.lang.String getEmailFromName(javax.portlet.PortletPreferences preferences, long companyId)
           
static java.util.List<java.lang.Object> getEntries(Hits hits)
           
static java.lang.String getFileEntryImage(FileEntry fileEntry, ThemeDisplay themeDisplay)
           
static java.util.Set<java.lang.Long> getFileEntryTypeSubscriptionClassPKs(long userId)
           
static java.lang.String getFileIcon(java.lang.String extension)
           
static java.lang.String getGenericName(java.lang.String extension)
           
static java.lang.String getImagePreviewURL(FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay)
           
static java.lang.String getImagePreviewURL(FileEntry fileEntry, ThemeDisplay themeDisplay)
           
static java.lang.String[] getMediaGalleryMimeTypes(javax.portlet.PortletPreferences portletPreferences, javax.portlet.PortletRequest portletRequest)
           
static java.lang.String getPreviewURL(FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay, java.lang.String queryString)
           
static java.lang.String getPreviewURL(FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay, java.lang.String queryString, boolean appendToken)
          Deprecated. As of 6.2.0, replaced by getPreviewURL(FileEntry, FileVersion, ThemeDisplay, String, boolean, boolean)
static java.lang.String getPreviewURL(FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay, java.lang.String queryString, boolean appendVersion, boolean absoluteURL)
           
static OrderByComparator getRepositoryModelOrderByComparator(java.lang.String orderByCol, java.lang.String orderByType)
           
static java.lang.String getTempFileId(long id, java.lang.String version)
           
static java.lang.String getTempFileId(long id, java.lang.String version, java.lang.String languageId)
           
static java.lang.String getThumbnailSrc(FileEntry fileEntry, DLFileShortcut dlFileShortcut, ThemeDisplay themeDisplay)
           
static java.lang.String getThumbnailSrc(FileEntry fileEntry, FileVersion fileVersion, DLFileShortcut dlFileShortcut, ThemeDisplay themeDisplay)
           
static java.lang.String getThumbnailStyle()
           
static java.lang.String getThumbnailStyle(boolean max, int margin)
           
static java.lang.String getTitleWithExtension(FileEntry fileEntry)
           
static java.lang.String getTitleWithExtension(java.lang.String title, java.lang.String extension)
           
static java.lang.String getWebDavURL(ThemeDisplay themeDisplay, Folder folder, FileEntry fileEntry)
           
static java.lang.String getWebDavURL(ThemeDisplay themeDisplay, Folder folder, FileEntry fileEntry, boolean manualCheckInRequired)
           
static java.lang.String getWebDavURL(ThemeDisplay themeDisplay, Folder folder, FileEntry fileEntry, boolean manualCheckInRequired, boolean officeExtensionRequired)
           
static boolean hasWorkflowDefinitionLink(long companyId, long groupId, long folderId, long fileEntryTypeId)
           
static boolean isAutoGeneratedDLFileEntryTypeDDMStructureKey(java.lang.String ddmStructureKey)
           
static boolean isOfficeExtension(java.lang.String extension)
           
static boolean isSubscribedToFileEntryType(long companyId, long groupId, long userId, long fileEntryTypeId)
           
static boolean isSubscribedToFolder(long companyId, long groupId, long userId, long folderId)
           
static boolean isSubscribedToFolder(long companyId, long groupId, long userId, long folderId, boolean recursive)
           
static boolean isValidVersion(java.lang.String version)
           
 void setDL(DL dl)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DLUtil

public DLUtil()
Method Detail

addPortletBreadcrumbEntries

public static void addPortletBreadcrumbEntries(DLFileShortcut dlFileShortcut,
                                               javax.servlet.http.HttpServletRequest request,
                                               javax.portlet.RenderResponse renderResponse)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

addPortletBreadcrumbEntries

public static void addPortletBreadcrumbEntries(FileEntry fileEntry,
                                               javax.servlet.http.HttpServletRequest request,
                                               javax.portlet.RenderResponse renderResponse)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

addPortletBreadcrumbEntries

public static void addPortletBreadcrumbEntries(Folder folder,
                                               javax.servlet.http.HttpServletRequest request,
                                               LiferayPortletResponse liferayPortletResponse)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

addPortletBreadcrumbEntries

public static void addPortletBreadcrumbEntries(Folder folder,
                                               javax.servlet.http.HttpServletRequest request,
                                               javax.portlet.PortletURL portletURL)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

addPortletBreadcrumbEntries

public static void addPortletBreadcrumbEntries(Folder folder,
                                               javax.servlet.http.HttpServletRequest request,
                                               javax.portlet.RenderResponse renderResponse)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

addPortletBreadcrumbEntries

public static void addPortletBreadcrumbEntries(long folderId,
                                               javax.servlet.http.HttpServletRequest request,
                                               javax.portlet.RenderResponse renderResponse)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

compareVersions

public static int compareVersions(java.lang.String version1,
                                  java.lang.String version2)

getAbsolutePath

public static java.lang.String getAbsolutePath(javax.portlet.PortletRequest portletRequest,
                                               long folderId)
                                        throws PortalException,
                                               SystemException
Throws:
PortalException
SystemException

getAllMediaGalleryMimeTypes

public static java.util.Set<java.lang.String> getAllMediaGalleryMimeTypes()

getDDMStructureKey

public static java.lang.String getDDMStructureKey(DLFileEntryType dlFileEntryType)

getDDMStructureKey

public static java.lang.String getDDMStructureKey(java.lang.String fileEntryTypeUuid)

getDeprecatedDDMStructureKey

public static java.lang.String getDeprecatedDDMStructureKey(DLFileEntryType dlFileEntryType)

getDeprecatedDDMStructureKey

public static java.lang.String getDeprecatedDDMStructureKey(long fileEntryTypeId)

getDividedPath

public static java.lang.String getDividedPath(long id)

getDL

public static DL getDL()

getDLFileEntryControlPanelLink

public static java.lang.String getDLFileEntryControlPanelLink(javax.portlet.PortletRequest portletRequest,
                                                              long fileEntryId)
                                                       throws PortalException,
                                                              SystemException
Throws:
PortalException
SystemException

getDLFolderControlPanelLink

public static java.lang.String getDLFolderControlPanelLink(javax.portlet.PortletRequest portletRequest,
                                                           long folderId)
                                                    throws PortalException,
                                                           SystemException
Throws:
PortalException
SystemException

getEmailFileEntryAddedBodyMap

public static java.util.Map<java.util.Locale,java.lang.String> getEmailFileEntryAddedBodyMap(javax.portlet.PortletPreferences preferences)

getEmailFileEntryAddedEnabled

public static boolean getEmailFileEntryAddedEnabled(javax.portlet.PortletPreferences preferences)

getEmailFileEntryAddedSubjectMap

public static java.util.Map<java.util.Locale,java.lang.String> getEmailFileEntryAddedSubjectMap(javax.portlet.PortletPreferences preferences)

getEmailFileEntryUpdatedBodyMap

public static java.util.Map<java.util.Locale,java.lang.String> getEmailFileEntryUpdatedBodyMap(javax.portlet.PortletPreferences preferences)

getEmailFileEntryUpdatedEnabled

public static boolean getEmailFileEntryUpdatedEnabled(javax.portlet.PortletPreferences preferences)

getEmailFileEntryUpdatedSubjectMap

public static java.util.Map<java.util.Locale,java.lang.String> getEmailFileEntryUpdatedSubjectMap(javax.portlet.PortletPreferences preferences)

getEmailFromAddress

public static java.lang.String getEmailFromAddress(javax.portlet.PortletPreferences preferences,
                                                   long companyId)
                                            throws SystemException
Throws:
SystemException

getEmailFromName

public static java.lang.String getEmailFromName(javax.portlet.PortletPreferences preferences,
                                                long companyId)
                                         throws SystemException
Throws:
SystemException

getEntries

public static java.util.List<java.lang.Object> getEntries(Hits hits)

getFileEntryImage

public static java.lang.String getFileEntryImage(FileEntry fileEntry,
                                                 ThemeDisplay themeDisplay)

getFileEntryTypeSubscriptionClassPKs

public static java.util.Set<java.lang.Long> getFileEntryTypeSubscriptionClassPKs(long userId)
                                                                          throws SystemException
Throws:
SystemException

getFileIcon

public static java.lang.String getFileIcon(java.lang.String extension)

getGenericName

public static java.lang.String getGenericName(java.lang.String extension)

getImagePreviewURL

public static java.lang.String getImagePreviewURL(FileEntry fileEntry,
                                                  FileVersion fileVersion,
                                                  ThemeDisplay themeDisplay)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

getImagePreviewURL

public static java.lang.String getImagePreviewURL(FileEntry fileEntry,
                                                  ThemeDisplay themeDisplay)
                                           throws java.lang.Exception
Throws:
java.lang.Exception

getMediaGalleryMimeTypes

public static java.lang.String[] getMediaGalleryMimeTypes(javax.portlet.PortletPreferences portletPreferences,
                                                          javax.portlet.PortletRequest portletRequest)

getPreviewURL

public static java.lang.String getPreviewURL(FileEntry fileEntry,
                                             FileVersion fileVersion,
                                             ThemeDisplay themeDisplay,
                                             java.lang.String queryString)

getPreviewURL

public static java.lang.String getPreviewURL(FileEntry fileEntry,
                                             FileVersion fileVersion,
                                             ThemeDisplay themeDisplay,
                                             java.lang.String queryString,
                                             boolean appendToken)
Deprecated. As of 6.2.0, replaced by getPreviewURL(FileEntry, FileVersion, ThemeDisplay, String, boolean, boolean)


getPreviewURL

public static java.lang.String getPreviewURL(FileEntry fileEntry,
                                             FileVersion fileVersion,
                                             ThemeDisplay themeDisplay,
                                             java.lang.String queryString,
                                             boolean appendVersion,
                                             boolean absoluteURL)

getRepositoryModelOrderByComparator

public static OrderByComparator getRepositoryModelOrderByComparator(java.lang.String orderByCol,
                                                                    java.lang.String orderByType)

getTempFileId

public static java.lang.String getTempFileId(long id,
                                             java.lang.String version)

getTempFileId

public static java.lang.String getTempFileId(long id,
                                             java.lang.String version,
                                             java.lang.String languageId)

getThumbnailSrc

public static java.lang.String getThumbnailSrc(FileEntry fileEntry,
                                               DLFileShortcut dlFileShortcut,
                                               ThemeDisplay themeDisplay)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

getThumbnailSrc

public static java.lang.String getThumbnailSrc(FileEntry fileEntry,
                                               FileVersion fileVersion,
                                               DLFileShortcut dlFileShortcut,
                                               ThemeDisplay themeDisplay)
                                        throws java.lang.Exception
Throws:
java.lang.Exception

getThumbnailStyle

public static java.lang.String getThumbnailStyle()
                                          throws java.lang.Exception
Throws:
java.lang.Exception

getThumbnailStyle

public static java.lang.String getThumbnailStyle(boolean max,
                                                 int margin)
                                          throws java.lang.Exception
Throws:
java.lang.Exception

getTitleWithExtension

public static java.lang.String getTitleWithExtension(FileEntry fileEntry)

getTitleWithExtension

public static java.lang.String getTitleWithExtension(java.lang.String title,
                                                     java.lang.String extension)

getWebDavURL

public static java.lang.String getWebDavURL(ThemeDisplay themeDisplay,
                                            Folder folder,
                                            FileEntry fileEntry)
                                     throws PortalException,
                                            SystemException
Throws:
PortalException
SystemException

getWebDavURL

public static java.lang.String getWebDavURL(ThemeDisplay themeDisplay,
                                            Folder folder,
                                            FileEntry fileEntry,
                                            boolean manualCheckInRequired)
                                     throws PortalException,
                                            SystemException
Throws:
PortalException
SystemException

getWebDavURL

public static java.lang.String getWebDavURL(ThemeDisplay themeDisplay,
                                            Folder folder,
                                            FileEntry fileEntry,
                                            boolean manualCheckInRequired,
                                            boolean officeExtensionRequired)
                                     throws PortalException,
                                            SystemException
Throws:
PortalException
SystemException

hasWorkflowDefinitionLink

public static boolean hasWorkflowDefinitionLink(long companyId,
                                                long groupId,
                                                long folderId,
                                                long fileEntryTypeId)
                                         throws java.lang.Exception
Throws:
java.lang.Exception

isAutoGeneratedDLFileEntryTypeDDMStructureKey

public static boolean isAutoGeneratedDLFileEntryTypeDDMStructureKey(java.lang.String ddmStructureKey)

isOfficeExtension

public static boolean isOfficeExtension(java.lang.String extension)

isSubscribedToFileEntryType

public static boolean isSubscribedToFileEntryType(long companyId,
                                                  long groupId,
                                                  long userId,
                                                  long fileEntryTypeId)
                                           throws SystemException
Throws:
SystemException

isSubscribedToFolder

public static boolean isSubscribedToFolder(long companyId,
                                           long groupId,
                                           long userId,
                                           long folderId)
                                    throws PortalException,
                                           SystemException
Throws:
PortalException
SystemException

isSubscribedToFolder

public static boolean isSubscribedToFolder(long companyId,
                                           long groupId,
                                           long userId,
                                           long folderId,
                                           boolean recursive)
                                    throws PortalException,
                                           SystemException
Throws:
PortalException
SystemException

isValidVersion

public static boolean isValidVersion(java.lang.String version)

setDL

public void setDL(DL dl)