Search in sources :

Example 1 with MDRRuleGroupInstance

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);
        }
    }
}
Also used : MDRRuleGroupInstance(com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance) Layout(com.liferay.portal.model.Layout) MDRAction(com.liferay.portlet.mobiledevicerules.model.MDRAction)

Aggregations

Layout (com.liferay.portal.model.Layout)1 MDRAction (com.liferay.portlet.mobiledevicerules.model.MDRAction)1 MDRRuleGroupInstance (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance)1