Пример #1
0
  /**
   * Perform the export format supression
   *
   * @param request The HTTP request
   * @throws AccessDeniedException the {@link AccessDeniedException}
   * @return The URL to go after performing the action
   */
  public String doRemoveXslExport(HttpServletRequest request) throws AccessDeniedException {
    if (!RBACService.isAuthorized(
        XslExport.RESOURCE_TYPE,
        RBAC.WILDCARD_RESOURCES_ID,
        XslExportResourceIdService.PERMISSION_DELETE,
        getUser())) {
      throw new AccessDeniedException(MESSAGE_PERMISSION_DENIED);
    }

    // ArrayList<String> listErrors = new ArrayList<String>( );
    String strIdXslExport = request.getParameter(PARAMETER_ID_XSL_EXPORT);
    int nIdXslExport = Integer.parseInt(strIdXslExport);
    XslExport xslExport = XslExportHome.findByPrimaryKey(nIdXslExport);

    // if ( !XslExportRemovalListenerService.getService( ).checkForRemoval( strIdXslExport,
    // listErrors, getLocale( ) ) )
    // {
    // String strCause = AdminMessageService.getFormattedList( listErrors, getLocale( ) );
    // Object[] args =
    // { strCause };
    //
    // return AdminMessageService.getMessageUrl( request, MESSAGE_CAN_NOT_REMOVE_XSL_EXPORT, args,
    // AdminMessage.TYPE_STOP );
    // }
    XslExportHome.remove(nIdXslExport);

    if (xslExport.getFile() != null) {
      FileHome.remove(xslExport.getFile().getIdFile());
    }

    return getJspManageXslExport(request);
  }