Пример #1
0
  /**
   * This method deletes the TerminationReasons record from database based on TerminationReasons
   * record Id
   *
   * @param resourceRequest
   * @param resourceResponse
   * @throws IOException
   * @throws PortletException
   * @throws SystemException
   * @throws PortalException
   * @throws NumberFormatException
   */
  public void serveResource(ResourceRequest resourceRequest, ResourceResponse resourceResponse)
      throws IOException {
    if (resourceRequest.getResourceID().equals("deleteTerminationReasons")) {
      System.out.println("deleting thes TerminationReasons");

      String[] idsArray = ParamUtil.getParameterValues(resourceRequest, "terminationreasonsIds");
      System.out.println(idsArray.length);

      for (int i = 0; i <= idsArray.length - 1; i++) {

        try {
          try {
            TerminationReasonsLocalServiceUtil.deleteTerminationReasons(
                Long.parseLong(idsArray[i]));
          } catch (PortalException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          } catch (SystemException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
          }
        } catch (NumberFormatException e) {
        }
      }
    }
  }