Move FreeMarker templates, controllers, setup, and library upgrades into trunk. Not used to generate any pages or templates yet (except a couple of hidden pages that are only available through the url).

This commit is contained in:
rjy7 2010-05-11 20:37:48 +00:00
parent 72ee86f0a7
commit a0c93fda6d
44 changed files with 2256 additions and 7 deletions

View file

@ -0,0 +1,12 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt -->
<h2>${title}</h2>
<#if aboutText??>
<div class="pageGroupBody" id="aboutText">${aboutText}</div>
</#if>
<#if acknowledgeText??>
<div class="pageGroupBody" id="acknowledgementText">${acknowledgeText}</div>
</#if>

View file

@ -0,0 +1,14 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#if message??>
<p>${message}</p>
<#else>
<#list classGroups as classGroup>
<h2>${classGroup.publicName}</h2>
<ul>
<#list classGroup.classes as class>
<li><a href="${class.url}">${class.name}</a> (${class.entityCount})</li>
</#list>
</ul>
</#list>
</#if>

View file

@ -0,0 +1,35 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<div class="contents">
<div class="entityList">
<h2>${title}</h2>
<#if subtitle??>
<h4>${subTitle}"</h4>
</#if>
<ul>
<#list entities as entity>
<#-- Iterate through the object's class hierarchy, looking for a custom view -->
<#-- RY This should be done in a view method -->
<#list entity.VClasses as type>
<#if type.customSearchView?has_content>
<#assign altRender = type.customSearchView>
<#-- What order are these returned in? If from specific to general, we should break if we find one -->
</#if>
</#list>
<li>
<#-- RY Create a directive to work like c:url with c:param -->
<#-- RY The JSP version includes URL rewriting in a filter - see URLRewritingHttpServletResponse -->
<a href="${entityUrl}${entity.URI?url}">${entity.name}</a> | <#-- add p:process to name -->
<#if entity.moniker?has_content>
${entity.moniker} <#-- add p:process -->
<#else>
${entity.VClass.name}
</#if>
</li>
</#list>
</ul>
</div>
</div>

View file

@ -0,0 +1,12 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#if copyright??>
<div class="copyright">
&copy;${copyright.year?c}
<#if copyright.url??>
<a href="${copyright.url}">${copyright.text}</a>
<#else>
${copyright.text}
</#if>
</div>
</#if>

View file

@ -0,0 +1,5 @@
<!-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">

View file

@ -0,0 +1,28 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#import "/macros/list.ftl" as l>
<div id="footer">
<#if bannerImageUrl??>
<img class="footerLogo" src="${urls.bannerImage}" alt="${tagline!}" />
</#if>
<div class="footerLinks">
<ul class="otherNav">
<@l.makeList>
<li><a href="${urls.about}" title="more about this web site">About</a></li>,
<#if urls.contact??>
<li><a href="${urls.contact}" title="feedback form">Contact Us</a></li>
</#if>
</@l.makeList>
</ul>
</div>
<#include "copyright.ftl">
All Rights Reserved. <a href="${urls.termsOfUse}">Terms of Use</a>
</div>
<#-- SCRIPT TAGS SHOULD GO HERE -->

View file

@ -0,0 +1,6 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<head>
<#include "title.ftl">
<#include "stylesheets.ftl">
</head>

View file

@ -0,0 +1,33 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#import "/macros/list.ftl" as l>
<div id="identity">
<h1><a title="Home" href="${urls.home}">${siteName}</a></h1>
<#-- RY We will need this in non-NIHVIVO versions
<#if tagline.has_content>
<em>${tagline}</em>
</#if>
-->
<ul id="otherMenu">
<@l.makeList>
<#if loginName??>
<li>
Logged in as <strong>${loginName}</strong> (<a href="${urls.logout}">Log out</a>)
</li>,
<li><a href="${urls.siteAdmin}">Site Admin</a></li>,
<#else>
<li><a title="log in to manage this site" href="${urls.login}">Log in</a></li>,
</#if>
<li><a href="${urls.about}$">About</a></li>,
<li><a href="${urls.aboutFM}">About - FM</a></li>,
<#if urls.contact??>
<li><a href="${urls.contact}">Contact Us</a></li>
</#if>
</@l.makeList>
</ul>
</div>

View file

@ -0,0 +1,13 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<div id="primaryAndOther">
<ul id="primary">
<#list tabMenu.items as item>
<li>
<a href="${item.url}" <#if item.active> class="activeTab" </#if>>
${item.linkText}
</a>
</li>
</#list>
</ul>
</div>

View file

@ -0,0 +1 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->

View file

@ -0,0 +1,19 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<div id="searchBlock">
<form id="searchForm" action="${urls.search}" >
<label for="search">Search </label>
<#if showFlag1SearchField??>
<select id="search-form-modifier" name="flag1" class="form-item" >
<option value="nofiltering" selected="selected">entire database (${loginName})</option>
<option value="${portalId}">${tagline!}</option>
</select>
<#else>
<input type="hidden" name="flag1" value="${portalId}" />
</#if>
<input type="text" name="querytext" id="search" class="search-form-item" value="${querytext!}" size="20" />
<input class="search-form-submit" name="submit" type="submit" value="Search" />
</form>
</div>

View file

@ -0,0 +1,8 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<link rel="stylesheet" type="text/css" href="${stylesheetDir}screen.css" media="screen"/>
<link rel="stylesheet" type="text/css" href="${stylesheetDir}print.css" media="print"/>
<#list stylesheets as stylesheet>
${stylesheet}
</#list>

View file

@ -0,0 +1,3 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<title>${title}</title>

View file

@ -0,0 +1,68 @@
<#--
Output a sequence of <li> elements, adding classes "first" and "last" to first and last list elements, respectively.
It is helpful when the list elements are generated conditionally, to avoid complex tests for the presence/absence
of other list elements in order to assign these classes.
Input should be a series of <li> elements separated by some delimiter. Default delimiter value is ",".
Tolerates a delimiter following the last <li> element.
Usage:
<@makeList>
<li>apples</li>,
<li>bananas</li>,
<li>oranges</li>
<@makeList>
<@makeList delim="??">
<li>apples, oranges</li>??
<li>bananas, lemons</li>??
<li>grapefruit, limes</li>
<@makeList>
RY Consider rewriting in Java. Probably designers won't want to modify this.
-->
<#macro makeList delim=",">
<#assign text>
<#nested>
</#assign>
<#-- Strip out a list-final delimiter, else (unlike most languages) it results in an empty final array item. -->
<#assign text = text?replace("${delim}$", "", "r")>
<#assign items = text?split(delim)>
<#list items as item>
<#-- A FreeMarker loop variable cannot have its value modified, so we use a new variable. -->
<#assign newItem = item?trim>
<#assign classVal = "">
<#-- Keep any class value already assigned -->
<#assign currentClass = newItem?matches("^<li [^>]*(class=[\'\"](.*?)[\'\"])")>
<#list currentClass as m>
<#assign classVal = m?groups[2]>
<#assign newItem = newItem?replace(m?groups[1], "")>
</#list>
<#-- Test indices, rather than comparing content, on the remote chance
that there are two list items with the same content. -->
<#-- <#if item == arr?first> -->
<#if item_index == 0>
<#assign classVal = "${classVal} first">
</#if>
<#-- <#if item == arr?last> -->
<#if !item_has_next>
<#assign classVal = "${classVal} last">
</#if>
<#if classVal != "">
<#assign classVal = classVal?replace("^ ", "", "r")>
<#-- Replace first instance only, in case the item contains nested li tags. -->
<#assign newItem = newItem?replace("<li", "<li class=\"${classVal}\"", "f")>
</#if>
${newItem}
</#list>
</#macro>
<#----------------------------------------------------------------------------->

View file

@ -0,0 +1,32 @@
<#-- $This file is distributed under the terms of the license in /doc/license.txt$ -->
<#include "/components/doctype.html">
<#include "/components/head.ftl">
<body>
<div id="wrap" class="container">
<div id="header">
<#include "/components/identity.ftl">
<div id="navAndSearch" class="block">
<#include "/components/menu.ftl">
<#include "/components/search.ftl">
</div> <!-- navAndSearch -->
</div> <!-- header -->
<hr class="hidden" />
<div id="contentwrap">
<div id="content" <#if contentClass??> class="${contentClass}" </#if>>
${body}
</div> <!-- content -->
</div> <!-- contentwrap -->
<#include "/components/footer.ftl">
</div> <!-- wrap -->
</body>
</html>