Skip to content

Commit

Permalink
Major new version of ala-web-theme - 0.2-SNAPSHOT - uses Grails 2.3.5…
Browse files Browse the repository at this point in the history
… 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
  • Loading branch information
nickdos committed Feb 26, 2014
1 parent ee9f497 commit e735762
Show file tree
Hide file tree
Showing 10 changed files with 348 additions and 150 deletions.
58 changes: 52 additions & 6 deletions AlaWebThemeGrailsPlugin.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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)
}
}
}
}

Expand All @@ -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')
Expand Down Expand Up @@ -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 = {
Expand Down
7 changes: 4 additions & 3 deletions application.properties
Original file line number Diff line number Diff line change
@@ -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
#Wed Feb 26 15:15:56 EST 2014
app.grails.version=2.3.5
app.name=ala-web-theme
app.servlet.version=2.5
4 changes: 2 additions & 2 deletions grails-app/conf/BuildConfig.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
24 changes: 24 additions & 0 deletions grails-app/conf/Config.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
12 changes: 9 additions & 3 deletions grails-app/taglib/au/org/ala/web/theme/HeaderFooterTagLib.groovy
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand All @@ -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: <hf:menu/>
*
* @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)
}

/**
Expand Down Expand Up @@ -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))
Expand Down
17 changes: 8 additions & 9 deletions grails-app/views/layouts/main.gsp
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,11 @@
<meta name="description" content="Atlas of Living Australia"/>
<meta name="author" content="Atlas of Living Australia">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="http://www.ala.org.au/wp-content/themes/ala2011/images/favicon.ico" rel="shortcut icon" />
<link href="http://www.ala.org.au/wp-content/themes/ala2011/images/favicon.ico" rel="shortcut icon" type="image/x-icon"/>

<title><g:layoutTitle /></title>

<%-- 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") --%>
<r:require modules="bootstrap, application"/>

<r:script disposition='head'>
Expand Down Expand Up @@ -66,20 +66,19 @@
<r:layoutResources/>
<g:layoutHead />
</head>
<body class="${pageProperty(name:'body.class')}" id="${pageProperty(name:'body.id')}" onload="${pageProperty(name:'body.onload')}">
<body class="${pageProperty(name:'body.class')?:'nav-datasets'}" id="${pageProperty(name:'body.id')}" onload="${pageProperty(name:'body.onload')}">
<g:set var="fluidLayout" value="${grailsApplication.config.skin?.fluidLayout}"/>
<hf:banner logoutUrl="${grailsApplication.config.grails.serverURL}/logout/logout" fluidLayout="${fluidLayout}"/>
<hf:banner logoutUrl="${grailsApplication.config.grails.serverURL}/logout/logout"/>
<hf:menu fluidLayout="${fluidLayout}"/>
<hf:menu/>
<div class="container" id="main-content">
<div class="${fluidLayout?'container-fluid':'container'}" id="main-content">
<g:layoutBody />
</div><!--/.container-->
<div class="container hidden-desktop">
<div class="${fluidLayout?'container-fluid':'container'} hidden-desktop">
<%-- Borrowed from http://marcusasplund.com/optout/ --%>
<a class="btn btn-small toggleResponsive"><i class="icon-resize-full"></i> <span>Desktop</span> version</a>
%{--<a class="btn btn-small toggleResponsive"><i class="icon-resize-full"></i> Desktop version</a>--}%
</div>
<hf:footer/>
Expand Down
27 changes: 1 addition & 26 deletions plugin.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<plugin name='ala-web-theme' version='0.2.2' grailsVersion='2.1 &gt; *'>
<plugin name='ala-web-theme' version='0.2-SNAPSHOT' grailsVersion='2.1 &gt; *'>
<author>Nick dos Remedios</author>
<authorEmail>[email protected]</authorEmail>
<title>Ala Web Theme Plugin</title>
Expand All @@ -16,29 +16,4 @@ made to `ala.less` and then CSS files generated with provided script (see README
<resource>au.org.ala.web.HttpWebService</resource>
<resource>au.org.ala.web.theme.HeaderFooterTagLib</resource>
</resources>
<repositories>
<repository name='grailsCentral' url='http://grails.org/plugins' />
<repository name='mavenCentral' url='http://repo1.maven.org/maven2/' />
<repository name='http://maven.ala.org.au/repository' url='http://maven.ala.org.au/repository/' />
<repository name='Codehaus' url='http://repository.codehaus.org/' />
<repository name='http://grails.org/plugins' url='http://grails.org/plugins' />
</repositories>
<dependencies>
<compile>
<dependency group='org.jasig.cas.client' name='cas-client-core' version='3.1.12' />
<dependency group='au.org.ala' name='ala-cas-client' version='2.0-SNAPSHOT' />
</compile>
</dependencies>
<plugins>
<compile>
<plugin group='org.grails.plugins' name='cache-ehcache' version='1.0.0' />
<plugin group='org.grails.plugins' name='rest' version='0.7' />
</compile>
<runtime>
<plugin group='org.grails.plugins' name='resources' version='1.2.1' />
<plugin group='org.grails.plugins' name='jquery' version='1.7.1' />
</runtime>
</plugins>
<runtimePluginRequirements />
<behavior />
</plugin>
7 changes: 4 additions & 3 deletions web-app/WEB-INF/applicationContext.xml
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?>
<beans xmlns="http://www.springframework.org/schema/beans"
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-2.5.xsd">
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">

<bean id="grailsApplication" class="org.codehaus.groovy.grails.commons.GrailsApplicationFactoryBean">
<description>Grails application factory bean</description>
Expand Down Expand Up @@ -30,4 +29,6 @@ http://www.springframework.org/schema/beans http://www.springframework.org/schem
<value>utf-8</value>
</property>
</bean>

<bean id="conversionService" class="org.springframework.context.support.ConversionServiceFactoryBean" />
</beans>
Loading

0 comments on commit e735762

Please sign in to comment.