protected void hook43(List down) {
   if (down.getString(down.getSelectedIndex()).equals("Videos"))
     videoController.init(videoAlbumData);
   original(down);
 }
Пример #2
0
 private void joBotDrive(int curState, int newState, int l, int r, int t) {
   if (state == curState) { // cur = Current, ofwel huidige waarde
     if (count < 5) {
       joBot.drive(100, 0);
     } else if (count <= 25) {
       joBot.drive(100, 100);
     }
     if (count++ >= t) {
       state = newState;
       joBot.printLCD("State=" + state);
       count = 0;
     }
   }
 }
 /**
  * 返回页面。
  *
  * @param request
  * @return
  */
 @RequestMapping(
     value = "/remind_password.do",
     method = {RequestMethod.GET, RequestMethod.POST, RequestMethod.HEAD})
 public ModelAndView handleRequestInternal(HttpServletRequest request) {
   ModelAndView mav = new ModelAndView("/remind_password");
   super.setModelAndView(mav, request);
   return mav;
 }
Пример #4
0
  @Override
  public void doAfterCompose(Component comp) throws Exception {
    super.doAfterCompose(comp);
    user = new Users();

    // clean user session
    session.removeAttribute(IConstants.KEY_USER);
    session.removeAttribute(IConstants.KEY_OKM_TOKEN);
    page.setAttribute(this.getClass().getSimpleName(), this);
  }
Пример #5
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;
  }
 /**
  * 由修改密码提示到修改密码
  *
  * @param request
  * @return
  */
 @RequestMapping(
     value = "/remind_modify_password.do",
     method = {RequestMethod.GET, RequestMethod.POST, RequestMethod.HEAD})
 public ModelAndView remindModifyPassword(HttpServletRequest request) {
   request.setAttribute("j_username", request.getParameter("j_username"));
   request.setAttribute("show_username", request.getParameter("show_username"));
   request.setAttribute("op", request.getParameter("op"));
   ModelAndView mav = new ModelAndView("/modify_password");
   super.setModelAndView(mav, request);
   return mav;
 }
Пример #7
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;
  }
Пример #8
0
  /**
   * Executes action.
   *
   * @param ctx
   * @param ctrlName
   * @param actionName
   * @return
   * @throws NoSuchActionException
   */
  public Target executeAction(Context ctx, String ctrlName, String actionName)
      throws NoSuchActionException {

    ControllerInfo controllerInfo = controllers.get(ctrlName);
    if (controllerInfo == null) {
      throw new NoSuchActionException(ctrlName + "/" + actionName);
    }

    /* create new instance of controller for specified ctrlName */
    BaseController ctrl = getController(ctrlName);

    if (StringUtils.isEmpty(actionName)) {
      actionName = controllerInfo.defaultActionName;
    }
    try {
      /* allow pre-processing */
      ctrl.beforeAction(actionName);

      /* find and invoke action */
      Target target = null;
      ActionInfo actionInfo = controllerInfo.actions.get(actionName);
      if (actionInfo == null) {
        throw new NoSuchActionException(ctrlName + "/" + actionName);
      }
      target = executeActionMethod(ctrl, actionInfo);

      /* allow post-processing */
      ctrl.afterAction(actionName, target);

      target = target != null ? target : new NullTarget();
      return target;
    } catch (
        ForceTargetException
            fte) { // action may throw this exception to force a target to be rendered
      return fte.getTarget();
    }
  }
Пример #9
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;
  }