예제 #1
0
  @Override
  public ActionForward render(
      ActionMapping mapping,
      ActionForm form,
      PortletConfig portletConfig,
      RenderRequest renderRequest,
      RenderResponse renderResponse)
      throws Exception {

    long actionId = ParamUtil.getLong(renderRequest, "actionId");

    MDRAction action = MDRActionServiceUtil.fetchAction(actionId);

    renderRequest.setAttribute(WebKeys.MOBILE_DEVICE_RULES_RULE_GROUP_ACTION, action);

    String type = BeanPropertiesUtil.getString(action, "type");

    renderRequest.setAttribute(WebKeys.MOBILE_DEVICE_RULES_RULE_GROUP_ACTION_TYPE, type);

    String editorJSP = getEditorJSP(type);

    renderRequest.setAttribute(WebKeys.MOBILE_DEVICE_RULES_RULE_GROUP_ACTION_EDITOR_JSP, editorJSP);

    long ruleGroupInstanceId = BeanParamUtil.getLong(action, renderRequest, "ruleGroupInstanceId");

    MDRRuleGroupInstance ruleGroupInstance =
        MDRRuleGroupInstanceLocalServiceUtil.getMDRRuleGroupInstance(ruleGroupInstanceId);

    renderRequest.setAttribute(WebKeys.MOBILE_DEVICE_RULES_RULE_GROUP_INSTANCE, ruleGroupInstance);

    return mapping.findForward("portlet.mobile_device_rules.edit_action");
  }
  public long getFolderId() throws PortalException {
    if (_folderId != null) {
      return _folderId;
    }

    JournalFolder folder = getFolder();

    _folderId =
        BeanParamUtil.getLong(
            folder, _request, "folderId", JournalFolderConstants.DEFAULT_PARENT_FOLDER_ID);

    return _folderId;
  }
  private boolean _hasFolderWorkflowDefinitionLink() {
    try {
      ThemeDisplay themeDisplay = (ThemeDisplay) _request.getAttribute(WebKeys.THEME_DISPLAY);

      long folderId = BeanParamUtil.getLong(_fileEntry, _request, "folderId");

      return DLUtil.hasWorkflowDefinitionLink(
          themeDisplay.getCompanyId(),
          themeDisplay.getScopeGroupId(),
          folderId,
          _dlFileEntryType.getFileEntryTypeId());
    } catch (Exception e) {
      throw new SystemException("Unable to check if folder has workflow definition link", e);
    }
  }