コード例 #1
0
  @Override
  public String render(RenderRequest renderRequest, RenderResponse renderResponse)
      throws PortletException {

    Portlet portlet = null;

    try {
      portlet = ActionUtil.getPortlet(renderRequest);
    } catch (PrincipalException pe) {
      SessionErrors.add(renderRequest, pe.getClass());

      return "/error.jsp";
    } catch (Exception e) {
      throw new PortletException(e);
    }

    try {
      renderResponse.setTitle(ActionUtil.getTitle(portlet, renderRequest));

      renderRequest = ActionUtil.getWrappedRenderRequest(renderRequest, null);

      return "/publish_portlet.jsp";
    } catch (Exception e) {
      SessionErrors.add(renderRequest, e.getClass());

      return "/error.jsp";
    }
  }
コード例 #2
0
  @Override
  public ActionForward render(
      ActionMapping actionMapping,
      ActionForm actionForm,
      PortletConfig portletConfig,
      RenderRequest renderRequest,
      RenderResponse renderResponse)
      throws Exception {

    renderRequest = ActionUtil.getWrappedRenderRequest(renderRequest, null);

    ThemeDisplay themeDisplay = (ThemeDisplay) renderRequest.getAttribute(WebKeys.THEME_DISPLAY);

    long groupId =
        ParamUtil.getLong(renderRequest, "resourceGroupId", themeDisplay.getScopeGroupId());

    String portletResource = ParamUtil.getString(renderRequest, "portletResource");
    String modelResource = ParamUtil.getString(renderRequest, "modelResource");
    String resourcePrimKey = ParamUtil.getString(renderRequest, "resourcePrimKey");

    String selResource = portletResource;

    if (Validator.isNotNull(modelResource)) {
      selResource = modelResource;
    }

    try {
      PermissionServiceUtil.checkPermission(groupId, selResource, resourcePrimKey);
    } catch (PrincipalException pe) {
      SessionErrors.add(renderRequest, PrincipalException.class.getName());

      setForward(renderRequest, "portlet.portlet_configuration.error");
    }

    Portlet portlet =
        PortletLocalServiceUtil.getPortletById(themeDisplay.getCompanyId(), portletResource);

    if (portlet != null) {
      renderResponse.setTitle(ActionUtil.getTitle(portlet, renderRequest));
    }

    return actionMapping.findForward(
        getForward(renderRequest, "portlet.portlet_configuration.edit_permissions"));
  }