From a28d6999783e9e0f4ad35ede85969aaa9fa3612c Mon Sep 17 00:00:00 2001 From: Yuriy Artamonov Date: Thu, 28 Mar 2013 14:00:50 +0000 Subject: [PATCH] Merge from trunk 10682 --- doc/tools/css/style.css | 18 ++++- doc/tools/xsl/html-single.xsl | 70 +++++++++++++++++-- .../cuba/gui/xml/layout/LayoutLoader.java | 25 ++++--- .../auth/DefaultDomainAliasesResolver.java | 4 ++ modules/web/src/cuba-web-spring.xml | 4 -- 5 files changed, 99 insertions(+), 22 deletions(-) diff --git a/doc/tools/css/style.css b/doc/tools/css/style.css index 28a2c3a446..8d55406d9a 100644 --- a/doc/tools/css/style.css +++ b/doc/tools/css/style.css @@ -499,7 +499,7 @@ table .footnote { /* ToC panel */ -a.toc-btn{ +a.toc-btn { position: fixed; background-color: #404040; opacity:0.5; @@ -543,6 +543,22 @@ a.toc-btn.active { border-top-left-radius: 15px; } +.toc-search, +.toc-search .toc-search-label { + color: #c0c0c0; + font-family: 'Arial', 'Verdana', sans-serif; + font-size: 14px; +} + +#toc-panel a.toc-search-result { + color: #ffffff; + font-weight: bold; +} + +#toc-panel a.toc-search-hidden { + display: none; +} + div#toc-panel a, div#toc-panel p { color: #c0c0c0; } diff --git a/doc/tools/xsl/html-single.xsl b/doc/tools/xsl/html-single.xsl index dbf14f5918..66d47b6c62 100644 --- a/doc/tools/xsl/html-single.xsl +++ b/doc/tools/xsl/html-single.xsl @@ -15,14 +15,21 @@ - + +
+
+ +
+
+
diff --git a/modules/gui/src/com/haulmont/cuba/gui/xml/layout/LayoutLoader.java b/modules/gui/src/com/haulmont/cuba/gui/xml/layout/LayoutLoader.java index 9b683c5e79..505e50e779 100644 --- a/modules/gui/src/com/haulmont/cuba/gui/xml/layout/LayoutLoader.java +++ b/modules/gui/src/com/haulmont/cuba/gui/xml/layout/LayoutLoader.java @@ -1,11 +1,7 @@ /* - * Copyright (c) 2008 Haulmont Technology Ltd. All Rights Reserved. + * Copyright (c) 2013 Haulmont Technology Ltd. All Rights Reserved. * Haulmont Technology proprietary and confidential. * Use is subject to license terms. - - * Author: Dmitry Abramov - * Created: 19.12.2008 15:15:51 - * $Id$ */ package com.haulmont.cuba.gui.xml.layout; @@ -31,6 +27,7 @@ import java.util.regex.Pattern; * @version $Id$ */ public class LayoutLoader { + protected ComponentLoader.Context context; private ComponentsFactory factory; private LayoutLoaderConfig config; @@ -38,9 +35,11 @@ public class LayoutLoader { private Locale locale; private String messagesPack; - private static final Pattern ASSIGN_PATTERN = Pattern.compile("", Pattern.DOTALL); - private static final Pattern DS_CONTEXT_PATTERN = Pattern.compile("(\\p{ASCII}+)"); + public static final Pattern ASSIGN_PATTERN = Pattern.compile(".+?", Pattern.DOTALL); public static Document parseDescriptor(InputStream stream, Map params) { if (stream == null) @@ -50,9 +49,11 @@ public class LayoutLoader { try { String template = IOUtils.toString(stream, "UTF-8"); + Matcher matcher = COMMENT_PATTERN.matcher(template); + template = matcher.replaceAll(""); + Map templateParams = new HashMap<>(params); - Matcher matcher; matcher = ASSIGN_PATTERN.matcher(template); while (matcher.find()) { templateParams.put(matcher.group(1), matcher.group(2)); @@ -60,13 +61,11 @@ public class LayoutLoader { matcher = DS_CONTEXT_PATTERN.matcher(template); if (matcher.find()) { - final String dsContext = matcher.group(1); - - template = DS_CONTEXT_PATTERN.matcher(template).replaceFirst(""); + Document dsContextDocument = Dom4j.readDocument(matcher.group()); + // dsContext queries may have their own templates which are processed later + template = matcher.replaceFirst(""); template = TemplateHelper.processTemplate(template, templateParams); document = Dom4j.readDocument(template); - - final Document dsContextDocument = Dom4j.readDocument("" + dsContext + ""); document.getRootElement().add(dsContextDocument.getRootElement()); } else { template = TemplateHelper.processTemplate(template, templateParams); diff --git a/modules/web/src/com/haulmont/cuba/web/sys/auth/DefaultDomainAliasesResolver.java b/modules/web/src/com/haulmont/cuba/web/sys/auth/DefaultDomainAliasesResolver.java index 9ae255fd6b..9ff6899f33 100644 --- a/modules/web/src/com/haulmont/cuba/web/sys/auth/DefaultDomainAliasesResolver.java +++ b/modules/web/src/com/haulmont/cuba/web/sys/auth/DefaultDomainAliasesResolver.java @@ -12,6 +12,8 @@ import org.apache.commons.lang.StringUtils; import org.apache.commons.logging.Log; import org.apache.commons.logging.LogFactory; +import javax.annotation.ManagedBean; +import javax.inject.Inject; import java.util.HashMap; import java.util.Map; @@ -19,11 +21,13 @@ import java.util.Map; * @author artamonov * @version $Id$ */ +@ManagedBean(DomainAliasesResolver.NAME) public class DefaultDomainAliasesResolver implements DomainAliasesResolver { private Map aliases = new HashMap<>(); private Log log = LogFactory.getLog(DomainAliasesResolver.class); + @Inject public DefaultDomainAliasesResolver(Configuration configuration) { WebConfig webConfig = configuration.getConfig(WebConfig.class); String aliasesConfig = webConfig.getActiveDirectoryAliases(); diff --git a/modules/web/src/cuba-web-spring.xml b/modules/web/src/cuba-web-spring.xml index 9689dab5aa..f39d2e5787 100644 --- a/modules/web/src/cuba-web-spring.xml +++ b/modules/web/src/cuba-web-spring.xml @@ -20,10 +20,6 @@ - - - -