diff --git a/modules/apps/document-library/document-library-service/src/main/java/com/liferay/document/library/internal/helper/DLURLHelperImpl.java b/modules/apps/document-library/document-library-service/src/main/java/com/liferay/document/library/internal/helper/DLURLHelperImpl.java index 4cfc7505d852f2..a3733a08c91354 100644 --- a/modules/apps/document-library/document-library-service/src/main/java/com/liferay/document/library/internal/helper/DLURLHelperImpl.java +++ b/modules/apps/document-library/document-library-service/src/main/java/com/liferay/document/library/internal/helper/DLURLHelperImpl.java @@ -11,7 +11,6 @@ import com.liferay.document.library.kernel.processor.PDFProcessorUtil; import com.liferay.document.library.kernel.processor.VideoProcessorUtil; import com.liferay.document.library.kernel.service.DLAppLocalService; -import com.liferay.document.library.kernel.util.DL; import com.liferay.document.library.service.DLFileVersionPreviewLocalService; import com.liferay.document.library.url.provider.DLFileVersionURLProvider; import com.liferay.document.library.util.DLURLHelper; @@ -39,6 +38,7 @@ import com.liferay.portal.kernel.util.URLCodec; import com.liferay.portal.kernel.util.Validator; import com.liferay.portal.util.PropsValues; +import com.liferay.portlet.documentlibrary.util.DLUtil; import com.liferay.portlet.documentlibrary.webdav.DLWebDAVUtil; import com.liferay.trash.TrashHelper; @@ -326,7 +326,7 @@ public String getWebDavURL( webDavURLSB.append("/webdav"); if (manualCheckInRequired) { - webDavURLSB.append(DL.MANUAL_CHECK_IN_REQUIRED_PATH); + webDavURLSB.append(DLUtil.MANUAL_CHECK_IN_REQUIRED_PATH); } Group group = null; diff --git a/modules/apps/document-library/document-library-web/src/main/java/com/liferay/document/library/web/internal/webdav/DLWebDAVStorageImpl.java b/modules/apps/document-library/document-library-web/src/main/java/com/liferay/document/library/web/internal/webdav/DLWebDAVStorageImpl.java index 206e7f6b74c364..97cfdc13c54d61 100644 --- a/modules/apps/document-library/document-library-web/src/main/java/com/liferay/document/library/web/internal/webdav/DLWebDAVStorageImpl.java +++ b/modules/apps/document-library/document-library-web/src/main/java/com/liferay/document/library/web/internal/webdav/DLWebDAVStorageImpl.java @@ -30,7 +30,6 @@ import com.liferay.document.library.kernel.service.DLFileEntryTypeLocalService; import com.liferay.document.library.kernel.service.DLFileVersionLocalService; import com.liferay.document.library.kernel.service.DLTrashService; -import com.liferay.document.library.kernel.util.DL; import com.liferay.document.library.util.DLFileEntryTypeUtil; import com.liferay.document.library.web.internal.helper.DLTrashHelper; import com.liferay.dynamic.data.mapping.kernel.DDMFormValues; @@ -71,6 +70,7 @@ import com.liferay.portal.webdav.BaseWebDAVStorageImpl; import com.liferay.portal.webdav.LockException; import com.liferay.portal.webdav.WebDAVUtil; +import com.liferay.portlet.documentlibrary.util.DLUtil; import com.liferay.portlet.documentlibrary.webdav.DLFileEntryResourceImpl; import com.liferay.portlet.documentlibrary.webdav.DLWebDAVUtil; @@ -467,7 +467,7 @@ public Status lockResource( DLFileEntry.class.getName(), webDAVRequest); serviceContext.setAttribute( - DL.MANUAL_CHECK_IN_REQUIRED, + DLUtil.MANUAL_CHECK_IN_REQUIRED, webDAVRequest.isManualCheckInRequired()); _populateServiceContext(serviceContext, fileEntry); @@ -902,7 +902,7 @@ public boolean unlockResource(WebDAVRequest webDAVRequest, String token) DLFileEntry.class.getName(), webDAVRequest); serviceContext.setAttribute( - DL.WEBDAV_CHECK_IN_MODE, Boolean.TRUE); + DLUtil.WEBDAV_CHECK_IN_MODE, Boolean.TRUE); _dlAppService.checkInFileEntry( fileEntry.getFileEntryId(), token, serviceContext); diff --git a/portal-impl/src/com/liferay/portal/repository/BaseRepositoryImpl.java b/portal-impl/src/com/liferay/portal/repository/BaseRepositoryImpl.java index c8e53955c77fd3..bdc15b97ca2cdc 100644 --- a/portal-impl/src/com/liferay/portal/repository/BaseRepositoryImpl.java +++ b/portal-impl/src/com/liferay/portal/repository/BaseRepositoryImpl.java @@ -9,7 +9,6 @@ import com.liferay.document.library.kernel.model.DLVersionNumberIncrease; import com.liferay.document.library.kernel.service.DLAppHelperLocalService; import com.liferay.document.library.kernel.service.DLFolderLocalService; -import com.liferay.document.library.kernel.util.DL; import com.liferay.portal.kernel.exception.NoSuchRepositoryEntryException; import com.liferay.portal.kernel.exception.PortalException; import com.liferay.portal.kernel.exception.SystemException; @@ -34,6 +33,7 @@ import com.liferay.portal.kernel.util.GetterUtil; import com.liferay.portal.kernel.util.OrderByComparator; import com.liferay.portal.kernel.util.UnicodeProperties; +import com.liferay.portlet.documentlibrary.util.DLUtil; import java.io.File; import java.io.FileInputStream; @@ -433,7 +433,7 @@ protected void clearManualCheckInRequired( throws NoSuchRepositoryEntryException { boolean webDAVCheckInMode = GetterUtil.getBoolean( - serviceContext.getAttribute(DL.WEBDAV_CHECK_IN_MODE)); + serviceContext.getAttribute(DLUtil.WEBDAV_CHECK_IN_MODE)); if (webDAVCheckInMode) { return; @@ -467,7 +467,7 @@ protected void setManualCheckInRequired( throws NoSuchRepositoryEntryException { if (!GetterUtil.getBoolean( - serviceContext.getAttribute(DL.MANUAL_CHECK_IN_REQUIRED))) { + serviceContext.getAttribute(DLUtil.MANUAL_CHECK_IN_REQUIRED))) { return; } diff --git a/portal-impl/src/com/liferay/portal/webdav/WebDAVUtil.java b/portal-impl/src/com/liferay/portal/webdav/WebDAVUtil.java index a6127bb9b59495..f248771fa57f04 100644 --- a/portal-impl/src/com/liferay/portal/webdav/WebDAVUtil.java +++ b/portal-impl/src/com/liferay/portal/webdav/WebDAVUtil.java @@ -5,7 +5,6 @@ package com.liferay.portal.webdav; -import com.liferay.document.library.kernel.util.DL; import com.liferay.osgi.service.tracker.collections.map.ServiceTrackerMap; import com.liferay.osgi.service.tracker.collections.map.ServiceTrackerMapFactory; import com.liferay.petra.string.CharPool; @@ -34,6 +33,7 @@ import com.liferay.portal.kernel.webdav.WebDAVStorage; import com.liferay.portal.kernel.xml.Namespace; import com.liferay.portal.kernel.xml.SAXReaderUtil; +import com.liferay.portlet.documentlibrary.util.DLUtil; import java.util.ArrayList; import java.util.Collection; @@ -308,11 +308,11 @@ public static boolean isOverwrite(HttpServletRequest httpServletRequest) { } public static String stripManualCheckInRequiredPath(String url) { - return stripToken(url, DL.MANUAL_CHECK_IN_REQUIRED_PATH); + return stripToken(url, DLUtil.MANUAL_CHECK_IN_REQUIRED_PATH); } public static String stripOfficeExtension(String url) { - String strippedUrl = stripToken(url, DL.OFFICE_EXTENSION_PATH); + String strippedUrl = stripToken(url, DLUtil.OFFICE_EXTENSION_PATH); if (strippedUrl.length() != url.length()) { strippedUrl = FileUtil.stripExtension(strippedUrl); diff --git a/portal-impl/src/com/liferay/portlet/documentlibrary/service/impl/DLFileEntryLocalServiceImpl.java b/portal-impl/src/com/liferay/portlet/documentlibrary/service/impl/DLFileEntryLocalServiceImpl.java index cee420c1c13ef1..73af4f2cf20fc3 100644 --- a/portal-impl/src/com/liferay/portlet/documentlibrary/service/impl/DLFileEntryLocalServiceImpl.java +++ b/portal-impl/src/com/liferay/portlet/documentlibrary/service/impl/DLFileEntryLocalServiceImpl.java @@ -39,7 +39,6 @@ import com.liferay.document.library.kernel.service.persistence.DLFolderPersistence; import com.liferay.document.library.kernel.store.DLStoreRequest; import com.liferay.document.library.kernel.store.DLStoreUtil; -import com.liferay.document.library.kernel.util.DL; import com.liferay.document.library.kernel.util.DLAppHelperThreadLocal; import com.liferay.document.library.kernel.util.DLValidatorUtil; import com.liferay.document.library.kernel.util.comparator.RepositoryModelModifiedDateComparator; @@ -397,7 +396,7 @@ public void checkInFileEntry( fileEntryId); boolean webDAVCheckInMode = GetterUtil.getBoolean( - serviceContext.getAttribute(DL.WEBDAV_CHECK_IN_MODE)); + serviceContext.getAttribute(DLUtil.WEBDAV_CHECK_IN_MODE)); boolean manualCheckInRequired = dlFileEntry.isManualCheckInRequired(); @@ -2385,7 +2384,7 @@ private DLFileEntry _checkOutDLFileEntryModel( serviceContext.setUserId(userId); boolean manualCheckinRequired = GetterUtil.getBoolean( - serviceContext.getAttribute(DL.MANUAL_CHECK_IN_REQUIRED)); + serviceContext.getAttribute(DLUtil.MANUAL_CHECK_IN_REQUIRED)); if (dlFileEntry.isManualCheckInRequired() ^ manualCheckinRequired) { dlFileEntry.setManualCheckInRequired(manualCheckinRequired); diff --git a/portal-impl/src/com/liferay/portlet/documentlibrary/util/DLUtil.java b/portal-impl/src/com/liferay/portlet/documentlibrary/util/DLUtil.java index 15cd71a52d7b0a..610cf3852716ea 100644 --- a/portal-impl/src/com/liferay/portlet/documentlibrary/util/DLUtil.java +++ b/portal-impl/src/com/liferay/portlet/documentlibrary/util/DLUtil.java @@ -94,6 +94,19 @@ */ public class DLUtil { + public static final String MANUAL_CHECK_IN_REQUIRED = + "manualCheckInRequired"; + + public static final String MANUAL_CHECK_IN_REQUIRED_PATH = + StringPool.SLASH + MANUAL_CHECK_IN_REQUIRED; + + public static final String OFFICE_EXTENSION = "officeExtension"; + + public static final String OFFICE_EXTENSION_PATH = + StringPool.SLASH + OFFICE_EXTENSION; + + public static final String WEBDAV_CHECK_IN_MODE = "webDAVCheckInMode"; + public static int compareVersions(String version1, String version2) { int[] splitVersion1 = StringUtil.split(version1, StringPool.PERIOD, 0); int[] splitVersion2 = StringUtil.split(version2, StringPool.PERIOD, 0); diff --git a/portal-kernel/src/com/liferay/document/library/kernel/util/DL.java b/portal-kernel/src/com/liferay/document/library/kernel/util/DL.java deleted file mode 100644 index 9debcea56a3699..00000000000000 --- a/portal-kernel/src/com/liferay/document/library/kernel/util/DL.java +++ /dev/null @@ -1,148 +0,0 @@ -/** - * SPDX-FileCopyrightText: (c) 2000 Liferay, Inc. https://liferay.com - * SPDX-License-Identifier: LGPL-2.1-or-later OR LicenseRef-Liferay-DXP-EULA-2.0.0-2023-06 - */ - -package com.liferay.document.library.kernel.util; - -import com.liferay.document.library.kernel.model.DLFileEntryType; -import com.liferay.document.library.kernel.model.DLFileVersion; -import com.liferay.petra.string.StringPool; -import com.liferay.portal.kernel.exception.PortalException; -import com.liferay.portal.kernel.repository.model.FileEntry; -import com.liferay.portal.kernel.repository.model.FileVersion; -import com.liferay.portal.kernel.search.Hits; -import com.liferay.portal.kernel.service.ServiceContext; -import com.liferay.portal.kernel.theme.ThemeDisplay; -import com.liferay.portal.kernel.util.OrderByComparator; - -import java.util.List; -import java.util.Map; -import java.util.Set; - -import javax.portlet.PortletRequest; - -import org.osgi.annotation.versioning.ProviderType; - -/** - * @author Eudaldo Alonso - */ -@ProviderType -public interface DL { - - public static final String MANUAL_CHECK_IN_REQUIRED = - "manualCheckInRequired"; - - public static final String MANUAL_CHECK_IN_REQUIRED_PATH = - StringPool.SLASH + MANUAL_CHECK_IN_REQUIRED; - - public static final String OFFICE_EXTENSION = "officeExtension"; - - public static final String OFFICE_EXTENSION_PATH = - StringPool.SLASH + OFFICE_EXTENSION; - - public static final String WEBDAV_CHECK_IN_MODE = "webDAVCheckInMode"; - - public int compareVersions(String version1, String version2); - - public String getAbsolutePath( - PortletRequest portletRequest, long rootFolderId, long folderId) - throws PortalException; - - public Set getAllMediaGalleryMimeTypes(); - - public String getDDMStructureKey(DLFileEntryType dlFileEntryType); - - public String getDDMStructureKey(String fileEntryTypeUuid); - - public String getDeprecatedDDMStructureKey(DLFileEntryType dlFileEntryType); - - public String getDeprecatedDDMStructureKey(long fileEntryTypeId); - - public String getDividedPath(long id); - - public Map getEmailDefinitionTerms( - PortletRequest portletRequest, String emailFromAddress, - String emailFromName); - - public Map getEmailFromDefinitionTerms( - PortletRequest portletRequest, String emailFromAddress, - String emailFromName); - - public List getFileEntries(Hits hits); - - public String getFileEntryImage( - FileEntry fileEntry, ThemeDisplay themeDisplay); - - public String getFileIcon(String extension); - - public String getFileIconCssClass(String extension); - - public String getGenericName(String extension); - - /** - * @deprecated As of Mueller (7.2.x), replaced by {@link - * com.liferay.document.library.util.DLURLHelper#getPreviewURL( - * FileEntry, FileVersion, ThemeDisplay, String)} - */ - @Deprecated - public String getPreviewURL( - FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay, - String queryString); - - /** - * @deprecated As of Mueller (7.2.x), replaced by {@link - * com.liferay.document.library.util.DLURLHelper#getPreviewURL( - * FileEntry, FileVersion, ThemeDisplay, String, boolean, - * boolean)} - */ - @Deprecated - public String getPreviewURL( - FileEntry fileEntry, FileVersion fileVersion, ThemeDisplay themeDisplay, - String queryString, boolean appendVersion, boolean absoluteURL); - - public OrderByComparator getRepositoryModelOrderByComparator( - String orderByCol, String orderByType); - - public OrderByComparator getRepositoryModelOrderByComparator( - String orderByCol, String orderByType, boolean orderByModel); - - public String getSanitizedFileName(String title, String extension); - - public String getTempFileId(long id, String version); - - public String getTempFileId(long id, String version, String languageId); - - public String getThumbnailStyle(); - - public String getThumbnailStyle(boolean max, int margin); - - public String getThumbnailStyle( - boolean max, int margin, int height, int width); - - public String getTitleWithExtension(FileEntry fileEntry); - - public String getTitleWithExtension(String title, String extension); - - public String getUniqueFileName( - long groupId, long folderId, String fileName, - boolean ignoreDuplicateTitle); - - public String getUniqueTitle(long groupId, long folderId, String title); - - public boolean hasWorkflowDefinitionLink( - long companyId, long groupId, long folderId, long fileEntryTypeId); - - public boolean isAutoGeneratedDLFileEntryTypeDDMStructureKey( - String ddmStructureKey); - - public boolean isOfficeExtension(String extension); - - public boolean isValidVersion(String version); - - public void startWorkflowInstance( - long userId, DLFileVersion dlFileVersion, String syncEventType, - ServiceContext serviceContext) - throws PortalException; - -} \ No newline at end of file