@Override
 public void prepare() throws Exception {
   user = (Users) this.getSession().get(APConstants.SESSION_USER);
   idEntSystem = UsersDao.getEntitySystem(user.getIdUsr());
   usrDao = new UsersDao();
   idUsrSystem = user.getIdUsr();
 }
  @Override
  public void prepare() throws Exception {
    user = (Users) ActionContext.getContext().getSession().get(APConstants.SESSION_USER);
    //        user = (Users) this.getSession().get(APConstants.SESSION_USER);
    idEntSystem = UsersDao.getEntitySystem(user.getIdUsr());
    EntitiesDao entDao = new EntitiesDao();
    Entities entTemp = entDao.findById(idEntSystem);
    typeEnt = entTemp.getEntitiesTypes().getIdEntTyp();
    if (entTemp.getEntitiesTypes().getIdEntTyp() == 2) {
      ProducersDao proDao = new ProducersDao();
      Producers proTemp = new Producers();
      proTemp = proDao.objectByEntityId(idEntSystem);
      if (proTemp != null) {
        idProducer = proTemp.getIdPro();
        name_producer = entTemp.getNameEnt();
      }
    }
    this.setDepartment_property(new DepartmentsDao().findAll());
    usrDao = new UsersDao();
    idUsrSystem = user.getIdUsr();
    List<Municipalities> mun = new ArrayList<Municipalities>();
    mun.add(new Municipalities());
    this.setCity_property(mun);
    assDao = new AssociationDao();
    //        HashMap route = new HashMap();
    //        route.put("getting", getText("email.from"));
    //        listRoute.add(route);
    //        route = new HashMap();
    ////        String val = getText('text.title.farm');
    //        route.put("listFarm", getText("email.from"));
    //        listRoute.add(route);

  }