Package de.innovationgate.wgpublisher.labels

Examples of de.innovationgate.wgpublisher.labels.WGAResourceBundleManager


       
        TMLContext tmlContext = WGAGlobal.fetchInitialContext(cx);
        Design design = (Design) thisObj;
       
        Arguments varArgs = _getLabelBundleVarargs.parse(args);
        WGAResourceBundleManager manager = tmlContext.getwgacore().getResourceBundleManager(design._designContext.getDesignDB());
       
        String container = (String) varArgs.get("container");
        if (container == null) {
            container = WGAResourceBundleManager.CONTAINER_DEFAULT;
        }
       
        String file = (String) varArgs.get("file");
        if (file == null) {
            file = WGAResourceBundleManager.FILE_DEFAULT;
        }
       
        Locale locale = WGLanguage.languageNameToLocale((String) varArgs.get("language"));
       
        return manager.getBundle(container, file, locale);
       
    }
View Full Code Here


               
        if (key == null) {
            return null;
        }
               
        WGAResourceBundleManager manager = getwgacore().getResourceBundleManager(designDB);
       
        String label = null;
        String forceLanguage = (String) designDB.getAttribute(WGACore.DBATTRIB_FORCE_LABEL_LANGUAGE);
        if (forceLanguage != null) {
            Locale prefLangLocale = WGLanguage.languageNameToLocale(forceLanguage);
            try {
                label = LanguageBehaviourTools.fetchLabelForLanguage(manager, containerName, fileName, key, prefLangLocale);
            }
            catch (IOException e) {
                getlog().error("Exception retrieving label " + containerName + "/" + fileName + "/" + key + " for language " + prefLangLocale.toString() + " from DB " + manager.getDb().getDbReference(), e);
            }
        }
        else {
            LanguageBehaviour langBehaviour = LanguageBehaviourTools.retrieve(designDB);
            label = langBehaviour.webtmlFetchLabel(manager, this, containerName, fileName, key);
View Full Code Here

    }

    public WGAResourceBundleManager getResourceBundleManager(WGDatabase database) {

        synchronized (database) {
            WGAResourceBundleManager manager = (WGAResourceBundleManager) database.getAttribute(DBATTRIB_RESOURCEBUNDLE_MANAGER);
            if (manager == null) {
                manager = new WGAResourceBundleManager(database);
                database.setAttribute(DBATTRIB_RESOURCEBUNDLE_MANAGER, manager);
            }
            return manager;
        }
View Full Code Here

TOP

Related Classes of de.innovationgate.wgpublisher.labels.WGAResourceBundleManager

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.