Examples of UserData


Examples of org.apache.myfaces.custom.date.HtmlInputDate.UserData

   
        if( isDisabled(facesContext, inputDate) ) // For safety, do not set the submited value if the component is disabled.
            return;

        Locale currentLocale = facesContext.getViewRoot().getLocale();
        UserData userData = (UserData) inputDate.getSubmittedValue();
        if( userData == null ) {
            userData = inputDate.getUserData(currentLocale);
        } else {
          inputDate.setUserData(userData);
        }
        String clientId = inputDate.getClientId(facesContext);
        String type = inputDate.getType();
        Map requestMap = facesContext.getExternalContext().getRequestParameterMap();

        if( ! type.equals( "time" ) ){
            userData.setDay( (String) requestMap.get(clientId + ID_DAY_POSTFIX) );
            userData.setMonth( (String) requestMap.get(clientId + ID_MONTH_POSTFIX) );
            userData.setYear( (String) requestMap.get(clientId + ID_YEAR_POSTFIX) );
        }
       
        if( ! type.equals( "date" ) ){
            userData.setHours( (String) requestMap.get(clientId + ID_HOURS_POSTFIX) );
            userData.setMinutes( (String) requestMap.get(clientId + ID_MINUTES_POSTFIX) );
            if (type.equals("full") || type.equals("time"))
              userData.setSeconds( (String) requestMap.get(clientId + ID_SECONDS_POSTFIX) );
        }

        inputDate.setSubmittedValue( userData );
    }
View Full Code Here

Examples of org.apache.myfaces.custom.date.HtmlInputDate.UserData

        inputDate.setSubmittedValue( userData );
    }
   
    public Object getConvertedValue(FacesContext context, UIComponent uiComponent, Object submittedValue) throws ConverterException {
        UserData userData = (UserData) submittedValue;
        try {
            return userData.parse();
        } catch (ParseException e) {
            Object[] args = {uiComponent.getId()};
            throw new ConverterException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, DATE_MESSAGE_ID, args));
        }
    }
View Full Code Here

Examples of org.apache.myfaces.custom.date.HtmlInputDate.UserData

    public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException {
        RendererUtils.checkParamValidity(facesContext, uiComponent, HtmlInputDate.class);

        HtmlInputDate inputDate = (HtmlInputDate) uiComponent;
        Locale currentLocale = facesContext.getViewRoot().getLocale();
        UserData userData = (UserData) inputDate.getSubmittedValue();
        if( userData == null )
            userData = inputDate.getUserData(currentLocale);
        String type = inputDate.getType();
        boolean ampm = inputDate.isAmpm();
        String clientId = uiComponent.getClientId(facesContext);
View Full Code Here

Examples of org.apache.myfaces.custom.date.HtmlInputDate.UserData

        if( isDisabled(facesContext, inputDate) ) // For safety, do not set the submited value if the component is disabled.
            return;

        Locale currentLocale = facesContext.getViewRoot().getLocale();
        UserData userData = (UserData) inputDate.getSubmittedValue();
        if( userData == null )
            userData = inputDate.getUserData(currentLocale);

        String clientId = inputDate.getClientId(facesContext);
        String type = inputDate.getType();
        Map requestMap = facesContext.getExternalContext().getRequestParameterMap();

        if( ! (type.equals( "time" ) || type.equals( "short_time" )) ){
            userData.setDay( (String) requestMap.get(clientId + ID_DAY_POSTFIX) );
            userData.setMonth( (String) requestMap.get(clientId + ID_MONTH_POSTFIX) );
            userData.setYear( (String) requestMap.get(clientId + ID_YEAR_POSTFIX) );
        }

        if( ! type.equals( "date" ) ){
            userData.setHours( (String) requestMap.get(clientId + ID_HOURS_POSTFIX) );
            userData.setMinutes( (String) requestMap.get(clientId + ID_MINUTES_POSTFIX) );
            if (type.equals("full") || type.equals("time"))
        userData.setSeconds( (String) requestMap.get(clientId + ID_SECONDS_POSTFIX) );

            if (inputDate.isAmpm()) {
              userData.setAmpm( (String) requestMap.get(clientId + ID_AMPM_POSTFIX) );
            }
        }
        inputDate.setSubmittedValue( userData );
    }
View Full Code Here

Examples of org.apache.myfaces.custom.date.HtmlInputDate.UserData

        }
        inputDate.setSubmittedValue( userData );
    }

    public Object getConvertedValue(FacesContext context, UIComponent uiComponent, Object submittedValue) throws ConverterException {
        UserData userData = (UserData) submittedValue;
        try {
            return userData.parse();
        } catch (ParseException e) {
            Object[] args = {uiComponent.getId()};
            throw new ConverterException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, DATE_MESSAGE_ID, args));
        }
    }
View Full Code Here

Examples of org.apache.myfaces.custom.date.HtmlInputDate.UserData

    public void encodeEnd(FacesContext facesContext, UIComponent uiComponent) throws IOException {
        RendererUtils.checkParamValidity(facesContext, uiComponent, HtmlInputDate.class);

        HtmlInputDate inputDate = (HtmlInputDate) uiComponent;
        Locale currentLocale = facesContext.getViewRoot().getLocale();
        UserData userData = (UserData) inputDate.getSubmittedValue();
        if( userData == null )
            userData = inputDate.getUserData(currentLocale);
        String type = inputDate.getType();
        String clientId = uiComponent.getClientId(facesContext);
View Full Code Here

Examples of org.apache.myfaces.custom.date.HtmlInputDate.UserData

   
        if( isDisabled(facesContext, inputDate) ) // For safety, do not set the submited value if the component is disabled.
            return;

        Locale currentLocale = facesContext.getViewRoot().getLocale();
        UserData userData = (UserData) inputDate.getSubmittedValue();
        if( userData == null )
            userData = inputDate.getUserData(currentLocale);
        String clientId = inputDate.getClientId(facesContext);
        String type = inputDate.getType();
        Map requestMap = facesContext.getExternalContext().getRequestParameterMap();

        if( ! type.equals( "time" ) ){
            userData.setDay( (String) requestMap.get(clientId + ID_DAY_POSTFIX) );
            userData.setMonth( (String) requestMap.get(clientId + ID_MONTH_POSTFIX) );
            userData.setYear( (String) requestMap.get(clientId + ID_YEAR_POSTFIX) );
        }
       
        if( ! type.equals( "date" ) ){
            userData.setHours( (String) requestMap.get(clientId + ID_HOURS_POSTFIX) );
            userData.setMinutes( (String) requestMap.get(clientId + ID_MINUTES_POSTFIX) );
            if (type.equals("full") || type.equals("time"))
              userData.setSeconds( (String) requestMap.get(clientId + ID_SECONDS_POSTFIX) );
        }

        inputDate.setSubmittedValue( userData );
    }
View Full Code Here

Examples of org.apache.myfaces.custom.date.HtmlInputDate.UserData

        inputDate.setSubmittedValue( userData );
    }
   
    public Object getConvertedValue(FacesContext context, UIComponent uiComponent, Object submittedValue) throws ConverterException {
        UserData userData = (UserData) submittedValue;
        try {
            return userData.parse();
        } catch (ParseException e) {
            Object[] args = {uiComponent.getId()};
            throw new ConverterException(MessageUtils.getMessage(FacesMessage.SEVERITY_ERROR, DATE_MESSAGE_ID, args));
        }
    }
View Full Code Here

Examples of org.apache.myfaces.orchestra.conversation.model.UserData

        final String BEAN_NAME = "persistentBackingBean";

        PersistentBackingBean conv = (PersistentBackingBean) applicationContext.getBean(BEAN_NAME);

        /* create and reread a user */
        UserData user = conv.createUser();
        UserData user2 = conv.readUser(user.getId());

        assertSame("has to be the same user",user , user2);

        conv.invalidateConversation();

        /* restart conversatin */
        UserData user3 = conv.readUser(user.getId());

        assertNotSame("should not be the same user", user ,user3);
    }
View Full Code Here

Examples of org.apache.openmeetings.db.entity.user.Userdata

    }
    return null;
  }

  public Userdata getUserdataByKey(Long user_id, String DATA_KEY) {
    Userdata userdata = new Userdata();
    if (user_id.longValue() > 0) {
      try {
        TypedQuery<Userdata> query = em
            .createQuery("select c from Userdata as c where c.user_id = :user_id AND c.data_key = :data_key AND c.deleted <> :deleted", Userdata.class);
        query.setParameter("user_id", user_id.longValue());
        query.setParameter("data_key", DATA_KEY);
        query.setParameter("deleted", true);
        for (Iterator<Userdata> it2 = query.getResultList().iterator(); it2
            .hasNext();) {
          userdata = it2.next();
        }
      } catch (Exception ex2) {
        log.error("getUserdataByKey", ex2);
      }
    } else {
      userdata.setComment("Error: No USER_ID given");
    }
    return userdata;
  }
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.