Package com.sun.star.script.framework.container

Examples of com.sun.star.script.framework.container.ParcelContainer


                        "ScriptProvider argument must be either a string, a valid XScriptInvocationContext, " +
                        "or an XModel", this);
                }

                contextUrl = getDocUrlFromModel( m_xModel );
                m_container = new ParcelContainer( m_xContext, contextUrl, language  );
            }
            else if (AnyConverter.isString(aArguments[0]) == true)
            {
                String originalContextURL = AnyConverter.toString(aArguments[0]);
                LogUtils.DEBUG("creating Application, path: " + originalContextURL );
                contextUrl = originalContextURL;
                // TODO no support for packages in documents yet
                if ( originalContextURL.startsWith( "vnd.sun.star.tdoc" ) )
                {
                    m_container = new ParcelContainer( m_xContext, contextUrl, language  );
                    m_xModel = getModelFromDocUrl( originalContextURL );
                }
                else
                {
                    if ( originalContextURL.startsWith( "share" ) )
                    {
                        contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::BaseInstallation}/share";
                    }
                    else if ( originalContextURL.startsWith( "user" ) )
                    {
                        contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
                    }
                   
                    if ( originalContextURL.endsWith( "uno_packages") )
                    {
                        isPkgProvider = true;
                    }
                    if ( originalContextURL.endsWith( "uno_packages") &&  !originalContextURL.equals( contextUrl  ) )
                    {
                        contextUrl = PathUtils.make_url( contextUrl, "uno_packages"  );
                    }
                    if ( isPkgProvider )
                    {
                        m_container = new UnoPkgContainer( m_xContext, contextUrl, language  );
                    }
                    else
                    {
                        m_container = new ParcelContainer( m_xContext, contextUrl, language  );
                    }
                }
            }
            else
            {
View Full Code Here


    // de-register for library only !!
    public void removeByName( String Name ) throws com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException
    {
        LogUtils.DEBUG("In ScriptProvider.removeByName() for " + Name + " this provider = " + language );
        ParcelContainer c = ((UnoPkgContainer)m_container).getRegisteredUnoPkgContainer( Name );
        if ( c != null )
        {
            String libName;
            if (Name.endsWith("/"))
            {
                String tmp = Name.substring( 0, Name.lastIndexOf( "/" ) );
                libName = tmp.substring( tmp.lastIndexOf( "/" ) + 1 );
            }
            else
            {
                libName = Name.substring( Name.lastIndexOf( "/" ) + 1 );
            }
            LogUtils.DEBUG("Deregistering library " + libName );
            if ( c.removeParcel( libName ) )
            {
                ((UnoPkgContainer)m_container).deRegisterPackageContainer( Name );
            }
            else
            {
View Full Code Here

                        "ScriptProvider argument must be either a string, a valid XScriptInvocationContext, " +
                        "or an XModel", this);
                }

                contextUrl = getDocUrlFromModel( m_xModel );
                m_container = new ParcelContainer( m_xContext, contextUrl, language  );
            }
            else if (AnyConverter.isString(aArguments[0]) == true)
            {
                String originalContextURL = AnyConverter.toString(aArguments[0]);
                LogUtils.DEBUG("creating Application, path: " + originalContextURL );
                contextUrl = originalContextURL;
                // TODO no support for packages in documents yet
                if ( originalContextURL.startsWith( "vnd.sun.star.tdoc" ) )
                {
                    m_container = new ParcelContainer( m_xContext, contextUrl, language  );
                    m_xModel = getModelFromDocUrl( originalContextURL );
                }
                else
                {
                    if ( originalContextURL.startsWith( "share" ) )
                    {
                        contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::BaseInstallation}/share";
                    }
                    else if ( originalContextURL.startsWith( "user" ) )
                    {
                        contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
                    }
                   
                    if ( originalContextURL.endsWith( "uno_packages") )
                    {
                        isPkgProvider = true;
                    }
                    if ( originalContextURL.endsWith( "uno_packages") &&  !originalContextURL.equals( contextUrl  ) )
                    {
                        contextUrl = PathUtils.make_url( contextUrl, "uno_packages"  );
                    }
                    if ( isPkgProvider )
                    {
                        m_container = new UnoPkgContainer( m_xContext, contextUrl, language  );
                    }
                    else
                    {
                        m_container = new ParcelContainer( m_xContext, contextUrl, language  );
                    }
                }
            }
            else
            {
View Full Code Here

    // de-register for library only !!
    public void removeByName( String Name ) throws com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException
    {
        LogUtils.DEBUG("In ScriptProvider.removeByName() for " + Name + " this provider = " + language );
        ParcelContainer c = ((UnoPkgContainer)m_container).getRegisteredUnoPkgContainer( Name );
        if ( c != null )
        {
            String libName;
            if (Name.endsWith("/"))
            {
                String tmp = Name.substring( 0, Name.lastIndexOf( "/" ) );
                libName = tmp.substring( tmp.lastIndexOf( "/" ) + 1 );
            }
            else
            {
                libName = Name.substring( Name.lastIndexOf( "/" ) + 1 );
            }
            LogUtils.DEBUG("Deregistering library " + libName );
            if ( c.removeParcel( libName ) )
            {
                ((UnoPkgContainer)m_container).deRegisterPackageContainer( Name );
            }
            else
            {
View Full Code Here

                        "ScriptProvider argument must be either a string, a valid XScriptInvocationContext, " +
                        "or an XModel", this);
                }

                contextUrl = getDocUrlFromModel( m_xModel );
                m_container = new ParcelContainer( m_xContext, contextUrl, language  );
            }
            else if (AnyConverter.isString(aArguments[0]) == true)
            {
                String originalContextURL = AnyConverter.toString(aArguments[0]);
                LogUtils.DEBUG("creating Application, path: " + originalContextURL );
                contextUrl = originalContextURL;
                // TODO no support for packages in documents yet
                if ( originalContextURL.startsWith( "vnd.sun.star.tdoc" ) )
                {
                    m_container = new ParcelContainer( m_xContext, contextUrl, language  );
                    m_xModel = getModelFromDocUrl( originalContextURL );
                }
                else
                {
                    String extensionDb = null;
                    String extensionRepository = null;
                    if ( originalContextURL.startsWith( "bundled" ) )
                    {
                        contextUrl = "vnd.sun.star.expand:$BUNDLED_EXTENSIONS";
                        extensionDb = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
                        extensionRepository = "bundled";
                    }

                    if ( originalContextURL.startsWith( "share" ) )
                    {
                        contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::BaseInstallation}/share";
                        extensionDb = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
                        extensionRepository = "shared";
                    }
                    else if ( originalContextURL.startsWith( "user" ) )
                    {
                        contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
                        extensionDb = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
                        extensionRepository = "user";
                    }
                   
                    if ( originalContextURL.endsWith( "uno_packages") )
                    {
                        isPkgProvider = true;
                    }
                    if ( originalContextURL.endsWith( "uno_packages") &&  !originalContextURL.equals( contextUrl  )
                            && !extensionRepository.equals("bundled"))
                    {
                        contextUrl = PathUtils.make_url( contextUrl, "uno_packages"  );
                    }
                    if ( isPkgProvider )
                    {
                        m_container = new UnoPkgContainer( m_xContext, contextUrl, extensionDb, extensionRepository, language  );
                    }
                    else
                    {
                        m_container = new ParcelContainer( m_xContext, contextUrl, language  );
                    }
                }
            }
            else
            {
View Full Code Here

    // de-register for library only !!
    public void removeByName( String Name ) throws com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException
    {
        LogUtils.DEBUG("In ScriptProvider.removeByName() for " + Name + " this provider = " + language );
        ParcelContainer c = ((UnoPkgContainer)m_container).getRegisteredUnoPkgContainer( Name );
        if ( c != null )
        {
            String libName;
            if (Name.endsWith("/"))
            {
                String tmp = Name.substring( 0, Name.lastIndexOf( "/" ) );
                libName = tmp.substring( tmp.lastIndexOf( "/" ) + 1 );
            }
            else
            {
                libName = Name.substring( Name.lastIndexOf( "/" ) + 1 );
            }
            LogUtils.DEBUG("Deregistering library " + libName );
            if ( c.removeParcel( libName ) )
            {
                ((UnoPkgContainer)m_container).deRegisterPackageContainer( Name );
            }
            else
            {
View Full Code Here

                        "ScriptProvider argument must be either a string, a valid XScriptInvocationContext, " +
                        "or an XModel", this);
                }

                contextUrl = getDocUrlFromModel( m_xModel );
                m_container = new ParcelContainer( m_xContext, contextUrl, language  );
            }
            else if (AnyConverter.isString(aArguments[0]) == true)
            {
                String originalContextURL = AnyConverter.toString(aArguments[0]);
                LogUtils.DEBUG("creating Application, path: " + originalContextURL );
                contextUrl = originalContextURL;
                // TODO no support for packages in documents yet
                if ( originalContextURL.startsWith( "vnd.sun.star.tdoc" ) )
                {
                    m_container = new ParcelContainer( m_xContext, contextUrl, language  );
                    m_xModel = getModelFromDocUrl( originalContextURL );
                }
                else
                {
                    if ( originalContextURL.startsWith( "share" ) )
                    {
                        contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::BaseInstallation}/share";
                    }
                    else if ( originalContextURL.startsWith( "user" ) )
                    {
                        contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
                    }
                   
                    if ( originalContextURL.endsWith( "uno_packages") )
                    {
                        isPkgProvider = true;
                    }
                    if ( originalContextURL.endsWith( "uno_packages") &&  !originalContextURL.equals( contextUrl  ) )
                    {
                        contextUrl = PathUtils.make_url( contextUrl, "uno_packages"  );
                    }
                    if ( isPkgProvider )
                    {
                        m_container = new UnoPkgContainer( m_xContext, contextUrl, language  );
                    }
                    else
                    {
                        m_container = new ParcelContainer( m_xContext, contextUrl, language  );
                    }
                }
            }
            else
            {
View Full Code Here

    // de-register for library only !!
    public void removeByName( String Name ) throws com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException
    {
        LogUtils.DEBUG("In ScriptProvider.removeByName() for " + Name + " this provider = " + language );
        ParcelContainer c = ((UnoPkgContainer)m_container).getRegisteredUnoPkgContainer( Name );
        if ( c != null )
        {
            String libName;
            if (Name.endsWith("/"))
            {
                String tmp = Name.substring( 0, Name.lastIndexOf( "/" ) );
                libName = tmp.substring( tmp.lastIndexOf( "/" ) + 1 );
            }
            else
            {
                libName = Name.substring( Name.lastIndexOf( "/" ) + 1 );
            }
            LogUtils.DEBUG("Deregistering library " + libName );
            if ( c.removeParcel( libName ) )
            {
                ((UnoPkgContainer)m_container).deRegisterPackageContainer( Name );
            }
            else
            {
View Full Code Here

                        "ScriptProvider argument must be either a string, a valid XScriptInvocationContext, " +
                        "or an XModel", this);
                }

                contextUrl = getDocUrlFromModel( m_xModel );
                m_container = new ParcelContainer( m_xContext, contextUrl, language  );
            }
            else if (AnyConverter.isString(aArguments[0]) == true)
            {
                String originalContextURL = AnyConverter.toString(aArguments[0]);
                LogUtils.DEBUG("creating Application, path: " + originalContextURL );
                contextUrl = originalContextURL;
                // TODO no support for packages in documents yet
                if ( originalContextURL.startsWith( "vnd.sun.star.tdoc" ) )
                {
                    m_container = new ParcelContainer( m_xContext, contextUrl, language  );
                    m_xModel = getModelFromDocUrl( originalContextURL );
                }
                else
                {
                    if ( originalContextURL.startsWith( "share" ) )
                    {
                        contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::BaseInstallation}/share";
                    }
                    else if ( originalContextURL.startsWith( "user" ) )
                    {
                        contextUrl = "vnd.sun.star.expand:${$BRAND_BASE_DIR/program/" + PathUtils.BOOTSTRAP_NAME + "::UserInstallation}/user";
                    }
                   
                    if ( originalContextURL.endsWith( "uno_packages") )
                    {
                        isPkgProvider = true;
                    }
                    if ( originalContextURL.endsWith( "uno_packages") &&  !originalContextURL.equals( contextUrl  ) )
                    {
                        contextUrl = PathUtils.make_url( contextUrl, "uno_packages"  );
                    }
                    if ( isPkgProvider )
                    {
                        m_container = new UnoPkgContainer( m_xContext, contextUrl, language  );
                    }
                    else
                    {
                        m_container = new ParcelContainer( m_xContext, contextUrl, language  );
                    }
                }
            }
            else
            {
View Full Code Here

    // de-register for library only !!
    public void removeByName( String Name ) throws com.sun.star.container.NoSuchElementException, com.sun.star.lang.WrappedTargetException
    {
        LogUtils.DEBUG("In ScriptProvider.removeByName() for " + Name + " this provider = " + language );
        ParcelContainer c = ((UnoPkgContainer)m_container).getRegisteredUnoPkgContainer( Name );
        if ( c != null )
        {
            String libName;
            if (Name.endsWith("/"))
            {
                String tmp = Name.substring( 0, Name.lastIndexOf( "/" ) );
                libName = tmp.substring( tmp.lastIndexOf( "/" ) + 1 );
            }
            else
            {
                libName = Name.substring( Name.lastIndexOf( "/" ) + 1 );
            }
            LogUtils.DEBUG("Deregistering library " + libName );
            if ( c.removeParcel( libName ) )
            {
                ((UnoPkgContainer)m_container).deRegisterPackageContainer( Name );
            }
            else
            {
View Full Code Here

TOP

Related Classes of com.sun.star.script.framework.container.ParcelContainer

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.