/** * Combines Dojo configuration from the configElement into the combinedElement. * * @param configElement WebFrameworkConfigElement * @param combinedElement WebFrameworkConfigElement */ public void combineDojoConfiguration( WebFrameworkConfigElement configElement, WebFrameworkConfigElement combinedElement) { combinedElement.dojoEnabled = this.dojoEnabled; if (configElement.dojoEnabled != null) { combinedElement.dojoEnabled = configElement.dojoEnabled; } combinedElement.dojoLoaderTraceEnabled = this.dojoLoaderTraceEnabled; if (configElement.dojoLoaderTraceEnabled != null) { combinedElement.dojoLoaderTraceEnabled = configElement.dojoLoaderTraceEnabled; } combinedElement.dojoBootstrapFile = this.dojoBootstrapFile; if (configElement.dojoBootstrapFile != null) { combinedElement.dojoBootstrapFile = configElement.dojoBootstrapFile; } combinedElement.dojoPageWidget = this.dojoPageWidget; if (configElement.dojoPageWidget != null) { combinedElement.dojoPageWidget = configElement.dojoPageWidget; } combinedElement.dojoBaseUrl = this.dojoBaseUrl; if (configElement.dojoBaseUrl != null) { combinedElement.dojoBaseUrl = configElement.dojoBaseUrl; } combinedElement.dojoMessagesObject = this.dojoMessagesObject; if (configElement.dojoMessagesObject != null) { combinedElement.dojoMessagesObject = configElement.dojoMessagesObject; } combinedElement.dojoMessagesDefaultScope = this.dojoMessagesDefaultScope; if (configElement.dojoMessagesDefaultScope != null) { combinedElement.dojoMessagesDefaultScope = configElement.dojoMessagesDefaultScope; } combinedElement.dojoDefaultLessConfig = this.dojoDefaultLessConfig; if (configElement.dojoDefaultLessConfig != null) { combinedElement.dojoDefaultLessConfig = configElement.dojoDefaultLessConfig; } combinedElement.dojoPackages = this.dojoPackages; if (configElement.dojoPackages != null) { combinedElement.dojoPackages.putAll(configElement.dojoPackages); } combinedElement.dojoPackagesMain = this.dojoPackagesMain; if (configElement.dojoPackagesMain != null) { combinedElement.dojoPackagesMain.putAll(configElement.dojoPackagesMain); } combinedElement.aikauVersion = this.aikauVersion; if (configElement.aikauVersion != null) { combinedElement.aikauVersion = configElement.aikauVersion; } }
/** * Processes the Dojo configuration from the supplied {@link Element} * * @param configElement WebFrameworkConfigElement * @param elem Element */ public static void processDojoConfiguration( WebFrameworkConfigElement configElement, Element elem) { Element dojoConfig = elem.element(DOJO_CONFIG); if (dojoConfig != null) { String dojoEnabled = dojoConfig.elementTextTrim(DOJO_ENABLED); if (dojoEnabled != null) { configElement.dojoEnabled = Boolean.valueOf(dojoEnabled); } String loaderTraceEnabled = dojoConfig.elementTextTrim(DOJO_LOADER_TRACE_ENABLED); if (loaderTraceEnabled != null) { configElement.dojoLoaderTraceEnabled = Boolean.valueOf(loaderTraceEnabled); } String bootstrapFile = dojoConfig.elementTextTrim(DOJO_BOOTSTRAP_FILE); if (bootstrapFile != null) { configElement.dojoBootstrapFile = bootstrapFile; } String pageWidget = dojoConfig.elementTextTrim(DOJO_PAGE_WIDGETS); if (pageWidget != null) { configElement.dojoPageWidget = pageWidget; } String baseUrl = dojoConfig.elementTextTrim(DOJO_BASE_URL); if (baseUrl != null) { configElement.dojoBaseUrl = baseUrl; } String messagesObject = dojoConfig.elementTextTrim(DOJO_MESSAGES_OBJECT); if (messagesObject != null) { configElement.dojoMessagesObject = messagesObject; } String messagesDefaultScope = dojoConfig.elementTextTrim(DOJO_MESSAGES_DEFAULT_SCOPE); if (messagesDefaultScope != null) { configElement.dojoMessagesDefaultScope = messagesDefaultScope; } String defaultLessConfig = dojoConfig.elementTextTrim(DOJO_DEFAULT_LESS_CONFIG); if (defaultLessConfig != null) { configElement.dojoDefaultLessConfig = defaultLessConfig; } String aikauVersion = dojoConfig.elementTextTrim(AIKAU_VERSION); if (aikauVersion != null) { configElement.aikauVersion = aikauVersion; } Element packages = dojoConfig.element(DOJO_PACKAGES); if (packages != null) { @SuppressWarnings("unchecked") List<Element> packageList = packages.elements(DOJO_PACKAGE); if (packageList != null) { for (Element packageEntry : packageList) { String name = packageEntry.attributeValue(DOJO_PACKAGE_NAME); String location = packageEntry.attributeValue(DOJO_PACKAGE_LOCATION); if (name != null && location != null) { configElement.dojoPackages.put(name, location); String main = packageEntry.attributeValue(DOJO_PACKAGE_MAIN); if (main != null) { configElement.dojoPackagesMain.put(name, main); } } } } } } }