use of com.liferay.portal.model.Layout in project liferay-ide by liferay.
the class FindKBArticleAction method getPortletId.
protected String getPortletId(long plid) throws Exception {
Layout layout = LayoutLocalServiceUtil.getLayout(plid);
long selPlid = PortalUtil.getPlidFromPortletId(layout.getGroupId(), PortletKeys.KNOWLEDGE_BASE_DISPLAY);
if (selPlid != LayoutConstants.DEFAULT_PARENT_LAYOUT_ID) {
return PortletKeys.KNOWLEDGE_BASE_DISPLAY;
}
return PortletKeys.KNOWLEDGE_BASE_ARTICLE_DEFAULT_INSTANCE;
}
use of com.liferay.portal.model.Layout in project liferay-ide by liferay.
the class EditLayoutsAction method inheritMobileRuleGroups.
protected void inheritMobileRuleGroups(Layout layout, ServiceContext serviceContext) throws PortalException, SystemException {
List<MDRRuleGroupInstance> parentMDRRuleGroupInstances = MDRRuleGroupInstanceLocalServiceUtil.getRuleGroupInstances(Layout.class.getName(), layout.getParentPlid());
for (MDRRuleGroupInstance parentMDRRuleGroupInstance : parentMDRRuleGroupInstances) {
MDRRuleGroupInstance mdrRuleGroupInstance = MDRRuleGroupInstanceServiceUtil.addRuleGroupInstance(layout.getGroupId(), Layout.class.getName(), layout.getPlid(), parentMDRRuleGroupInstance.getRuleGroupId(), parentMDRRuleGroupInstance.getPriority(), serviceContext);
List<MDRAction> parentMDRActions = MDRActionLocalServiceUtil.getActions(parentMDRRuleGroupInstance.getRuleGroupInstanceId());
for (MDRAction mdrAction : parentMDRActions) {
MDRActionServiceUtil.addAction(mdrRuleGroupInstance.getRuleGroupInstanceId(), mdrAction.getNameMap(), mdrAction.getDescriptionMap(), mdrAction.getType(), mdrAction.getTypeSettings(), serviceContext);
}
}
}
Aggregations