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 0000000..2045de9 Binary files /dev/null and b/web-app/images/ALA_logo_sm.png differ