Example usage for com.liferay.portal.kernel.servlet SessionMessages KEY_SUFFIX_PORTLET_NOT_AJAXABLE

List of usage examples for com.liferay.portal.kernel.servlet SessionMessages KEY_SUFFIX_PORTLET_NOT_AJAXABLE

Introduction

In this page you can find the example usage for com.liferay.portal.kernel.servlet SessionMessages KEY_SUFFIX_PORTLET_NOT_AJAXABLE.

Prototype

String KEY_SUFFIX_PORTLET_NOT_AJAXABLE

To view the source code for com.liferay.portal.kernel.servlet SessionMessages KEY_SUFFIX_PORTLET_NOT_AJAXABLE.

Click Source Link

Usage

From source file:com.liferay.portlet.stagingbar.action.EditLayoutBranchAction.java

License:Open Source License

protected void deleteLayoutBranch(ActionRequest actionRequest, PortletConfig portletConfig) throws Exception {

    long layoutBranchId = ParamUtil.getLong(actionRequest, "layoutBranchId");

    long currentLayoutBranchId = ParamUtil.getLong(actionRequest, "currentLayoutBranchId");

    LayoutBranchServiceUtil.deleteLayoutBranch(layoutBranchId);

    SessionMessages.add(actionRequest, "pageVariationDeleted");

    if (layoutBranchId == currentLayoutBranchId) {
        SessionMessages.add(actionRequest,
                portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_PORTLET_NOT_AJAXABLE);
    }/*from   w w  w.  ja  v  a2 s.c om*/
}

From source file:com.liferay.portlet.stagingbar.action.EditLayoutSetBranchAction.java

License:Open Source License

protected void deleteLayoutSetBranch(ActionRequest actionRequest, PortletConfig portletConfig)
        throws Exception {

    long layoutSetBranchId = ParamUtil.getLong(actionRequest, "layoutSetBranchId");

    long currentLayoutBranchId = ParamUtil.getLong(actionRequest, "currentLayoutBranchId");

    if (layoutSetBranchId == currentLayoutBranchId) {
        SessionMessages.add(actionRequest,
                portletConfig.getPortletName() + SessionMessages.KEY_SUFFIX_PORTLET_NOT_AJAXABLE);
    }// w  w  w.j a va2s.  c  o m

    LayoutSetBranchServiceUtil.deleteLayoutSetBranch(layoutSetBranchId);

    SessionMessages.add(actionRequest, "sitePageVariationDeleted");
}

From source file:com.liferay.staging.bar.web.internal.portlet.action.DeleteLayoutBranchMVCActionCommand.java

License:Open Source License

@Override
protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

    long layoutBranchId = ParamUtil.getLong(actionRequest, "layoutBranchId");

    long currentLayoutBranchId = ParamUtil.getLong(actionRequest, "currentLayoutBranchId");

    try {//from  w  w  w .ja  va 2  s. c o  m
        _layoutBranchService.deleteLayoutBranch(layoutBranchId);

        SessionMessages.add(actionRequest, "pageVariationDeleted");

        if (layoutBranchId == currentLayoutBranchId) {
            SessionMessages.add(actionRequest,
                    _portal.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_PORTLET_NOT_AJAXABLE);
        }

        ActionUtil.addLayoutBranchSessionMessages(actionRequest, actionResponse);
    } catch (Exception e) {
        SessionErrors.add(actionRequest, e.getClass(), e);

        actionResponse.setRenderParameter("mvcPath", "/error.jsp");
    }
}

From source file:com.liferay.staging.bar.web.internal.portlet.action.DeleteLayoutSetBranchMVCActionCommand.java

License:Open Source License

@Override
protected void doProcessAction(ActionRequest actionRequest, ActionResponse actionResponse) throws Exception {

    long layoutSetBranchId = ParamUtil.getLong(actionRequest, "layoutSetBranchId");

    long currentLayoutBranchId = ParamUtil.getLong(actionRequest, "currentLayoutBranchId");

    if (layoutSetBranchId == currentLayoutBranchId) {
        SessionMessages.add(actionRequest,
                _portal.getPortletId(actionRequest) + SessionMessages.KEY_SUFFIX_PORTLET_NOT_AJAXABLE);
    }//from  ww w . j a va2 s .c  o m

    try {
        _layoutSetBranchService.deleteLayoutSetBranch(layoutSetBranchId);

        SessionMessages.add(actionRequest, "sitePageVariationDeleted");

        ActionUtil.addLayoutBranchSessionMessages(actionRequest, actionResponse);
    } catch (Exception e) {
        SessionErrors.add(actionRequest, e.getClass(), e);

        actionResponse.setRenderParameter("mvcPath", "/error.jsp");
    }
}