Example #1
0
  @RequestMapping(
      value = {ViewPath.SERVICES_CATALOG_PORTAL},
      method = RequestMethod.GET)
  public String handleRequestPortalServices(HttpServletRequest request, ModelMap model)
      throws SSOException {

    String languageCode = request.getParameter("languageCode");
    String multiticket = (String) request.getSession().getAttribute("ticketid");

    String site = "uaq";
    String pageName = "";
    String source = (String) request.getServletPath();
    if (source.contains("/")) {
      pageName = source.split("/")[2];
      pageName = (pageName.split(".html")[0]);
    }
    NavigationVO navigationVO = new NavigationVO();
    navigationVO.setSite(site);
    navigationVO.setLanguage(request.getParameter("languageCode"));
    navigationVO.setName(UrlTransliterationUtil.getString(pageName));
    navigationVO.setTicketId(multiticket);

    logger.enter("Call Service for" + ViewPath.SERVICES_CATALOG);

    ServicesCatalogPageVO servicesCatalogPageVO = null;

    NavigationVO navigation;
    try {
      navigation = pageReferneceDAO.findByPrimaryKey(navigationVO);
      navigationVO.setAssetId(navigation.getAssetId());
      servicesCatalogPageVO =
          ((ServicesCatalogPageService) servicesCatalogPageService).getPageVO(navigationVO);

    } catch (UAQException e1) {
      // TODO Auto-generated catch block
      e1.printStackTrace();
    }

    String view = "services.list";
    super.handleRequest(request, model);

    Map<String, List<ServicesVO>> serviceMap = null;
    try {
      serviceMap = servicesService.getServices(languageCode);
    } catch (UAQException e) {
      // TODO Auto-generated catch block
      e.printStackTrace();
    }
    model.addAttribute("servicesCatalogPageVO", servicesCatalogPageVO);
    model.addAttribute("serviceMap", serviceMap);
    model.addAttribute("languageCode", languageCode);
    model.addAttribute("pageMetadata", servicesCatalogPageVO.getPageMetadataVO());

    return view;
  }
Example #2
0
  @RequestMapping(value = ViewPath.SITES_SERVICES_DETAIL, method = RequestMethod.GET)
  public String handleDetailRequest(
      @PathVariable("site") String site,
      @PathVariable("parent") String parent,
      @PathVariable("name") String name,
      HttpServletRequest request,
      ModelMap model)
      throws SSOException {

    String view = "sites.services.detail";
    logger.enter("Get Sites Services Detail | handle Request");

    super.handleDepartmentRequest(request, model, site);
    ServicesVO serviceVO = null;
    String pageName = "Services";
    NavigationVO navigationVO = new NavigationVO();
    navigationVO.setSite(site);
    navigationVO.setTicketId((String) request.getSession().getAttribute(SESSION_TICKET));
    navigationVO.setName(UrlTransliterationUtil.getString(name));
    navigationVO.setLanguage(request.getParameter("languageCode"));
    GenericPageVO genericPageVO = null;

    try {

      serviceVO = serviceDetailService.execute(navigationVO);

      navigationVO = null;
      navigationVO = new NavigationVO();
      navigationVO.setSite(site);
      navigationVO.setTicketId((String) request.getSession().getAttribute(SESSION_TICKET));
      navigationVO.setName(UrlTransliterationUtil.getString(pageName));
      navigationVO.setLanguage(request.getParameter("languageCode"));
      genericPageVO = ((GenericPageService) genericPageService).getPageMetaData(navigationVO);

      model.addAttribute("serviceVO", serviceVO);
      model.addAttribute("landing", parent);
      model.addAttribute("pageMetadata", genericPageVO.getPageMetadataVO());
    } catch (UAQException e) {
      logger.error("Error getting session " + e.getMessage());
    }

    // model.addAttribute("pageMetadata", serviceVO.getPageMetadataVO());

    return view;
  }