Package org.hdiv.dataComposer

Examples of org.hdiv.dataComposer.IDataComposer


public class ThymeleafHdivRequestDataValueProcessor extends HdivRequestDataValueProcessor {

  @Override
  public String processAction(HttpServletRequest request, String action, String method) {

    IDataComposer dataComposer = (IDataComposer) request.getAttribute(HDIVUtil.DATACOMPOSER_REQUEST_KEY);

    if (dataComposer != null && dataComposer.isRequestStarted()) {
      // End with the last form
      dataComposer.endRequest();
    }

    // Start with the new form
    return super.processAction(request, action, method);
  }
View Full Code Here


    if (name == null) {
      return value;
    }

    IDataComposer dataComposer = (IDataComposer) request.getAttribute(HDIVUtil.DATACOMPOSER_REQUEST_KEY);

    if (dataComposer == null || dataComposer.isRequestStarted() == false) {
      return value;
    }

    if (isEditable(type)) {
      dataComposer.composeFormField(name, value, true, type);
      return value;
    } else {
      String result = dataComposer.composeFormField(name, value, false, type);
      return result;
    }

  }
View Full Code Here

    return super.processAction(request, action, method);
  }

  public Map<String, String> getExtraHiddenFields(HttpServletRequest request) {

    IDataComposer dataComposer = (IDataComposer) request.getAttribute(HDIVUtil.DATACOMPOSER_REQUEST_KEY);
    Map<String, String> extraFields = new HashMap<String, String>();

    if (this.innerRequestDataValueProcessor != null) {
      Map<String, String> innerExtras = this.innerRequestDataValueProcessor.getExtraHiddenFields(request);
      if (innerExtras != null) {
        extraFields.putAll(innerExtras);
      }
    }

    if (dataComposer == null || dataComposer.isRequestStarted() == false) {
      return extraFields;
    }

    // Use the state id generated by the form action processing
    String formStateId = (String) request.getAttribute(FormUrlProcessor.FORM_STATE_ID);
View Full Code Here

   *            request object
   * @return hidden field name/value
   */
  public Map<String, String> getExtraHiddenFields(HttpServletRequest request) {

    IDataComposer dataComposer = (IDataComposer) request.getAttribute(HDIVUtil.DATACOMPOSER_REQUEST_KEY);
    Map<String, String> extraFields = new HashMap<String, String>();

    if (this.innerRequestDataValueProcessor != null) {
      Map<String, String> innerExtras = this.innerRequestDataValueProcessor.getExtraHiddenFields(request);
      if (innerExtras != null) {
        extraFields.putAll(innerExtras);
      }
    }

    if (dataComposer == null || dataComposer.isRequestStarted() == false) {
      return extraFields;
    }

    String requestId = dataComposer.endRequest();

    if (requestId != null && requestId.length() > 0) {
      String hdivStateParam = (String) request.getSession().getAttribute(Constants.HDIV_PARAMETER);
      extraFields.put(hdivStateParam, requestId);

View Full Code Here

   * @see org.hdiv.dataComposer.IDataComposer#composeFormField(String, String, boolean, String)
   */
  public int doStartTag() throws JspException {

    HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
    IDataComposer dataComposer = HDIVUtil.getDataComposer(request);

    // this property is editable and we must check it
    dataComposer.composeFormField(prepareName(), "", true, "password");

    return super.doStartTag();
  }
View Full Code Here

          // Do nothing
          return;
        }

        IDataComposer dataComposer = HDIVUtil.getDataComposer(request);
        dataComposer.beginRequest("GET", urlData.getUrlWithoutContextPath());

        String processedParams = dataComposer.composeParams(urlData.getUrlParams(), "GET", Constants.ENCODING_UTF_8);
        urlData.setUrlParams(processedParams);

        if (hasUIParams) {

          for (UIComponent comp : component.getChildren()) {
            if (comp instanceof UIParameter) {
              UIParameter param = (UIParameter) comp;
              String name = param.getName();
              String value = param.getValue().toString();

              dataComposer.compose(name, value, false);
            }
          }

          String stateParam = dataComposer.endRequest();

          url = this.urlProcessor.getProcessedUrl(urlData);

          component.setValue(url);

          // Add a children UIParam component with Hdiv's state
          UIParameter paramComponent = (UIParameter) context.getApplication().createComponent(
              UIParameter.COMPONENT_TYPE);

          String hdivParameter = (String) externalContext.getSessionMap().get(Constants.HDIV_PARAMETER);

          paramComponent.setName(hdivParameter);
          paramComponent.setValue(stateParam);
          component.getChildren().add(paramComponent);
        } else {

          String stateParam = dataComposer.endRequest();

          // Add state directly in the outputLink's value
          url = this.urlProcessor.getProcessedUrlWithHdivState(request, urlData, stateParam);
          component.setValue(url);
        }
View Full Code Here

            pageContext.setAttribute(Globals.EXCEPTION_KEY, e, PageContext.REQUEST_SCOPE);
            throw e;
        }

        HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
    IDataComposer dataComposer = HDIVUtil.getDataComposer(request);
    String cipheredValue = dataComposer.composeFormField(property, value, false, null);
       
    prepareAttribute(results, "value", TagUtils.getInstance().filter(cipheredValue));
       
        // returns unciphered value to check selected options
        return value;
View Full Code Here

   * @see org.hdiv.dataComposer.IDataComposer#composeFormField(String, String, boolean, String)
   */
  public int doStartTag() throws JspException {

    HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
    IDataComposer dataComposer = HDIVUtil.getDataComposer(request)

    // this property is editable and we must check it
    dataComposer.composeFormField(property, "", true, null);

    return super.doStartTag();
 
View Full Code Here

          hiddenValue = lookupValue.toString();
        }
      }
               
      HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
      IDataComposer dataComposer = HDIVUtil.getDataComposer(request);
      this.encodedValue = dataComposer.composeFormField(prepareName(), hiddenValue, false, null);
      
      // Render the result to the output writer
      TagUtils.getInstance().write(this.pageContext, this.renderInputElement());
     
      // Is rendering the value separately requested?
View Full Code Here

      
      String cipheredValue = null;
      
      String preparedName = prepareName();
      HttpServletRequest request = (HttpServletRequest) this.pageContext.getRequest();
    IDataComposer dataComposer = HDIVUtil.getDataComposer(request);
    cipheredValue = dataComposer.composeFormField(preparedName, serverValue, false, null);
       
        StringBuffer results = new StringBuffer("<input type=\"radio\"");
       
        renderAttribute(results, "name", preparedName);
        renderAttribute(results, "accesskey", accesskey);
View Full Code Here

TOP

Related Classes of org.hdiv.dataComposer.IDataComposer

Copyright © 2018 www.massapicom. 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.