Package org.apache.beehive.netui.script.common.bundle

Examples of org.apache.beehive.netui.script.common.bundle.BundleNode


        if(LOGGER.isInfoEnabled() && _registeredBundles.containsKey(name))
            LOGGER.info("The bundle map already contains a key \"" + name + "\" overwriting the previous value.");

        Locale locale = forcedLocale != null ? forcedLocale : InternalUtils.lookupLocale(_servletRequest);
        ResourceBundle resourceBundle = ResourceBundle.getBundle(resourcePath, locale);
        BundleNode bundle = BundleNodeFactory.getInstance().getResourceBundleNode(name, resourceBundle, locale);
        _registeredBundles.put(name, bundle);
    }
View Full Code Here


            map = new BundleNodeMap(name, (BundleNode)_registeredBundles.get(name));
        }
        else if(name.equals(DEFAULT_STRUTS_BUNDLE_NAME)) {
            MessageResources resources = lookupDefaultStrutsBundle();
            if(resources != null) {
                BundleNode bundleNode = BundleNodeFactory.getInstance().getStrutsBundleNode(name, resources, retrieveUserLocale());
                map = new BundleNodeMap(name, bundleNode);
            }
        }
        else if(_servletContext.getAttribute(name) != null) {
            MessageResources resources = lookupStrutsBundle(name);
            if(resources != null) {
                BundleNode bundleNode = BundleNodeFactory.getInstance().getStrutsBundleNode(name, resources, retrieveUserLocale());
                map = new BundleNodeMap(name, bundleNode);
            }
        }
        else {
            ModuleConfig moduleConfig = lookupCurrentModuleConfig();
            if(moduleConfig != null) {
                MessageResourcesConfig[] mrs = moduleConfig.findMessageResourcesConfigs();
                if(mrs != null) {
                    for(int i = 0; i < mrs.length; i++) {
                        /* skip the default bundle */
                        if(mrs[i].getKey().equals(Globals.MESSAGES_KEY))
                            continue;
                        else if(mrs[i].getKey().equals(name)) {
                            String resourceKey = mrs[i].getKey() + moduleConfig.getPrefix();
                            MessageResources resources = lookupStrutsBundle(resourceKey);
                            BundleNode bundleNode = BundleNodeFactory.getInstance().getStrutsBundleNode(name, resources, retrieveUserLocale());
                            map = new BundleNodeMap(name, bundleNode);
                            break;
                        }
                    }
                }
View Full Code Here

        if(LOGGER.isInfoEnabled() && _registeredBundles.containsKey(name))
            LOGGER.info("The bundle map already contains a key \"" + name + "\" overwriting the previous value.");

        Locale locale = forcedLocale != null ? forcedLocale : InternalUtils.lookupLocale(_servletRequest);
        ResourceBundle resourceBundle = ResourceBundle.getBundle(resourcePath, locale);
        BundleNode bundle = BundleNodeFactory.getInstance().getResourceBundleNode(name, resourceBundle, locale);
        _registeredBundles.put(name, bundle);
    }
View Full Code Here

            map = new BundleNodeMap(name, (BundleNode)_registeredBundles.get(name));
        }
        else if(name.equals(DEFAULT_STRUTS_BUNDLE_NAME)) {
            MessageResources resources = lookupDefaultStrutsBundle();
            if(resources != null) {
                BundleNode bundleNode = BundleNodeFactory.getInstance().getStrutsBundleNode(name, resources, retrieveUserLocale());
                map = new BundleNodeMap(name, bundleNode);
            }
        }
        else if(_servletContext.getAttribute(name) != null) {
            MessageResources resources = lookupStrutsBundle(name);
            if(resources != null) {
                BundleNode bundleNode = BundleNodeFactory.getInstance().getStrutsBundleNode(name, resources, retrieveUserLocale());
                map = new BundleNodeMap(name, bundleNode);
            }
        }
        else {
            ModuleConfig moduleConfig = lookupCurrentModuleConfig();
            if(moduleConfig != null) {
                MessageResourcesConfig[] mrs = moduleConfig.findMessageResourcesConfigs();
                if(mrs != null) {
                    for(int i = 0; i < mrs.length; i++) {
                        /* skip the default bundle */
                        if(mrs[i].getKey().equals(Globals.MESSAGES_KEY))
                            continue;
                        else if(mrs[i].getKey().equals(name)) {
                            String resourceKey = mrs[i].getKey() + moduleConfig.getPrefix();
                            MessageResources resources = lookupStrutsBundle(resourceKey);
                            BundleNode bundleNode = BundleNodeFactory.getInstance().getStrutsBundleNode(name, resources, retrieveUserLocale());
                            map = new BundleNodeMap(name, bundleNode);
                            break;
                        }
                    }
                }
View Full Code Here

TOP

Related Classes of org.apache.beehive.netui.script.common.bundle.BundleNode

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.