use of com.ableneo.liferay.portal.setup.domain.StructureType in project liferay-db-setup-core by ableneo.
the class SetupArticles method setupSiteStructuresAndTemplates.
public static void setupSiteStructuresAndTemplates(final Site site, long groupId) throws PortalException {
List<StructureType> articleStructures = site.getArticleStructure();
if (articleStructures != null && false == articleStructures.isEmpty()) {
long classNameId = ClassNameLocalServiceUtil.getClassNameId(JournalArticle.class);
for (StructureType structure : articleStructures) {
addDDMStructure(structure, groupId, classNameId);
}
}
List<StructureType> ddlStructures = site.getDdlStructure();
if (ddlStructures != null && false == ddlStructures.isEmpty()) {
long classNameId = ClassNameLocalServiceUtil.getClassNameId(DDLRecordSet.class);
for (StructureType structure : ddlStructures) {
LOG.info(String.format("Adding DDL structure %1$s", structure.getName()));
addDDMStructure(structure, groupId, classNameId);
}
}
List<ArticleTemplate> articleTemplates = site.getArticleTemplate();
if (articleTemplates != null) {
for (ArticleTemplate template : articleTemplates) {
try {
addDDMTemplate(template, groupId);
} catch (TemplateDuplicateTemplateKeyException e) {
LOG.error(e);
}
}
}
}
Aggregations