Package mondrian.tui
Class XmlaSupport
java.lang.Object
mondrian.tui.XmlaSupport
Support for making XMLA requests and looking at the responses.
- Author:
- Richard M. Emberson
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringThis is the prefix used in xpath and transforms for the xmla rowset namespace "urn:schemas-microsoft-com:xml-analysis:rowset".static final String -
Method Summary
Modifier and TypeMethodDescriptionstatic Documentstatic Node[]extractFaultNodesFromSoap(byte[] bytes) static Node[]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[]static Node[]extractNodesFromXmla(byte[] bytes) static Node[]static CatalogLocatorgetDataSources(String connectString, Map<String, String> catalogNameUrls) static StringgetDataSourcesText(String connectString, Map<String, String> catalogNameUrls) With a connection string, generate the DataSource xml.static Stringstatic Stringstatic Stringstatic Stringstatic Stringstatic StringThis is a parameterized XSLT.static javax.servlet.ServletmakeServlet(String connectString, Map<String, String> catalogNameUrls, String cbClassName, Map<List<String>, javax.servlet.Servlet> servletCache) parseDataSources(String dataSourcesConfigString, org.apache.logging.log4j.Logger logger) 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(String requestText, String connectString, Map<String, String> catalogNameUrls, String cbClassName, Role role, Map<List<String>, javax.servlet.Servlet> servletCache) static byte[]processSoapXmla(String requestText, javax.servlet.Servlet servlet) 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(Document doc, javax.servlet.Servlet servlet) static byte[]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, Map<List<String>, MondrianServer> cache) static byte[]processXmla(String requestText, String connectString, Map<String, String> catalogNameUrls, Map<List<String>, MondrianServer> cache) 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, Map<List<String>, MondrianServer> cache) static StringReads a file line by line, adds a '\n' after each line and returns in a String.static DocumenttransformSoapXmla(Document doc, String[][] namevalueParameters) static booleanvalidateEmbeddedSchema(byte[] bytes, String schemaTransform, String dataTransform) See next method for JavaDocvalidateEmbeddedSchema(org.w3c.dom.Document, String, String).static booleanvalidateEmbeddedSchema(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 booleanvalidateNodes(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 booleanvalidateSchemaSoapXmla(byte[] bytes) Check is a byte array containing a SOAP-XMLA response method is valid.static booleanvalidateSchemaXmla(byte[] bytes) Check is a byte array containing a XMLA response method is valid.static booleanvalidateSoapXmlaUsingXpath(byte[] bytes) This validates a SOAP-XMLA response using xpaths to extract the schema and data parts.static booleanvalidateXmlaUsingXpath(byte[] bytes) This validates a XMLA response using xpaths to extract the schema and data parts.
-
Field Details
-
nl
-
SOAP_PREFIX
- See Also:
-
CATALOG_NAME
- See Also:
-
DATASOURCE_NAME
- See Also:
-
DATASOURCE_DESCRIPTION
- See Also:
-
DATASOURCE_INFO
- See Also:
-
ENV
-
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:
-
-
Method Details
-
getXmlaTransform
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
-
getDataSources
public static DataSourcesConfig.DataSources getDataSources(String connectString, Map<String, String> catalogNameUrls) throws org.eigenbase.xom.XOMException- Throws:
org.eigenbase.xom.XOMException
-
parseDataSources
public static DataSourcesConfig.DataSources parseDataSources(String dataSourcesConfigString, org.apache.logging.log4j.Logger logger) -
getDataSourcesText
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 stringcatalogNameUrls- array of catalog names, catalog url pairs
-
getSoapFaultXPath
-
getSoapHeaderAndBodyXPath
-
getSoapBodyXPath
-
getSoapXmlaRootXPath
-
getXmlaRootXPath
-
extractNodesFromSoapXmla
public static Node[] extractNodesFromSoapXmla(byte[] bytes) throws SAXException, IOException, XPathException - Throws:
SAXExceptionIOExceptionXPathException
-
extractNodesFromSoapXmla
public static Node[] extractNodesFromSoapXmla(Document doc) throws SAXException, IOException, XPathException - Throws:
SAXExceptionIOExceptionXPathException
-
extractNodesFromXmla
public static Node[] extractNodesFromXmla(byte[] bytes) throws SAXException, IOException, XPathException - Throws:
SAXExceptionIOExceptionXPathException
-
extractNodesFromXmla
public static Node[] extractNodesFromXmla(Document doc) throws SAXException, IOException, XPathException - Throws:
SAXExceptionIOExceptionXPathException
-
extractFaultNodesFromSoap
public static Node[] extractFaultNodesFromSoap(byte[] bytes) throws SAXException, IOException, XPathException - Throws:
SAXExceptionIOExceptionXPathException
-
extractFaultNodesFromSoap
public static Node[] extractFaultNodesFromSoap(Document doc) throws SAXException, IOException, XPathException - Throws:
SAXExceptionIOExceptionXPathException
-
extractBodyFromSoap
public static Document extractBodyFromSoap(Document doc) throws SAXException, IOException, XPathException - Throws:
SAXExceptionIOExceptionXPathException
-
extractNodes
public static Node[] extractNodes(Node node, String xpath, String[][] nsArray) throws SAXException, IOException, XPathException Given a Document and an xpath/namespace-array pair, extract and return the Nodes resulting from applying the xpath.- Throws:
SAXException- on errorIOException- on errorXPathException
-
processSoapXmla
public static byte[] processSoapXmla(File file, String connectString, Map<String, String> catalogNameUrls, String cbClassName) throws IOException, javax.servlet.ServletException, SAXExceptionProcess the given input file as a SOAP-XMLA request.- Throws:
IOExceptionjavax.servlet.ServletExceptionSAXException
-
processSoapXmla
public static byte[] processSoapXmla(Document doc, String connectString, Map<String, String> catalogNameUrls, String cbClassName, Role role, Map<List<String>, throws IOException, javax.servlet.ServletException, SAXExceptionjavax.servlet.Servlet> servletCache) - Throws:
IOExceptionjavax.servlet.ServletExceptionSAXException
-
processSoapXmla
public static byte[] processSoapXmla(String requestText, String connectString, Map<String, String> catalogNameUrls, String cbClassName, Role role, Map<List<String>, throws IOException, javax.servlet.ServletException, SAXExceptionjavax.servlet.Servlet> servletCache) - Throws:
IOExceptionjavax.servlet.ServletExceptionSAXException
-
makeServlet
public static javax.servlet.Servlet makeServlet(String connectString, Map<String, String> catalogNameUrls, String cbClassName, Map<List<String>, throws IOException, javax.servlet.ServletException, SAXExceptionjavax.servlet.Servlet> servletCache) - Throws:
IOExceptionjavax.servlet.ServletExceptionSAXException
-
processSoapXmla
public static byte[] processSoapXmla(Document doc, javax.servlet.Servlet servlet) throws IOException, javax.servlet.ServletException, SAXException - Throws:
IOExceptionjavax.servlet.ServletExceptionSAXException
-
processSoapXmla
public static byte[] processSoapXmla(String requestText, javax.servlet.Servlet servlet) throws IOException, javax.servlet.ServletException, SAXException - Throws:
IOExceptionjavax.servlet.ServletExceptionSAXException
-
validateSchemaSoapXmla
public static boolean validateSchemaSoapXmla(byte[] bytes) throws SAXException, IOException, ParserConfigurationException, 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. -
processXmla
public static byte[] processXmla(File file, String connectString, Map<String, String> catalogNameUrls) throws IOException, SAXException, org.eigenbase.xom.XOMExceptionProcesses the given input file as an XMLA request (no SOAP elements).- Throws:
IOExceptionSAXExceptionorg.eigenbase.xom.XOMException
-
processXmla
public static byte[] processXmla(File file, String connectString, Map<String, String> catalogNameUrls, Map<List<String>, throws IOException, SAXException, org.eigenbase.xom.XOMExceptionMondrianServer> cache) - Throws:
IOExceptionSAXExceptionorg.eigenbase.xom.XOMException
-
processXmla
public static byte[] processXmla(File file, String connectString, Map<String, String> catalogNameUrls, Role role, Map<List<String>, throws IOException, SAXException, org.eigenbase.xom.XOMExceptionMondrianServer> cache) - Throws:
IOExceptionSAXExceptionorg.eigenbase.xom.XOMException
-
processXmla
public static byte[] processXmla(String requestText, String connectString, Map<String, String> catalogNameUrls, Map<List<String>, throws IOException, SAXException, org.eigenbase.xom.XOMExceptionMondrianServer> cache) - Throws:
IOExceptionSAXExceptionorg.eigenbase.xom.XOMException
-
processXmla
public static byte[] processXmla(Document requestDoc, String connectString, Map<String, String> catalogNameUrls, Role role, Map<List<String>, throws IOException, org.eigenbase.xom.XOMExceptionMondrianServer> cache) - Throws:
IOExceptionorg.eigenbase.xom.XOMException
-
processXmla
public static byte[] processXmla(Element requestElem, String connectString, Map<String, String> catalogNameUrls, Role role, Map<List<String>, throws IOException, org.eigenbase.xom.XOMExceptionMondrianServer> cache) - Throws:
IOExceptionorg.eigenbase.xom.XOMException
-
validateSchemaXmla
public static boolean validateSchemaXmla(byte[] bytes) throws SAXException, IOException, ParserConfigurationException, 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. -
validateSoapXmlaUsingXpath
public static boolean validateSoapXmlaUsingXpath(byte[] bytes) throws SAXException, IOException, XPathException 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:
SAXExceptionIOExceptionXPathException
-
validateXmlaUsingXpath
public static boolean validateXmlaUsingXpath(byte[] bytes) throws SAXException, IOException, XPathException 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:
SAXExceptionIOExceptionXPathException
-
validateNodes
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:
SAXExceptionIOException
-
validateEmbeddedSchema
public static boolean validateEmbeddedSchema(byte[] bytes, String schemaTransform, String dataTransform) throws SAXException, IOException, ParserConfigurationException, TransformerException See next method for JavaDocvalidateEmbeddedSchema(org.w3c.dom.Document, String, String). -
validateEmbeddedSchema
public static boolean validateEmbeddedSchema(Document doc, String schemaTransform, String dataTransform) throws SAXException, IOException, ParserConfigurationException, TransformerException 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).
-
transformSoapXmla
public static Document transformSoapXmla(Document doc, String[][] namevalueParameters) throws SAXException, IOException, ParserConfigurationException, TransformerException -
readFile
Reads a file line by line, adds a '\n' after each line and returns in a String.- Throws:
IOException
-