Esempio n. 1
0
  @RequestMapping(value = ViewPath.SERVICES_DETAIL, method = RequestMethod.GET)
  public String handleRequest(
      @PathVariable("site") String site,
      @PathVariable("name") String name,
      @PathVariable("sector") String sector,
      HttpServletRequest request,
      ModelMap model)
      throws UAQException {

    String view = null;
    String pageName = "servicecatalog";

    String multiticket = (String) request.getSession().getAttribute("ticketid");
    logger.debug("Multiticket is : " + multiticket);

    // String dept = getSite(sector);

    if (site.equals("uaq")) {
      view = "services.detail";
      logger.enter("Get Services Detail | handle Request");
      super.handleRequest(request, model);

      NavigationVO navigationVO = new NavigationVO();
      navigationVO.setSite(sector);
      navigationVO.setLanguage(request.getParameter("languageCode"));
      navigationVO.setName(UrlTransliterationUtil.getString(name));
      navigationVO.setTicketId(multiticket);
      GenericPageVO genericPageVO = null;

      NavigationVO navigation = contentReferneceDAO.findByPrimaryKey(navigationVO);
      try {
        AssetBean assetBean =
            AssetUtil.getAssetDetail(sector, "Content_C", navigation.getAssetId(), multiticket);
        ServicesVO serviceVO = (ServicesVO) this.mapper.mapAssetToVO(assetBean);

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

        genericPageVO = ((GenericPageService) genericPageService).getPageMetaData(navigationVO);

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

    return view;
  }
Esempio n. 2
0
  /**
   * !
   *
   * @param searchCommand
   * @return list of job Objects.
   */
  @Override
  public SearchResponseVO execute(SearchCommand searchCommand) throws UAQException {

    logger.enter("Entered execute of jobsDAO");
    List<JobVO> jobObjects = null;
    SearchResponseVO searchResponseVO = null;

    String queryString = prepareQueryString(searchCommand);

    try {
      jobObjects = jdbcTemplate.query(queryString, new Object[] {}, new JobMapper());

      if (jobObjects != null && jobObjects.size() > 0) {
        searchResponseVO = getVO(jobObjects, jobObjects.get(0).getCount());

        logger.debug("Size of results =" + jobObjects.size());
        logger.debug("Total results =" + jobObjects.get(0).getCount());

      } else {
        logger.debug("Size of results =" + 0);
        logger.debug("Total results =" + 0);
      }

    } catch (Exception e) {
      logger.error(e.getMessage());
    }

    logger.debug("Exiting JobsDAO");
    // TODO Auto-generated method stub
    return searchResponseVO;
  }
Esempio n. 3
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;
  }
Esempio n. 4
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;
  }