Examples of XContent


Examples of com.sun.star.ucb.XContent

                log.println("SubStorage names " + i + ": " +names[i]);
            }
            XStorage xStorage = xDocumentSubStorageSupplier.getDocumentSubStorage(names[0], ElementModes.READWRITE);
            assure("Could not get a storage from the XDocumentStorageSupplier.", xStorage != null);
            // get content
            XContent xContent = xTransientDocumentsDocumentContentFactory.createDocumentContent(xModel);
            // actual test: execute some commands
            XCommandProcessor xCommandProcessor = (XCommandProcessor)UnoRuntime.queryInterface(XCommandProcessor.class, xContent);

            // create the command and arguments
            Command command = new Command();
            OpenCommandArgument2 cmargs2 = new OpenCommandArgument2();
            Property[]props = new Property[1];
            props[0] = new Property();
            props[0].Name = "Title";
            props[0].Handle = -1;
            cmargs2.Mode = OpenMode.ALL;
            cmargs2.Properties = props;

            command.Name = "open";
            command.Argument = cmargs2;

            Object result = xCommandProcessor.execute(command, 0, null);
            XDynamicResultSet xDynamicResultSet = (XDynamicResultSet)UnoRuntime.queryInterface(XDynamicResultSet.class, result);
            XResultSet xResultSet = xDynamicResultSet.getStaticResultSet();
            XRow xRow = (XRow)UnoRuntime.queryInterface(XRow.class, xResultSet);
            // create the new folder 'folderName': first, check if it's already there
            while(xResultSet.next()) {
                String existingFolderName = xRow.getString(1);
                log.println("Found existing folder: '" + existingFolderName + "'");
                if (folderName.equals(existingFolderName)) {
                    failed("Cannot create a new folder: folder already exists: adapt test or choose a different document.");
                }
            }
            // create a folder
            XContent xNewFolder = null;
            log.println("Create new folder "+ folderName);
            ContentInfo contentInfo = new ContentInfo();
            contentInfo.Type = "application/vnd.sun.star.tdoc-folder";
            XContentCreator xContentCreator = (XContentCreator)UnoRuntime.queryInterface(XContentCreator.class, xContent);
            xNewFolder = xContentCreator.createNewContent(contentInfo);
View Full Code Here

Examples of com.sun.star.ucb.XContent

                            (XContentProvider)UnoRuntime.queryInterface(XContentProvider.class, xContentIdentifierFactory);
            // create a content identifier from the ucb for tdoc
            XContentIdentifier xContentIdentifier =
                               xContentIdentifierFactory.createContentIdentifier("vnd.sun.star.tdoc:/1");
            // get content
            XContent xContent = xContentProvider.queryContent(xContentIdentifier);

            // actual test: commands to get some properties
            XCommandProcessor xCommandProcessor = (XCommandProcessor)UnoRuntime.queryInterface(XCommandProcessor.class, xContent);
            // build up the command
            Command command = new Command();
View Full Code Here

Examples of com.sun.star.ucb.XContent

    protected XContent getSubContent(XContent content, String subName) {
        XResultSet statRes = getStatResultSet(content);
        XRow row = (XRow)UnoRuntime.queryInterface(XRow.class, statRes);
        XContentAccess contAcc = (XContentAccess)
            UnoRuntime.queryInterface(XContentAccess.class, statRes);
        XContent subContent = null;
        try {
            statRes.first();
            while(!statRes.isAfterLast()) {
                if ( subName.equals(row.getString(1)) ) {
                    subContent = contAcc.queryContent();
View Full Code Here

Examples of com.sun.star.ucb.XContent

            XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ;

            XContentProvider cntProv = (XContentProvider)
                UnoRuntime.queryInterface(XContentProvider.class, oUCB) ;

            XContent cnt = cntProv.queryContent(CI) ;

            XCommandProcessor cmdProc = (XCommandProcessor)
                UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ;

            Property prop = new Property() ;
View Full Code Here

Examples of com.sun.star.ucb.XContent

                            "com.sun.star.ucb.UniversalContentBroker"));
            // create a content identifier from the ucb for tdoc
            XContentIdentifier xContentIdentifier =
                            xContentIdentifierFactory.createContentIdentifier("vnd.sun.star.tdoc:/");
            // get content
            XContent xContent = xContentProvider.queryContent(xContentIdentifier);
           
            // actual test: execute an "open" command with the content
            XCommandProcessor xCommandProcessor = (XCommandProcessor)UnoRuntime.queryInterface(XCommandProcessor.class, xContent);
            // build up the command
            Command command = new Command();
View Full Code Here

Examples of com.sun.star.ucb.XContent

        if ( factory == null )
            throw new com.sun.star.uno.RuntimeException( "ScriptProvider: unable to create a TDOC context factory.", this );

        try
        {
            XContent content = factory.createDocumentContent( document );
            return content.getIdentifier().getContentIdentifier();
        }
        catch( Exception ex )
        {
        }
View Full Code Here

Examples of com.sun.star.ucb.XContent

            XContentProvider xCntAccess = ( XContentProvider )
                UnoRuntime.queryInterface( XContentProvider.class,
                    ucb );
           

            XContent xCnt = xCntAccess.queryContent( xCntId );


            XCommandProcessor xCmd = ( XCommandProcessor )
                UnoRuntime.queryInterface( XCommandProcessor.class, xCnt );
View Full Code Here

Examples of com.sun.star.ucb.XContent

            XContentIdentifierFactory CIF = (XContentIdentifierFactory)
                                                tEnv.getObjRelation("FACTORY");
            String aURL = content1;
            log.println("Trying to query "+aURL);
            XContentIdentifier CI = CIF.createContentIdentifier(aURL);
            XContent aContent = oObj.queryContent(CI);
            boolean res = true;
            Object nc = tEnv.getObjRelation("NoCONTENT");
            if (nc == null) {
                res = aContent != null;
            }
View Full Code Here

Examples of com.sun.star.ucb.XContent

            XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ;

            XContentProvider cntProv = (XContentProvider)
                UnoRuntime.queryInterface(XContentProvider.class, oUCB) ;

            XContent cnt = cntProv.queryContent(CI) ;

            XCommandProcessor cmdProc = (XCommandProcessor)
                UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ;

            Property prop = new Property() ;
View Full Code Here

Examples of com.sun.star.ucb.XContent

            XContentIdentifier CI = ciFac.createContentIdentifier(cntUrl) ;

            XContentProvider cntProv = (XContentProvider)
                UnoRuntime.queryInterface(XContentProvider.class, oUCB) ;

            XContent cnt = cntProv.queryContent(CI) ;

            XCommandProcessor cmdProc = (XCommandProcessor)
                UnoRuntime.queryInterface(XCommandProcessor.class, cnt) ;

            Property prop = new Property() ;
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.