Examples of NameValuePair


Examples of com.structis.fichesst.client.util.NameValuePair

      public void onExportSyntheseEcran(ExportSyntheseEcranEvent event) {

        List<NameValuePair> params = new ArrayList<NameValuePair>();
        // Information Chantier
        String chantier = chatierName.getValue();
        params.add(new NameValuePair("paramChantier", chantier));
        if( prorataTheorique.getValue() != null ) {
          Double prorata = prorataTheorique.getValue().doubleValue();
          params.add(new NameValuePair("paramProrata", prorata + ""));
        }
        // Synthese des fiches st
        // + Grid 1
        List<FicheStDto> fichestGrid1 = ficheStGrid1.getStore().getModels();
        List<String> lstKeyGrid1 = new ArrayList<String>();
        String keyGrid1 = "";
        for( int i = 0 ; i < fichestGrid1.size() ; i++ ) {
          if( fichestGrid1.get(i).getLotType() != null && !lstKeyGrid1.contains(fichestGrid1.get(i).getLotType().getName()) ) {
            lstKeyGrid1.add(fichestGrid1.get(i).getLotType().getName());
            keyGrid1 += fichestGrid1.get(i).getLotType().getName() + Constants.SEPRATE;
          }
        }
        if( keyGrid1 != null && keyGrid1.length() > 0 ) {
          keyGrid1 = keyGrid1.substring(0, keyGrid1.length() - Constants.SEPRATE.length());
          params.add(new NameValuePair("paramKeyGrid1", keyGrid1));
        }
        Map<String, String> mapGrid1 = new HashMap<String, String>();
        Map<String, String> mapTotalGroupGrid1 = new HashMap<String, String>();
        String totalSumGrid1 = createGridReport(fichestGrid1, lstKeyGrid1, mapGrid1, mapTotalGroupGrid1);
        params.add(new NameValuePair("paramMapGrid1", mapGrid1.toString()));
        params.add(new NameValuePair("paramMapTotalGroupGrid1", mapTotalGroupGrid1.toString()));
        params.add(new NameValuePair("paramTotalSumGrid1", totalSumGrid1));

        // +Grid 2
        List<FicheStDto> fichestGrid2 = ficheStGrid2.getStore().getModels();
        Map<String, String> mapGrid2 = new HashMap<String, String>();
        Map<String, String> mapTotalGroupGrid2 = new HashMap<String, String>();
        List<String> lstKeyGrid2 = new ArrayList<String>();
        String keyGrid2 = "";
        for( int i = 0 ; i < fichestGrid2.size() ; i++ ) {
          if( fichestGrid2.get(i).getLotType() != null && !lstKeyGrid2.contains(fichestGrid2.get(i).getLotType().getName()) ) {
            lstKeyGrid2.add(fichestGrid2.get(i).getLotType().getName());
            keyGrid2 += fichestGrid2.get(i).getLotType().getName() + Constants.SEPRATE;
          }
        }
        if( keyGrid2 != null && keyGrid2.length() > 0 ) {
          keyGrid2 = keyGrid2.substring(0, keyGrid2.length() - Constants.SEPRATE.length());
          params.add(new NameValuePair("paramKeyGrid2", keyGrid2));
        }
        String totalSumGrid2 = createGridReport(fichestGrid2, lstKeyGrid2, mapGrid2, mapTotalGroupGrid2);
        params.add(new NameValuePair("paramMapGrid2", mapGrid2.toString()));
        params.add(new NameValuePair("paramMapTotalGroupGrid2", mapTotalGroupGrid2.toString()));
        params.add(new NameValuePair("paramTotalSumGrid2", totalSumGrid2));

        // Synthese des transpert pp
        List<TransfertPpSummaryDto> listTransfertPpGrid = transfertPpGrid.getStore().getModels();
        TransfertPpSummaryDto transfertPpSummaryDto = null;
        String grid3 = "";
        double sumColumnObjectif = 0.0;
        double sumColumnObj = 0.0;
        double sumColumnTransfert = 0.0;
        double sumColumnRd = 0.0;
        double sumColumnTs = 0.0;
        double sumRow = 0.0;
        double sumSumRow = 0.0;
        NumberFormat numberFormat = NumberFormat.getFormat(Constants.NUMBER_FORMAT);
        for( int i = 0 ; i < listTransfertPpGrid.size() ; i++ ) {
          transfertPpSummaryDto = listTransfertPpGrid.get(i);
          sumColumnObjectif += transfertPpSummaryDto.getObjective();
          sumColumnObj += transfertPpSummaryDto.getObj();
          sumColumnTransfert += transfertPpSummaryDto.getDevers();
          sumColumnRd += transfertPpSummaryDto.getRd();
          sumColumnTs += transfertPpSummaryDto.getTs();
          sumRow = transfertPpSummaryDto.getObj() + transfertPpSummaryDto.getDevers() + transfertPpSummaryDto.getRd() + transfertPpSummaryDto.getTs();
          sumSumRow += sumRow;
          grid3 += createTotalSumReport(
              numberFormat, transfertPpSummaryDto.getLabel(), transfertPpSummaryDto.getObjective(),
              transfertPpSummaryDto.getObj(), transfertPpSummaryDto.getDevers(),
              transfertPpSummaryDto.getRd(), transfertPpSummaryDto.getTs(), sumRow);

        }
        params.add(new NameValuePair("paramGrid3", grid3));
        String totalSumGrid3 = createTotalSumReport(
            numberFormat, "Total PP", sumColumnObjectif, sumColumnObj, sumColumnTransfert, sumColumnRd,
            sumColumnTs, sumSumRow);
        params.add(new NameValuePair("paramTotalSumGrid3", totalSumGrid3));

        // ficheStSummaryGrid
        // +Grid 4
        List<FicheStDto> fichestGrid4 = ficheStSummaryGrid.getStore().getModels();
        String[] arr = createGridReportSummary(fichestGrid4);
        params.add(new NameValuePair("paramGrid4", arr[0]));
        params.add(new NameValuePair("paramTotalSumGrid4", arr[1]));

        String exportPdfUrl = GWT.getHostPageBaseURL() + "synthese.pdf";
        ReportUtil.showReport(exportPdfUrl, params.toArray(new NameValuePair[params.size()]));

      }
View Full Code Here

Examples of com.sun.jersey.samples.entityprovider.resources.NameValuePair

            } else if (idx > 0) {
                map.put(URLDecoder.decode(token.substring(0, idx),"UTF-8"), URLDecoder.decode(token.substring(idx+1),"UTF-8"));
            }
        }
       
        return new NameValuePair(map.get("name"), map.get("value"));
    }
View Full Code Here

Examples of com.volantis.synergetics.NameValuePair

        String result = name;
        // Try the static cache first.
        int index = Arrays.binarySearch(cacheArray, name, comparator);
        if (index >= 0) {
            NameValuePair pair = (NameValuePair)cacheArray[index];

            // If we are converting to lower case use the value, otherwise
            // use the name (which is uppercase).
            result = convertToLowerCase ? pair.getValue() : pair.getName();
            if (logger.isDebugEnabled()) {
                logger.debug("Found local name in static cache: " + name);
            }
        } else {
            NameValuePair pair = findCachedNameValuePair(
                    new CaseInsensitiveName(name));

            if (pair == null) {
                pair = new NameValuePair(name, convertLocalName(name));

                if (logger.isDebugEnabled()) {
                    logger.debug("Adding localName object to dynamic cache: " +
                                 pair);
                }
                dynamicCache.add(pair);
            }
            result = pair.getValue();
        }
        return result;
    }
View Full Code Here

Examples of net.helipilot50.aerospike.model.NameValuePair

      List<NameValuePair>  dbInfo = new ArrayList<NameValuePair>();
      String statistics = info.get("statistics");
      String part[] = statistics.split(";");
      for (String entry : part){
        dbInfo.add(new NameValuePair(entry, "="));
      }
      target.setStats(dbInfo);

    }
  }
View Full Code Here

Examples of open.dolphin.client.NameValuePair

     * 抽出期間を変更し再検索する。
     */
    public void periodChanged(int state) {
        if (state == ItemEvent.SELECTED) {
            int index = extractionCombo.getSelectedIndex();
            NameValuePair pair = extractionObjects[index];
            String value = pair.getValue();
            int addValue = Integer.parseInt(value);
            GregorianCalendar today = new GregorianCalendar();
            today.add(GregorianCalendar.MONTH, addValue);
            today.clear(Calendar.HOUR_OF_DAY);
            today.clear(Calendar.MINUTE);
View Full Code Here

Examples of org.ajax4jsf.templatecompiler.elements.NameValuePair

      String[] attributesSet = namesList.split(",");
      for (String attribute : attributesSet) {
        String trimmedAttribute = attribute.trim();
        if (trimmedAttribute.length() != 0) {
          String elExpression = String.format(elFormat, trimmedAttribute);
          values.add(new NameValuePair(trimmedAttribute,
            ELParser.compileEL(elExpression, componentBean)));
        }
      }
    }
  }
View Full Code Here

Examples of org.apache.aries.util.manifest.ManifestHeaderProcessor.NameValuePair

{
  @Test
  public void testNameValuePair() throws Exception {
  HashMap<String, String> attrs = new HashMap<String, String>();
  attrs.put("some", "value");
    NameValuePair nvp = new NameValuePair("key", attrs);

    assertEquals("The name value pair is not set properly.", nvp.getName(), "key");
    assertEquals("The value is not set properly.", nvp.getAttributes().get("some"), "value");

  attrs = new HashMap<String, String>();
  attrs.put("some", "value");
    NameValuePair anotherNvp = new NameValuePair("key", attrs);
    assertEquals("The two objects of NameValuePair is not equal.", nvp, anotherNvp);

    nvp.setName("newKey");
    attrs = new HashMap<String, String>();
  attrs.put("some", "newValue");
    nvp.setAttributes(attrs);
    assertEquals("The name value pair is not set properly.", nvp.getName(), "newKey");
    assertEquals("The value is not set properly.", nvp.getAttributes().get("some"), "newValue");

    Map<String,String> nvm1 = new HashMap<String,String>();
    nvm1.put("a","b");
    nvm1.put("c","d");

    Map<String,String> nvm2 = new HashMap<String,String>();
    nvm2.put("c","d");
    nvm2.put("a","b");
    assertEquals("The maps are not equal.", nvm1, nvm2);
    nvm2.put("e","f");
    assertNotSame("The maps are the same.", nvm1, nvm2);

    NameValuePair nvp1 = new NameValuePair("one",nvm1);
    NameValuePair nvp2 = new NameValuePair("one",nvm2);

    assertNotSame("The pairs are identical ",nvp1,nvp2);
    nvm1.put("e","f");
    assertEquals("The pairs are not equal.", nvp1,nvp2);
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

            Object contentType = header.getValue();
            Object charSetEnc = null;

            for (int i = 0; i < headers.length; i++) {
                NameValuePair charsetEnc = headers[i].getParameterByName(
                        HTTPConstants.CHAR_SET_ENCODING);
                if (charsetEnc != null) {
                    charSetEnc = charsetEnc.getValue();
                }
            }

            if (inMessageContext != null) {
                inMessageContext
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

    private String processCookieHeader(HeaderElement element) {
        String cookie = element.getName() + "=" + element.getValue();
        NameValuePair[] parameters =  element.getParameters();
        for (int j = 0; parameters != null && j < parameters.length; j++) {
            NameValuePair parameter = parameters[j];
            cookie = cookie + "; " + parameter.getName() + "=" + parameter.getValue();
        }
        return cookie;
    }
View Full Code Here

Examples of org.apache.commons.httpclient.NameValuePair

        throws UnsupportedEncodingException
     {
        StringBuffer buf = new StringBuffer();
        for (int i = 0; i < pairs.length; i++) {
            URLCodec codec = new URLCodec();
            NameValuePair pair = pairs[i];
            if (pair.getName() != null) {
                if (i > 0) {
                    buf.append("&");
                }
                buf.append(codec.encode(pair.getName(), charset));
                buf.append("=");
                if (pair.getValue() != null) {
                    buf.append(codec.encode(pair.getValue(), charset));
                }
            }
        }
        return buf.toString();
    }
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.