private void reloadLists() {
    Include incL = (Include) getFellow("incContentLeft");
    incL.setSrc(null);
    incL.setSrc("/gui/main/content/ContentAssociationEditor.zul?id=1");

    Include incR = (Include) getFellow("incContentRight");
    incR.setSrc(null);
    incR.setSrc("/gui/main/content/ContentAssociationEditor.zul?id=2");
  }
Exemple #2
0
 @Listen("onSelect = #sidebar")
 public void doSelect() {
   Navitem item = sidebar.getSelectedItem();
   String label = item.getLabel(), icon = item.getIconSclass();
   if ("Inbox".equals(label)) {
     mainInclude.setSrc("inbox.zul");
   } else if ("Create New Task".equals(label)) {
     mainInclude.setSrc("create.zul");
   } else if ("Rescue the Baby".equals(label)) {
     mainInclude.setSrc("baby.zul");
   } else if ("Play Darts".equals(label)) {
     mainInclude.setSrc("dart.zul");
   } else if ("Plant Flowers".equals(label)) {
     mainInclude.setSrc("flower.zul");
   } else if ("Wash the Car".equals(label)) {
     mainInclude.setSrc("car.zul");
   } else if ("Buy Aspirin".equals(label)) {
     mainInclude.setSrc("head.zul");
   } else if ("Hide and Seek".equals(label)) {
     mainInclude.setSrc("cat.zul");
   } else if ("Say Hi to the Soldier".equals(label)) {
     mainInclude.setSrc("hi.zul");
   } else {
     mainInclude.setSrc("");
     mainInclude.setSrc("none.zul");
   }
 }
  private void initList() {
    // incList
    List<GenericListHeaderType> header = new LinkedList<GenericListHeaderType>();
    header.add(
        new GenericListHeaderType(
            Labels.getLabel("common.code"), 0, "", true, "String", true, true, false, false));
    header.add(
        new GenericListHeaderType(
            Labels.getLabel("common.relation"), 130, "", true, "String", true, true, false, false));
    header.add(
        new GenericListHeaderType(
            Labels.getLabel("common.code"), 0, "", true, "String", true, true, false, false));

    List<GenericListRowType> dataList = new LinkedList<GenericListRowType>();

    /*for (MetadataParameter meta : valueSet.getMetadataParameters())
    {
    GenericListRowType row = createRowFromMetadataParameter(meta);
    dataList.add(row);
    }*/
    // Liste initialisieren
    Include inc = (Include) getFellow("incList");
    Window winGenericList = (Window) inc.getFellow("winGenericList");
    genericList = (GenericList) winGenericList;

    // genericList.setUserDefinedId("1");
    genericList.setListActions(this);
    genericList.setButton_new(false);
    genericList.setButton_edit(false);
    genericList.setButton_delete(true);
    genericList.setListHeader(header);
    genericList.setDataList(dataList);

    genericList.removeCustomButtons();

    Button buttonAuto =
        new Button(
            Labels.getLabel("common.automatic") + "...", "/rsc/img/design/automatic_16x16.png");
    buttonAuto.addEventListener(
        Events.ON_CLICK,
        new EventListener<Event>() {
          public void onEvent(Event t) throws Exception {
            automaticAssociations();
          }
        });
    buttonAuto.setAttribute("disabled", false);
    buttonAuto.setAttribute("right", true);
    genericList.addCustomButton(buttonAuto);

    Button button = new Button(Labels.getLabel("common.save"), "/rsc/img/design/save_16x16.png");
    button.addEventListener(
        Events.ON_CLICK,
        new EventListener<Event>() {
          public void onEvent(Event t) throws Exception {
            saveAssociations();
          }
        });
    button.setAttribute("disabled", false);
    button.setAttribute("right", true);

    genericList.addCustomButton(button);
  }
  public void afterCompose() {
    logger.debug("AssociationEditor, afterCompose()");

    // ((Borderlayout)getRoot()).setTitle(Labels.getLabel("common.associationEditor"));
    //    Radiogroup rgMode = (Radiogroup) getFellow("rgMode");
    //    rgMode.addEventListener(Events.ON_CHECK, new EventListener()
    //    {
    //      public void onEvent(Event event) throws Exception
    //      {
    ////                if(windowL != null && windowL.getWindowContentConcepts() != null)
    ////
    // windowL.getWindowContentConcepts().setAssociationMode(getAssociationMode());
    ////                if(windowR != null && windowR.getWindowContentConcepts() != null)
    ////
    // windowR.getWindowContentConcepts().setAssociationMode(getAssociationMode());
    //      }
    //    });
    //
    //
    Include incL = (Include) getFellow("incContentLeft");
    incL.setDynamicProperty("updateListener", this);
    incL.setDynamicProperty("associationEditor", this);
    incL.setSrc(null);
    incL.setSrc("/gui/main/content/ContentAssociationEditor.zul?id=1");

    for (Component comp : incL.getChildren()) {
      logger.debug("Comp: " + comp.getClass().getCanonicalName());
    }

    //    windowL = (ContentAssociationEditor) incL.getFellow("winAss");
    //    windowL.setUpdateListener(this);
    Include incR = (Include) getFellow("incContentRight");
    incR.setDynamicProperty("updateListener", this);
    incR.setDynamicProperty("associationEditor", this);
    incR.setSrc(null);
    incR.setSrc("/gui/main/content/ContentAssociationEditor.zul?id=2");
    //    windowR = (ContentAssociationEditor) incR.getFellow("winAss");
    //    windowR.setUpdateListener(this);

    fillAssociationTypeList();

    initList();
  }
Exemple #5
0
 public void includeContent(String file) {
   System.out.println("Loading file: " + file);
   Include content = (Include) this.getFellow("content");
   content.setSrc(file);
 }
Exemple #6
0
  public void loginOk(boolean bootstrap) throws Exception {

    LoginUsuario lu = new LoginUsuario();
    LoginUsuarioDTO uDto = lu.log(this.user, this.pass);

    this.setAtributoSession(Config.LOGEADO, uDto.isLogeado());
    this.setAtributoSession(Config.USUARIO, uDto);

    this.setUs(uDto);
    this.poneCarita(uDto.isLogeado());

    Component compTool = Path.getComponent("/templateInicio");
    Control vm = (Control) compTool.getAttribute("vm");
    vm.setUs(uDto);

    if (uDto.isLogeado() == true) {

      // registrar el login
      this.registrarLogin();

      try {
        // recupero el control de esta sesion y lo pongo a escuchar
        // eventos para este login

        ControlInicio miCi = (ControlInicio) this.getAtributoSession(Config.MI_ALERTAS);

        EventQueues.lookup(this.getLoginNombre(), EventQueues.APPLICATION, true)
            .subscribe(new AlertaEvento(miCi));

        // ================

        this.m.ejecutarMetoto(Config.INIT_CLASE, Config.INIT_AFTER_LOGIN);
      } catch (Exception e) {
        e.printStackTrace();
        uDto.setLogeado(false);
        System.out.println(
            "Error: Metodo afterLogin\n "
                + "   InitClase:"
                + Config.INIT_CLASE
                + "\n    metodo:"
                + Config.INIT_AFTER_LOGIN);
        this.msg = "Configuración incorrecta";
        Clients.evalJavaScript("loginFaild()");
        return;
      }

      Include inc = (Include) compTool.getFellow("menu");
      inc.invalidate(); // esto hace un refresh del menu

      if (this.isSiPiePagina() == true) {
        Include incS = (Include) compTool.getFellow("menuSistema");
        incS.invalidate(); // esto hace un refresh del menu
      }

      Object menuBar = inc.getFellow("menubar");
      habilitarDeshabilitarMenuBar(menuBar);

      BindUtils.postGlobalCommand(null, null, "habilitarMenu", null);

      this.setTextoFormularioCorriente(" ");
      this.saltoDePagina(bootstrap ? Archivo.okLoginBootstrap : Archivo.okLogin);

    } else {
      this.msg = "Usuario o clave incorrecta";
      Clients.evalJavaScript("loginFaild()");
    }
  }