Examples of XStorable


Examples of com.sun.star.frame.XStorable

    */
    public void store() throws IOException
    {
        if ( m_databaseDocument != null )
        {
            XStorable storeDoc = (XStorable)UnoRuntime.queryInterface( XStorable.class,
                m_databaseDocument );
            storeDoc.store();
        }
    }
View Full Code Here

Examples of com.sun.star.frame.XStorable

            Object objectDocumentToStore =
                xcomponentloader.loadComponentFromURL(
                    stringUrl, "_blank", 0, propertyvalue );
           
            // Getting an object that will offer a simple way to store a document to a URL.
            XStorable xstorable =
                ( XStorable ) UnoRuntime.queryInterface( XStorable.class,
                                                         objectDocumentToStore );
     
            // Preparing properties for converting the document
            propertyvalue = new PropertyValue[ 2 ];
            // Setting the flag for overwriting
            propertyvalue[ 0 ] = new PropertyValue();
            propertyvalue[ 0 ].Name = "Overwrite";
            propertyvalue[ 0 ].Value = new Boolean(true);
            // Setting the filter name
            propertyvalue[ 1 ] = new PropertyValue();
            propertyvalue[ 1 ].Name = "FilterName";
            propertyvalue[ 1 ].Value = stringConvertType;
           
            // Appending the favoured extension to the origin document name
            int index = stringUrl.lastIndexOf('.');
            if ( index >= 0 ) {
                stringConvertedFile = stringUrl.substring(0, index) + "." + stringExtension;
            } else {   
                stringConvertedFile = stringUrl + "." + stringExtension;
            }
           
            // Storing and converting the document
            xstorable.storeAsURL( stringConvertedFile, propertyvalue );
           
            XCloseable xcloseable = (XCloseable)UnoRuntime.queryInterface( XCloseable.class,xstorable );
           
            // Closing the converted document
            if ( xcloseable != null )
View Full Code Here

Examples of com.sun.star.frame.XStorable

        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);
        }
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

            revokeDB(name) ;
        } catch (com.sun.star.uno.Exception e) {}
       
        XDocumentDataSource xDDS = (XDocumentDataSource)
        UnoRuntime.queryInterface(XDocumentDataSource.class, dataSource);
        XStorable store = (XStorable) UnoRuntime.queryInterface(XStorable.class,
                xDDS.getDatabaseDocument());
        String aFile = utils.getOfficeTemp(xMSF) + name + ".odb";
        store.storeAsURL(aFile, new PropertyValue[] {  });

        registerDB(name, dataSource) ;
    }
View Full Code Here

Examples of com.sun.star.frame.XStorable

            resultDocName = suffix.insert(0, resultDocName).toString();

        // create a result URL for storing the office document
        String resultURL = URLHelper.getFileURLFromSystemPath(ensureEndingFileSep(_sOutputPath) + resultDocName);

        XStorable xStorable = null;
        xStorable  = (com.sun.star.frame.XStorable)UnoRuntime.queryInterface(com.sun.star.frame.XStorable.class, xComponent);
        if(xStorable == null)
        {
            throw new ConvWatchCancelException("com.sun.star.frame.XStorable could not be instantiated from the office.");
        }

        PropertyValue pvFilterName = new PropertyValue("FilterName", -1, exportFilter, com.sun.star.beans.PropertyState.getDefault());
        PropertyValue pvOverwrite = new PropertyValue("Overwrite", -1, new Boolean(true), com.sun.star.beans.PropertyState.getDefault());

        try
        {
            xStorable.storeAsURL(resultURL, new PropertyValue[]{pvFilterName, pvOverwrite});
        }
        catch (com.sun.star.io.IOException e)
        {
            // wrap IOException
            throw new ConvWatchCancelException("Wrap IOException caught, " + e.getMessage());
View Full Code Here

Examples of com.sun.star.frame.XStorable

    public boolean storeDatabaseDocumentToTempPath(XComponent _xcomponent, String _storename){
    try{
        XInterface xInterface = (XInterface) xMSF.createInstance("com.sun.star.ucb.SimpleFileAccess");
        XSimpleFileAccess xSimpleFileAccess = (XSimpleFileAccess) UnoRuntime.queryInterface(XSimpleFileAccess.class, xInterface);
        String storepath = FileAccess.getOfficePath(xMSF, "Temp", xSimpleFileAccess) + "/" + _storename;
        XStorable xStoreable = (XStorable) UnoRuntime.queryInterface(XStorable.class, _xcomponent);
        PropertyValue[] oStoreProperties = new PropertyValue[1];
        oStoreProperties[0] = Properties.createProperty("FilterName", "writer8");
        storepath += ".odt";
        xStoreable.storeAsURL(storepath, oStoreProperties);
        return true;
    } catch (Exception e) {
        e.printStackTrace(System.out);
        return false;
    }}
View Full Code Here

Examples of com.sun.star.frame.XStorable

                ex.printStackTrace();
            }
               
            agendaTemplate.finish( topicsControl.getTopicsData());
            try {
                XStorable xStoreable = (XStorable) UnoRuntime.queryInterface(XStorable.class, agendaTemplate.document);
                xStoreable.store();
            }
            catch (Exception ex) {
                SystemDialog.showMessageBox(xMSF, "ErrBox", VclWindowPeerAttribute.OK, resources.resErrSaveTemplate);
                ex.printStackTrace();
            }
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

        // store the document
        File tempFile = File.createTempFile( "xmlforms", ".odt" );
        tempFile.deleteOnExit();
        String fileURL = tempFile.toURL().toExternalForm();
        XStorable store = (XStorable)UnoRuntime.queryInterface( XStorable.class,
            m_document.getDocument() );
        store.storeAsURL( fileURL, new PropertyValue[] {} );
        assure( "document still modified after saving it", !m_document.isModified() );
    }
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.