Beispiel #1
0
  @RequestMapping(value = "/saveContactUS/{commuId}/{lanuageId}", method = RequestMethod.POST)
  public String saveContactUS(
      @ModelAttribute("Worklist2") Worklist2 worklist2,
      BindingResult result,
      @PathVariable("commuId") int commuId,
      @PathVariable("lanuageId") int lanuageId,
      @ModelAttribute(value = "userdetail") UserProfileForm userdetail) {

    // check session

    int userID = 0;
    if (userdetail != null && userdetail.getUserName() != null) {
      System.out.println("USer  is " + userdetail.getUserName());
      userID = userdetail.getUserID();
    } else {
      System.out.println("Session is null ");
    }

    String[] touser = worklist2.getToUserName().split("\\|");
    worklist2.setWorklistSubjectId(Integer.valueOf(touser[0]));
    worklist2.setToUserName(touser[1]);
    worklist2.setCommunityId(commuId);
    worklist2.setWorklistTypeId(1);

    worklist2.setWorklistStatusId(1);
    worklist2.setModifyDate(new Date(System.currentTimeMillis()));
    worklist2.setCreateDate(new Date(System.currentTimeMillis()));
    worklist2.setAddressId(userdetail.getAddressID());
    worklist2.setFromUserId(userID);

    contactService.saveWorklist(worklist2);

    return "redirect:/haaksq/home/" + commuId + "/" + lanuageId + "/1";
  }
Beispiel #2
0
  private Map<String, Object> loadBlog(
      Map<String, Object> map,
      int moduleId,
      int commuId,
      int lanuageID,
      boolean fullDetail,
      UserProfileForm userDetail) {

    switch (moduleId) {
      case 0: // news
        map.put("smallBlogNews", loadPageService.getBlogNews(commuId, fullDetail));
        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_NEWS);
        break;

      case 2: // gallaryBlog
        map.put("gallaryBlogList", loadPageService.loadGallary(commuId, fullDetail));
        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_GALLERY);
        break;

      case 3: // SaleAndRent
        map.put(
            "smallBlogSaleAndRent",
            loadPageService.loadSaleAndRent(commuId, lanuageID, fullDetail));
        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_SALE_AND_RENT);
        break;

      case 4: // LifeStyle
        map.put(
            "smallBlogLifeStyle", loadPageService.loadLifeStyle(commuId, lanuageID, fullDetail));
        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_LIFE_STYLE);
        break;

      case 5: // WhatNearBy
        map.put(
            "smallBlogWhatNearByList",
            loadPageService.loadWhatNearBy(commuId, lanuageID, fullDetail));
        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_WHAT_NEAR_BY);
        break;

      case 7: // Opportunities
        map.put("smallBlogOppo", loadPageService.loadOppo(commuId, lanuageID, fullDetail));
        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_OPPORTUNITIES);
        break;

      case 8: // Contact Form
        boolean publicFlag = true;
        String defaultName = "Guest";
        if (userDetail != null
            && userDetail.getUserName() != null
            && userDetail.getUserName().trim().length() != 0) {
          publicFlag = false;
          defaultName = userDetail.getFirstName() + " " + userDetail.getLastName();
        }

        if (fullDetail) {
          Worklist2 wl = new Worklist2();
          wl.setFromUserName(defaultName);
          map.put("Worklist2", wl);
          map.put("SubjectList", contactService.getContactFormSubject(commuId, publicFlag));
        }
        map.put("newContactForm", "contactform.htm/" + commuId);
        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_CONTACT_FORM);
        map.put("commuID", commuId);
        map.put("lanuageId", lanuageID);
        break;
        /*		case 3://community blog
        map.put("smallBlogBOD", getSmallBlogModuleThree(false, 3, lanuageId));
        break;		*/

      case 9: // inbox
        if (userDetail != null
            && userDetail.getUserName() != null
            && userDetail.getUserName().trim().length() != 0) {
          for (int role : userDetail.getRoleList()) {
            if (role == 4) {
              map.put("ROLE_ADMIN", "Y");
            }
          }
        }
        if (userDetail != null
            && userDetail.getUserName() != null
            && userDetail.getUserName().trim().length() != 0) {
          map.put(
              "smallBlogInbox",
              loadPageService.getInboxByUser(
                  userDetail.getRoleList(), userDetail.getAddressID(), fullDetail));
        } else {
          map.put("smallBlogInbox", loadPageService.getInboxByUser(null, commuId, fullDetail));
        }

        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_INBOX);
        break;

      case 10: // SaleAndRent
        map.put("smallBlogBOD", blogService.getBOD(commuId, lanuageID, fullDetail));
        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_BOD);
        break;

      case 13: // resource
        if (userDetail != null
            && userDetail.getUserName() != null
            && userDetail.getUserName().trim().length() != 0) {
          map.put(
              "smallBlogresource",
              loadPageService.getResource(commuId, fullDetail, lanuageID, true));
        } else {
          map.put(
              "smallBlogresource",
              loadPageService.getResource(commuId, fullDetail, lanuageID, false));
        }

        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_RESOURCE);
        break;

      case 12: // About
        map.put("smallBlogCommu", loadPageService.loadCommunityDeatils(commuId, 1));
        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_COMMUNITY_DETAILS);
        break;

      case 14: // About
        map.put(
            "smallBlogContactNumber",
            loadPageService.getContractNumber(commuId, fullDetail, lanuageID));
        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_CONTACT_NUMBER);
        break;

      case 15: // TaskManager
        map.put("smallBlogTaskManager", loadPageService.getTaskManager(commuId, true, fullDetail));
        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_TASK_MANAGER);
        if (userDetail != null
            && userDetail.getUserName() != null
            && userDetail.getUserName().trim().length() != 0) {
          for (int role : userDetail.getRoleList()) {
            if (role == 4) {
              map.put("ROLE_ADMIN", "Y");
            }
          }
        }

        break;
      case 101: // NewsCommunity
        if (userDetail != null
            && userDetail.getUserName() != null
            && userDetail.getUserName().trim().length() != 0) {
          map.put(
              "smallBlogNewsCommunity",
              loadPageService.getNewsCommunity(commuId, fullDetail, lanuageID, true));
        } else {
          map.put(
              "smallBlogNewsCommunity",
              loadPageService.getNewsCommunity(commuId, fullDetail, lanuageID, false));
        }

        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_NEWS_COMMUNITY);
        break;
      case 102: // NewsGeneral
        map.put(
            "smallBlogNewsGeneral", loadPageService.getNewsGeneral(commuId, fullDetail, lanuageID));
        map.put(HaakConst.KEY_RETURN_PAGE, HaakConst.PAGE_NEWS_GENERAL);

        System.out.println(
            " New gen size >"
                + loadPageService.getNewsGeneral(commuId, fullDetail, lanuageID).size());

        break;

      default:
        break;
    }

    return map;
  }