Package mondrian.tui

Class XmlaSupport


  • public class XmlaSupport
    extends java.lang.Object
    Support for making XMLA requests and looking at the responses.
    Author:
    Richard M. Emberson
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static java.lang.String CATALOG_NAME  
      static java.lang.String DATASOURCE_DESCRIPTION  
      static java.lang.String DATASOURCE_INFO  
      static java.lang.String DATASOURCE_NAME  
      static java.util.Map<java.lang.String,​java.lang.String> ENV  
      static java.lang.String nl  
      static java.lang.String ROW_SET_PREFIX
      This is the prefix used in xpath and transforms for the xmla rowset namespace "urn:schemas-microsoft-com:xml-analysis:rowset".
      static java.lang.String SOAP_PREFIX  
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static org.w3c.dom.Document extractBodyFromSoap​(org.w3c.dom.Document doc)  
      static org.w3c.dom.Node[] extractFaultNodesFromSoap​(byte[] bytes)  
      static org.w3c.dom.Node[] extractFaultNodesFromSoap​(org.w3c.dom.Document doc)  
      static org.w3c.dom.Node[] extractHeaderAndBodyFromSoap​(byte[] bytes)  
      static org.w3c.dom.Node[] extractHeaderAndBodyFromSoap​(org.w3c.dom.Document doc)  
      static org.w3c.dom.Node[] extractNodes​(org.w3c.dom.Node node, java.lang.String xpath, java.lang.String[][] nsArray)
      Given a Document and an xpath/namespace-array pair, extract and return the Nodes resulting from applying the xpath.
      static org.w3c.dom.Node[] extractNodesFromSoapXmla​(byte[] bytes)  
      static org.w3c.dom.Node[] extractNodesFromSoapXmla​(org.w3c.dom.Document doc)  
      static org.w3c.dom.Node[] extractNodesFromXmla​(byte[] bytes)  
      static org.w3c.dom.Node[] extractNodesFromXmla​(org.w3c.dom.Document doc)  
      static CatalogLocator getCatalogLocator()  
      static DataSourcesConfig.DataSources getDataSources​(java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls)  
      static java.lang.String getDataSourcesText​(java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls)
      With a connection string, generate the DataSource xml.
      static java.lang.String getSoapBodyXPath()  
      static java.lang.String getSoapFaultXPath()  
      static java.lang.String getSoapHeaderAndBodyXPath()  
      static java.lang.String getSoapXmlaRootXPath​(java.lang.String xmlaPrefix)  
      static java.lang.String getXmlaRootXPath​(java.lang.String xmlaPrefix)  
      static java.lang.String getXmlaTransform​(java.lang.String xmlaPrefix)
      This is a parameterized XSLT.
      static Servlet makeServlet​(java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, java.lang.String cbClassName)  
      static Servlet makeServlet​(java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, java.lang.String cbClassName, java.util.Map<java.util.List<java.lang.String>,​Servlet> servletCache)  
      static DataSourcesConfig.DataSources parseDataSources​(java.lang.String dataSourcesConfigString, org.apache.log4j.Logger logger)  
      static byte[] processSoapXmla​(java.io.File file, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, java.lang.String cbClassName)
      Process the given input file as a SOAP-XMLA request.
      static byte[] processSoapXmla​(java.io.File file, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, java.lang.String cbClassName, java.util.Map<java.util.List<java.lang.String>,​Servlet> servletCache)  
      static byte[] processSoapXmla​(java.io.File file, Servlet servlet)  
      static byte[] processSoapXmla​(java.lang.String requestText, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, java.lang.String cbClassName, Role role)  
      static byte[] processSoapXmla​(java.lang.String requestText, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, java.lang.String cbClassName, Role role, java.util.Map<java.util.List<java.lang.String>,​Servlet> servletCache)  
      static byte[] processSoapXmla​(java.lang.String requestText, Servlet servlet)  
      static byte[] processSoapXmla​(org.w3c.dom.Document doc, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, java.lang.String cbClassName, Role role)  
      static byte[] processSoapXmla​(org.w3c.dom.Document doc, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, java.lang.String cbClassName, Role role, java.util.Map<java.util.List<java.lang.String>,​Servlet> servletCache)  
      static byte[] processSoapXmla​(org.w3c.dom.Document doc, Servlet servlet)  
      static byte[] processXmla​(java.io.File file, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls)
      Processes the given input file as an XMLA request (no SOAP elements).
      static byte[] processXmla​(java.io.File file, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, java.util.Map<java.util.List<java.lang.String>,​MondrianServer> cache)  
      static byte[] processXmla​(java.io.File file, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, Role role)  
      static byte[] processXmla​(java.io.File file, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, Role role, java.util.Map<java.util.List<java.lang.String>,​MondrianServer> cache)  
      static byte[] processXmla​(java.lang.String requestText, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls)  
      static byte[] processXmla​(java.lang.String requestText, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, java.util.Map<java.util.List<java.lang.String>,​MondrianServer> cache)  
      static byte[] processXmla​(org.w3c.dom.Document requestDoc, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, Role role)  
      static byte[] processXmla​(org.w3c.dom.Document requestDoc, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, Role role, java.util.Map<java.util.List<java.lang.String>,​MondrianServer> cache)  
      static byte[] processXmla​(org.w3c.dom.Element requestElem, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, Role role)  
      static byte[] processXmla​(org.w3c.dom.Element requestElem, java.lang.String connectString, java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls, Role role, java.util.Map<java.util.List<java.lang.String>,​MondrianServer> cache)  
      static java.lang.String readFile​(java.io.File file)
      Reads a file line by line, adds a '\n' after each line and returns in a String.
      static org.w3c.dom.Document transformSoapXmla​(org.w3c.dom.Document doc, java.lang.String[][] namevalueParameters, java.lang.String ns)  
      static boolean validateEmbeddedSchema​(byte[] bytes, java.lang.String schemaTransform, java.lang.String dataTransform)
      static boolean validateEmbeddedSchema​(org.w3c.dom.Document doc, java.lang.String schemaTransform, java.lang.String dataTransform)
      A given Document has both content and an embedded schema (where the schema has a single root node and the content has a single root node - they are not interwoven).
      static boolean validateNodes​(org.w3c.dom.Node[] nodes)
      Validate Nodes with throws an error if validation was attempted but failed, returns true if validation was successful and false if validation was not tried.
      static boolean validateSchemaSoapXmla​(byte[] bytes)
      Check is a byte array containing a SOAP-XMLA response method is valid.
      static boolean validateSchemaXmla​(byte[] bytes)
      Check is a byte array containing a XMLA response method is valid.
      static boolean validateSoapXmlaUsingXpath​(byte[] bytes)
      This validates a SOAP-XMLA response using xpaths to extract the schema and data parts.
      static boolean validateXmlaUsingXpath​(byte[] bytes)
      This validates a XMLA response using xpaths to extract the schema and data parts.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Field Detail

      • nl

        public static final java.lang.String nl
      • DATASOURCE_DESCRIPTION

        public static final java.lang.String DATASOURCE_DESCRIPTION
        See Also:
        Constant Field Values
      • ENV

        public static final java.util.Map<java.lang.String,​java.lang.String> ENV
      • ROW_SET_PREFIX

        public static final java.lang.String ROW_SET_PREFIX
        This is the prefix used in xpath and transforms for the xmla rowset namespace "urn:schemas-microsoft-com:xml-analysis:rowset".
        See Also:
        Constant Field Values
    • Method Detail

      • getXmlaTransform

        public static java.lang.String getXmlaTransform​(java.lang.String xmlaPrefix)
        This is a parameterized XSLT. The parameters are: "soap" with values "none" or empty "content" with values "schemadata", "schema", "data" or empty With these setting one can extract from an XMLA SOAP message the soap wrapper plus body or simply the body; the complete body (schema and data), only the schema of the body, only the data of the body or none of the body
      • getCatalogLocator

        public static CatalogLocator getCatalogLocator()
      • parseDataSources

        public static DataSourcesConfig.DataSources parseDataSources​(java.lang.String dataSourcesConfigString,
                                                                     org.apache.log4j.Logger logger)
      • getDataSourcesText

        public static java.lang.String getDataSourcesText​(java.lang.String connectString,
                                                          java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls)
        With a connection string, generate the DataSource xml. Since this is used by directly, same process, communicating with XMLA Mondrian, the fact that the URL contains "localhost" is not important.
        Parameters:
        connectString - Connect string
        catalogNameUrls - array of catalog names, catalog url pairs
      • getSoapFaultXPath

        public static java.lang.String getSoapFaultXPath()
      • getSoapHeaderAndBodyXPath

        public static java.lang.String getSoapHeaderAndBodyXPath()
      • getSoapBodyXPath

        public static java.lang.String getSoapBodyXPath()
      • getSoapXmlaRootXPath

        public static java.lang.String getSoapXmlaRootXPath​(java.lang.String xmlaPrefix)
      • getXmlaRootXPath

        public static java.lang.String getXmlaRootXPath​(java.lang.String xmlaPrefix)
      • extractNodesFromSoapXmla

        public static org.w3c.dom.Node[] extractNodesFromSoapXmla​(byte[] bytes)
                                                           throws org.xml.sax.SAXException,
                                                                  java.io.IOException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • extractNodesFromSoapXmla

        public static org.w3c.dom.Node[] extractNodesFromSoapXmla​(org.w3c.dom.Document doc)
                                                           throws org.xml.sax.SAXException,
                                                                  java.io.IOException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • extractNodesFromXmla

        public static org.w3c.dom.Node[] extractNodesFromXmla​(byte[] bytes)
                                                       throws org.xml.sax.SAXException,
                                                              java.io.IOException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • extractNodesFromXmla

        public static org.w3c.dom.Node[] extractNodesFromXmla​(org.w3c.dom.Document doc)
                                                       throws org.xml.sax.SAXException,
                                                              java.io.IOException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • extractFaultNodesFromSoap

        public static org.w3c.dom.Node[] extractFaultNodesFromSoap​(byte[] bytes)
                                                            throws org.xml.sax.SAXException,
                                                                   java.io.IOException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • extractFaultNodesFromSoap

        public static org.w3c.dom.Node[] extractFaultNodesFromSoap​(org.w3c.dom.Document doc)
                                                            throws org.xml.sax.SAXException,
                                                                   java.io.IOException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • extractHeaderAndBodyFromSoap

        public static org.w3c.dom.Node[] extractHeaderAndBodyFromSoap​(byte[] bytes)
                                                               throws org.xml.sax.SAXException,
                                                                      java.io.IOException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • extractHeaderAndBodyFromSoap

        public static org.w3c.dom.Node[] extractHeaderAndBodyFromSoap​(org.w3c.dom.Document doc)
                                                               throws org.xml.sax.SAXException,
                                                                      java.io.IOException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • extractBodyFromSoap

        public static org.w3c.dom.Document extractBodyFromSoap​(org.w3c.dom.Document doc)
                                                        throws org.xml.sax.SAXException,
                                                               java.io.IOException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • extractNodes

        public static org.w3c.dom.Node[] extractNodes​(org.w3c.dom.Node node,
                                                      java.lang.String xpath,
                                                      java.lang.String[][] nsArray)
                                               throws org.xml.sax.SAXException,
                                                      java.io.IOException
        Given a Document and an xpath/namespace-array pair, extract and return the Nodes resulting from applying the xpath.
        Throws:
        org.xml.sax.SAXException - on error
        java.io.IOException - on error
      • processSoapXmla

        public static byte[] processSoapXmla​(java.io.File file,
                                             java.lang.String connectString,
                                             java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                             java.lang.String cbClassName)
                                      throws java.io.IOException,
                                             ServletException,
                                             org.xml.sax.SAXException
        Process the given input file as a SOAP-XMLA request.
        Throws:
        java.io.IOException
        ServletException
        org.xml.sax.SAXException
      • processSoapXmla

        public static byte[] processSoapXmla​(java.io.File file,
                                             java.lang.String connectString,
                                             java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                             java.lang.String cbClassName,
                                             java.util.Map<java.util.List<java.lang.String>,​Servlet> servletCache)
                                      throws java.io.IOException,
                                             ServletException,
                                             org.xml.sax.SAXException
        Throws:
        java.io.IOException
        ServletException
        org.xml.sax.SAXException
      • processSoapXmla

        public static byte[] processSoapXmla​(org.w3c.dom.Document doc,
                                             java.lang.String connectString,
                                             java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                             java.lang.String cbClassName,
                                             Role role)
                                      throws java.io.IOException,
                                             ServletException,
                                             org.xml.sax.SAXException
        Throws:
        java.io.IOException
        ServletException
        org.xml.sax.SAXException
      • processSoapXmla

        public static byte[] processSoapXmla​(org.w3c.dom.Document doc,
                                             java.lang.String connectString,
                                             java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                             java.lang.String cbClassName,
                                             Role role,
                                             java.util.Map<java.util.List<java.lang.String>,​Servlet> servletCache)
                                      throws java.io.IOException,
                                             ServletException,
                                             org.xml.sax.SAXException
        Throws:
        java.io.IOException
        ServletException
        org.xml.sax.SAXException
      • processSoapXmla

        public static byte[] processSoapXmla​(java.lang.String requestText,
                                             java.lang.String connectString,
                                             java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                             java.lang.String cbClassName,
                                             Role role)
                                      throws java.io.IOException,
                                             ServletException,
                                             org.xml.sax.SAXException
        Throws:
        java.io.IOException
        ServletException
        org.xml.sax.SAXException
      • processSoapXmla

        public static byte[] processSoapXmla​(java.lang.String requestText,
                                             java.lang.String connectString,
                                             java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                             java.lang.String cbClassName,
                                             Role role,
                                             java.util.Map<java.util.List<java.lang.String>,​Servlet> servletCache)
                                      throws java.io.IOException,
                                             ServletException,
                                             org.xml.sax.SAXException
        Throws:
        java.io.IOException
        ServletException
        org.xml.sax.SAXException
      • makeServlet

        public static Servlet makeServlet​(java.lang.String connectString,
                                          java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                          java.lang.String cbClassName)
                                   throws java.io.IOException,
                                          ServletException,
                                          org.xml.sax.SAXException
        Throws:
        java.io.IOException
        ServletException
        org.xml.sax.SAXException
      • makeServlet

        public static Servlet makeServlet​(java.lang.String connectString,
                                          java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                          java.lang.String cbClassName,
                                          java.util.Map<java.util.List<java.lang.String>,​Servlet> servletCache)
                                   throws java.io.IOException,
                                          ServletException,
                                          org.xml.sax.SAXException
        Throws:
        java.io.IOException
        ServletException
        org.xml.sax.SAXException
      • processSoapXmla

        public static byte[] processSoapXmla​(java.io.File file,
                                             Servlet servlet)
                                      throws java.io.IOException,
                                             ServletException,
                                             org.xml.sax.SAXException
        Throws:
        java.io.IOException
        ServletException
        org.xml.sax.SAXException
      • processSoapXmla

        public static byte[] processSoapXmla​(org.w3c.dom.Document doc,
                                             Servlet servlet)
                                      throws java.io.IOException,
                                             ServletException,
                                             org.xml.sax.SAXException
        Throws:
        java.io.IOException
        ServletException
        org.xml.sax.SAXException
      • processSoapXmla

        public static byte[] processSoapXmla​(java.lang.String requestText,
                                             Servlet servlet)
                                      throws java.io.IOException,
                                             ServletException,
                                             org.xml.sax.SAXException
        Throws:
        java.io.IOException
        ServletException
        org.xml.sax.SAXException
      • validateSchemaSoapXmla

        public static boolean validateSchemaSoapXmla​(byte[] bytes)
                                              throws org.xml.sax.SAXException,
                                                     java.io.IOException,
                                                     javax.xml.parsers.ParserConfigurationException,
                                                     javax.xml.transform.TransformerException
        Check is a byte array containing a SOAP-XMLA response method is valid. Schema validation occurs if the XMLA response contains both a content and schmema section. This includes both the SOAP elements and the SOAP body content, the XMLA response.
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        javax.xml.transform.TransformerException
      • processXmla

        public static byte[] processXmla​(java.io.File file,
                                         java.lang.String connectString,
                                         java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException,
                                         XOMException
        Processes the given input file as an XMLA request (no SOAP elements).
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        XOMException
      • processXmla

        public static byte[] processXmla​(java.io.File file,
                                         java.lang.String connectString,
                                         java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                         java.util.Map<java.util.List<java.lang.String>,​MondrianServer> cache)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException,
                                         XOMException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        XOMException
      • processXmla

        public static byte[] processXmla​(java.io.File file,
                                         java.lang.String connectString,
                                         java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                         Role role)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException,
                                         XOMException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        XOMException
      • processXmla

        public static byte[] processXmla​(java.io.File file,
                                         java.lang.String connectString,
                                         java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                         Role role,
                                         java.util.Map<java.util.List<java.lang.String>,​MondrianServer> cache)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException,
                                         XOMException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        XOMException
      • processXmla

        public static byte[] processXmla​(java.lang.String requestText,
                                         java.lang.String connectString,
                                         java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException,
                                         XOMException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        XOMException
      • processXmla

        public static byte[] processXmla​(java.lang.String requestText,
                                         java.lang.String connectString,
                                         java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                         java.util.Map<java.util.List<java.lang.String>,​MondrianServer> cache)
                                  throws java.io.IOException,
                                         org.xml.sax.SAXException,
                                         XOMException
        Throws:
        java.io.IOException
        org.xml.sax.SAXException
        XOMException
      • processXmla

        public static byte[] processXmla​(org.w3c.dom.Document requestDoc,
                                         java.lang.String connectString,
                                         java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                         Role role)
                                  throws java.io.IOException,
                                         XOMException
        Throws:
        java.io.IOException
        XOMException
      • processXmla

        public static byte[] processXmla​(org.w3c.dom.Document requestDoc,
                                         java.lang.String connectString,
                                         java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                         Role role,
                                         java.util.Map<java.util.List<java.lang.String>,​MondrianServer> cache)
                                  throws java.io.IOException,
                                         XOMException
        Throws:
        java.io.IOException
        XOMException
      • processXmla

        public static byte[] processXmla​(org.w3c.dom.Element requestElem,
                                         java.lang.String connectString,
                                         java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                         Role role)
                                  throws java.io.IOException,
                                         XOMException
        Throws:
        java.io.IOException
        XOMException
      • processXmla

        public static byte[] processXmla​(org.w3c.dom.Element requestElem,
                                         java.lang.String connectString,
                                         java.util.Map<java.lang.String,​java.lang.String> catalogNameUrls,
                                         Role role,
                                         java.util.Map<java.util.List<java.lang.String>,​MondrianServer> cache)
                                  throws java.io.IOException,
                                         XOMException
        Throws:
        java.io.IOException
        XOMException
      • validateSchemaXmla

        public static boolean validateSchemaXmla​(byte[] bytes)
                                          throws org.xml.sax.SAXException,
                                                 java.io.IOException,
                                                 javax.xml.parsers.ParserConfigurationException,
                                                 javax.xml.transform.TransformerException
        Check is a byte array containing a XMLA response method is valid. Schema validation occurs if the XMLA response contains both a content and schmema section. This should not be used when the byte array contains both the SOAP elements and content, but only for the content.
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        javax.xml.transform.TransformerException
      • validateSoapXmlaUsingXpath

        public static boolean validateSoapXmlaUsingXpath​(byte[] bytes)
                                                  throws org.xml.sax.SAXException,
                                                         java.io.IOException
        This validates a SOAP-XMLA response using xpaths to extract the schema and data parts. In addition, it does a little surgery on the DOMs removing the schema nodes from the XMLA root node.
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • validateXmlaUsingXpath

        public static boolean validateXmlaUsingXpath​(byte[] bytes)
                                              throws org.xml.sax.SAXException,
                                                     java.io.IOException
        This validates a XMLA response using xpaths to extract the schema and data parts. In addition, it does a little surgery on the DOMs removing the schema nodes from the XMLA root node.
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • validateNodes

        public static boolean validateNodes​(org.w3c.dom.Node[] nodes)
                                     throws org.xml.sax.SAXException,
                                            java.io.IOException
        Validate Nodes with throws an error if validation was attempted but failed, returns true if validation was successful and false if validation was not tried.
        Returns:
        true if validation succeeded, false if validation was not tried
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
      • validateEmbeddedSchema

        public static boolean validateEmbeddedSchema​(byte[] bytes,
                                                     java.lang.String schemaTransform,
                                                     java.lang.String dataTransform)
                                              throws org.xml.sax.SAXException,
                                                     java.io.IOException,
                                                     javax.xml.parsers.ParserConfigurationException,
                                                     javax.xml.transform.TransformerException,
                                                     javax.xml.transform.TransformerConfigurationException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        javax.xml.transform.TransformerException
        javax.xml.transform.TransformerConfigurationException
      • validateEmbeddedSchema

        public static boolean validateEmbeddedSchema​(org.w3c.dom.Document doc,
                                                     java.lang.String schemaTransform,
                                                     java.lang.String dataTransform)
                                              throws org.xml.sax.SAXException,
                                                     java.io.IOException,
                                                     javax.xml.parsers.ParserConfigurationException,
                                                     javax.xml.transform.TransformerException,
                                                     javax.xml.transform.TransformerConfigurationException
        A given Document has both content and an embedded schema (where the schema has a single root node and the content has a single root node - they are not interwoven). A single xsl transform is provided to extract the schema part of the Document and another xsl transform is provided to extract the content part and then the content is validated against the schema.

        If the content is valid, then nothing happens, but if the content is not valid an execption is thrown (currently a RuntimeException).

        When Mondrian moves to Java 5 or includes the JAXP 1.3 jar, then there is a utility in JAXP that does something like this (but allows for multiple schema/content parts).

        Throws:
        org.xml.sax.SAXException
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        javax.xml.transform.TransformerException
        javax.xml.transform.TransformerConfigurationException
      • transformSoapXmla

        public static org.w3c.dom.Document transformSoapXmla​(org.w3c.dom.Document doc,
                                                             java.lang.String[][] namevalueParameters,
                                                             java.lang.String ns)
                                                      throws org.xml.sax.SAXException,
                                                             java.io.IOException,
                                                             javax.xml.parsers.ParserConfigurationException,
                                                             javax.xml.transform.TransformerException
        Throws:
        org.xml.sax.SAXException
        java.io.IOException
        javax.xml.parsers.ParserConfigurationException
        javax.xml.transform.TransformerException
      • readFile

        public static java.lang.String readFile​(java.io.File file)
                                         throws java.io.IOException
        Reads a file line by line, adds a '\n' after each line and returns in a String.
        Throws:
        java.io.IOException