From e7357627ae50465e65d795128d3be09f3a3ad963 Mon Sep 17 00:00:00 2001 From: nickdos Date: Wed, 26 Feb 2014 05:36:07 +0000 Subject: [PATCH] Major new version of ala-web-theme - 0.2-SNAPSHOT - uses Grails 2.3.5 and thus SNAPSHOT version numbering should allow latest version to be picked up automatically. Previous version was tagged in svn. git-svn-id: http://ala.googlecode.com/svn/trunk/ala-web-theme@183 cf76a52e-83f7-1f8e-e3a8-b8364d34af1a --- AlaWebThemeGrailsPlugin.groovy | 58 ++- application.properties | 7 +- grails-app/conf/BuildConfig.groovy | 4 +- grails-app/conf/Config.groovy | 24 ++ .../ala/web/theme/HeaderFooterTagLib.groovy | 12 +- grails-app/views/layouts/main.gsp | 17 +- plugin.xml | 27 +- web-app/WEB-INF/applicationContext.xml | 7 +- web-app/WEB-INF/tld/spring.tld | 342 +++++++++++++----- web-app/images/ALA_logo_sm.png | Bin 0 -> 2578 bytes 10 files changed, 348 insertions(+), 150 deletions(-) create mode 100644 web-app/images/ALA_logo_sm.png diff --git a/AlaWebThemeGrailsPlugin.groovy b/AlaWebThemeGrailsPlugin.groovy index 05eb29b..5e7a734 100644 --- a/AlaWebThemeGrailsPlugin.groovy +++ b/AlaWebThemeGrailsPlugin.groovy @@ -3,7 +3,7 @@ import grails.util.Holders class AlaWebThemeGrailsPlugin { // the plugin version - def version = "0.2.2" + def version = "0.2-SNAPSHOT" // the version or versions of Grails the plugin is designed for def grailsVersion = "2.1 > *" // the other plugins this plugin depends on @@ -47,11 +47,49 @@ made to `ala.less` and then CSS files generated with provided script (see README def doWithWebDescriptor = { xml -> def mappingElement = xml.'context-param' def lastMapping = mappingElement[mappingElement.size()-1] - lastMapping + { - 'env-entry' { - 'env-entry-name' ('configPropFile') - 'env-entry-value' (Holders.config.default_config) - 'env-entry-type' ('java.lang.String') + String defaultConfig = Holders.config.default_config + + if (new File(defaultConfig).exists()) { + // Use `configPropFile` external config which is read by ala-cas-client-2.0-SNAPSHOT.jar + lastMapping + { + 'env-entry' { + 'env-entry-name' ('configPropFile') + 'env-entry-value' (defaultConfig) + 'env-entry-type' ('java.lang.String') + } + } + } else { + // default_config file not found - use security.cas.* settings instead + lastMapping + { + 'context-param' { + 'param-name' ('serverName') + 'param-value' (Holders.config.security.cas.appServerName) + } + 'context-param' { + 'param-name' ('casServerName') + 'param-value' (Holders.config.security.cas.casServerName) + } + 'context-param' { + 'param-name' ('uriFilterPattern') + 'param-value' (Holders.config.security.cas.uriFilterPattern) + } + 'context-param' { + 'param-name' ('uriExclusionFilterPattern') + 'param-value' (Holders.config.security.cas.uriExclusionFilterPattern) + } + 'context-param' { + 'param-name' ('authenticateOnlyIfLoggedInFilterPattern') + 'param-value' (Holders.config.security.cas.authenticateOnlyIfLoggedInPattern) + } + } + + if (Holders.config.security.cas.contextPath) { + lastMapping + { + 'context-param' { + 'param-name' ('contextPath') + 'param-value' (Holders.config.security.cas.contextPath) + } + } } } @@ -77,6 +115,10 @@ made to `ala.less` and then CSS files generated with provided script (see README 'param-name' ('gateway') 'param-value' ('false') } + 'init-param' { + 'param-name' ('disableCAS') + 'param-value' (Holders.config.security.cas.bypass == true ? 'true' : 'true') + } } 'filter' { 'filter-name' ('CAS Validation Filter') @@ -115,6 +157,10 @@ made to `ala.less` and then CSS files generated with provided script (see README 'url-pattern' ('/*') } } + + if (Holders.config.security.cas.debugWebXml) { + println "web.xml = ${mappingElement}" + } } def doWithSpring = { diff --git a/application.properties b/application.properties index 218584d..4f7cd97 100644 --- a/application.properties +++ b/application.properties @@ -1,4 +1,5 @@ #Grails Metadata file -#Mon Dec 09 20:00:04 EST 2013 -app.grails.version=2.2.2 -app.name=ala-web-theme \ No newline at end of file +#Wed Feb 26 15:15:56 EST 2014 +app.grails.version=2.3.5 +app.name=ala-web-theme +app.servlet.version=2.5 diff --git a/grails-app/conf/BuildConfig.groovy b/grails-app/conf/BuildConfig.groovy index 01c6c07..c3adada 100644 --- a/grails-app/conf/BuildConfig.groovy +++ b/grails-app/conf/BuildConfig.groovy @@ -39,8 +39,8 @@ grails.project.dependency.resolution = { plugins { runtime ":jquery:1.7.1" runtime ":resources:1.2.1" - compile(":tomcat:$grailsVersion", - ":release:2.2.1") { + compile(":tomcat:7.0.50", + ":release:3.0.1") { export = false } compile ":cache-ehcache:1.0.0" diff --git a/grails-app/conf/Config.groovy b/grails-app/conf/Config.groovy index fb8a48a..025ab3c 100644 --- a/grails-app/conf/Config.groovy +++ b/grails-app/conf/Config.groovy @@ -54,3 +54,27 @@ log4j = { } } //grails.views.default.codec="none" // none, html, base64 grails.views.gsp.encoding="UTF-8" + +// Uncomment and edit the following lines to start using Grails encoding & escaping improvements + +/* remove this line +// GSP settings +grails { + views { + gsp { + encoding = 'UTF-8' + htmlcodec = 'xml' // use xml escaping instead of HTML4 escaping + codecs { + expression = 'html' // escapes values inside null + scriptlet = 'none' // escapes output from scriptlets in GSPs + taglib = 'none' // escapes output from taglibs + staticparts = 'none' // escapes output from static template parts + } + } + // escapes all not-encoded output at final stage of outputting + filteringCodecForContentType { + //'text/html' = 'html' + } + } +} +remove this line */ diff --git a/grails-app/taglib/au/org/ala/web/theme/HeaderFooterTagLib.groovy b/grails-app/taglib/au/org/ala/web/theme/HeaderFooterTagLib.groovy index 05a848d..bb30803 100644 --- a/grails-app/taglib/au/org/ala/web/theme/HeaderFooterTagLib.groovy +++ b/grails-app/taglib/au/org/ala/web/theme/HeaderFooterTagLib.groovy @@ -37,6 +37,7 @@ class HeaderFooterTagLib { * @attr casLoginUrl - defaults to {CH.config.security.cas.loginUrl} * @attr casLogoutUrl - defaults to {CH.config.security.cas.logoutUrl} * @attr ignoreCookie - if true the helper cookie will not be used to determine login - defaults to false + * @attr fluidLayout - if true the BS CSS class of "container" is changed to "container-fluid" */ def banner = { attrs -> out << load('banner2', attrs) @@ -45,13 +46,15 @@ class HeaderFooterTagLib { /** * Display the main menu. * - * Note that highlighting of the current menu item is done by including the apropriate class in the + * Note that highlighting of the current menu item is done by including the appropriate class in the * body tag, eg class="collections". * * Usage: + * + * @attr fluidLayout - if true the BS CSS class of "container" is changed to "container-fluid" */ - def menu = { - out << load('menu', [:]) + def menu = { attrs -> + out << load('menu', attrs) } /** @@ -149,6 +152,9 @@ class HeaderFooterTagLib { content = content.replaceAll(/::centralServer::/, alaBaseURL) content = content.replaceAll(/::searchServer::/, bieBaseURL) // change for BIE to grailServerURL content = content.replaceAll(/::searchPath::/, bieSearchPath) + if (attrs.fluidLayout) { + content = content.replaceAll('class="container"', 'class="container-fluid"') + } if (content =~ "::loginLogoutListItem::") { // only do the work if it is needed content = content.replaceAll(/::loginLogoutListItem::/, buildLoginoutLink(attrs)) diff --git a/grails-app/views/layouts/main.gsp b/grails-app/views/layouts/main.gsp index 1a3ecfe..aa79276 100644 --- a/grails-app/views/layouts/main.gsp +++ b/grails-app/views/layouts/main.gsp @@ -8,11 +8,11 @@ - + <g:layoutTitle /> - <%-- Do not include JS & CSS files here - add them to your app's "application" module (in "Configuration/ApplicationResources.groovy") --%> +<%-- Do not include JS & CSS files here - add them to your app's "application" module (in "Configuration/ApplicationResources.groovy") --%> @@ -66,20 +66,19 @@ - + + + - + - - -
+
-
+
<%-- Borrowed from http://marcusasplund.com/optout/ --%> Desktop version - %{-- Desktop version--}%
diff --git a/plugin.xml b/plugin.xml index 4e5524a..e3950a7 100644 --- a/plugin.xml +++ b/plugin.xml @@ -1,4 +1,4 @@ - + Nick dos Remedios nick.dosremedios@csiro.au Ala Web Theme Plugin @@ -16,29 +16,4 @@ made to `ala.less` and then CSS files generated with provided script (see README au.org.ala.web.HttpWebService au.org.ala.web.theme.HeaderFooterTagLib - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/web-app/WEB-INF/applicationContext.xml b/web-app/WEB-INF/applicationContext.xml index 69fbef3..a48dec0 100644 --- a/web-app/WEB-INF/applicationContext.xml +++ b/web-app/WEB-INF/applicationContext.xml @@ -1,8 +1,7 @@ + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans.xsd"> Grails application factory bean @@ -30,4 +29,6 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem utf-8 + + \ No newline at end of file diff --git a/web-app/WEB-INF/tld/spring.tld b/web-app/WEB-INF/tld/spring.tld index 1bc7091..a0a8c6f 100644 --- a/web-app/WEB-INF/tld/spring.tld +++ b/web-app/WEB-INF/tld/spring.tld @@ -1,311 +1,457 @@ - - - - - - 1.1.1 - - 1.2 - - Spring - + + + + Spring Framework JSP Tag Library + 3.0 + spring http://www.springframework.org/tags - Spring Framework JSP Tag Library. Authors: Rod Johnson, Juergen Hoeller - - - - htmlEscape - org.springframework.web.servlet.tags.HtmlEscapeTag - JSP - Sets default HTML escape value for the current page. Overrides a "defaultHtmlEscape" context-param in web.xml, if any. - + htmlEscape + org.springframework.web.servlet.tags.HtmlEscapeTag + JSP + Set the default value for HTML escaping, to be put + into the current PageContext. defaultHtmlEscape true true - - - - escapeBody - org.springframework.web.servlet.tags.EscapeBodyTag - JSP - Escapes its enclosed body content, applying HTML escaping and/or JavaScript escaping. The HTML escaping flag participates in a page-wide or application-wide setting (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml). - + escapeBody + org.springframework.web.servlet.tags.EscapeBodyTag + JSP + Set HTML escaping for this tag, as boolean value. Overrides the + default HTML escaping setting for the current page. htmlEscape false true - + Set JavaScript escaping for this tag, as boolean value. + Default is false. javaScriptEscape false true - - - - message - org.springframework.web.servlet.tags.MessageTag - JSP - Retrieves the message with the given code, or text if code isn't resolvable. The HTML escaping flag participates in a page-wide or application-wide setting (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml). - + message + org.springframework.web.servlet.tags.MessageTag + JSP + A MessageSourceResolvable argument (direct or through JSP EL). + Fits nicely when used in conjunction with Spring's own validation error + classes which all implement the MessageSourceResolvable interface. For + example, this allows you to iterate over all of the errors in a form, + passing each error (using a runtime expression) as the value of this + 'message' attribute, thus effecting the easy display of such error + messages. + message + false + true + + + The code (key) to use when looking up the message. + If code is not provided, the text attribute will be used. code false true - + Set optional message arguments for this tag, as a + (comma-)delimited String (each String argument can contain JSP EL), + an Object array (used as argument array), or a single Object (used + as single argument). arguments false true - + The separator character to be used for splitting the + arguments string value; defaults to a 'comma' (','). + argumentSeparator + false + true + + + Default text to output when a message for the given code + could not be found. If both text and code are not set, the tag will + output null. text false true - + The string to use when binding the result to the page, + request, session or application scope. If not specified, the result + gets outputted to the writer (i.e. typically directly to the JSP). var false true - + The scope to use when exporting the result to a variable. + This attribute is only used when var is also set. Possible values are + page, request, session and application. scope false true - + Set HTML escaping for this tag, as boolean value. + Overrides the default HTML escaping setting for the current page. htmlEscape false true - + Set JavaScript escaping for this tag, as boolean value. Default is false. javaScriptEscape false true - - - - theme - org.springframework.web.servlet.tags.ThemeTag - JSP - Retrieves the theme message with the given code, or text if code isn't resolvable. The HTML escaping flag participates in a page-wide or application-wide setting (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml). - + theme + org.springframework.web.servlet.tags.ThemeTag + JSP + A MessageSourceResolvable argument (direct or through JSP EL). + message + false + true + + + The code (key) to use when looking up the message. + If code is not provided, the text attribute will be used. code false true - + Set optional message arguments for this tag, as a + (comma-)delimited String (each String argument can contain JSP EL), + an Object array (used as argument array), or a single Object (used + as single argument). arguments false true - + The separator character to be used for splitting the + arguments string value; defaults to a 'comma' (','). + argumentSeparator + false + true + + + Default text to output when a message for the given code + could not be found. If both text and code are not set, the tag will + output null. text false true - + The string to use when binding the result to the page, + request, session or application scope. If not specified, the result + gets outputted to the writer (i.e. typically directly to the JSP). var false true - + The scope to use when exporting the result to a variable. + This attribute is only used when var is also set. Possible values are + page, request, session and application. scope false true - + Set HTML escaping for this tag, as boolean value. + Overrides the default HTML escaping setting for the current page. htmlEscape false true - + Set JavaScript escaping for this tag, as boolean value. Default is false. javaScriptEscape false true - - - - hasBindErrors - org.springframework.web.servlet.tags.BindErrorsTag - JSP - Provides Errors instance in case of bind errors. The HTML escaping flag participates in a page-wide or application-wide setting (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml). - + hasBindErrors + org.springframework.web.servlet.tags.BindErrorsTag + JSP errors org.springframework.validation.Errors - + The name of the bean in the request, that needs to be + inspected for errors. If errors are available for this bean, they + will be bound under the 'errors' key. name true true - + Set HTML escaping for this tag, as boolean value. + Overrides the default HTML escaping setting for the current page. htmlEscape false true - - - - nestedPath - org.springframework.web.servlet.tags.NestedPathTag - JSP - Sets a nested path to be used by the bind tag's path. - + nestedPath + org.springframework.web.servlet.tags.NestedPathTag + JSP nestedPath java.lang.String - + Set the path that this tag should apply. E.g. 'customer' + to allow bind paths like 'address.street' rather than + 'customer.address.street'. path true true - - - - bind - org.springframework.web.servlet.tags.BindTag - JSP - Provides BindStatus object for the given bind path. The HTML escaping flag participates in a page-wide or application-wide setting (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml). - + bind + org.springframework.web.servlet.tags.BindTag + JSP status org.springframework.web.servlet.support.BindStatus - + The path to the bean or bean property to bind status + information for. For instance account.name, company.address.zipCode + or just employee. The status object will exported to the page scope, + specifically for this bean or bean property path true true - + Set whether to ignore a nested path, if any. Default is to not ignore. ignoreNestedPath false true - + Set HTML escaping for this tag, as boolean value. Overrides + the default HTML escaping setting for the current page. htmlEscape false true - - - - transform - org.springframework.web.servlet.tags.TransformTag - JSP - Provides transformation of variables to Strings, using an appropriate custom PropertyEditor from BindTag (can only be used inside BindTag). The HTML escaping flag participates in a page-wide or application-wide setting - (i.e. by HtmlEscapeTag or a "defaultHtmlEscape" context-param in web.xml). + (i.e. by HtmlEscapeTag or a 'defaultHtmlEscape' context-param in web.xml). - + transform + org.springframework.web.servlet.tags.TransformTag + JSP + The value to transform. This is the actual object you want + to have transformed (for instance a Date). Using the PropertyEditor that + is currently in use by the 'spring:bind' tag. value true true - + The string to use when binding the result to the page, + request, session or application scope. If not specified, the result gets + outputted to the writer (i.e. typically directly to the JSP). var false true - + The scope to use when exported the result to a variable. + This attribute is only used when var is also set. Possible values are + page, request, session and application. scope false true + + Set HTML escaping for this tag, as boolean value. Overrides + the default HTML escaping setting for the current page. + htmlEscape + false + true + + + + URL tag based on the JSTL c:url tag. This variant is fully + backwards compatible with the standard tag. Enhancements include support + for URL template parameters. + url + org.springframework.web.servlet.tags.UrlTag + JSP + + The URL to build. This value can include template place holders + that are replaced with the URL encoded value of the named parameter. Parameters + must be defined using the param tag inside the body of this tag. + value + true + true + + + Specifies a remote application context path. The default is the + current application context path. + context + false + true + + + The name of the variable to export the URL value to. + var + false + true + + The scope for the var. 'application', 'session', 'request' and + 'page' scopes are supported. Defaults to page scope. This attribute has no + effect unless the var attribute is also defined. + scope + false + true + + + Set HTML escaping for this tag, as a boolean value. Overrides the + default HTML escaping setting for the current page. htmlEscape false true + + Set JavaScript escaping for this tag, as a boolean value. + Default is false. + javaScriptEscape + false + true + + + + + Parameter tag based on the JSTL c:param tag. The sole purpose is to + support params inside the spring:url tag. + param + org.springframework.web.servlet.tags.ParamTag + JSP + + The name of the parameter. + name + true + true + + + The value of the parameter. + value + false + true + + + + Evaluates a Spring expression (SpEL) and either prints the result or assigns it to a variable. + eval + org.springframework.web.servlet.tags.EvalTag + JSP + + The expression to evaluate. + expression + true + true + + + The name of the variable to export the evaluation result to. + var + false + true + + + The scope for the var. 'application', 'session', 'request' and + 'page' scopes are supported. Defaults to page scope. This attribute has no + effect unless the var attribute is also defined. + scope + false + true + + + Set HTML escaping for this tag, as a boolean value. Overrides the + default HTML escaping setting for the current page. + htmlEscape + false + true + + + Set JavaScript escaping for this tag, as a boolean value. Default is false. + javaScriptEscape + false + true + diff --git a/web-app/images/ALA_logo_sm.png b/web-app/images/ALA_logo_sm.png new file mode 100644 index 0000000000000000000000000000000000000000..2045de9ac3c4ec54c65f5ac9d5f02b637d0dabc2 GIT binary patch literal 2578 zcmb_ec~lek8jZAogyo>2gjGV2C1FWI%3??&$fBS?#2|?*O&|jXvo#3_b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