Examples of XDocumentDataSource


Examples of com.sun.star.sdb.XDocumentDataSource

            XPropertySet xDSProps = (XPropertySet)
                UnoRuntime.queryInterface(XPropertySet.class, oInterface) ;

            xDSProps.setPropertyValue("URL", "sdbc:dbase:file:///.") ;
           
            XDocumentDataSource xDDS = (XDocumentDataSource)
            UnoRuntime.queryInterface(XDocumentDataSource.class, oInterface);
            XStorable store = (XStorable) UnoRuntime.queryInterface(XStorable.class,
            xDDS.getDatabaseDocument ());
            String aFile = utils.getOfficeTemp ((XMultiServiceFactory) Param.getMSF ())+"DatabaseContext.odb";
            log.println("store to '" + aFile + "'");
            store.storeAsURL(aFile,new PropertyValue[]{});           
           
            tEnv.addObjRelation("XNamingService.RegisterObject", oInterface) ;
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

    protected DatabaseDocument( final XMultiServiceFactory _orb, final DataSource _dataSource )
    {
        m_orb = _orb;
        m_dataSource = _dataSource;

        XDocumentDataSource docDataSource = (XDocumentDataSource)UnoRuntime.queryInterface(
            XDocumentDataSource.class, m_dataSource.getDataSource() );
        m_databaseDocument = (XOfficeDatabaseDocument)UnoRuntime.queryInterface(XOfficeDatabaseDocument.class,
            docDataSource.getDatabaseDocument() );

        m_model = (XModel)UnoRuntime.queryInterface( XModel.class, m_databaseDocument );
        m_storeDoc = (XStorable)UnoRuntime.queryInterface( XStorable.class, m_databaseDocument );
    }
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

        }
       
        try
        {
            log.println("writing database file ...");
            XDocumentDataSource xDDS = (XDocumentDataSource)
            UnoRuntime.queryInterface(XDocumentDataSource.class, oDBSource);
            store = (XStorable) UnoRuntime.queryInterface(XStorable.class,
                    xDDS.getDatabaseDocument());
           
            aFile = utils.getOfficeTemp((XMultiServiceFactory) Param.getMSF())+"ConnectionLine.odb";
            log.println("... filename will be "+aFile);
            store.storeAsURL(aFile,new PropertyValue[]
            {});
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

    {
        try
        {
            this.DataSourceName = _DataSourceName;
            getDataSourceInterfaces();
            XDocumentDataSource xDocu = UnoRuntime.queryInterface( XDocumentDataSource.class, getDataSource() );
            if (xDocu != null)
            {
                xModel = xDocu.getDatabaseDocument();
            }
        }
        catch (Exception e)
        {
            Logger.getLogger( DBMetaData.class.getName() ).log( Level.SEVERE, null, e );
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

                if (xConnection != null)
                {
                    com.sun.star.container.XChild child = UnoRuntime.queryInterface( com.sun.star.container.XChild.class, xConnection );

                    m_dataSource = UnoRuntime.queryInterface( XDataSource.class, child.getParent() );
                    XDocumentDataSource xDocu = UnoRuntime.queryInterface( XDocumentDataSource.class, m_dataSource );
                    if (xDocu != null)
                    {
                        xModel = xDocu.getDatabaseDocument();
                    }
                    XPropertySet xPSet = UnoRuntime.queryInterface( XPropertySet.class, m_dataSource );
                    if (xPSet != null)
                    {
                        DataSourceName = AnyConverter.toString(xPSet.getPropertyValue(PropertyNames.PROPERTY_NAME));
                    }
                    return getConnection(xConnection);
                }
                else
                {
                    bdisposeConnection = true;
                }
            }
            else
            {
                bdisposeConnection = true;
            }
            if (Properties.hasPropertyValue(curproperties, "DataSourceName"))
            {
                String sDataSourceName = AnyConverter.toString(Properties.getPropertyValue(curproperties, "DataSourceName"));
                return getConnection(sDataSourceName);
            }
            else if (Properties.hasPropertyValue(curproperties, "DataSource"))
            {
                m_dataSource = UnoRuntime.queryInterface( XDataSource.class, Properties.getPropertyValue( curproperties, "DataSource" ) );
                XDocumentDataSource xDocu = UnoRuntime.queryInterface( XDocumentDataSource.class, this.m_dataSource );
                if (xDocu != null)
                {
                    xModel = xDocu.getDatabaseDocument();
                }
                return getConnection(m_dataSource);
            }
            if (Properties.hasPropertyValue(curproperties, "DatabaseLocation"))
            {
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

            {
                mimetype = PentahoReportEngineMetaData.OPENDOCUMENT_TEXT;
            }

            final XChild child = UnoRuntime.queryInterface(XChild.class, activeConnection);
            final XDocumentDataSource docSource = UnoRuntime.queryInterface(XDocumentDataSource.class, child.getParent());
            final XModel model = UnoRuntime.queryInterface(XModel.class, docSource.getDatabaseDocument());
            final DataSourceFactory dataFactory = new SDBCReportDataFactory(m_cmpCtx, activeConnection);
            final StorageRepository storageRepository = new StorageRepository(input, output, model.getURL());

            final String inputName = "content.xml";
            final String outputName = "content.xml";
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

        try {
            XCloseable closer = (XCloseable) UnoRuntime.queryInterface(
                                        XCloseable.class, m_dbSrc);
            if ( closer == null )
            {
                XDocumentDataSource dataSource = (XDocumentDataSource)UnoRuntime.queryInterface(
                    XDocumentDataSource.class, m_dbSrc);
                if ( dataSource != null )
                    closer = (XCloseable) UnoRuntime.queryInterface(
                        XCloseable.class, dataSource.getDatabaseDocument() );
            }
            if (debug && closer==null){
                log.println("ERROR: couldn't get 'XCloseable' from DataSource");
            }
            closer.close(true);
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

        assertTrue( "A newly created doc should not have the test case marker", !impl_hasMarker( databaseDoc.getArgs() ) );

        // obtain the DataSource associated with the document. Keeping this alive
        // ensures that the "impl data" of the document is kept alive, too, so when closing
        // and re-opening it, this "impl data" must be re-used.
        XDocumentDataSource dataSource = UnoRuntime.queryInterface(XDocumentDataSource.class, (UnoRuntime.queryInterface(XOfficeDatabaseDocument.class, databaseDoc)).getDataSource());

        // close and reload the doc
        impl_closeDocument(databaseDoc);
        databaseDoc = impl_loadDocument( documentURL, impl_getMarkerLoadArgs() );
        // since we just put the marker into the load-call, it should be present at the doc
        assertTrue( "The test case marker got lost.", impl_hasMarker( databaseDoc.getArgs() ) );

        // The basic library should have survived
        final XEmbeddedScripts embeddedScripts = UnoRuntime.queryInterface(XEmbeddedScripts.class, databaseDoc);
        final XStorageBasedLibraryContainer basicLibs = embeddedScripts.getBasicLibraries();
        assertTrue( "Baisc lib did not survive reloading a closed document", basicLibs.hasByName( "Lib" ) );
        final XNameContainer lib = UnoRuntime.queryInterface(XNameContainer.class, basicLibs.getByName("Lib"));
        assertTrue( "Basic module did not survive reloading a closed document", lib.hasByName( "Module" ) );

        // now closing the doc, and obtaining it from the data source, should preserve the marker we put into the load
        // args
        impl_closeDocument( databaseDoc );
        databaseDoc = UnoRuntime.queryInterface(XModel.class, dataSource.getDatabaseDocument());
        assertTrue( "The test case marker did not survive re-retrieval of the doc from the data source.",
            impl_hasMarker( databaseDoc.getArgs() ) );

        // on the other hand, closing and regurlarly re-loading the doc *without* the marker should indeed
        // lose it
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

                showElements(xNameAccess);
                Object aObj = xNameAccess.getByName(sFileURL);
//                    System.out.println("1");
               
                    // PropertySetHelper aHelper = new PropertySetHelper(aObj);
                XDocumentDataSource xDataSource = UnoRuntime.queryInterface(XDocumentDataSource.class, aObj);
//                    Object aDatabaseDocmuent = aHelper.getPropertyValueAsObject("DatabaseDocument");
                XOfficeDatabaseDocument xOfficeDBDoc = xDataSource.getDatabaseDocument();
               
                // XOfficeDatabaseDocument xOfficeDBDoc = (XOfficeDatabaseDocument)UnoRuntime.queryInterface(XOfficeDatabaseDocument.class, aDatabaseDocument);
                assertNotNull("can't access DatabaseDocument", xOfficeDBDoc);
//                    System.out.println("2");
               
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

    {
        m_databaseDocumentFile = _docURL;

        XNameAccess dbContext = (XNameAccess)UnoRuntime.queryInterface( XNameAccess.class,
            m_context.getServiceManager().createInstanceWithContext( "com.sun.star.sdb.DatabaseContext", m_context ) );
        XDocumentDataSource dataSource = (XDocumentDataSource)UnoRuntime.queryInterface( XDocumentDataSource.class,
            dbContext.getByName( _docURL ) );

        m_databaseDocument = dataSource.getDatabaseDocument();
    }
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.