Example #1
0
  /**
   * Constructs an execution for the given HTTP request.
   *
   * @param creating which page is being creating for this execution, or null if none is being
   *     created.
   */
  public ExecutionImpl(
      ServletContext ctx,
      HttpServletRequest request,
      HttpServletResponse response,
      Desktop desktop,
      Page creating) {
    super(desktop, creating);
    _ctx = ctx;
    _request = request;
    _response = response;
    _xelctx = new ReqContext();

    Servlets.getBrowser(request); // update request info

    _attrs =
        new AttributesMap() {
          @SuppressWarnings("unchecked")
          protected Enumeration<String> getKeys() {
            return _request.getAttributeNames();
          }

          protected Object getValue(String key) {
            return _request.getAttribute(key);
          }

          protected void setValue(String key, Object val) {
            _request.setAttribute(key, val);
          }

          protected void removeValue(String key) {
            _request.removeAttribute(key);
          }
        };
  }
  @AfterCompose
  public void afterCompose(@ContextParam(ContextType.VIEW) Component view) {
    Double ie = Servlets.getBrowser(request, "ie");
    if (ie != null && ie < 8.0) {
      Clients.showNotification("This application does not support IE6/7", true);
    }

    Selectors.wireComponents(view, this, false);
  }
  @Init
  public void init() {

    mobile = Servlets.getBrowser(request, "mobile") != null;

    if (mobile) {
      css = "css/tablet.css.dsp";
    } else {
      css = "css/desktop.css.dsp";
    }

    menuGroups =
        new MenuGroupBean[] {
          new MenuGroupBean(
              "MAGAZZINO",
              new ListModelArray<MenuItemBean>(
                  new MenuItemBean[] {
                    new MenuItemBean("images/navigation/menu/articoli24.png", "Articoli"),
                    new MenuItemBean("images/navigation/menu/categorie24.png", "Categorie")
                  })),
          new MenuGroupBean(
              "ANAGRAFICHE",
              new ListModelArray<MenuItemBean>(
                  new MenuItemBean[] {
                    new MenuItemBean("images/navigation/menu/fornitori24.png", "Fornitori"),
                    new MenuItemBean("images/navigation/menu/clienti24.png", "Clienti")
                    //							,
                    //							new MenuItemBean(
                    //									"",
                    //									"Agenti")
                  })),
          new MenuGroupBean(
              "SCADENZE e PAGAMENTI",
              new ListModelArray<MenuItemBean>(
                  new MenuItemBean[] {
                    new MenuItemBean("images/navigation/menu/scadenziario24.png", "Scadenziario"),
                    new MenuItemBean("images/navigation/menu/promemoria24.png", "Promemoria")
                  })),
          new MenuGroupBean(
              "DOCUMENTI",
              new ListModelArray<MenuItemBean>(
                  new MenuItemBean[] {
                    new MenuItemBean(
                        "images/navigation/menu/documenti24.png", "Gestione Documenti"),
                    new MenuItemBean("images/navigation/menu/fatture24.png", "Fatture"),
                    new MenuItemBean("images/navigation/menu/ordini24.png", "Ordini"),
                    new MenuItemBean("images/navigation/menu/preventivi24.png", "Preventivi"),
                    new MenuItemBean(
                        "images/navigation/menu/spedizioni24.png", "Vendita al pubblico")
                  }))
        };

    user = new User();
    user.setUsername(authService.getUserCredential().getUsername());
  }
Example #4
0
 @Override
 public String getBrowser() {
   return Servlets.getBrowser(_request);
 }
Example #5
0
 @Override
 public Double getBrowser(String name) {
   return Servlets.getBrowser(_request, name);
 }