Package com.sun.star.document

Examples of com.sun.star.document.XDocumentInfoSupplier


            {"end", "office:meta"},
            {"end", "office:document-meta"}} ;

        tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;

        XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier) UnoRuntime.queryInterface
            (XDocumentInfoSupplier.class, xTextDoc) ;
        final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
            (XPropertySet.class, infoSup.getDocumentInfo()) ;
        final PrintWriter logF = log ;

        tEnv.addObjRelation("XDocumentHandler.ImportChecker",
            new ifc.xml.sax._XDocumentHandler.ImportChecker() {
                public boolean checkImport() {
View Full Code Here


                {"end", "office:meta"},
            {"end", "office:document-meta"}} ;

        tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;

        XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
            UnoRuntime.queryInterface
            (XDocumentInfoSupplier.class, xImpressDoc) ;
        final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
            (XPropertySet.class, infoSup.getDocumentInfo()) ;
        final PrintWriter logF = log ;

        tEnv.addObjRelation("XDocumentHandler.ImportChecker",
            new ifc.xml.sax._XDocumentHandler.ImportChecker() {
                public boolean checkImport() {
View Full Code Here

            throw new StatusException( "Couldn't create document", e );
        }

        shortWait();

        XDocumentInfoSupplier xdis = (XDocumentInfoSupplier)
                UnoRuntime.queryInterface(XDocumentInfoSupplier.class, xTextDoc);
        //oObj = (XInterface)UnoRuntime.queryInterface(XInterface.class, docInfo);
        oObj = xdis.getDocumentInfo();
        TestEnvironment tEnv = new TestEnvironment( oObj );

        return tEnv;
    } // finish method getTestEnvironment
View Full Code Here

            XExporter xEx = (XExporter) UnoRuntime.queryInterface
                (XExporter.class,oObj);
            xEx.setSourceDocument(xSheetDoc);

            // Obtaining and changing property values
            XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
                UnoRuntime.queryInterface (XDocumentInfoSupplier.class,
                xSheetDoc) ;
            XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, infoSup.getDocumentInfo()) ;
            docInfo.setPropertyValue("Title", "TestDocument");
           
            log.println("fill sheet 1 with contnet...");
            util.CalcTools.fillCalcSheetWithContent(xSheetDoc,1, 3, 3, 50, 50);
           
View Full Code Here

            {"end", "office:document-meta"}} ;

        tEnv.addObjRelation("XDocumentHandler.XMLData", xml) ;

        //set some meta data
        XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
            UnoRuntime.queryInterface
            (XDocumentInfoSupplier.class, xDrawDoc);
        final XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
                        (XPropertySet.class, infoSup.getDocumentInfo());
        final PrintWriter logF = log ;

        tEnv.addObjRelation("XDocumentHandler.ImportChecker",
            new ifc.xml.sax._XDocumentHandler.ImportChecker() {
                public boolean checkImport() {
View Full Code Here

        log.println("Opening a Writer document");
        xTextDoc = WriterTools.createTextDoc(m_xMSF);
        log.println("... done");

        XDocumentInfoSupplier xDocInfoSup =
            (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class,
                xTextDoc);
        XDocumentInfo xDocInfo = xDocInfoSup.getDocumentInfo();
        XPropertyContainer xPropContainer =
            (XPropertyContainer) UnoRuntime.queryInterface(XPropertyContainer.class,
                xDocInfo);

        log.println("Trying to add a existing property");

        boolean worked =
            addProperty(xPropContainer, "Author", (short) 0, "");
        assure("Could set an existing property", !worked);
        log.println("...done");

        log.println("Trying to add a integer property");
        worked =
            addProperty(xPropContainer, "intValue", com.sun.star.beans.PropertyAttribute.READONLY,
                new Integer(17));
        assure("Couldn't set an integer property", worked);
        log.println("...done");

        log.println("Trying to add a double property");
        worked =
            addProperty(xPropContainer, "doubleValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE ,
                new Double(17.7));
        assure("Couldn't set an double property", worked);
        log.println("...done");

        log.println("Trying to add a boolean property");
        worked =
            addProperty(xPropContainer, "booleanValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE,
                Boolean.TRUE);
        assure("Couldn't set an boolean property", worked);
        log.println("...done");

        log.println("Trying to add a date property");
        worked =
            addProperty(xPropContainer, "dateValue", com.sun.star.beans.PropertyAttribute.REMOVEABLE,
                new Date());
        assure("Couldn't set an date property", worked);
        log.println("...done");
       
        log.println("trying to remove a read only Property");
        try {
            xPropContainer.removeProperty ("intValue");
            assure("Could remove read only property", false);
        } catch (Exception e) {
            log.println("\tException was thrown "+e);
            log.println("\t...OK");
        }
        log.println("...done");       
       

        String tempdir = System.getProperty("java.io.tmpdir");
        String fs = System.getProperty("file.separator");

        if (!tempdir.endsWith(fs)) {
            tempdir += fs;
        }

        tempdir = util.utils.getFullURL(tempdir);

        log.println("Storing the document");

        try {
            XStorable store =
                (XStorable) UnoRuntime.queryInterface(XStorable.class,
                    xTextDoc);
            store.storeToURL(tempdir + "DocInfo.oot",
                new PropertyValue[] {});
            DesktopTools.closeDoc(xTextDoc);
        } catch (Exception e) {
            assure("Couldn't store document", false);
        }

        log.println("...done");

        log.println("loading the document");

        try {
            XComponentLoader xCL =
                (XComponentLoader) UnoRuntime.queryInterface(XComponentLoader.class,
                    m_xMSF.createInstance(
                        "com.sun.star.frame.Desktop"));
            XComponent xComp =
                xCL.loadComponentFromURL(tempdir + "DocInfo.oot",
                    "_blank", 0, new PropertyValue[] {});
            xTextDoc =
                (XTextDocument) UnoRuntime.queryInterface(XTextDocument.class,
                    xComp);
        } catch (Exception e) {
            assure("Couldn't load document", false);
        }

        log.println("...done");

        xDocInfoSup =
            (XDocumentInfoSupplier) UnoRuntime.queryInterface(XDocumentInfoSupplier.class,
                xTextDoc);
        xDocInfo = xDocInfoSup.getDocumentInfo();

        XPropertySet xProps =
            (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class,
                xDocInfo);
View Full Code Here

            XExporter xEx = (XExporter)
                UnoRuntime.queryInterface(XExporter.class, oObj);
            xEx.setSourceDocument(xDrawDoc);

            //set some meta data
            XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
                UnoRuntime.queryInterface(XDocumentInfoSupplier.class,
                xDrawDoc) ;
            XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
                            (XPropertySet.class, infoSup.getDocumentInfo()) ;
            docInfo.setPropertyValue("Title", TITLE);

        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log) ;
            throw new StatusException("Can't create component.", e) ;
View Full Code Here

            XExporter xEx = (XExporter)
                UnoRuntime.queryInterface(XExporter.class,oObj);
            xEx.setSourceDocument(xImpressDoc);

        //change title name
            XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
                UnoRuntime.queryInterface
                (XDocumentInfoSupplier.class, xImpressDoc) ;
            XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, infoSup.getDocumentInfo()) ;
            docInfo.setPropertyValue("Title", NAME);

        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log) ;
            throw new StatusException("Can't create component.", e) ;
View Full Code Here

            XExporter xEx = (XExporter) UnoRuntime.queryInterface
                (XExporter.class,oObj);
            xEx.setSourceDocument(xTextDoc);

            //set some meta data
            XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
                UnoRuntime.queryInterface
                (XDocumentInfoSupplier.class, xTextDoc) ;
            XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, infoSup.getDocumentInfo()) ;
            docInfo.setPropertyValue("Title", TITLE);

        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log) ;
            throw new StatusException("Can't create component.", e) ;
View Full Code Here

            XExporter xEx = (XExporter)
                UnoRuntime.queryInterface(XExporter.class,oObj);
            xEx.setSourceDocument(xImpressDoc);

        //change title name
            XDocumentInfoSupplier infoSup = (XDocumentInfoSupplier)
                UnoRuntime.queryInterface
                (XDocumentInfoSupplier.class, xImpressDoc) ;
            XPropertySet docInfo = (XPropertySet) UnoRuntime.queryInterface
                (XPropertySet.class, infoSup.getDocumentInfo()) ;
            docInfo.setPropertyValue("Title", NAME);

        } catch (com.sun.star.uno.Exception e) {
            e.printStackTrace(log) ;
            throw new StatusException("Can't create component.", e) ;
View Full Code Here

TOP

Related Classes of com.sun.star.document.XDocumentInfoSupplier

Copyright © 2018 www.massapicom. 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.