public static long[] getCurrentAndAncestorSiteGroupIds( long[] groupIds, boolean checkContentSharingWithChildrenEnabled) throws PortalException { return getPortal().getCurrentAndAncestorSiteGroupIds( groupIds, checkContentSharingWithChildrenEnabled); }
public static long[] getCurrentAndAncestorSiteGroupIds( long groupId, boolean checkContentSharingWithChildrenEnabled) throws PortalException { return getPortal().getCurrentAndAncestorSiteGroupIds( groupId, checkContentSharingWithChildrenEnabled); }
public void validateFolderDDMStructures(long folderId, long parentFolderId) throws PortalException { JournalFolder folder = _journalFolderLocalService.fetchFolder(folderId); int restrictionType = JournalFolderConstants.RESTRICTION_TYPE_DDM_STRUCTURES_AND_WORKFLOW; JournalFolder parentFolder = _journalFolderLocalService.fetchFolder( parentFolderId); if (parentFolder != null) { restrictionType = parentFolder.getRestrictionType(); } List<DDMStructure> folderDDMStructures = _journalFolderLocalService.getDDMStructures( _portal.getCurrentAndAncestorSiteGroupIds(folder.getGroupId()), parentFolderId, restrictionType); long[] ddmStructureIds = new long[folderDDMStructures.size()]; for (int i = 0; i < folderDDMStructures.size(); i++) { DDMStructure folderDDMStructure = folderDDMStructures.get(i); ddmStructureIds[i] = folderDDMStructure.getStructureId(); } validateArticleDDMStructures(folderId, ddmStructureIds); }
public void validateDDMStructureId( long groupId, long folderId, String ddmStructureKey) throws PortalException { int restrictionType = _journalHelper.getRestrictionType(folderId); DDMStructure ddmStructure = _ddmStructureLocalService.getStructure( _portal.getSiteGroupId(groupId), _classNameLocalService.getClassNameId(JournalArticle.class), ddmStructureKey, true); List<DDMStructure> folderDDMStructures = _journalFolderLocalService.getDDMStructures( _portal.getCurrentAndAncestorSiteGroupIds(groupId), folderId, restrictionType); for (DDMStructure folderDDMStructure : folderDDMStructures) { if (folderDDMStructure.getStructureId() == ddmStructure.getStructureId()) { return; } } throw new InvalidDDMStructureException( StringBundler.concat( "Invalid structure ", ddmStructure.getStructureId(), " for folder ", folderId)); }
protected void checkValidContainer(long classPK, long containerModelId) throws PortalException { JournalArticle article = _journalArticleLocalService.getLatestArticle( classPK); DDMStructure ddmStructure = _ddmStructureLocalService.getStructure( _portal.getSiteGroupId(article.getGroupId()), _portal.getClassNameId(JournalArticle.class), article.getDDMStructureKey(), true); if (containerModelId == TrashEntryConstants.DEFAULT_CONTAINER_ID) { containerModelId = article.getFolderId(); } int restrictionType = _journalHelper.getRestrictionType( containerModelId); List<DDMStructure> folderDDMStructures = _journalFolderLocalService.getDDMStructures( _portal.getCurrentAndAncestorSiteGroupIds(article.getGroupId()), containerModelId, restrictionType); for (DDMStructure folderDDMStructure : folderDDMStructures) { if (folderDDMStructure.getStructureId() == ddmStructure.getStructureId()) { return; } } throw new RestoreEntryException( RestoreEntryException.INVALID_CONTAINER); }
protected void checkValidContainer(long classPK, long containerModelId) throws PortalException { JournalArticle article = _journalArticleLocalService.getLatestArticle( classPK); DDMStructure ddmStructure = _ddmStructureLocalService.getStructure( _portal.getSiteGroupId(article.getGroupId()), _portal.getClassNameId(JournalArticle.class), article.getDDMStructureKey(), true); if (containerModelId == TrashEntryConstants.DEFAULT_CONTAINER_ID) { containerModelId = article.getFolderId(); } int restrictionType = JournalHelperUtil.getRestrictionType( containerModelId); List<DDMStructure> folderDDMStructures = _journalFolderLocalService.getDDMStructures( _portal.getCurrentAndAncestorSiteGroupIds(article.getGroupId()), containerModelId, restrictionType); for (DDMStructure folderDDMStructure : folderDDMStructures) { if (folderDDMStructure.getStructureId() == ddmStructure.getStructureId()) { return; } } throw new RestoreEntryException( RestoreEntryException.INVALID_CONTAINER); }