Package com.sun.star.util

Examples of com.sun.star.util.XMacroExpander


    public static String expandMacro(XMultiServiceFactory xMSF, String expand) throws java.lang.Exception {
        try {
            XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xMSF);
            XComponentContext xContext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class,
                xPS.getPropertyValue("DefaultContext"));
            XMacroExpander xME = (XMacroExpander) UnoRuntime.queryInterface(XMacroExpander.class,
                xContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander"));
            return xME.expandMacros(expand);
        } catch (Exception e) {
            throw new Exception("could not expand macro: " + e.toString(), e);
        }

    }
View Full Code Here


            }

            Object serviceObj = m_xContext.getValueByName(
                "/singletons/com.sun.star.util.theMacroExpander");

            XMacroExpander me = (XMacroExpander) AnyConverter.toObject(
                new Type(XMacroExpander.class), serviceObj);

            XMLParserFactory.setOfficeDTDURL(me.expandMacros(
                "${$BRAND_BASE_DIR/program/bootstraprc::BaseInstallation}/share/dtd/officedocument/1_0/"));
           
        }
        catch ( Exception e )
        {
View Full Code Here

public static XMacroExpander getMacroExpander(XMultiServiceFactory _xMSF)
{
    final XComponentContext xComponentContext = getComponentContext(_xMSF);
    final Object aSingleton = xComponentContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander");
    XMacroExpander xExpander = (XMacroExpander)UnoRuntime.queryInterface(XMacroExpander.class, aSingleton);
    // String[][] aStrListList = xProvider.getExtensionList();
//     final String sLocation = xProvider.getPackageLocation("com.sun.reportdesigner");
    return xExpander;
}
View Full Code Here

                String sPath = Template_internal[i];
                if (sPath.startsWith("vnd."))
                {
                    String sPathToExpand = sPath.substring("vnd.sun.star.Expand:".length());
                           
                    XMacroExpander xExpander = Helper.getMacroExpander(xMSF);
                    sPath = xExpander.expandMacros(sPathToExpand);
                }

                // if there exists a language in the directory, we try to add the right language
                sPath = checkIfLanguagePathExists(xMSF, sPath);
               
View Full Code Here

     */
    public static String expandMacro(XMultiServiceFactory xMSF, String expand) throws java.lang.Exception{
        try {
            XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xMSF);
            XComponentContext xContext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class, xPS.getPropertyValue("DefaultContext"));
            XMacroExpander xME = (XMacroExpander) UnoRuntime.queryInterface(XMacroExpander.class, xContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander"));
            return xME.expandMacros(expand);
        }
        catch(Exception e) {
            throw new Exception("could not expand macro: " + e.toString(),e);
        }
       
View Full Code Here

            }

            Object serviceObj = m_xContext.getValueByName(
                "/singletons/com.sun.star.util.theMacroExpander");

            XMacroExpander me = (XMacroExpander) AnyConverter.toObject(
                new Type(XMacroExpander.class), serviceObj);

            XMLParserFactory.setOfficeDTDURL(me.expandMacros(
                "${$BRAND_BASE_DIR/program/bootstraprc::BaseInstallation}/share/dtd/officedocument/1_0/"));
           
        }
        catch ( Exception e )
        {
View Full Code Here

    public static String expandMacro(XMultiServiceFactory xMSF, String expand) throws java.lang.Exception {
        try {
            XPropertySet xPS = (XPropertySet) UnoRuntime.queryInterface(XPropertySet.class, xMSF);
            XComponentContext xContext = (XComponentContext) UnoRuntime.queryInterface(XComponentContext.class,
                xPS.getPropertyValue("DefaultContext"));
            XMacroExpander xME = (XMacroExpander) UnoRuntime.queryInterface(XMacroExpander.class,
                xContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander"));
            return xME.expandMacros(expand);
        } catch (Exception e) {
            throw new Exception("could not expand macro: " + e.toString(), e);
        }

    }
View Full Code Here

    public static XMacroExpander getMacroExpander(XMultiServiceFactory _xMSF)
    {
        final XComponentContext xComponentContext = getComponentContext(_xMSF);
        final Object aSingleton = xComponentContext.getValueByName("/singletons/com.sun.star.util.theMacroExpander");
        XMacroExpander xExpander = (XMacroExpander) UnoRuntime.queryInterface(XMacroExpander.class, aSingleton);
        // String[][] aStrListList = xProvider.getExtensionList();
//     final String sLocation = xProvider.getPackageLocation("com.sun.reportdesigner");
        return xExpander;
    }
View Full Code Here

                String sPath = Template_internal[i];
                if (sPath.startsWith("vnd."))
                {
                    String sPathToExpand = sPath.substring("vnd.sun.star.Expand:".length());

                    XMacroExpander xExpander = Helper.getMacroExpander(xMSF);
                    sPath = xExpander.expandMacros(sPathToExpand);
                }

                // if there exists a language in the directory, we try to add the right language
                sPath = checkIfLanguagePathExists(xMSF, sPath);
View Full Code Here

                String sPath = Template_internal[i];
                if (sPath.startsWith("vnd."))
                {
                    String sPathToExpand = sPath.substring("vnd.sun.star.Expand:".length());

                    XMacroExpander xExpander = Helper.getMacroExpander(xMSF);
                    sPath = xExpander.expandMacros(sPathToExpand);
                }

                // if there exists a language in the directory, we try to add the right language
                sPath = checkIfLanguagePathExists(xMSF, sPath);
View Full Code Here

TOP

Related Classes of com.sun.star.util.XMacroExpander

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.