/**
   * 기 등록 된 PROCESS모니터링 정보를 수정 한다.
   *
   * @param processNm - PROCESS모니터링 model
   * @return String - 리턴 Url
   * @param processNm
   */
  @RequestMapping(value = "/utl/sys/prm/EgovComUtlProcessMonModify.do")
  public String updateProcessMon(
      @ModelAttribute("processMonVO") ProcessMonVO processMonVO,
      BindingResult bindingResult,
      Map commandMap,
      ModelMap model)
      throws Exception {

    // 로그인 객체 선언
    LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();

    String sCmd = commandMap.get("cmd") == null ? "" : (String) commandMap.get("cmd");
    if (sCmd.equals("")) {
      ProcessMonVO vo = processMonService.selectProcessMon(processMonVO);
      model.addAttribute("processMonVO", vo);
      return "egovframework/com/utl/sys/prm/EgovComUtlProcessMonModify";
    } else if (sCmd.equals("Modify")) {
      beanValidator.validate(processMonVO, bindingResult);
      if (bindingResult.hasErrors()) {
        ProcessMonVO vo = processMonService.selectProcessMon(processMonVO);
        model.addAttribute("processMonVO", vo);
        return "egovframework/com/utl/sys/prm/EgovComUtlProcessMonModify";
      }

      // 아이디 설정
      processMonVO.setFrstRegisterId((String) loginVO.getUniqId());
      processMonVO.setLastUpdusrId((String) loginVO.getUniqId());

      processMonService.updateProcessMon(processMonVO);
      return "forward:/utl/sys/prm/EgovComUtlProcessMonList.do";
    } else {
      return "forward:/utl/sys/prm/EgovComUtlProcessMonList.do";
    }
  }
  /*
   * This controller method is for demonstration purposes only. It contains a call to
   * catalogService.findActiveProductsByCategory, which may return a large list. A
   * more performant solution would be to utilize data paging techniques.
   */
  protected boolean addProductsToModel(
      HttpServletRequest request, ModelMap model, CatalogSort catalogSort) {
    boolean productFound = false;

    String productId = request.getParameter("productId");
    Product product = null;
    try {
      product = catalogService.findProductById(new Long(productId));
    } catch (Exception e) {
      // If product is not found, return all values in category
    }

    if (product != null && product.isActive()) {
      productFound = validateProductAndAddToModel(product, model);
      addRatingSummaryToModel(productId, model);
    } else {
      Category currentCategory = (Category) model.get("currentCategory");
      List<Product> productList =
          catalogService.findActiveProductsByCategory(currentCategory, SystemTime.asDate());
      SearchFilterUtil.filterProducts(
          productList, request.getParameterMap(), new String[] {"manufacturer", "sku.salePrice"});

      if ((catalogSort != null) && (catalogSort.getSort() != null)) {
        populateProducts(productList, currentCategory);
        model.addAttribute("displayProducts", sortProducts(catalogSort, productList));
      } else {
        catalogSort = new CatalogSort();
        catalogSort.setSort("featured");
        populateProducts(productList, currentCategory);
        model.addAttribute("displayProducts", sortProducts(catalogSort, productList));
      }
    }

    return productFound;
  }
Esempio n. 3
0
  @RequestMapping("/touch/reg")
  public String reg(Integer errCode, Integer shareId, HttpServletRequest request, ModelMap map) {
    String username = (String) request.getSession().getAttribute("username");
    if (null != shareId) {
      map.addAttribute("share_id", shareId);
    }

    // 基本信息
    tdCommonService.setHeader(map, request);

    if (null == username) {
      if (null != errCode) {
        if (errCode.equals(1)) {
          map.addAttribute("error", "验证码错误");
        } else if (errCode.equals(2)) {
          map.addAttribute("error", "用户名已存在");
        } else if (errCode.equals(3)) {
          map.addAttribute("error", "短信验证码错误");
        }
        map.addAttribute("errCode", errCode);
      }
      return "/touch/reg";
    }
    return "redirect:/";
  }
  @RequestMapping("/fbuilder/app/(*:appId)/(~:appVersion)/form/(*:formId)/element/preview")
  public String previewElement(
      ModelMap model,
      @RequestParam("appId") String appId,
      @RequestParam(value = "appVersion", required = false) String appVersion,
      @RequestParam("formId") String formId,
      @RequestParam("json") String json) {
    try {
      FormUtil.setProcessedFormJson(json);

      model.addAttribute("appId", appId);
      model.addAttribute("appVersion", appVersion);
      AppDefinition appDef = appService.getAppDefinition(appId, appVersion);

      String tempJson = json;
      if (tempJson.contains(SecurityUtil.ENVELOPE)
          || tempJson.contains(PropertyUtil.PASSWORD_PROTECTED_VALUE)) {
        FormDefinition formDef = formDefinitionDao.loadById(formId, appDef);

        if (formDef != null) {
          tempJson = PropertyUtil.propertiesJsonStoreProcessing(formDef.getJson(), tempJson);
        }
      }

      String elementHtml = formService.previewElement(tempJson);
      model.addAttribute("elementTemplate", elementHtml);
      model.addAttribute("elementJson", json);
    } finally {
      FormUtil.clearProcessedFormJson();
    }

    return "fbuilder/previewElement";
  }
  /**
   * 받은쪽지함관리 목록을 상세조회 조회한다.
   *
   * @param searchVO -검색정보가 담긴 Model
   * @param commandMap -Request Variable
   * @param noteRecptn -받은쪽지함관리 Model
   * @param model -Spring 제공하는 ModelMap
   * @return String -리턴 URL
   * @throws Exception
   */
  @RequestMapping(value = "/uss/ion/ntr/detailNoteRecptn.do")
  public String EgovNoteRecptnDetail(
      @ModelAttribute("searchVO") NoteRecptn searchVO,
      Map commandMap,
      @ModelAttribute("noteRecptn") NoteRecptn noteRecptn,
      ModelMap model)
      throws Exception {

    String sLocationUrl = "egovframework/com/uss/ion/nts/EgovNoteTrnsmitDetail";

    String sCmd = commandMap.get("cmd") == null ? "" : (String) commandMap.get("cmd");

    if (sCmd.equals("del")) {
      egovNoteRecptnService.deleteNoteRecptn(searchVO);
      return "redirect:/uss/ion/ntr/listNoteRecptn.do";
    } else {
      // 로그인 객체 선언/아이디설정
      LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
      searchVO.setFrstRegisterId((String) loginVO.getUniqId());
      searchVO.setLastUpdusrId((String) loginVO.getUniqId());

      Map noteRecptnMap = egovNoteRecptnService.selectNoteRecptnDetail(searchVO);
      model.addAttribute("noteRecptn", noteRecptnMap);

      egovframework.com.uss.ion.nts.service.NoteTrnsmit noteTrnsmit =
          new egovframework.com.uss.ion.nts.service.NoteTrnsmit();
      noteTrnsmit.setNoteId((String) commandMap.get("noteId"));

      List resultRecptnEmp = egovNoteTrnsmitService.selectNoteTrnsmitCnfirm(noteTrnsmit);
      model.addAttribute("resultRecptnEmp", resultRecptnEmp);
    }

    return "egovframework/com/uss/ion/ntr/EgovNoteRecptnDetail";
  }
  @PreAuthorize("hasRole('ROLE_ADMIN')")
  @RequestMapping(
      value = "/registration/{clientId}",
      method = RequestMethod.PUT,
      produces = MediaType.APPLICATION_JSON_VALUE)
  public String rotateRegistrationTokenByClientId(
      @PathVariable("clientId") String clientId, ModelMap m, Principal p) {
    ClientDetailsEntity client = clientService.loadClientByClientId(clientId);

    if (client != null) {
      OAuth2AccessTokenEntity token =
          oidcTokenService.rotateRegistrationAccessTokenForClient(client);
      token = tokenService.saveAccessToken(token);

      if (token != null) {
        m.put(JsonEntityView.ENTITY, token);
        return TokenApiView.VIEWNAME;
      } else {
        m.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
        m.put(JsonErrorView.ERROR_MESSAGE, "No registration token could be found.");
        return JsonErrorView.VIEWNAME;
      }
    } else {
      // client not found
      m.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
      m.put(
          JsonErrorView.ERROR_MESSAGE,
          "The requested client with id " + clientId + " could not be found.");
      return JsonErrorView.VIEWNAME;
    }
  }
  /**
   * 권한별 할당된 롤 목록 조회
   *
   * @param authorRoleManageVO AuthorRoleManageVO
   * @return String
   * @exception Exception
   */
  @RequestMapping(value = "/sec/ram/EgovAuthorRoleList.do")
  public String selectAuthorRoleList(
      @ModelAttribute("authorRoleManageVO") AuthorRoleManageVO authorRoleManageVO, ModelMap model)
      throws Exception {

    /** paging */
    PaginationInfo paginationInfo = new PaginationInfo();
    paginationInfo.setCurrentPageNo(authorRoleManageVO.getPageIndex());
    paginationInfo.setRecordCountPerPage(authorRoleManageVO.getPageUnit());
    paginationInfo.setPageSize(authorRoleManageVO.getPageSize());

    authorRoleManageVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
    authorRoleManageVO.setLastIndex(paginationInfo.getLastRecordIndex());
    authorRoleManageVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());

    authorRoleManageVO.setAuthorRoleList(
        egovAuthorRoleManageService.selectAuthorRoleList(authorRoleManageVO));
    model.addAttribute("authorRoleList", authorRoleManageVO.getAuthorRoleList());

    int totCnt = egovAuthorRoleManageService.selectAuthorRoleListTotCnt(authorRoleManageVO);
    paginationInfo.setTotalRecordCount(totCnt);
    model.addAttribute("paginationInfo", paginationInfo);

    model.addAttribute("message", egovMessageSource.getMessage("success.common.select"));

    return "egovframework/com/sec/ram/EgovAuthorRoleManage";
  }
Esempio n. 8
0
  @RequestMapping(method = RequestMethod.GET)
  protected String processGet(
      @RequestAttribute Context context,
      ModelMap model,
      HttpServletRequest request,
      HttpServletResponse response)
      throws ServletException, IOException, SQLException, AuthorizeException {

    Group group = null;
    group = checkGroup(context, request);

    if (group != null) {

      // unknown action, show edit page
      model.addAttribute("group", group);
      model.addAttribute("members", group.getMembers());
      model.addAttribute("membergroups", group.getMemberGroups());

      String utilsGrpName = Utils.addEntities(group.getName());
      model.addAttribute("utilsGrpName", utilsGrpName);
      return "pages/admin/group-edit";

    } else {

      return showMainPage(context, model, request, response);
    }
  } // end processGet
  /**
   * 로그인정책 목록을 조회한다.
   *
   * @param loginPolicyVO - 로그인정책 VO
   * @return String - 리턴 Url
   */
  @IncludedInfo(name = "로그인정책관리", order = 30, gid = 10)
  @RequestMapping("/uat/uap/selectLoginPolicyList.do")
  public String selectLoginPolicyList(
      @ModelAttribute("loginPolicyVO") LoginPolicyVO loginPolicyVO, ModelMap model)
      throws Exception {

    /** paging */
    PaginationInfo paginationInfo = new PaginationInfo();
    paginationInfo.setCurrentPageNo(loginPolicyVO.getPageIndex());
    paginationInfo.setRecordCountPerPage(loginPolicyVO.getPageUnit());
    paginationInfo.setPageSize(loginPolicyVO.getPageSize());

    loginPolicyVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
    loginPolicyVO.setLastIndex(paginationInfo.getLastRecordIndex());
    loginPolicyVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());

    loginPolicyVO.setLoginPolicyList(egovLoginPolicyService.selectLoginPolicyList(loginPolicyVO));
    model.addAttribute("loginPolicyList", loginPolicyVO.getLoginPolicyList());

    int totCnt = egovLoginPolicyService.selectLoginPolicyListTotCnt(loginPolicyVO);
    paginationInfo.setTotalRecordCount(totCnt);
    model.addAttribute("paginationInfo", paginationInfo);
    model.addAttribute("message", egovMessageSource.getMessage("success.common.select"));

    return "egovframework/com/uat/uap/EgovLoginPolicyList";
  }
  /**
   * 기 등록 된 지식정보평가 정보를 수정 한다.
   *
   * @param AppraisalknoAps - 지식정보평가 model
   * @return String - 리턴 Url
   * @param knoAps
   */
  @RequestMapping(value = "/dam/app/EgovComDamAppraisalModify.do")
  public String updateKnoAppraisal(
      @ModelAttribute("knoId") KnoAppraisal knoAppraisal,
      BindingResult bindingResult,
      Map commandMap,
      ModelMap model)
      throws Exception {

    // 로그인 객체 선언
    LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();

    String sCmd = commandMap.get("cmd") == null ? "" : (String) commandMap.get("cmd");
    if (sCmd.equals("")) {
      KnoAppraisal vo = knoAppraisalService.selectKnoAppraisal(knoAppraisal);
      model.addAttribute("knoAppraisal", vo);
      return "egovframework/com/dam/app/EgovComDamAppraisalModify";
    } else if (sCmd.equals("Modify")) {
      beanValidator.validate(knoAppraisal, bindingResult);
      if (bindingResult.hasErrors()) {
        KnoAppraisal vo = knoAppraisalService.selectKnoAppraisal(knoAppraisal);
        model.addAttribute("knoAppraisal", vo);
        return "egovframework/com/dam/app/EgovComDamAppraisalModify";
      }

      // 아이디 설정
      // knoAppraisal.setFrstRegisterId((String)loginVO.getUniqId());
      // knoAppraisal.setLastUpdusrId((String)loginVO.getUniqId());
      knoAppraisal.setSpeId((String) loginVO.getUniqId());

      knoAppraisalService.updateKnoAppraisal(knoAppraisal);
      return "forward:/dam/app/EgovComDamAppraisalList.do";
    } else {
      return "forward:/dam/app/EgovComDamAppraisalList.do";
    }
  }
 /*
  * This method will provide the medium to add a new company.
  */
 @RequestMapping(value = "/new", method = RequestMethod.GET)
 public String newCompany(ModelMap model) {
   Company company = new Company();
   model.addAttribute("company", company);
   model.addAttribute("edit", false);
   return "registration";
 }
  /**
   * 모바일 기기 정보 수정 Service interface 호출 및 결과를 반환한다.
   *
   * @param deviceIdentVO
   */
  @RequestMapping(value = "/mbl/com/mdi/updateDeviceIdent.do")
  @Secured("ROLE_ADMIN")
  public String updateDeviceIdent(
      @ModelAttribute DeviceIdentVO deviceIdentVO, BindingResult bindingResult, ModelMap model) {

    // Validation
    beanValidator.validate(deviceIdentVO, bindingResult);
    if (bindingResult.hasErrors()) {

      model.addAttribute("browserCmmCodeDetailList", cmmUseService.selectCmmCodeList("COM083"));
      model.addAttribute("osCmmCodeDetailList", cmmUseService.selectCmmCodeList("COM084"));

      RequestContextHolder.getRequestAttributes()
          .setAttribute("jspPrefix", "aramframework/mbl", RequestAttributes.SCOPE_REQUEST);
      return WebUtil.adjustViewName("/com/mdi/DeviceIdentEdit");
    }

    deviceIdentService.updateDeviceIdent(deviceIdentVO);

    // XML 파일 생성
    deviceIdentService.createDeviceIndentListToXML();

    model.addAttribute("message", MessageHelper.getMessage("success.common.insert"));
    return WebUtil.redirectJsp(model, "/mbl/com/mdi/listDeviceIdent.do");
  }
  /**
   * 모바일 기기 정보 등록 Service interface 호출 및 결과를 반환한다.
   *
   * @param deviceIdentVO
   */
  @RequestMapping(value = "/mbl/com/mdi/insertDeviceIdent.do")
  @Secured("ROLE_ADMIN")
  public String insertDeviceIdent(
      @ModelAttribute DeviceIdentVO deviceIdentVO, BindingResult bindingResult, ModelMap model) {

    beanValidator.validate(deviceIdentVO, bindingResult);
    if (bindingResult.hasErrors()) {

      model.addAttribute("browserCmmCodeDetailList", cmmUseService.selectCmmCodeList("COM083"));
      model.addAttribute("osCmmCodeDetailList", cmmUseService.selectCmmCodeList("COM084"));

      RequestContextHolder.getRequestAttributes()
          .setAttribute("jspPrefix", "aramframework/mbl", RequestAttributes.SCOPE_REQUEST);
      return WebUtil.adjustViewName("/com/mdi/DeviceIdentRegist");
    }

    // 로그인VO에서 사용자 정보 가져오기
    LoginVO loginVO = (LoginVO) UserDetailsHelper.getAuthenticatedUser();
    deviceIdentVO.setMberId(loginVO.getId());
    deviceIdentVO.setBrowserNm("COM083");
    deviceIdentVO.setOsNm("COM084");

    deviceIdentService.insertDeviceIdent(deviceIdentVO);

    // XML 파일 생성
    deviceIdentService.createDeviceIndentListToXML();

    model.addAttribute("message", MessageHelper.getMessage("success.common.insert"));
    return WebUtil.redirectJsp(model, "/mbl/com/mdi/listDeviceIdent.do");
  }
  /**
   * 등록된 PROCESS모니터링 정보를 조회 한다.
   *
   * @param processMonVO- PROCESS모니터링 VO
   * @return String - 리턴 Url
   * @param processMonVO
   */
  @IncludedInfo(name = "프로세스모니터링", order = 2110, gid = 90)
  @RequestMapping("/utl/sys/prm/EgovComUtlProcessMonList.do")
  public String selectProcessMonList(
      @ModelAttribute("searchVO") ProcessMonVO processMonVO, ModelMap model) throws Exception {

    // 로그인 객체 선언
    LoginVO loginVO = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();

    processMonVO.setPageUnit(propertyService.getInt("pageUnit"));
    processMonVO.setPageSize(propertyService.getInt("pageSize"));

    PaginationInfo paginationInfo = new PaginationInfo();
    paginationInfo.setCurrentPageNo(processMonVO.getPageIndex());
    paginationInfo.setRecordCountPerPage(processMonVO.getPageUnit());
    paginationInfo.setPageSize(processMonVO.getPageSize());

    processMonVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
    processMonVO.setLastIndex(paginationInfo.getLastRecordIndex());
    processMonVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());

    List ProcessMonList = processMonService.selectProcessMonList(processMonVO);
    model.addAttribute("resultList", ProcessMonList);

    int totCnt = processMonService.selectProcessMonTotCnt(processMonVO);
    paginationInfo.setTotalRecordCount(totCnt);
    model.addAttribute("paginationInfo", paginationInfo);

    return "egovframework/com/utl/sys/prm/EgovComUtlProcessMonList";
  }
Esempio n. 15
0
 /** @return @Description:详情页面 */
 @RequestMapping("/detailUI")
 @Permission(systemSn = "privilege", moduleSn = "user", value = PermissionConatant.R)
 public String detailUI(String sessionId, ModelMap model, String userId) {
   model.addAttribute("sessionId", sessionId);
   model.addAttribute("userId", userId);
   return "/privilege/user_detail";
 }
  /**
   * 승인(탈퇴)요청 확인 처리를 위해 수정페이지로 이동한다.
   *
   * @param historyVO
   * @param status
   * @param model
   * @return
   * @throws Exception
   */
  @SuppressWarnings("unchecked")
  @RequestMapping("/cop/com/forUpdateConfirmRequest.do")
  public String forUpdateConfirmRequest(
      @ModelAttribute("searchVO") ConfirmHistoryVO historyVO, SessionStatus status, ModelMap model)
      throws Exception {

    LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
    Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();

    historyVO.setConfmerId(user.getUniqId());

    if (isAuthenticated) {
      ConfirmHistoryVO vo = confmService.selectSingleConfirmRequest(historyVO);
      model.addAttribute("historyVO", vo);
    }

    ComDefaultCodeVO vo = new ComDefaultCodeVO();

    vo.setCodeId("COM007");

    List codeResult = cmmUseService.selectCmmCodeDetail(vo);

    model.addAttribute("typeList", codeResult);

    return "egovframework/com/cop/com/EgovConfmInfUpdt";
  }
Esempio n. 17
0
 /**
  * @param userId
  * @param model
  * @return @Description:分配角色页面
  */
 @RequestMapping("/insertRoleUI")
 @Permission(systemSn = "privilege", moduleSn = "user", value = PermissionConatant.C)
 public String insertRoleUI(String userId, String sessionId, ModelMap model) {
   model.addAttribute("sessionId", sessionId);
   model.put("userId", userId);
   return "/privilege/user_role";
 }
  /**
   * 승인(탈퇴)요청에 대한 목록을 조회한다.
   *
   * @param historyvO
   * @param sessionVO
   * @param status
   * @param model
   * @return
   * @throws Exception
   */
  @RequestMapping("/cop/com/selectConfirmRequest.do")
  public String selectConfirmRequest(
      @ModelAttribute("searchVO") ConfirmHistoryVO historyVO, SessionStatus status, ModelMap model)
      throws Exception {

    LoginVO user = (LoginVO) EgovUserDetailsHelper.getAuthenticatedUser();
    @SuppressWarnings("unused")
    Boolean isAuthenticated = EgovUserDetailsHelper.isAuthenticated();

    historyVO.setPageUnit(propertyService.getInt("pageUnit"));
    historyVO.setPageSize(propertyService.getInt("pageSize"));

    PaginationInfo paginationInfo = new PaginationInfo();

    paginationInfo.setCurrentPageNo(historyVO.getPageIndex());
    paginationInfo.setRecordCountPerPage(historyVO.getPageUnit());
    paginationInfo.setPageSize(historyVO.getPageSize());

    historyVO.setFirstIndex(paginationInfo.getFirstRecordIndex());
    historyVO.setLastIndex(paginationInfo.getLastRecordIndex());
    historyVO.setRecordCountPerPage(paginationInfo.getRecordCountPerPage());
    historyVO.setConfmerId(user.getUniqId());

    Map<String, Object> map = confmService.selectConfirmRequest(historyVO);
    int totCnt = Integer.parseInt((String) map.get("resultCnt"));

    paginationInfo.setTotalRecordCount(totCnt);

    model.addAttribute("resultList", map.get("resultList"));
    model.addAttribute("resultCnt", map.get("resultCnt"));
    model.addAttribute("paginationInfo", paginationInfo);

    return "egovframework/com/cop/com/EgovConfirmList";
  }
  @RequestMapping(
      value = "/access/{id}",
      method = RequestMethod.GET,
      produces = MediaType.APPLICATION_JSON_VALUE)
  public String getAccessTokenById(@PathVariable("id") Long id, ModelMap m, Principal p) {

    OAuth2AccessTokenEntity token = tokenService.getAccessTokenById(id);

    if (token == null) {
      logger.error("getToken failed; token not found: " + id);
      m.put(HttpCodeView.CODE, HttpStatus.NOT_FOUND);
      m.put(
          JsonErrorView.ERROR_MESSAGE,
          "The requested token with id " + id + " could not be found.");
      return JsonErrorView.VIEWNAME;
    } else if (!token.getAuthenticationHolder().getAuthentication().getName().equals(p.getName())) {
      logger.error("getToken failed; token does not belong to principal " + p.getName());
      m.put(HttpCodeView.CODE, HttpStatus.FORBIDDEN);
      m.put(JsonErrorView.ERROR_MESSAGE, "You do not have permission to view this token");
      return JsonErrorView.VIEWNAME;
    } else {
      m.put(JsonEntityView.ENTITY, token);
      return TokenApiView.VIEWNAME;
    }
  }
  /**
   * API to display entry-form for adding a new UtilityAttribute time Usage :
   * /UtilityAttribute/create
   *
   * @param
   * @return : name of jsp file
   */
  @RequestMapping(value = "/utilityattribute/create/{uid}/{slno}", method = RequestMethod.GET)
  public String showNewUtilityAttribute(
      ModelMap model, @PathVariable("uid") int utilityid, @PathVariable("slno") int slno) {

    int stat = -1;
    if (slno != -1) {
      boolean bln = mastersservice.deleteUtilityAttr(slno);
      if (bln) {
        stat = 1;
      } else {
        stat = -1;
      }
    }

    logger.info(" going to create new UtilityAttribute");
    UtilityAttributes uattr = new UtilityAttributes();
    uattr.setUtilityid(utilityid);
    model.addAttribute("utilityattribute", uattr);
    List<Attributes> attrList = mastersservice.getAttributeList();
    model.addAttribute("attrList", attrList);
    model.addAttribute("utilityid", utilityid);
    List<UtilityAttributes> utlyattr = mastersservice.getUtilityAttr(utilityid);
    model.addAttribute("utlyattr", utlyattr);
    model.addAttribute("stat", stat);
    return "utilityattributes";
  }
  @RequestMapping(value = "/offer/{offerName}", method = RequestMethod.GET)
  public String showPage(
      @PathVariable("offerName") String articleId,
      ModelMap model,
      HttpServletRequest request,
      HttpServletResponse response)
      throws DocumentException {

    LOGGER.info(" Processing request for offer : " + articleId);

    if (PRE_DEFINED_OFFERS.containsKey(articleId)) articleId = PRE_DEFINED_OFFERS.get(articleId);

    String content =
        cmsRequestHandler.getOffersCmsContent(
            articleId, null, OPEN_CAMPAIGN_TEMPLATE_FILE_KEY, false);
    articleId = getArticleId(articleId);

    if (requestedOnMobile(request)) {
      String modifiedUrl = constructRedirectUrl(request);
      if (!StringUtils.isBlank(modifiedUrl)) {
        Utility.saveCookie(response, "detectmobilesticky", "true");
        return modifiedUrl;
      }
    }

    model.addAttribute("content", content);
    model.addAttribute("title", articleId);

    List metaContent =
        cmsRequestHandler.getCmsMetaContent(
            model, request, articleId, Integer.parseInt(CMS_APPROVED_STATUS));
    if (metaContent.size() > 0) model.addAttribute("metaContent", metaContent);

    return VIEW_OFFER_PAGE;
  }
  @RequestMapping(
      value = {"/add-document-{userId}"},
      method = RequestMethod.POST)
  public String uploadDocument(
      @Valid FileBucket fileBucket, BindingResult result, ModelMap model, @PathVariable int userId)
      throws IOException {

    if (result.hasErrors()) {
      System.out.println("validation errors");
      User user = userService.findById(userId);
      model.addAttribute("user", user);

      List<UserDocument> documents = userDocumentService.findAllByUserId(userId);
      model.addAttribute("documents", documents);

      return "managedocuments";
    } else {

      System.out.println("Fetching file");

      User user = userService.findById(userId);
      model.addAttribute("user", user);

      saveDocument(fileBucket, user);

      return "redirect:/add-document-" + userId;
    }
  }
Esempio n. 23
0
  @RequestMapping(value = "/delete/{pid}", method = RequestMethod.GET)
  public String deletePayment(ModelMap modelMap, @PathVariable int pid) {

    Payment payment = paymentService.getPaymentById(pid);
    logService.addLog(
        new Log(
            sessionBean.getUserName(),
            "delete",
            "payment delete",
            "удален платеж на сумму: "
                + payment.getCredit()
                + "/ "
                + payment.getDebt()
                + " для клиента "
                + payment.getClientP().getName()
                + " "
                + payment.getClientP().getContractInfo()
                + " "
                + payment.getReason()));

    if (payment.getInvoiceP() != null || payment.getWaybill() != null) {
      modelMap.addAttribute("message", "unable to remove this type of payment!");
      return "/auth/message";
    }

    String message = "payment with id " + payment.getId() + " has been deleted";
    paymentService.deletePayment(payment);
    System.out.println("deleting!!");
    modelMap.addAttribute("message", message);
    return "/auth/message";
  }
Esempio n. 24
0
 /** 添加 */
 @RequestMapping(value = "/add", method = RequestMethod.GET)
 public String add(ModelMap model) {
   model.addAttribute("genders", Gender.values());
   model.addAttribute("memberRanks", memberRankService.findAll());
   model.addAttribute("memberAttributes", memberAttributeService.findList());
   return "/admin/member/add";
 }
  protected boolean addCategoryListToModel(
      List<Category> categoryList, Category rootCategory, String url, ModelMap model) {
    boolean categoryError = false;

    while (categoryList == null) {
      categoryError = true;

      int pos = url.indexOf("/");
      if (pos == -1) {
        categoryList = new ArrayList<Category>(1);
        categoryList.add(rootCategory);
      } else {
        url = url.substring(0, url.lastIndexOf("/"));
        List<Long> categoryIdList =
            catalogService.getChildCategoryURLMapByCategoryId(rootCategory.getId()).get(url);
        if (categoryIdList != null) {
          categoryList = new ArrayList<Category>(categoryIdList.size());
          for (Long id : categoryIdList) {
            categoryList.add(catalogService.findCategoryById(id));
          }
        }
      }
    }

    List<Category> siblingCategories = new ArrayList<Category>();
    Category currentCategory = (Category) categoryList.get(categoryList.size() - 1);
    siblingCategories = currentCategory.getAllChildCategories();

    model.addAttribute("breadcrumbCategories", categoryList);
    model.addAttribute("currentCategory", categoryList.get(categoryList.size() - 1));
    model.addAttribute("categoryError", categoryError);
    model.addAttribute("displayCategories", siblingCategories);

    return categoryError;
  }
Esempio n. 26
0
 /** 列表 */
 @RequestMapping(value = "/list", method = RequestMethod.GET)
 public String list(Pageable pageable, ModelMap model) {
   model.addAttribute("memberRanks", memberRankService.findAll());
   model.addAttribute("memberAttributes", memberAttributeService.findAll());
   model.addAttribute("page", memberService.findPage(pageable));
   return "/admin/member/list";
 }
  private String showCatalog(ModelMap model, HttpServletRequest request, CatalogSort catalogSort) {
    addCategoryToModel(request, model);
    boolean productFound = addProductsToModel(request, model, catalogSort);

    String view = defaultCategoryView;
    if (productFound) {
      // TODO: Nice to have: product logic similar to category below
      view = defaultProductView;
    } else {
      Category currentCategory = (Category) model.get("currentCategory");
      if (currentCategory.getUrl() != null && !"".equals(currentCategory.getUrl())) {
        return "redirect:" + currentCategory.getUrl();
      } else if (currentCategory.getDisplayTemplate() != null
          && !"".equals(currentCategory.getUrl())) {
        view = categoryTemplatePrefix + currentCategory.getDisplayTemplate();
      } else {
        if ("true".equals(request.getParameter("ajax"))) {
          view = "catalog/categoryView/mainContentFragment";
        } else {
          view = defaultCategoryView;
        }
      }
    }

    if (catalogSort == null) {
      model.addAttribute("catalogSort", new CatalogSort());
    }

    List<Order> wishlists =
        cartService.findOrdersForCustomer(customerState.getCustomer(request), OrderStatus.NAMED);
    model.addAttribute("wishlists", wishlists);

    return view;
  }
Esempio n. 28
0
 /** 查看 */
 @RequestMapping(value = "/view", method = RequestMethod.GET)
 public String view(Long id, ModelMap model) {
   model.addAttribute("genders", Gender.values());
   model.addAttribute("memberAttributes", memberAttributeService.findList());
   model.addAttribute("member", memberService.find(id));
   return "/admin/member/view";
 }
 @RequestMapping("/add/{id}")
 public String add(@PathVariable String id, ModelMap m) {
   m.put("archive_id", id);
   m.put("DicList", dictionaryService.listDictionaryByPid("3"));
   m.put("jxnr", choicenesscontentService.selectByKey(id));
   return "system/jxnr/jxnrinfo";
 }
Esempio n. 30
0
 @RequestMapping(value = "/jobs/{jobId}/delete")
 public String deleteJob(@PathVariable String jobId, HttpServletRequest request, ModelMap model) {
   User user = (User) request.getSession().getAttribute("user");
   if (user == null) {
     model.addAttribute("errorMsg", "User has no permission");
     return "login";
   }
   try {
     // Archive applications as well
     List<Application> applications =
         ApplicationsDao.instance.getByJob(ORSKEY, user.getShortKey(), jobId);
     if (request.getParameter("selectedCandidate") != null) {
       for (Application a : applications) {
         a.setStatus(ApplicationStatus.ARCHIVED);
         ApplicationsDao.instance.update(a);
       }
     }
     JobsDao.instance.delete(ORSKEY, user.getShortKey(), jobId);
     return "redirect:/jobs";
   } catch (Exception e) {
     e.printStackTrace();
     model.addAttribute("errorMsg", e.getMessage());
     return "error";
   }
 }