public static long getSiteGroupId(long scopeGroupId) { return getPortal().getSiteGroupId(scopeGroupId); }
private long[] _getSiteGroupIds(long[] groupIds) { Set<Long> siteGroupIds = new LinkedHashSet<>(); for (long groupId : groupIds) { siteGroupIds.add(_portal.getSiteGroupId(groupId)); } return ArrayUtil.toLongArray(siteGroupIds); }
DDMStructure ddmStructure = _ddmStructureLocalService.fetchStructure( _portal.getSiteGroupId(groupId), classNameId, ddmStructureKey, true); _portal.getSiteGroupId(groupId), classNameId, ddmTemplateKey, true);
_portal.getSiteGroupId(article.getGroupId()), _portal.getClassNameId(JournalArticle.class), article.getDDMStructureKey(), true);
protected void addDDMStructureAttributes( Document document, JournalArticle article) throws Exception { DDMStructure ddmStructure = _ddmStructureLocalService.fetchStructure( _portal.getSiteGroupId(article.getGroupId()), _portal.getClassNameId(JournalArticle.class), article.getDDMStructureKey(), true); if (ddmStructure == null) { return; } document.addKeyword(Field.CLASS_TYPE_ID, ddmStructure.getStructureId()); DDMFormValues ddmFormValues = null; try { Fields fields = _journalConverter.getDDMFields( ddmStructure, article.getDocument()); ddmFormValues = _fieldsToDDMFormValuesConverter.convert( ddmStructure, fields); } catch (Exception e) { return; } if (ddmFormValues != null) { _ddmIndexer.addAttributes(document, ddmStructure, ddmFormValues); } }
protected String extractDDMContent( JournalArticle article, String languageId) throws Exception { DDMStructure ddmStructure = _ddmStructureLocalService.fetchStructure( _portal.getSiteGroupId(article.getGroupId()), _portal.getClassNameId(JournalArticle.class), article.getDDMStructureKey(), true); if (ddmStructure == null) { return StringPool.BLANK; } DDMFormValues ddmFormValues = null; try { Fields fields = _journalConverter.getDDMFields( ddmStructure, article.getDocument()); ddmFormValues = _fieldsToDDMFormValuesConverter.convert( ddmStructure, fields); } catch (Exception e) { return StringPool.BLANK; } if (ddmFormValues == null) { return StringPool.BLANK; } return _ddmIndexer.extractIndexableAttributes( ddmStructure, ddmFormValues, LocaleUtil.fromLanguageId(languageId)); }
_portal.getSiteGroupId(groupId), _classNameLocalService.getClassNameId(JournalArticle.class), ddmStructureKey, true); _portal.getSiteGroupId(groupId), _classNameLocalService.getClassNameId(DDMStructure.class), ddmTemplateKey, true);
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 = 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); }
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); }
_portal.getSiteGroupId(groupId), sourceAvailableLocale)) { le.setTargetAvailableLocales( LanguageUtil.getAvailableLocales( _portal.getSiteGroupId(groupId)));
StringUtil.merge( LanguageUtil.getAvailableLocales( _portal.getSiteGroupId( portletDataContext.getScopeGroupId())))); headerElement.addAttribute(