Examples of XStorable


Examples of com.sun.star.frame.XStorable

    /** stores our document
     * @throws com.sun.star.io.IOException
     */
    private void impl_storeDocument() throws IOException
    {
        XStorable store = (XStorable)UnoRuntime.queryInterface( XStorable.class,
            m_document.getDocument() );
        store.store();
        assure( "document still modified after saving it", !m_document.isModified() );
    }
View Full Code Here

Examples of com.sun.star.frame.XStorable

        for (int k=0; k<sDocTypeExportFilter.length; k++) {
            // iterate over all documents of this type
            for (int i=0; i<sDocuments[k].length; i++) {
                System.out.println("Document: "+ sDocuments[k][i]);
                XComponent xComponent = DesktopTools.loadDoc(xMSF, sDocuments[k][i], null);
                XStorable xStorable = (XStorable)UnoRuntime.queryInterface(XStorable.class, xComponent);
                if (xStorable != null) {
                    // export each document iExportDocCount times
                    for (int j=0; j<iExportDocCount; j++) {
                        String url = utils.getFullURL(sTempDir + "DocExport" + j + ".pdf");
                        try {
                            PropertyValue[] props = new PropertyValue[1];
                            props[0] = new PropertyValue();
                            props[0].Name = "FilterName";
                            // use export filter for this doc type
                            props[0].Value = sDocTypeExportFilter[k][1];
                            xStorable.storeToURL(url, props);
                        }
                        catch(com.sun.star.io.IOException e) {
                            failed("Could not store to '" + url + "'", true);
                        }
                    }
View Full Code Here

Examples of com.sun.star.frame.XStorable

            listBoxControl.addItemListener( this );
        }

        try
        {
            XStorable storable = (XStorable)m_document.query( XStorable.class );
            storable.storeAsURL( java.io.File.createTempFile( getTestObjectName(),".oxs").getAbsoluteFile().toURL().toString(), new com.sun.star.beans.PropertyValue[]{} );
        }
        catch( java.lang.Throwable e )
        {
            e.printStackTrace();
        }
View Full Code Here

Examples of com.sun.star.frame.XStorable

            xDoc = xLoader.loadComponentFromURL(sSourceURL, "_blank", 0, lLoadProps);
            if (xDoc == null)
                failed("Could create office document, which should be saved as temp one.");

            // save it as temp file
            XStorable xStore = (XStorable)UnoRuntime.queryInterface(
                                            XStorable.class,
                                            xDoc);
            xStore.storeAsURL(sTargetURL, lSaveProps);
           
            // Dont forget to close this file. Otherwise the temp file is locked!
            XCloseable xClose = (XCloseable)UnoRuntime.queryInterface(
                                                XCloseable.class,
                                                xDoc);
View Full Code Here

Examples of com.sun.star.frame.XStorable

    /* ------------------------------------------------------------------ */
    private void impl_checkPropertyPersistence() throws com.sun.star.uno.Exception
    {
        // store the document
        XStorable store = (XStorable)UnoRuntime.queryInterface( XStorable.class,
            m_document.getDocument() );
        String documentURL = util.utils.getOfficeTemp( m_orb ) + "document.odt";
        PropertyValue[] storeArguments = new PropertyValue[] { new PropertyValue() };
        storeArguments[0].Name = "FilterName";
        storeArguments[0].Value = "writer8";
        store.storeAsURL( documentURL, storeArguments );

        // close and re-load it
        impl_closeDoc();

        m_document = DocumentHelper.loadDocument( m_orb, documentURL );
View Full Code Here

Examples of com.sun.star.frame.XStorable

    protected TestEnvironment createTestEnvironment
            (TestParameters tParam, PrintWriter log) {

        XMultiServiceFactory xMSF = (XMultiServiceFactory)tParam.getMSF();
        XInterface oObj = null;
        XStorable store = null;

        try {
            oObj = (XInterface)xMSF.createInstance
                ("com.sun.star.frame.DocumentTemplates");
            store = (XStorable) UnoRuntime.queryInterface
View Full Code Here

Examples of com.sun.star.frame.XStorable

            SOF.insertTextContent( xTextDoc, (XTextContent) xBookMark );
           
            fileURL = utils.getOfficeTemp((XMultiServiceFactory)Param.getMSF() );
            fileURL = fileURL + "bookmarks.oot";

            XStorable store = (XStorable) UnoRuntime.queryInterface(XStorable.class, xTextDoc);
            System.out.println(fileURL);
            store.storeToURL(fileURL, new PropertyValue[0]);
           
        } catch( com.sun.star.uno.Exception e ) {
            e.printStackTrace( log );
            throw new StatusException( "Couldn't create Bookmark", e );
        }
View Full Code Here

Examples of com.sun.star.frame.XStorable

     
     
    } finally {

       // store the document
        XStorable storable = (XStorable) UnoRuntime.queryInterface(XStorable.class, document);
        storeProperties.put("CharacterSet", "UTF-8");
      storable.storeToURL(outputUrl, toPropertyValues(storeProperties));
      document.dispose();
    }
  }
View Full Code Here

Examples of com.sun.star.frame.XStorable

            aOverwrite.Name = "Overwrite";
            aOverwrite.Value = Boolean.TRUE;
            aPropertyList.add(aOverwrite);

            // store the document in an other directory
            XStorable aStorable = (XStorable) UnoRuntime.queryInterface( XStorable.class, _xComponent);
            if (aStorable != null)
            {
                log.println("store document as URL: '" + sOutputURL + "'");
                try
                {
                    aStorable.storeAsURL(sOutputURL, PropertyHelper.createPropertyValueArrayFormArrayList(aPropertyList));
                }
                catch (com.sun.star.io.IOException e)
                {
                    log.println("ERROR: Exception caught");
                    log.println("Can't write document URL: '" + sOutputURL + "'");
View Full Code Here

Examples of com.sun.star.frame.XStorable

                        XLoadable.class, oTextDocument );
                xLoadable.initNew();
                m_aTestHelper.Message ( "New document initialized." );
               
                //store the instance to the temporary file URL
                XStorable xStorable = (XStorable) UnoRuntime.queryInterface (
                        XStorable.class, oTextDocument );
                String sURL = AnyConverter.toString ( xTempFile.getUri () );
                PropertyValue aProps[] = new PropertyValue[2];
                aProps[0] = new PropertyValue();
                aProps[0].Name = "DocumentTitle";
                aProps[0].Value = sDocTitle[i];
                aProps[1] = new PropertyValue();
                aProps[1].Name = "FilterName";
                aProps[1].Value = sFilterName[i];
                m_aTestHelper.Message ( "Set title: " +
                        sDocTitle[i] );
                xStorable.storeToURL ( sURL, aProps );
                m_aTestHelper.Message ( "Document stored." );
               
                //create StandaloneDocumentInfo object and load it from the file
                Object oStandaloneDocInfo = m_xMSF.createInstance (
                        "com.sun.star.document.StandaloneDocumentInfo" );
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.