Exemple #1
0
  @RequestMapping("/welcome.htm_2")
  public String loadContacts(Map<String, Object> map) {

    String tmp_commu_id = "00001";

    // map.put("contact", new Contact());
    // map.put("contactList", contactService.getContact());
    map.put("BlogNews", new BlogNews());
    map.put("loginm", new LoginForm());
    map.put("BlogNewsList", contactService.getBlogNews(tmp_commu_id));
    List<BlogNews> gg = contactService.getBlogNews(tmp_commu_id);
    System.out.println("test thai" + gg.get(0).getDetails());

    return "contract-us";
  }
Exemple #2
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";
  }
Exemple #3
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;
  }
Exemple #4
0
  @RequestMapping(value = "/home/{commuId}/{lanuageId}/{menuId}", method = RequestMethod.GET)
  public String home(
      Map<String, Object> map,
      @PathVariable("commuId") int commuId,
      @PathVariable("lanuageId") int lanuageId,
      @PathVariable("menuId") int MenuID,
      @ModelAttribute(value = "userdetail") UserProfileForm userdetail) {

    // init page
    // VCommunity commuDetails= loadPageService.loadCommunityDeatils(commuId, 1);
    boolean flagLogin = false;
    boolean flagFullDetails = false;
    List<VModuleSubmenu> vModuleSubmenuList = new ArrayList<VModuleSubmenu>();
    // int commuid get from request
    if (userdetail != null && userdetail.getUserName() != null) {
      flagLogin = true;
    }
    // --end init page

    // login Process
    if (flagLogin) {
      map.put(
          "NEW_SUB_MENU",
          getStringSubMenu(
              loadPageService.loadMenuSubmenu(lanuageId, commuId, userdetail.getRoleList()),
              commuId,
              lanuageId,
              MenuID));
      vModuleSubmenuList = loadPageService.getUserPrivilege(commuId, userdetail.getRoleList());
      map.put("listNewUser", contactService.getUserImgDetails(commuId, false));
      //    		map.put("MENU_LIST", loadPageService.loadMenuSubmenu( lanuageId ,commuId
      // ,userdetail.getRoleList()),commuId,lanuageId,MenuID);
    } else {
      vModuleSubmenuList = loadPageService.getUserPrivilege(commuId, new int[] {0});
      map.put(
          "NEW_SUB_MENU",
          getStringSubMenu(
              loadPageService.loadMenuSubmenu(lanuageId, commuId, new int[] {6}),
              commuId,
              lanuageId,
              MenuID));
      map.put("MENU_LIST", loadPageService.loadMenuSubmenu(lanuageId, commuId, new int[] {6}));
      map.put("listNewUser", contactService.getUserImgDetails(commuId, false));
    }
    map.put("ACCESS_CONTROL", vModuleSubmenuList);
    map.put("menuform", new MenuForm());
    map.put("adobj", new BlogAd());
    map.put("commuID", commuId);
    map.put("lanuageId", lanuageId);

    for (VModuleSubmenu vModuleSubmenu : vModuleSubmenuList) {
      int moduleId = vModuleSubmenu.getModuleId();
      if (moduleId == 9 && flagLogin != true) {
        // loadBlog(map,9 , commuId, lanuageId,packageID , false,userdetail);
      } else {
        // loadBlog(map, moduleId, commuId, lanuageId,packageID , flagFullDetails,userdetail);
        loadBlog(map, moduleId, commuId, lanuageId, flagFullDetails, userdetail);
      }
    }

    if (flagLogin) {
      // loadBlog(map, 100, commuId, lanuageId,packageID , flagFullDetails,userdetail);
      loadBlog(map, 100, commuId, lanuageId, flagFullDetails, userdetail);
    }
    return "welcome.htm";
  }