Many resources are needed to download a project. Please understand that we have to compensate our server costs. Thank you in advance. Project price only 1 $
You can buy this project and download/modify it how often you want.
/**
* Copyright (c) 2000-present Liferay, Inc. All rights reserved.
*
* This library is free software; you can redistribute it and/or modify it under
* the terms of the GNU Lesser General Public License as published by the Free
* Software Foundation; either version 2.1 of the License, or (at your option)
* any later version.
*
* This library is distributed in the hope that it will be useful, but WITHOUT
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
* FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
* details.
*/
package com.liferay.journal.service.impl;
import com.liferay.dynamic.data.mapping.model.DDMStructure;
import com.liferay.dynamic.data.mapping.service.permission.DDMStructurePermission;
import com.liferay.journal.model.JournalArticle;
import com.liferay.journal.model.JournalFolder;
import com.liferay.journal.service.base.JournalFolderServiceBaseImpl;
import com.liferay.journal.service.permission.JournalFolderPermission;
import com.liferay.portal.kernel.dao.orm.QueryDefinition;
import com.liferay.portal.kernel.exception.PortalException;
import com.liferay.portal.kernel.security.permission.ActionKeys;
import com.liferay.portal.kernel.security.permission.PermissionChecker;
import com.liferay.portal.kernel.service.ServiceContext;
import com.liferay.portal.kernel.util.ListUtil;
import com.liferay.portal.kernel.util.OrderByComparator;
import com.liferay.portal.kernel.workflow.WorkflowConstants;
import com.liferay.portal.util.PropsValues;
import java.util.ArrayList;
import java.util.Iterator;
import java.util.List;
/**
* @author Juan Fernández
*/
public class JournalFolderServiceImpl extends JournalFolderServiceBaseImpl {
@Override
public JournalFolder addFolder(
long groupId, long parentFolderId, String name, String description,
ServiceContext serviceContext)
throws PortalException {
JournalFolderPermission.check(
getPermissionChecker(), groupId, parentFolderId,
ActionKeys.ADD_FOLDER);
return journalFolderLocalService.addFolder(
getUserId(), groupId, parentFolderId, name, description,
serviceContext);
}
@Override
public void deleteFolder(long folderId) throws PortalException {
JournalFolder folder = journalFolderLocalService.getFolder(folderId);
JournalFolderPermission.check(
getPermissionChecker(), folder, ActionKeys.DELETE);
journalFolderLocalService.deleteFolder(folderId);
}
@Override
public void deleteFolder(long folderId, boolean includeTrashedEntries)
throws PortalException {
JournalFolder folder = journalFolderLocalService.getFolder(folderId);
JournalFolderPermission.check(
getPermissionChecker(), folder, ActionKeys.DELETE);
journalFolderLocalService.deleteFolder(folderId, includeTrashedEntries);
}
@Override
public JournalFolder fetchFolder(long folderId) throws PortalException {
JournalFolder folder = journalFolderLocalService.fetchFolder(folderId);
if (folder != null) {
JournalFolderPermission.check(
getPermissionChecker(), folder, ActionKeys.VIEW);
}
return folder;
}
@Override
public List getDDMStructures(
long[] groupIds, long folderId, int restrictionType)
throws PortalException {
return filterStructures(
journalFolderLocalService.getDDMStructures(
groupIds, folderId, restrictionType));
}
@Override
public JournalFolder getFolder(long folderId) throws PortalException {
JournalFolder folder = journalFolderLocalService.getFolder(folderId);
JournalFolderPermission.check(
getPermissionChecker(), folder, ActionKeys.VIEW);
return folder;
}
@Override
public List getFolderIds(long groupId, long folderId)
throws PortalException {
JournalFolderPermission.check(
getPermissionChecker(), groupId, folderId, ActionKeys.VIEW);
List folderIds = getSubfolderIds(groupId, folderId, true);
folderIds.add(0, folderId);
return folderIds;
}
@Override
public List getFolders(long groupId) {
return journalFolderPersistence.filterFindByGroupId(groupId);
}
@Override
public List getFolders(long groupId, long parentFolderId) {
return getFolders(
groupId, parentFolderId, WorkflowConstants.STATUS_APPROVED);
}
@Override
public List getFolders(
long groupId, long parentFolderId, int status) {
return journalFolderPersistence.filterFindByG_P_S(
groupId, parentFolderId, status);
}
@Override
public List getFolders(
long groupId, long parentFolderId, int start, int end) {
return getFolders(
groupId, parentFolderId, WorkflowConstants.STATUS_APPROVED, start,
end);
}
@Override
public List getFolders(
long groupId, long parentFolderId, int status, int start, int end) {
return journalFolderPersistence.filterFindByG_P_S(
groupId, parentFolderId, status, start, end);
}
@Override
public List