Ejemplo n.º 1
0
  @SuppressWarnings("unused")
  public ActionForward manage(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {

    LoggedInInfo loggedInInfo = LoggedInInfo.getLoggedInInfoFromSession(request);
    request.setAttribute("lookupLists", lookupListManager.findAllActiveLookupLists(loggedInInfo));

    return mapping.findForward("success");
  }
Ejemplo n.º 2
0
  @SuppressWarnings("unused")
  public ActionForward add(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {

    LoggedInInfo loggedInInfo = LoggedInInfo.getLoggedInInfoFromSession(request);
    String lookupListItemLabel = request.getParameter("lookupListItemLabel");
    String lookupListId = request.getParameter("lookupListId");
    String user = (String) request.getSession().getAttribute("user");
    LookupListItem lookupListItem;
    int lookupListIdInteger;
    List<LookupListItem> lookupListItems;

    if (user == null) {
      user = "";
    }

    if (lookupListItemLabel != null
        && !lookupListItemLabel.isEmpty()
        && lookupListId != null
        && !lookupListId.isEmpty()) {

      lookupListIdInteger = Integer.parseInt(lookupListId);
      lookupListItems =
          lookupListManager.findLookupListItemsByLookupListId(loggedInInfo, lookupListIdInteger);
      lookupListItem = new LookupListItem();
      lookupListItem.setActive(true);
      lookupListItem.setCreatedBy(user);
      lookupListItem.setDisplayOrder(
          lookupListItems.get(lookupListItems.size() - 1).getDisplayOrder() + 1);
      lookupListItem.setLabel(lookupListItemLabel);
      lookupListItem.setLookupListId(lookupListIdInteger);
      lookupListItem.setValue(UUID.randomUUID().toString());

      lookupListManager.addLookupListItem(loggedInInfo, lookupListItem);
    }

    request.setAttribute("lookupLists", lookupListManager.findAllActiveLookupLists(loggedInInfo));

    return mapping.findForward("success");
  }
Ejemplo n.º 3
0
  @SuppressWarnings("unused")
  public ActionForward remove(
      ActionMapping mapping,
      ActionForm form,
      HttpServletRequest request,
      HttpServletResponse response) {

    LoggedInInfo loggedInInfo = LoggedInInfo.getLoggedInInfoFromSession(request);
    String lookupListItemId = request.getParameter("lookupListItemId");
    int id = 0;

    if (lookupListItemId != null && !lookupListItemId.isEmpty()) {
      id = Integer.parseInt(lookupListItemId);
    }

    if (id > 0) {
      lookupListManager.removeLookupListItem(loggedInInfo, id);
    }

    request.setAttribute("lookupLists", lookupListManager.findAllActiveLookupLists(loggedInInfo));

    return mapping.findForward("success");
  }