Search in sources :

Example 6 with Layout

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

Example 7 with Layout

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);
        }
    }
}
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)7 Group (com.liferay.portal.model.Group)2 KBArticle (com.liferay.knowledgebase.model.KBArticle)1 JSONObject (com.liferay.portal.kernel.json.JSONObject)1 StringBundler (com.liferay.portal.kernel.util.StringBundler)1 LayoutTypePortlet (com.liferay.portal.model.LayoutTypePortlet)1 Portlet (com.liferay.portal.model.Portlet)1 Ticket (com.liferay.portal.model.Ticket)1 User (com.liferay.portal.model.User)1 UserGroup (com.liferay.portal.model.UserGroup)1 ThemeDisplay (com.liferay.portal.theme.ThemeDisplay)1 SubscriptionSender (com.liferay.portal.util.SubscriptionSender)1 MDRAction (com.liferay.portlet.mobiledevicerules.model.MDRAction)1 MDRRuleGroupInstance (com.liferay.portlet.mobiledevicerules.model.MDRRuleGroupInstance)1 ArrayList (java.util.ArrayList)1 PortletPreferences (javax.portlet.PortletPreferences)1 PortletURL (javax.portlet.PortletURL)1 UserPref (org.apache.shindig.gadgets.spec.UserPref)1