Search in sources :

Example 11 with PropertyList

use of mondrian.olap.Util.PropertyList in project pentaho-platform by pentaho.

the class MondrianCatalogHelper method docAtUrlToString.

protected String docAtUrlToString(final String urlStr, final IPentahoSession pentahoSession) {
    // String relPath = getSolutionRepositoryRelativePath(urlStr, pentahoSession);
    String res = null;
    InputStream in = null;
    try {
        LocalizingDynamicSchemaProcessor schemaProcessor = new LocalizingDynamicSchemaProcessor();
        PropertyList localeInfo = new PropertyList();
        // $NON-NLS-1$
        localeInfo.put("Locale", getLocale().toString());
        FileSystemManager fsManager = VFS.getManager();
        FileObject mondrianDS = fsManager.resolveFile(urlStr);
        in = mondrianDS.getContent().getInputStream();
        res = schemaProcessor.filter(null, localeInfo, in);
    } catch (FileNotFoundException fnfe) {
        throw new MondrianCatalogServiceException(Messages.getInstance().getErrorString("MondrianCatalogHelper.ERROR_0007_FILE_NOT_FOUND"), // $NON-NLS-1$
        fnfe);
    } catch (Exception e) {
        throw new MondrianCatalogServiceException(Messages.getInstance().getErrorString("MondrianCatalogHelper.ERROR_0006_IO_PROBLEM"), // $NON-NLS-1$
        e);
    } finally {
        IOUtils.closeQuietly(in);
    }
    return res;
}
Also used : LocalizingDynamicSchemaProcessor(mondrian.i18n.LocalizingDynamicSchemaProcessor) PropertyList(mondrian.olap.Util.PropertyList) FileInputStream(java.io.FileInputStream) InputStream(java.io.InputStream) FileNotFoundException(java.io.FileNotFoundException) FileObject(org.apache.commons.vfs2.FileObject) DefaultFileSystemManager(org.apache.commons.vfs2.impl.DefaultFileSystemManager) FileSystemManager(org.apache.commons.vfs2.FileSystemManager) UnifiedRepositoryException(org.pentaho.platform.api.repository2.unified.UnifiedRepositoryException) XOMException(org.eigenbase.xom.XOMException) FileSystemException(org.apache.commons.vfs2.FileSystemException) FileNotFoundException(java.io.FileNotFoundException) ObjectFactoryException(org.pentaho.platform.api.engine.ObjectFactoryException) XmlParseException(org.pentaho.platform.api.util.XmlParseException) SAXException(org.xml.sax.SAXException) MondrianException(mondrian.olap.MondrianException) UnsupportedEncodingException(java.io.UnsupportedEncodingException) DBDatasourceServiceException(org.pentaho.platform.api.data.DBDatasourceServiceException) IOException(java.io.IOException) SAXParseException(org.xml.sax.SAXParseException) ParserConfigurationException(javax.xml.parsers.ParserConfigurationException)

Aggregations

PropertyList (mondrian.olap.Util.PropertyList)11 SQLException (java.sql.SQLException)2 ArrayList (java.util.ArrayList)2 LocalizingDynamicSchemaProcessor (mondrian.i18n.LocalizingDynamicSchemaProcessor)2 MondrianException (mondrian.olap.MondrianException)2 OlapException (org.olap4j.OlapException)2 FileInputStream (java.io.FileInputStream)1 FileNotFoundException (java.io.FileNotFoundException)1 IOException (java.io.IOException)1 InputStream (java.io.InputStream)1 UnsupportedEncodingException (java.io.UnsupportedEncodingException)1 HashMap (java.util.HashMap)1 List (java.util.List)1 Map (java.util.Map)1 Properties (java.util.Properties)1 ParserConfigurationException (javax.xml.parsers.ParserConfigurationException)1 Transformer (javax.xml.transform.Transformer)1 TransformerFactory (javax.xml.transform.TransformerFactory)1 DOMSource (javax.xml.transform.dom.DOMSource)1 StreamResult (javax.xml.transform.stream.StreamResult)1