Examples of States


Examples of org.openmeetings.app.persistence.beans.adresses.States

   * @return id of generated Adress-Object or NULL
   */
  public Long saveAddress(String street, String zip, String town,
      long states_id, String additionalname, String comment, String fax, String phone, String email) {
    try {
      States st = Statemanagement.getInstance().getStateById(states_id);

      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.adresses.States

   * @return the updated Adress-Object or null
   */
  public Adresses updateAdress(long adresses_id, String street, String zip, String town,
      long states_id, String additionalname, String comment, String fax, String email, String phone) {
    try {
      States st = Statemanagement.getInstance().getStateById(states_id);
     
      Adresses adr = this.getAdressbyId(adresses_id);

      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.adresses.States

      Object idf = PersistenceSessionUtil.createSession();
      EntityManager session = PersistenceSessionUtil.getSession();
      EntityTransaction tx = session.getTransaction();
      tx.begin();

      States st = new States();
      st.setName(statename);
      st.setStarttime(new Date());
      st.setDeleted("false");

      st = session.merge(st);
      Long id = st.getState_id();

      tx.commit();
      PersistenceSessionUtil.closeSession(idf);

      log.debug("added id " + id);
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.adresses.States

                String email = "";
                if (itemUsers.element("mail") != null) {
                  email = unformatString(itemUsers.element("mail").getText());
                }
               
                States st = Statemanagement.getInstance().getStateById(state_id);
                if (st == null) {
                  Statemanagement.getInstance().getStateById(1L);
                }
               
                Adresses adr = new Adresses();
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.adresses.States

    if(state != null){
      // Lookup for states
      List<States> states = Statemanagement.getInstance().getStates();
     
      for(int i = 0; i < states.size(); i++){
        States oneState = states.get(i);
     
        if(oneState.getName().equals(state)){
          state_id = oneState.getState_id();
          break;
        }
      }
     
    }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.adresses.States

   * @return the id of the new state or null if an error occurred
   */
  public Long addState(String name, String shortName, int code) {
    try {

      States st = new States();
      st.setName(name);
      st.setShortName(shortName);
      st.setCode(code);
      st.setStarttime(new Date());
      st.setDeleted("false");

      st = em.merge(st);
      Long id = st.getState_id();

      log.debug("added id " + id);

      return id;
    } catch (Exception ex2) {
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.adresses.States

    if (state != null) {
      // Lookup for states
      List<States> states = statemanagement.getStates();

      for (int i = 0; i < states.size(); i++) {
        States oneState = states.get(i);

        if (oneState.getName().equals(state)) {
          state_id = oneState.getState_id();
          break;
        }
      }

    }
View Full Code Here

Examples of org.openmeetings.app.persistence.beans.adresses.States

            if (itemUsers.element("mail") != null) {
              email = unformatString(itemUsers.element("mail")
                  .getText());
            }

            States st = statemanagement.getStateById(state_id);
            if (st == null) {
              st = statemanagement.getStateById(1L);
            }

            us.setAdresses(street, zip, town,
View Full Code Here

Examples of org.richfaces.ui.model.States

      String outcome) {
    if(null != outcome){
      Map<String, Object> requestMap = context.getExternalContext().getRequestMap();
      for (Object bean : requestMap.values()) {
        if (bean instanceof States) {
          States state = (States) bean;
          String navigation = state.getNavigation(outcome);
          if(null != navigation){
            state.setCurrentState(navigation);
          }
        }
      }
    }
    parent.handleNavigation(context, fromAction, outcome);
View Full Code Here

Examples of org.richfaces.ui.model.States

public class Config {

  public States getStates() {
    FacesContext facesContext = FacesContext.getCurrentInstance();
    States states = new States();

    // Registering new User State definition
    states.setCurrentState("register"); // Name of the new state

    // Text labels, properties and Labels for controls in "register" state
    states.put("showConfirm", Boolean.TRUE); // confirm field rendering
    states.put("link", "(To login)"); // Switch State link label
    states.put("okBtn", "Register"); // Login/Register button label
    states.put("stateTitle", "Register New User"); // Panel title

    ExpressionFactory expressionFactory = facesContext.getApplication()
        .getExpressionFactory();

    // Define "registerbean" available under "bean" EL binding on the page
    ValueExpression beanExpression = expressionFactory
        .createValueExpression(facesContext.getELContext(),
            "#{registerbean}", Bean.class);
    states.put("bean", beanExpression);

    // Define "registeraction" available under "action" EL binding on the
    // page
    beanExpression = expressionFactory.createValueExpression(facesContext
        .getELContext(), "#{registeraction}", RegisterAction.class);
    states.put("action", beanExpression);

    // Define method expression inside registeraction binding for this state
    MethodExpression methodExpression = expressionFactory
        .createMethodExpression(facesContext.getELContext(),
            "#{registeraction.ok}", String.class, new Class[] {});
    states.put("ok", methodExpression);

    // Outcome for switching to login state definition
    states.setNavigation("switch", "login");

    // Login Existent User State analogous definition
    states.setCurrentState("login");
    states.put("showConfirm", Boolean.FALSE);
    states.put("link", "(To register)");
    states.put("okBtn", "Login");
    states.put("stateTitle", "Login Existent User");

    beanExpression = expressionFactory.createValueExpression(facesContext
        .getELContext(), "#{loginbean}", Bean.class);
    states.put("bean", beanExpression);

    beanExpression = expressionFactory.createValueExpression(facesContext
        .getELContext(), "#{loginaction}", LoginAction.class);
    states.put("action", beanExpression);

    methodExpression = expressionFactory.createMethodExpression(
        facesContext.getELContext(), "#{loginaction.ok}", String.class,
        new Class[] {});
    states.put("ok", methodExpression);

    states.setNavigation("switch", "register");

    return states;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.