Package com.esri.gpt.framework.xml

Examples of com.esri.gpt.framework.xml.XsltTemplate.transform()


      StringWriter writer = new StringWriter();
      StreamResult result = new StreamResult(writer);
      HashMap<String, String> params = new HashMap<String, String>();
      params.put("operation", operation);
      params.put("input", input);
      template.transform(source, result, params);

      Document outputDom = null;
      try {
        outputDom = DomUtil.makeDomFromString(Val.chkStr(writer.toString()),
            true);
View Full Code Here


        throw new AgpPublishException("Schema: " + schema.getKey() + " has no transformation to ItemInformation.");
      }

      // run the validation xsl
      XsltTemplate template = this.getCompiledTemplate(toEsriItemInfoXslt);
      String result = template.transform(metadata);

      // load the result SVRL document
      Document dom = DomUtil.makeDomFromString(result, true);

      // find ESRI item information
View Full Code Here

      }
     
      try {  
        for (String sKey: keys) {
          String sXml = this.readXml(request,context,sKey);
          String sResult = Val.chkStr(template.transform(sXml));
          if (sResult.length() > 0) {
            byte[] bytes = sResult.getBytes("UTF-8");
            out.write(bytes);
            out.flush();
          }
View Full Code Here

  XsltTemplate template = SearchConfig.getConfiguredInstance()
      .getGptToCswXsltTemplate();

  try {
    template.transform(dSource, new StreamResult(writer), null);
    if (LOG.isLoggable(Level.FINER)) {
      LOG.log(Level.FINER, "SearchCriteria DOM := \n{0}", XmlIoUtil.domToString(criteria.toDom(operation.name(), DATE_FORMAT_OBJ)));
      LOG.log(Level.FINER, "CSW Request formed := \n{0}", writer.toString());
    }
  } catch (Exception e) {
View Full Code Here

          sb.append(nl).append("</collection>");
         
          // transform then return the response
          boolean bTransform = true;
          if (bTransform) {
            String sResult = Val.chkStr(template.transform(sb.toString()));
            if (sResult.length() > 0) {
              byte[] bytes = sResult.getBytes("UTF-8");
              out.write(bytes);
              out.flush();
            }
View Full Code Here

          // create notification subject and message using transformations
          XsltTemplate notifSubjectTemplate = XsltTemplate.makeFromResourcePath(NOTIF_SUBJECT_PATH);
          XsltTemplate notifMessageTemplate = XsltTemplate.makeFromResourcePath(NOTIF_MESSAGE_PATH);
          String notifSubject = notifSubjectTemplate.transform(notification);
          String notfiMessage = notifMessageTemplate.transform(notification);

          // send email to each recipient
          for (String emailAddress : emailAddresses) {

            // create and init mail request
View Full Code Here

   * @return the HTML representation
   * @throws TransformerException if an exception occurs
   */
  public String transformToHtml(String url) throws TransformerException {
    XsltTemplate template = getCompiledTemplate(CswRepository.XSLT_CSW_TO_HTML);
    String xml = template.transform(XmlIoUtil.readXml(url));
    return xml;
  }

}
View Full Code Here

  throws TransformerException, ParserConfigurationException, SAXException, IOException {
  HashMap<String,String> params = new HashMap<String,String>();
  params.put("documentUuid",Val.chkStr(uuid));
  params.put("fileIdentifier",Val.chkStr(fileIdentifier));
  XsltTemplate template = getCompiledTemplate(toEsriIsoXslt);
  String sXml = template.transform(originalXml,params);
  Document dom = DomUtil.makeDomFromString(sXml,false);
  insertEnclosure(dom,originalXml);
  return XmlIoUtil.domToString(dom);
}
View Full Code Here

              if( serviceIndexStart > -1){
                params.put("serviceType", s[i].substring(serviceIndexStart+8,s[i].length()));            
              }
            }                 
          }
          template.transform(source,result,params);       
          _transformedToKnownXml = Val.chkStr(writer.toString());
          dom = loadDom(_transformedToKnownXml);
          schema = schemas.interrogate(dom);
          schema.setActiveDocumentXml(_transformedToKnownXml);
        } catch (TransformerException e) {
View Full Code Here

   * @return the transformed document
   * @throws TransformerException if an exception occurs
   */
  public String transform(String xml, String xsltPath) throws TransformerException {
    XsltTemplate template = this.getCompiledTemplate(xsltPath);
    String result = template.transform(xml);
    return result;
  }
 
  /**
   * Transforms an metadata document XML to an HTML fragment suitable for display within the
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.