Created
July 22, 2020 16:54
-
-
Save fabian-bouche-liferay/7595ff70e2821f1e7e29ae2fbd66b842 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package com.liferay.samples.fbo.custom; | |
| import java.util.List; | |
| import org.osgi.service.component.annotations.Component; | |
| import org.slf4j.Logger; | |
| import org.slf4j.LoggerFactory; | |
| import com.liferay.document.library.kernel.service.DLAppService; | |
| import com.liferay.document.library.kernel.service.DLAppServiceWrapper; | |
| import com.liferay.portal.kernel.exception.PortalException; | |
| import com.liferay.portal.kernel.security.auth.GuestOrUserUtil; | |
| import com.liferay.portal.kernel.service.ServiceWrapper; | |
| import com.liferay.portal.kernel.util.OrderByComparator; | |
| @Component( | |
| immediate = true, | |
| property = { | |
| }, | |
| service = ServiceWrapper.class | |
| ) | |
| public class DLAppServiceOverride extends DLAppServiceWrapper { | |
| private static final Logger LOG = LoggerFactory.getLogger(DLAppServiceOverride.class); | |
| public DLAppServiceOverride() { | |
| super(null); | |
| } | |
| public DLAppServiceOverride(DLAppService dlAppService) { | |
| super(dlAppService); | |
| } | |
| @Override | |
| public List<Object> getFoldersAndFileEntriesAndFileShortcuts(long repositoryId, long folderId, int status, | |
| boolean includeMountFolders, int start, int end) throws PortalException { | |
| long userId = GuestOrUserUtil.getUserId(); | |
| LOG.info("METHOD 1: " + userId); | |
| return super.getFoldersAndFileEntriesAndFileShortcuts(repositoryId, folderId, status, includeMountFolders, start, end); | |
| } | |
| @Override | |
| public List<Object> getFoldersAndFileEntriesAndFileShortcuts(long repositoryId, long folderId, int status, | |
| boolean includeMountFolders, int start, int end, OrderByComparator<?> obc) throws PortalException { | |
| long userId = GuestOrUserUtil.getUserId(); | |
| LOG.info("METHOD 2: " + userId); | |
| return super.getFoldersAndFileEntriesAndFileShortcuts(repositoryId, folderId, status, includeMountFolders, start, end, | |
| obc); | |
| } | |
| @Override | |
| public List<Object> getFoldersAndFileEntriesAndFileShortcuts(long repositoryId, long folderId, int status, | |
| String[] mimeTypes, boolean includeMountFolders, boolean includeOwner, int start, int end, | |
| OrderByComparator<?> obc) throws PortalException { | |
| long userId = GuestOrUserUtil.getUserId(); | |
| LOG.info("METHOD 3: " + userId); | |
| return super.getFoldersAndFileEntriesAndFileShortcuts(repositoryId, folderId, status, mimeTypes, includeMountFolders, | |
| includeOwner, start, end, obc); | |
| } | |
| @Override | |
| public List<Object> getFoldersAndFileEntriesAndFileShortcuts(long repositoryId, long folderId, int status, | |
| String[] mimeTypes, boolean includeMountFolders, int start, int end, OrderByComparator<?> obc) | |
| throws PortalException { | |
| long userId = GuestOrUserUtil.getUserId(); | |
| LOG.info("METHOD 4: " + userId); | |
| return super.getFoldersAndFileEntriesAndFileShortcuts(repositoryId, folderId, status, mimeTypes, includeMountFolders, | |
| start, end, obc); | |
| } | |
| @Override | |
| public int getFoldersAndFileEntriesAndFileShortcutsCount(long repositoryId, long folderId, int status, | |
| boolean includeMountFolders) throws PortalException { | |
| long userId = GuestOrUserUtil.getUserId(); | |
| LOG.info("METHOD 5: " + userId); | |
| return super.getFoldersAndFileEntriesAndFileShortcutsCount(repositoryId, folderId, status, includeMountFolders); | |
| } | |
| @Override | |
| public int getFoldersAndFileEntriesAndFileShortcutsCount(long repositoryId, long folderId, int status, | |
| String[] mimeTypes, boolean includeMountFolders) throws PortalException { | |
| long userId = GuestOrUserUtil.getUserId(); | |
| LOG.info("METHOD 6: " + userId); | |
| return super.getFoldersAndFileEntriesAndFileShortcutsCount(repositoryId, folderId, status, mimeTypes, | |
| includeMountFolders); | |
| } | |
| @Override | |
| public int getFoldersAndFileEntriesAndFileShortcutsCount(long repositoryId, long folderId, int status, | |
| String[] mimeTypes, boolean includeMountFolders, boolean includeOwner) throws PortalException { | |
| long userId = GuestOrUserUtil.getUserId(); | |
| LOG.info("METHOD 7: " + userId); | |
| return super.getFoldersAndFileEntriesAndFileShortcutsCount(repositoryId, folderId, status, mimeTypes, | |
| includeMountFolders, includeOwner); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment