public class XmlaSupport extends Object
| Modifier and Type | Field and Description | 
|---|---|
static String | 
CATALOG_NAME  | 
static String | 
DATASOURCE_DESCRIPTION  | 
static String | 
DATASOURCE_INFO  | 
static String | 
DATASOURCE_NAME  | 
static Map<String,String> | 
ENV  | 
static String | 
nl  | 
static 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 String | 
SOAP_PREFIX  | 
| Modifier and Type | Method and Description | 
|---|---|
static Document | 
extractBodyFromSoap(Document doc)  | 
static Node[] | 
extractFaultNodesFromSoap(byte[] bytes)  | 
static Node[] | 
extractFaultNodesFromSoap(Document doc)  | 
static Node[] | 
extractHeaderAndBodyFromSoap(byte[] bytes)  | 
static Node[] | 
extractHeaderAndBodyFromSoap(Document doc)  | 
static Node[] | 
extractNodes(Node node,
            String xpath,
            String[][] nsArray)
Given a Document and an xpath/namespace-array pair, extract and return
 the Nodes resulting from applying the xpath. 
 | 
static Node[] | 
extractNodesFromSoapXmla(byte[] bytes)  | 
static Node[] | 
extractNodesFromSoapXmla(Document doc)  | 
static Node[] | 
extractNodesFromXmla(byte[] bytes)  | 
static Node[] | 
extractNodesFromXmla(Document doc)  | 
static CatalogLocator | 
getCatalogLocator()  | 
static DataSourcesConfig.DataSources | 
getDataSources(String connectString,
              Map<String,String> catalogNameUrls)  | 
static String | 
getDataSourcesText(String connectString,
                  Map<String,String> catalogNameUrls)
With a connection string, generate the DataSource xml. 
 | 
static String | 
getSoapBodyXPath()  | 
static String | 
getSoapFaultXPath()  | 
static String | 
getSoapHeaderAndBodyXPath()  | 
static String | 
getSoapXmlaRootXPath(String xmlaPrefix)  | 
static String | 
getXmlaRootXPath(String xmlaPrefix)  | 
static String | 
getXmlaTransform(String xmlaPrefix)
This is a parameterized XSLT. 
 | 
static javax.servlet.Servlet | 
makeServlet(String connectString,
           Map<String,String> catalogNameUrls,
           String cbClassName)  | 
static javax.servlet.Servlet | 
makeServlet(String connectString,
           Map<String,String> catalogNameUrls,
           String cbClassName,
           Map<List<String>,javax.servlet.Servlet> servletCache)  | 
static DataSourcesConfig.DataSources | 
parseDataSources(String dataSourcesConfigString,
                org.apache.log4j.Logger logger)  | 
static byte[] | 
processSoapXmla(Document doc,
               javax.servlet.Servlet servlet)  | 
static byte[] | 
processSoapXmla(Document doc,
               String connectString,
               Map<String,String> catalogNameUrls,
               String cbClassName,
               Role role)  | 
static byte[] | 
processSoapXmla(Document doc,
               String connectString,
               Map<String,String> catalogNameUrls,
               String cbClassName,
               Role role,
               Map<List<String>,javax.servlet.Servlet> servletCache)  | 
static byte[] | 
processSoapXmla(File file,
               javax.servlet.Servlet servlet)  | 
static byte[] | 
processSoapXmla(File file,
               String connectString,
               Map<String,String> catalogNameUrls,
               String cbClassName)
Process the given input file as a SOAP-XMLA request. 
 | 
static byte[] | 
processSoapXmla(File file,
               String connectString,
               Map<String,String> catalogNameUrls,
               String cbClassName,
               Map<List<String>,javax.servlet.Servlet> servletCache)  | 
static byte[] | 
processSoapXmla(String requestText,
               javax.servlet.Servlet servlet)  | 
static byte[] | 
processSoapXmla(String requestText,
               String connectString,
               Map<String,String> catalogNameUrls,
               String cbClassName,
               Role role)  | 
static byte[] | 
processSoapXmla(String requestText,
               String connectString,
               Map<String,String> catalogNameUrls,
               String cbClassName,
               Role role,
               Map<List<String>,javax.servlet.Servlet> servletCache)  | 
static byte[] | 
processXmla(Document requestDoc,
           String connectString,
           Map<String,String> catalogNameUrls,
           Role role)  | 
static byte[] | 
processXmla(Document requestDoc,
           String connectString,
           Map<String,String> catalogNameUrls,
           Role role,
           Map<List<String>,MondrianServer> cache)  | 
static byte[] | 
processXmla(Element requestElem,
           String connectString,
           Map<String,String> catalogNameUrls,
           Role role)  | 
static byte[] | 
processXmla(Element requestElem,
           String connectString,
           Map<String,String> catalogNameUrls,
           Role role,
           Map<List<String>,MondrianServer> cache)  | 
static byte[] | 
processXmla(File file,
           String connectString,
           Map<String,String> catalogNameUrls)
Processes the given input file as an XMLA request (no SOAP elements). 
 | 
static byte[] | 
processXmla(File file,
           String connectString,
           Map<String,String> catalogNameUrls,
           Map<List<String>,MondrianServer> cache)  | 
static byte[] | 
processXmla(File file,
           String connectString,
           Map<String,String> catalogNameUrls,
           Role role)  | 
static byte[] | 
processXmla(File file,
           String connectString,
           Map<String,String> catalogNameUrls,
           Role role,
           Map<List<String>,MondrianServer> cache)  | 
static byte[] | 
processXmla(String requestText,
           String connectString,
           Map<String,String> catalogNameUrls)  | 
static byte[] | 
processXmla(String requestText,
           String connectString,
           Map<String,String> catalogNameUrls,
           Map<List<String>,MondrianServer> cache)  | 
static String | 
readFile(File file)
Reads a file line by line, adds a '\n' after each line and
 returns in a String. 
 | 
static Document | 
transformSoapXmla(Document doc,
                 String[][] namevalueParameters,
                 String ns)  | 
static boolean | 
validateEmbeddedSchema(byte[] bytes,
                      String schemaTransform,
                      String dataTransform)
See next method for JavaDoc  
validateEmbeddedSchema(org.w3c.dom.Document, String, String). | 
static boolean | 
validateEmbeddedSchema(Document doc,
                      String schemaTransform,
                      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(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. 
 | 
public static final String nl
public static final String SOAP_PREFIX
public static final String CATALOG_NAME
public static final String DATASOURCE_NAME
public static final String DATASOURCE_DESCRIPTION
public static final String DATASOURCE_INFO
public static final String ROW_SET_PREFIX
public static String getXmlaTransform(String xmlaPrefix)
public static CatalogLocator getCatalogLocator()
public static DataSourcesConfig.DataSources getDataSources(String connectString, Map<String,String> catalogNameUrls) throws XOMException
XOMExceptionpublic static DataSourcesConfig.DataSources parseDataSources(String dataSourcesConfigString, org.apache.log4j.Logger logger)
public static String getDataSourcesText(String connectString, Map<String,String> catalogNameUrls)
connectString - Connect stringcatalogNameUrls - array of catalog names, catalog url pairspublic static String getSoapFaultXPath()
public static String getSoapHeaderAndBodyXPath()
public static String getSoapBodyXPath()
public static Node[] extractNodesFromSoapXmla(byte[] bytes) throws SAXException, IOException
SAXExceptionIOExceptionpublic static Node[] extractNodesFromSoapXmla(Document doc) throws SAXException, IOException
SAXExceptionIOExceptionpublic static Node[] extractNodesFromXmla(byte[] bytes) throws SAXException, IOException
SAXExceptionIOExceptionpublic static Node[] extractNodesFromXmla(Document doc) throws SAXException, IOException
SAXExceptionIOExceptionpublic static Node[] extractFaultNodesFromSoap(byte[] bytes) throws SAXException, IOException
SAXExceptionIOExceptionpublic static Node[] extractFaultNodesFromSoap(Document doc) throws SAXException, IOException
SAXExceptionIOExceptionpublic static Node[] extractHeaderAndBodyFromSoap(byte[] bytes) throws SAXException, IOException
SAXExceptionIOExceptionpublic static Node[] extractHeaderAndBodyFromSoap(Document doc) throws SAXException, IOException
SAXExceptionIOExceptionpublic static Document extractBodyFromSoap(Document doc) throws SAXException, IOException
SAXExceptionIOExceptionpublic static Node[] extractNodes(Node node, String xpath, String[][] nsArray) throws SAXException, IOException
SAXException - on errorIOException - on errorpublic static byte[] processSoapXmla(File file, String connectString, Map<String,String> catalogNameUrls, String cbClassName) throws IOException, javax.servlet.ServletException, SAXException
IOExceptionjavax.servlet.ServletExceptionSAXExceptionpublic static byte[] processSoapXmla(File file, String connectString, Map<String,String> catalogNameUrls, String cbClassName, Map<List<String>,javax.servlet.Servlet> servletCache) throws IOException, javax.servlet.ServletException, SAXException
IOExceptionjavax.servlet.ServletExceptionSAXExceptionpublic static byte[] processSoapXmla(Document doc, String connectString, Map<String,String> catalogNameUrls, String cbClassName, Role role) throws IOException, javax.servlet.ServletException, SAXException
IOExceptionjavax.servlet.ServletExceptionSAXExceptionpublic static byte[] processSoapXmla(Document doc, String connectString, Map<String,String> catalogNameUrls, String cbClassName, Role role, Map<List<String>,javax.servlet.Servlet> servletCache) throws IOException, javax.servlet.ServletException, SAXException
IOExceptionjavax.servlet.ServletExceptionSAXExceptionpublic static byte[] processSoapXmla(String requestText, String connectString, Map<String,String> catalogNameUrls, String cbClassName, Role role) throws IOException, javax.servlet.ServletException, SAXException
IOExceptionjavax.servlet.ServletExceptionSAXExceptionpublic static byte[] processSoapXmla(String requestText, String connectString, Map<String,String> catalogNameUrls, String cbClassName, Role role, Map<List<String>,javax.servlet.Servlet> servletCache) throws IOException, javax.servlet.ServletException, SAXException
IOExceptionjavax.servlet.ServletExceptionSAXExceptionpublic static javax.servlet.Servlet makeServlet(String connectString, Map<String,String> catalogNameUrls, String cbClassName) throws IOException, javax.servlet.ServletException, SAXException
IOExceptionjavax.servlet.ServletExceptionSAXExceptionpublic static javax.servlet.Servlet makeServlet(String connectString, Map<String,String> catalogNameUrls, String cbClassName, Map<List<String>,javax.servlet.Servlet> servletCache) throws IOException, javax.servlet.ServletException, SAXException
IOExceptionjavax.servlet.ServletExceptionSAXExceptionpublic static byte[] processSoapXmla(File file, javax.servlet.Servlet servlet) throws IOException, javax.servlet.ServletException, SAXException
IOExceptionjavax.servlet.ServletExceptionSAXExceptionpublic static byte[] processSoapXmla(Document doc, javax.servlet.Servlet servlet) throws IOException, javax.servlet.ServletException, SAXException
IOExceptionjavax.servlet.ServletExceptionSAXExceptionpublic static byte[] processSoapXmla(String requestText, javax.servlet.Servlet servlet) throws IOException, javax.servlet.ServletException, SAXException
IOExceptionjavax.servlet.ServletExceptionSAXExceptionpublic static boolean validateSchemaSoapXmla(byte[] bytes)
                                      throws SAXException,
                                             IOException,
                                             ParserConfigurationException,
                                             TransformerException
public static byte[] processXmla(File file, String connectString, Map<String,String> catalogNameUrls) throws IOException, SAXException, XOMException
IOExceptionSAXExceptionXOMExceptionpublic static byte[] processXmla(File file, String connectString, Map<String,String> catalogNameUrls, Map<List<String>,MondrianServer> cache) throws IOException, SAXException, XOMException
IOExceptionSAXExceptionXOMExceptionpublic static byte[] processXmla(File file, String connectString, Map<String,String> catalogNameUrls, Role role) throws IOException, SAXException, XOMException
IOExceptionSAXExceptionXOMExceptionpublic static byte[] processXmla(File file, String connectString, Map<String,String> catalogNameUrls, Role role, Map<List<String>,MondrianServer> cache) throws IOException, SAXException, XOMException
IOExceptionSAXExceptionXOMExceptionpublic static byte[] processXmla(String requestText, String connectString, Map<String,String> catalogNameUrls) throws IOException, SAXException, XOMException
IOExceptionSAXExceptionXOMExceptionpublic static byte[] processXmla(String requestText, String connectString, Map<String,String> catalogNameUrls, Map<List<String>,MondrianServer> cache) throws IOException, SAXException, XOMException
IOExceptionSAXExceptionXOMExceptionpublic static byte[] processXmla(Document requestDoc, String connectString, Map<String,String> catalogNameUrls, Role role) throws IOException, XOMException
IOExceptionXOMExceptionpublic static byte[] processXmla(Document requestDoc, String connectString, Map<String,String> catalogNameUrls, Role role, Map<List<String>,MondrianServer> cache) throws IOException, XOMException
IOExceptionXOMExceptionpublic static byte[] processXmla(Element requestElem, String connectString, Map<String,String> catalogNameUrls, Role role) throws IOException, XOMException
IOExceptionXOMExceptionpublic static byte[] processXmla(Element requestElem, String connectString, Map<String,String> catalogNameUrls, Role role, Map<List<String>,MondrianServer> cache) throws IOException, XOMException
IOExceptionXOMExceptionpublic static boolean validateSchemaXmla(byte[] bytes)
                                  throws SAXException,
                                         IOException,
                                         ParserConfigurationException,
                                         TransformerException
public static boolean validateSoapXmlaUsingXpath(byte[] bytes)
                                          throws SAXException,
                                                 IOException
SAXExceptionIOExceptionpublic static boolean validateXmlaUsingXpath(byte[] bytes)
                                      throws SAXException,
                                             IOException
SAXExceptionIOExceptionpublic static boolean validateNodes(Node[] nodes) throws SAXException, IOException
SAXExceptionIOExceptionpublic static boolean validateEmbeddedSchema(byte[] bytes,
                             String schemaTransform,
                             String dataTransform)
                                      throws SAXException,
                                             IOException,
                                             ParserConfigurationException,
                                             TransformerException,
                                             TransformerConfigurationException
validateEmbeddedSchema(org.w3c.dom.Document, String, String).public static boolean validateEmbeddedSchema(Document doc, String schemaTransform, String dataTransform) throws SAXException, IOException, ParserConfigurationException, TransformerException, TransformerConfigurationException
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).
public static Document transformSoapXmla(Document doc, String[][] namevalueParameters, String ns) throws SAXException, IOException, ParserConfigurationException, TransformerException
public static String readFile(File file) throws IOException
IOException