@Override
  public ActionForward render(
      ActionMapping actionMapping,
      ActionForm actionForm,
      PortletConfig portletConfig,
      RenderRequest renderRequest,
      RenderResponse renderResponse)
      throws Exception {

    try {
      ActionUtil.getFileEntry(renderRequest);
    } catch (Exception e) {
      if (e instanceof NoSuchFileEntryException
          || e instanceof NoSuchFileVersionException
          || e instanceof NoSuchRepositoryEntryException
          || e instanceof PrincipalException) {

        SessionErrors.add(renderRequest, e.getClass());

        return actionMapping.findForward("portlet.document_selector.error");
      } else {
        throw e;
      }
    }

    String forward = "portlet.document_selector.add_file_entry";

    return actionMapping.findForward(getForward(renderRequest, forward));
  }
Exemple #2
0
  @Override
  public ActionForward render(
      ActionMapping actionMapping,
      ActionForm actionForm,
      PortletConfig portletConfig,
      RenderRequest renderRequest,
      RenderResponse renderResponse)
      throws Exception {

    try {
      ActionUtil.getFileShortcut(renderRequest);
    } catch (Exception e) {
      if (e instanceof NoSuchFileShortcutException || e instanceof PrincipalException) {

        SessionErrors.add(renderRequest, e.getClass());

        return actionMapping.findForward("portlet.document_library.error");
      } else {
        throw e;
      }
    }

    return actionMapping.findForward(
        getForward(renderRequest, "portlet.document_library.edit_file_shortcut"));
  }