Merge with 70c5d6efd68d22258532fdad80e29aea91bb24ae
authorymh <ymh.work@gmail.com>
Tue, 26 Mar 2013 08:27:58 +0100
changeset 126 4479369ff9f1
parent 122 ea11e17e0a35 (current diff)
parent 125 82fcd1c24cd8 (diff)
child 127 906fed13c1e1
Merge with 70c5d6efd68d22258532fdad80e29aea91bb24ae
server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html
server/src/main/webapp/static/js/corenkan.js
--- a/server/src/main/webapp/WEB-INF/i18n/messages_en.properties	Wed Apr 03 16:17:36 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/i18n/messages_en.properties	Tue Mar 26 08:27:58 2013 +0100
@@ -27,4 +27,16 @@
 renkanIndex.space_proj_count = Renkan count
 
 
-renkanIndex.js.empty_name_error = Please enter a title
\ No newline at end of file
+renkanIndex.js.empty_name_error = Please enter a title
+
+renkanAdmin.renkan_admin = Renkan administration
+renkanAdmin.site_admin = Site administration
+
+renkanAdmin.object_list = {0} list
+
+renkanAdmin.object_name = Name
+renkanAdmin.object_edit = Edit
+renkanAdmin.object_delete = Delete
+renkanAdmin.object_edit_link = Edit
+renkanAdmin.object_delete_link = Del.
+
--- a/server/src/main/webapp/WEB-INF/i18n/messages_fr.properties	Wed Apr 03 16:17:36 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/i18n/messages_fr.properties	Tue Mar 26 08:27:58 2013 +0100
@@ -29,3 +29,14 @@
 
 renkanIndex.js.empty_name_error = Veuillez entrer un titre
 
+renkanAdmin.renkan_admin = Administration Renkan
+renkanAdmin.site_admin = Administration site
+
+renkanAdmin.object_list = Liste de {0}
+
+renkanAdmin.object_name = Nom
+renkanAdmin.object_edit = Modif.
+renkanAdmin.object_delete = Eff.
+renkanAdmin.object_edit_link = Modif.
+renkanAdmin.object_delete_link = Eff.
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/main/webapp/WEB-INF/templates/admin/objectsList.html	Tue Mar 26 08:27:58 2013 +0100
@@ -0,0 +1,75 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" >
+<head>
+<meta charset="utf-8">
+<title>${objectName} List</title>
+</head>
+<body>
+  <head>
+    <title>Renkan Admin</title>
+      <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+      <meta charset="utf-8"/>
+      <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
+
+      <link rel="shortcut icon" href="favicon.ico"/>
+
+      <link href="../../../static/css/style.css" rel="stylesheet" th:href="@{/static/css/style.css}"/>
+      <link href="../../../static/css/index.css" rel="stylesheet" th:href="@{/static/css/index.css}"/>
+      
+      <script th:remove="all" type="text/javascript" src="../../../static/lib/jquery.min.js"></script>
+      <script th:remove="all" type="text/javascript" src="../../../static/js/thymol.js"></script> 
+  </head>
+  <body>
+    <div id="container">
+      <div id="wrapper">
+        <h1 th:text="#{renkanAdmin.renkan_admin}">Renkan administration</h1>
+        <div id="inner">
+            <div id="label" class="translate" th:text="#{renkanAdmin.obj_create}">Create an object</div> 
+            <form action="#" onsubmit="go2Title();return false;"> 
+                <input type="text" id="renkantitle" autofocus="autofocus" x-webkit-speech="x-webkit-speech"/> 
+                <button type="submit">OK</button>
+            </form>
+        </div>
+        <h2 th:text="#{renkanAdmin.object_list(${objectName})}" >List of objects</h2>        
+        <div th:include="fragment/paginationFragment :: paginationFragment" class="pagination-container">
+          <div>               
+            <a href="#?p.page=1">&lt;&lt;</a>                    
+            <a href="#?p.page=3">&lt;</a>
+            <span>...</span>
+            <a href="#?p.page=2">2</a>
+            <a href="#?p.page=3">3</a>
+            <span>4</span>
+            <a href="#?p.page=5">5</a>
+            <a href="#?p.page=6">6</a>
+            <span>...</span>
+            <a href="#?p.page=5">&gt;</a>
+            <a href="#?p.page=7">&gt;&gt;</a> 
+          </div>
+        </div>
+        
+        <table>
+          <thead>
+            <tr>
+              <th th:text="#{renkanAdmin.object_name}">Name</th>
+              <th th:text="#{renkanAdmin.object_edit}">Edit</th>
+              <th th:text="#{renkanAdmin.object_delete}">Delete</th>
+            </tr>
+          </thead>
+          <tbody>
+            <tr th:each="object: ${page.content}">
+              <th th:text="${object.title}">title</th>
+              <td><a href="#" th:href="@{'/s/'+${object.id}}" th:text="#{renkanAdmin.object_edit_link}">Edit</a></td>
+              <td><a href="#" th:href="@{'/s/'+${object.id}}" th:text="#{renkanAdmin.object_delete_link}">Delete</a></td>
+            </tr>
+          </tbody>
+        </table>            
+        
+        
+        
+      </div>
+      <div id="footer" th:include="fragment/pageFragment :: footerFragment">
+        <div id="version">© <span class="version-date">2013</span> <a href="http://www.iri.centrepompidou.fr" target="_blanck">IRI</a> - Version <span class="version-version">0.0</span></div>
+      </div>
+    </div>
+  </body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/main/webapp/WEB-INF/templates/adminIndex.html	Tue Mar 26 08:27:58 2013 +0100
@@ -0,0 +1,42 @@
+<!doctype html>
+<html xmlns="http://www.w3.org/1999/xhtml" xmlns:th="http://www.thymeleaf.org" >
+  <head>
+    <title>Renkan Admin</title>
+    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
+    <meta charset="utf-8"/>
+    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
+
+    <link rel="shortcut icon" href="favicon.ico"/>
+
+    <link href="../../static/css/style.css" rel="stylesheet" th:href="@{/static/css/style.css}"/>
+    <link href="../../static/css/index.css" rel="stylesheet" th:href="@{/static/css/index.css}"/>
+    
+    <script th:remove="all" type="text/javascript" src="../../static/lib/jquery.min.js"></script>
+    <script th:remove="all" type="text/javascript" src="../../static/js/thymol.js"></script> 
+  </head>
+  <body>
+    <div id="container">
+      <div id="wrapper">
+        <h1 th:text="#{renkanAdmin.renkan_admin}">Renkan administration</h1>
+        <h2 th:text="#{renkanAdmin.object_list}">Site administration</h2>
+        <table id="object_list">
+              <thead>
+                <tr>
+                    <th th:text="#{renkanAdmin.object}">Object</th>
+                    <th>&nbsp;</th>
+                </tr>
+              </thead>
+              <tbody>
+                <tr>
+                  <th th:text="${space.title}">title</th>
+                  <th th:text="${space.title}">title</th>
+                </tr>
+              </tbody>        
+        </table>
+      </div>
+      <div id="footer" th:include="fragment/pageFragment :: footerFragment">
+        <div id="version">© <span class="version-date">2013</span> <a href="http://www.iri.centrepompidou.fr" target="_blanck">IRI</a> - Version <span class="version-version">0.0</span></div>
+      </div>      
+    </div>
+  </body>
+</html>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/main/webapp/WEB-INF/templates/fragment/spaceForm.html	Tue Mar 26 08:27:58 2013 +0100
@@ -0,0 +1,42 @@
+<!DOCTYPE html>
+<html xmlns="http://www.w3.org/1999/xhtml"
+ xmlns:th="http://www.thymeleaf.org">
+<head>
+<meta charset="utf-8">
+<title>Space form</title>
+</head>
+<body>
+<div id="Fragment" th:fragment="spaceFormFragment" >
+  <form action="#" th:object="${space}" th:action="@{/}" method="post">
+       <fieldset>
+         <input type="hidden" th:field="*{id}" />
+         <div>
+           <label for="title" th:text="#{renkan.form.title}">Title: </label> 
+           <input type="text" th:field="*{title}" /> 
+         </div> 
+         <div>
+           <label for="uri" th:text="#{renkan.form.uri}">Uri: </label> 
+           <input type="text" th:field="*{uri}" /> 
+         </div> 
+         <div>
+           <label for="description" th:text="#{renkan.form.description}">Description: </label> 
+           <textarea th:field="*{description}"></textarea> 
+         </div> 
+         <div>
+           <label for="color" th:text="#{renkan.form.color}">Color: </label> 
+           <input type="text" th:field="*{color}" /> 
+         </div>
+         <div>
+           <label for="binConfig" th:text="#{renkan.form.space.bin_config}">Bin config: </label> 
+           <textarea th:field="*{binConfig}"></textarea> 
+         </div> 
+
+       <div class="submit"> 
+         <button type="submit" name="save" th:text="#{renkan.form.space.submit}">Save</button> 
+       </div> 
+      
+     </fieldset>  
+  </form>
+</div>
+</body>
+</html>
\ No newline at end of file
--- a/server/src/main/webapp/WEB-INF/templates/projectIndex.html	Wed Apr 03 16:17:36 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/templates/projectIndex.html	Tue Mar 26 08:27:58 2013 +0100
@@ -8,6 +8,10 @@
         <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
 
         <link rel="shortcut icon" href="favicon.ico"/>
+        
+        <script th:remove="all" type="text/javascript" src="../../static/lib/jquery.min.js"></script>
+        <script th:remove="all" type="text/javascript" src="../../static/js/thymol.js"></script>         
+        
         <script src="../../lib/jquery.min.js" th:src="@{/static/lib/jquery.min.js}" ></script>
         <script src="../../lib/underscore-min.js" th:src="@{/static/lib/underscore-min.js}" ></script>
         <script src="../../js/main.js" th:src="@{/static/js/main.js}" ></script>
--- a/server/src/main/webapp/WEB-INF/templates/renkanIndex.html	Wed Apr 03 16:17:36 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/templates/renkanIndex.html	Tue Mar 26 08:27:58 2013 +0100
@@ -8,6 +8,10 @@
         <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0"/>
 
         <link rel="shortcut icon" href="favicon.ico"/>
+        
+        <script th:remove="all" type="text/javascript" src="../../static/lib/jquery.min.js"></script>
+        <script th:remove="all" type="text/javascript" src="../../static/js/thymol.js"></script> 
+
         <script src="../../lib/jquery.min.js" th:src="@{/static/lib/jquery.min.js}" ></script>
         <script src="../../lib/underscore-min.js" th:src="@{/static/lib/underscore-min.js}" ></script>
         <script src="../../js/main.js" th:src="@{/static/js/main.js}" ></script>
--- a/server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html	Wed Apr 03 16:17:36 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/templates/renkanProjectEdit.html	Tue Mar 26 08:27:58 2013 +0100
@@ -27,7 +27,7 @@
         <script type="text/javascript" th:inline="javascript">
             var cowebConfig = {
         	    baseUrl: window.location.protocol + '//' + window.location.host,
-        	    adminUrl : dojoConfig.baseUrl+'admin',
+        	    adminUrl : dojoConfig.baseUrl+'ocw_admin',
         	    debug: /*[[${coweb_debug}]]*/false,
         	    useWebSockets: /*[[${coweb_websockets}]]*/false
         	};
@@ -37,6 +37,7 @@
             $(function() {
             	var renkan_config = {
                     static_url : /*[[@{/static/}]]*/ "",
+                    read_only: true,
                     bins: [
                         {
                             type: "Wikipedia",
@@ -91,8 +92,6 @@
 
                 require({corenkanConfig: corenkanConfig}, ["corenkan"], function(corenkan) {            
                     corenkan.app.onStatusChange = function(status) {
-                    	if(status == "ready") {
-                    	}
                     };
                 });
             });
--- a/server/src/main/webapp/WEB-INF/web.xml	Wed Apr 03 16:17:36 2013 +0200
+++ b/server/src/main/webapp/WEB-INF/web.xml	Tue Mar 26 08:27:58 2013 +0100
@@ -63,7 +63,7 @@
   </servlet>
   <servlet-mapping>
     <servlet-name>admin</servlet-name>
-    <url-pattern>/admin/*</url-pattern>
+    <url-pattern>/ocw_admin/*</url-pattern>
   </servlet-mapping>
   <servlet>
     <servlet-name>rest Servlet</servlet-name>
--- a/server/src/main/webapp/static/js/corenkan.js	Wed Apr 03 16:17:36 2013 +0200
+++ b/server/src/main/webapp/static/js/corenkan.js	Tue Mar 26 08:27:58 2013 +0100
@@ -39,6 +39,7 @@
 
 	    	sess.onStatusChange = function(status) {
 	    	    console.log(status);
+	    	    that.onInternalStatusChange(status);
 	    	    if(typeof that.onStatusChange === "function") {
 	    	    	that.onStatusChange(status);
 	    	    }
@@ -117,6 +118,17 @@
     	this.project.set(obj, {validate: true});
     };
     
+    proto.onInternalStatusChange = function(status) {
+    	if(status == "ready") {
+    	    this.renkan.read_only = false;
+    		this.renkan.onStatusChange();
+    	}
+    	else {
+            this.renkan.read_only = true;
+            this.renkan.onStatusChange();                    		
+    	}
+    };
+    
     function prepareValues(obj,c) {
 		values = {};
 		for(var fieldname in c.changes) {
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/server/src/main/webapp/static/js/thymol.js	Tue Mar 26 08:27:58 2013 +0100
@@ -0,0 +1,376 @@
+/*-------------------- Thymol - the flavour of Thymeleaf --------------------*
+
+   Thymol version 0.1.2 Copyright 2012 James J. Benson.
+   jjbenson .AT. users.sf.net
+
+   Licensed under the Apache License, Version 2.0 (the "License");
+   you may not use this file except in compliance with the License.
+   You may obtain a copy of the License at
+
+       http://www.apache.org/licenses/LICENSE-2.0
+
+   Unless required by applicable law or agreed to in writing, software
+   distributed under the License is distributed on an "AS IS" basis,
+   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expressed or implied.
+   See the License for the specific language governing permissions and
+   limitations under the License.
+
+ *---------------------------------------------------------------------------*/
+
+var thURL = "http://www.thymeleaf.org";
+var thPrefix = "th";
+var thProtocol = "file:///";
+var thCache = new Object;
+
+$(function() {
+	thymol();
+});
+
+var thymol = function() {
+	
+	var urlParams = {};
+	(function() {
+		var e, a = /\+/g, r = /([^&=]+)=?([^&]*)/g, d = function(s) {
+			return decodeURIComponent(s.replace(a, " "));
+		}, f = function(s) {
+			return new Param(d(s));
+		}, q = window.location.search.substring(1);
+		while (e = r.exec(q)) {
+			urlParams[d(e[1])] = f(e[2]);
+		}
+	})();
+
+	var debug = getThParam("thDebug",true,false);
+	var root = getThParam("thRoot",false,true);
+	var path = getThParam("thPath",false,true);
+
+	$.ajaxSetup({
+		async : false,
+		isLocal : true
+	});
+
+	(function() {
+		var htmlTag = $("html")[0];
+		$(htmlTag.attributes).each(function() {
+			if (thURL == this.value) {
+				var nsspec = this.localName.split(":");
+				if (nsspec.length > 0) {
+					thPrefix = nsspec[nsspec.length - 1];
+					return;
+				}
+			}
+		});
+	})();
+
+	var thIncl = new ThObj("include");
+	var thSubs = new ThObj("substituteby");
+	var thIf = new ThObj("if");
+	var thUnless = new ThObj("unless");
+	var thSwitch = new ThObj("switch");
+	var thCase = new ThObj("case");
+
+	var thFragEscp = "[" + thPrefix + "\\:fragment='";
+	var base = new ThNode(document, false, null, null, null, document.nodeName, "::", false, document);
+	process(base);
+	return;
+
+	function process(base) {
+		var n = base;
+		while (n.thDoc) {
+			getChildren(n);
+			if (n.firstChild && n.firstChild.thDoc && !n.visited) {
+				n.visited = true;
+				n = n.firstChild;
+			}
+			else {
+				doReplace(n.isNode, n.element, n.thDoc);
+				if (n.nextSibling && n.nextSibling.thDoc) {
+					n = n.nextSibling;
+				}
+				else {
+					if (n == base)
+						break;
+					else {
+						n = n.parentDoc;
+					}
+				}
+			}
+		}
+	}
+
+	function getChildren(base) {
+		var thIfSpecs = $(thIf.escp, base.thDoc);
+		var thUnlessSpecs = $(thUnless.escp, base.thDoc);
+		var thSwitchSpecs = $(thSwitch.escp, base.thDoc);
+		var ths = $(thIfSpecs).add(thUnlessSpecs).add(thSwitchSpecs);
+		ths.each(function() {
+			var element = this;
+			$(element.attributes).each(function() {
+				var thAttr = this;
+				if (thIf.name == thAttr.name || thUnless.name == thAttr.name || thSwitch.name == thAttr.name) {
+					processConditional(element, base, thAttr);
+				}
+			});
+		});
+		var thInclSpecs = $(thIncl.escp, base.thDoc);
+		var thSubsSpecs = $(thSubs.escp, base.thDoc);
+		ths = $(thInclSpecs).add(thSubsSpecs);
+		var count = 0;
+		var last = null;
+		ths.each(function() {
+			var element = this;
+			$(element.attributes).each(function() {
+				var thAttr = this;
+				if (thIncl.name == thAttr.name || thSubs.name == thAttr.name) {
+					var child = processImport(element, base, thAttr);
+					if( child != null ) {
+						if (count == 0) {
+							base.firstChild = child;
+						}
+						else {
+							last.nextSibling = child;
+						}
+						last = child;
+						count++;						
+					}
+				}
+			});
+		});
+	}
+
+	function processConditional(element, base, attr) {
+		var args = attr.value.match(/[$\*#]{(!?.*)}/);
+		var processed = false;
+		if (args.length > 0) {
+			var param = args[1];
+			if (thSwitch.name == attr.name) {
+				processed = processSwitch(element, base, attr, param);
+			}
+			else {
+				var negate = false;
+				if (args[1].charAt(0) == '!') {
+					negate = true;
+					param = args[1].substring(1);
+				}
+				if ((!negate && isTrue(param)) || (negate && !isTrue(param))) {
+					if (thUnless.name == attr.name) { // true for "if" and
+						// false for "unless"
+						element.innerHTML = "";
+					}
+					processed = true;
+				}
+				else {
+					if (thIf.name == attr.name) { // false for "if", true for
+						// "unless"
+						element.innerHTML = "";
+					}
+					processed = true;
+				}
+
+			}
+		}
+		if (!processed && debug) {
+			window.alert("thymol.processConditional cannot process: " + attr.name + "=\"" + attr.value + "\"\n" + element.innerHTML);
+		}
+		element.removeAttribute(attr.name);
+	}
+
+	function processSwitch(element, base, attr, param) {
+		var matched = false;
+		var haveDefault = false;
+		var thCaseSpecs = $(thCase.escp, element);
+		thCaseSpecs.each(function() {
+			var caseClause = this;
+			var remove = true;
+			$(caseClause.attributes).each(function() {
+				var ccAttr = this;
+				if (thCase.name == ccAttr.name) {
+					if (!matched) {
+						var s = urlParams[param];
+						if (ccAttr.value == "*" || (s && (s.getStringValue() == ccAttr.value))) {
+							matched = true;
+							remove = false;
+						}
+					}
+					caseClause.removeAttribute(ccAttr.name);
+				}
+			});
+			if (remove) {
+				caseClause.innerHTML = "";
+			}
+		});
+		return matched;
+	}
+
+	function processImport(element, base, attr) {
+		var importNode = null;
+		var filePart = null;
+		var fragmentPart = "::";
+		if (attr.value.indexOf("::") < 0) {
+			filePart = getFilePart(attr.value); 
+		}
+		else {
+			var names = attr.value.split("::");
+			filePart = getFilePart(names[0].trim());
+			fragmentPart = substitute(names[1].trim());
+		}
+		var isNode = (thSubs.name == attr.localName);
+		if (thCache[filePart] != null && thCache[filePart][fragmentPart] != null) {
+			isNode = ((thSubs.name == attr.localName) || (fragmentPart == "::"));
+			importNode = new ThNode(thCache[filePart][fragmentPart], false, base, null, null, filePart, fragmentPart, isNode, element);
+		}
+		else {
+			var fileName = filePart + ".html";
+			$.get(fileName, function(content, status) {
+				if ("success" == status) {
+					if (thCache[filePart] == null) {
+						thCache[filePart] = new Object;
+					}
+					if (fragmentPart == "::") {
+						var htmlContent = $("html", content)[0];
+						thCache[filePart][fragmentPart] = htmlContent;
+					}
+					else {
+						var fragSpec = thFragEscp + fragmentPart + "']";
+						var fragArray = $(fragSpec, content);
+						$(fragArray).each(function() {
+							thCache[filePart][fragmentPart] = this;
+						});
+					}
+					importNode = new ThNode(thCache[filePart][fragmentPart], false, base, null, null, filePart, fragmentPart, isNode, element);
+				}
+				else if (debug) {
+					window.alert("file read failed: " + filePart + " fragment: " + fragmentPart);
+				}
+	    	}, "xml");
+			if (importNode == null && debug) {
+				window.alert("fragment import failed: " + filePart + " fragment: " + fragmentPart);
+			}
+		}
+		element.removeAttribute(attr.name);		
+		return importNode;
+	}
+	
+	function getFilePart(part) {
+		var result = substitute(part);
+		if( result.charAt(0) != '.' ) {	// Initial period character indicates a relative path
+			if( result.indexOf('/') >= 0 ) {	// If it doesn't start with a '.', and there are no path separators, it's also treated as relative
+				result = thProtocol + root + path + result;													
+			}
+		}
+		return result;
+	}
+
+	function doReplace(isNode, element, content) {
+		if (isNode) {
+			element.parentNode.replaceChild(content.cloneNode(true), element);
+		}
+		else {			
+			try {
+				element.innerHTML = content.innerHTML;
+			}
+			catch (err) { // Work-around for IE
+				while (element.firstChild != null) {
+					element.removeChild(element.firstChild);
+				}
+				for (i = 0; i < content.childNodes.length; i++) {
+					element.appendChild(content.childNodes[i].cloneNode(true));
+				}
+			}			
+		}
+	}
+
+	function ThNode(thDoc, visited, parentDoc, firstChild, nextSibling, fileName, fragName, isNode, element) {
+		this.thDoc = thDoc;
+		this.visited = visited;
+		this.parentDoc = parentDoc;
+		this.firstChild = firstChild;
+		this.nextSibling = nextSibling;
+		this.fileName = fileName;
+		this.fragName = fragName;
+		this.isNode = isNode;
+		this.element = element;
+	}
+
+	function ThObj(suffix) {
+		this.name = thPrefix + ":" + suffix;
+		this.escp = "[" + thPrefix + "\\:" + suffix + "]";
+	}
+
+	function Param(valueArg) {
+		this.value = valueArg;
+		this.getBooleanValue = function() {
+			return !(this.value == "false" || this.value == "off" || this.value == "no");
+		};
+		this.getStringValue = function() {
+			return this.value;
+		};
+		this.getNumericValue = function() {
+			return Number(this.value);
+		};
+	}
+
+	function isTrue(arg) {
+		var p = urlParams[arg];
+		if (p) {
+			return p.getBooleanValue();
+		}
+		return false;
+	}
+	
+	function substitute(argValue) {
+		var result = argValue;
+		var args = argValue.match(/[$\*#]{(!?.*)}/);
+		if (args != null && args.length > 0) {
+			var param = args[1];
+			if(param) {
+				var paramValue = urlParams[param];
+				if (paramValue) {
+					result = paramValue.value;
+				}					
+			}		
+		}			
+		return result;
+	}
+
+	function getThParam(paramName,isBoolean,isPath) {
+		var localValue;
+		if( isBoolean ) {
+			localValue = false;
+		}
+		else {
+			localValue = "";			
+		}
+		var theParam = urlParams[paramName];
+		if (isBoolean && theParam) {
+			localValue = theParam.getBooleanValue();
+		}
+		else {
+			var paramValue;
+			try {			
+				paramValue = eval(paramName);
+				if( !(typeof paramValue === "undefined") ) {
+					if( paramValue != null ) {
+						if ( isBoolean ) {
+							localValue = (paramValue==true);
+						}								
+						else {
+							localValue = paramValue;							
+						}
+					}
+				}
+			}
+			catch (err) {
+				if (err instanceof ReferenceError) {					
+				}
+				if (err instanceof EvalError) {					
+				}
+			}				
+		}
+		if( !isBoolean && isPath && localValue.length > 0 && localValue.charAt(localValue.length-1) != '/' ) {
+			localValue = localValue + '/';
+		}
+		return localValue;
+	}
+
+};
\ No newline at end of file