use of com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance 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