Esempio n. 1
0
  public final void startUp() {

    // System.out.println("on Startup");

    if (coreCfg.getUserInfo() != null) {
      cfg.moduleGrant.loadGrantForRole(coreCfg.getUserInfo().getRole(), Cfg.defaultsGrant);
    } else {
      cfg.moduleGrant.loadGrantForRole("", Cfg.defaultsGrant);
    }

    if (coreCfg.getUserInfo() != null) {
      if (cfg.allowedEditingUsers.contains(coreCfg.getUserInfo().getAbrev())
          || cfg.fullEditingUsers.contains(coreCfg.getUserInfo().getAbrev())
          || cfg.moduleGrant.get("edit_own_anuncis").getValue() != GrantBean.NONE
          || cfg.moduleGrant.get("edit_all_anuncis").getValue() != GrantBean.NONE) {

        buttonNouAnunci.setEnabled(true);

      } else {

        buttonNouAnunci.setEnabled(false);
      }
    } else {

      buttonNouAnunci.setEnabled(false);
    }

    ////// System.out.println("Grants OK");
    listening = true;
    fillList();
    // Problem fillList is done with swingworker and "vigents" may not be
    // populated yet
    String abrev = "";
    if (cfg.getCoreCfg().getUserInfo() != null) {
      abrev = cfg.getCoreCfg().getUserInfo().getAbrev();
    }

    vigents = cfg.getCoreCfg().getIesClient().getAnuncisClient().getAnuncisVigents(abrev);
    // System.out.println("VIGENTS ->"+vigents);
    if (vigents == 0) {
      this.setModuleStatus(TopModuleWindow.STATUS_SLEEPING);
    } else {
      this.setModuleStatus(TopModuleWindow.STATUS_NORMAL);
    }
  }
Esempio n. 2
0
 private ArrayList<AnunciBean> loadAnuncis(int type, int order) {
   String limit = (String) jComboBox2.getSelectedItem();
   String txt = jTextField1.getText().toUpperCase().trim();
   return cfg.getCoreCfg().getIesClient().getAnuncisClient().loadAnuncis(type, order, limit, txt);
 }