Examples of XDocumentDataSource


Examples of com.sun.star.sdb.XDocumentDataSource

        try {
            this.DataSourceName = _DataSourceName;
            Object oDataSource = xNameAccess.getByName(DataSourceName);
            xDataSource = (XDataSource) UnoRuntime.queryInterface(XDataSource.class, oDataSource);
            getDataSourceInterfaces();
            XDocumentDataSource xDocu = (XDocumentDataSource)UnoRuntime.queryInterface(XDocumentDataSource.class,this.xDataSource);
            if ( xDocu != null )
                xModel = xDocu.getDatabaseDocument();
        } catch (Exception exception) {
            exception.printStackTrace(System.out);
        }
    }
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

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

                xDataSource = (XDataSource) UnoRuntime.queryInterface(XDataSource.class, child.getParent());
                XDocumentDataSource xDocu = (XDocumentDataSource)UnoRuntime.queryInterface(XDocumentDataSource.class,this.xDataSource);
                if ( xDocu != null )
                    xModel = xDocu.getDatabaseDocument();
                XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xDataSource);
                if ( xPSet != null )
                    DataSourceName = AnyConverter.toString(xPSet.getPropertyValue("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")){
            xDataSource = (XDataSource) UnoRuntime.queryInterface(XDataSource.class, Properties.getPropertyValue(curproperties, "DataSource"));
            XDocumentDataSource xDocu = (XDocumentDataSource)UnoRuntime.queryInterface(XDocumentDataSource.class,this.xDataSource);
            if ( xDocu != null )
                xModel = xDocu.getDatabaseDocument();
            return getConnection(xDataSource);                                                                         
        }                                                                          
        if (Properties.hasPropertyValue(curproperties, "DatabaseLocation")){
            String sDataSourceName = AnyConverter.toString(Properties.getPropertyValue(curproperties, "DatabaseLocation"));
            return getConnection(sDataSourceName);
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

                showElements(xNameAccess);
                Object aObj = xNameAccess.getByName(sFileURL);
//                    log.println("1");
               
                    // PropertySetHelper aHelper = new PropertySetHelper(aObj);
                XDocumentDataSource xDataSource = (XDocumentDataSource)UnoRuntime.queryInterface(XDocumentDataSource.class, aObj);
//                    Object aDatabaseDocmuent = aHelper.getPropertyValueAsObject("DatabaseDocument");
                XOfficeDatabaseDocument xOfficeDBDoc = xDataSource.getDatabaseDocument();
               
                // XOfficeDatabaseDocument xOfficeDBDoc = (XOfficeDatabaseDocument)UnoRuntime.queryInterface(XOfficeDatabaseDocument.class, aDatabaseDocument);
                assure("can't access DatabaseDocument", xOfficeDBDoc != null);
//                    log.println("2");
               
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

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

Examples of com.sun.star.sdb.XDocumentDataSource

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

Examples of com.sun.star.sdb.XDocumentDataSource

    {
        try
        {
            this.DataSourceName = _DataSourceName;
            getDataSourceInterfaces();
            XDocumentDataSource xDocu = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, getDataSource());
            if (xDocu != null)
            {
                xModel = xDocu.getDatabaseDocument();
            }
        }
        catch (Exception exception)
        {
            exception.printStackTrace(System.out);
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

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

                    xDataSource = (XDataSource) UnoRuntime.queryInterface(XDataSource.class, child.getParent());
                    XDocumentDataSource xDocu = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, this.xDataSource);
                    if (xDocu != null)
                    {
                        xModel = xDocu.getDatabaseDocument();
                    }
                    XPropertySet xPSet = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xDataSource);
                    if (xPSet != null)
                    {
                        DataSourceName = AnyConverter.toString(xPSet.getPropertyValue("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"))
            {
                xDataSource = (XDataSource) UnoRuntime.queryInterface(XDataSource.class, Properties.getPropertyValue(curproperties, "DataSource"));
                XDocumentDataSource xDocu = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class, this.xDataSource);
                if (xDocu != null)
                {
                    xModel = xDocu.getDatabaseDocument();
                }
                return getConnection(xDataSource);
            }
            if (Properties.hasPropertyValue(curproperties, "DatabaseLocation"))
            {
View Full Code Here

Examples of com.sun.star.sdb.XDocumentDataSource

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

Examples of com.sun.star.sdb.XDocumentDataSource

    {
        m_databaseDocumentFile = _docURL;

        final XNameAccess dbContext = (XNameAccess) UnoRuntime.queryInterface(XNameAccess.class,
                m_orb.createInstance("com.sun.star.sdb.DatabaseContext"));
        final XDocumentDataSource dataSource = (XDocumentDataSource) UnoRuntime.queryInterface(XDocumentDataSource.class,
                dbContext.getByName(_docURL));

        m_databaseDocument = dataSource.getDatabaseDocument();
        m_dataSource = new DataSource(m_orb, m_databaseDocument.getDataSource());
    }
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.