You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@isis.apache.org by da...@apache.org on 2012/02/17 01:31:10 UTC
svn commit: r1245265 [10/10] - in
/incubator/isis/trunk/framework/quickstart-archetype: ./ src/ src/main/
src/main/appended-resources/ src/main/resources/
src/main/resources/META-INF/ src/main/resources/META-INF/maven/
src/main/resources/archetype-reso...
Propchange: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/jquery/jquery-1.6.4.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/login.shtml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/login.shtml?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/login.shtml (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/login.shtml Fri Feb 17 00:31:04 2012
@@ -0,0 +1,28 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<swf:template file="scimpi/style/site-template.shtml" />
+
+<style>
+div#content {
+ margin-left: 2em;
+}
+</style>
+<h2>Please Log On</h2>
+<swf:logon view="index.shtml"/>
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/app.css
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/app.css?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/app.css (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/app.css Fri Feb 17 00:31:04 2012
@@ -0,0 +1,18 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
Propchange: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/app.css
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/app.js
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/app.js?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/app.js (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/app.js Fri Feb 17 00:31:04 2012
@@ -0,0 +1,24 @@
+var util = namespace('org.apache.isis.viewer.json.jqmobile.util');
+var generic = namespace('org.apache.isis.viewer.json.jqmobile.generic');
+
+$(function() {
+ $("#settings-theme input").click(function(e) {
+
+ var theme = e.currentTarget.value;
+ $("div[data-role='page']").each( function() {
+ $(this).attr("data-theme", e);
+ // TODO: how refresh?
+ });
+ });
+
+ $(document).bind("pagebeforechange", generic.submitRenderAndNavigate);
+
+ // if user manually refreshes page for domain object, then re-retrieve
+ var locationHref = location.href;
+ if(locationHref.indexOf("genericDomainObjectView") != -1) {
+ var urlHref = generic.extract(locationHref);
+ generic.submitAndRender(urlHref, "pop");
+ } else {
+ $.mobile.changePage($("#home"))
+ }
+});
\ No newline at end of file
Propchange: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/app.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/generic.js
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/generic.js?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/generic.js (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/generic.js Fri Feb 17 00:31:04 2012
@@ -0,0 +1,226 @@
+var util = namespace('org.apache.isis.viewer.json.jqmobile.util');
+var generic = namespace('org.apache.isis.viewer.json.jqmobile.generic');
+
+generic.itemLinks = function(jsonItems) {
+ var items = $.map(jsonItems, function(value, i) {
+ return {
+ "hrefUrlEncoded" : util.urlencode(value.href),
+ "title" : value.title,
+ "href" : value.href
+ }
+ })
+ return items
+}
+
+generic.extract = function(urlHref) {
+ // does it match: foobar.html?dataUrl=xxx; if so, then return xxx
+ var matches = /.*?dataUrl=(.*)/.exec(urlHref)
+ var url = matches && matches[1]
+ if(url) {
+ return util.urldecode(url)
+ }
+ // does it simply match foobar.html; if so, then return null
+ if ( /.*\.html$/.test(urlHref)) {
+ return null
+ }
+ // simply return the URL, assuming it is the data url we need to get.
+ return urlHref
+}
+
+generic.returnTypeFor = function(memberItem) {
+ var detailsJson = util.grepAndFollowLink(memberItem.links, "details")
+ if (!detailsJson) {
+ return null;
+ }
+ var describedByJson = util.grepAndFollowLink(detailsJson.links, "describedby")
+ if (!describedByJson) {
+ return null;
+ }
+ var returnTypeLink = util.grepLink(describedByJson.links, "returntype")
+ return returnTypeLink? returnTypeLink.href : null;
+}
+
+generic.dataTypeFor = function(memberItem) {
+ var returnType = generic.returnTypeFor(memberItem);
+ if(returnType.endsWith("boolean")) return "boolean"
+ return "string"
+}
+
+generic.pageAndOptions = function(page, view, dataUrl, transition) {
+ var pageAndOptions = {
+ "page": page,
+ "options": {
+ "dataUrl": "#" + view + "?dataUrl=" + util.urlencode(dataUrl),
+ "allowSamePageTransition": true,
+ "transition": transition
+ }
+ }
+ return pageAndOptions
+}
+
+generic.handleDomainObjectRepresentation = function(urlHref, pageChangeData, json, xhr) {
+
+ var page = $("#genericDomainObjectView");
+ var header = page.children(":jqmData(role=header)");
+ var content = page.children(":jqmData(role=content)");
+
+ header.find("h1").html(json.title);
+
+ // value properties
+ var valueProperties = json.members.filter(function(item) {
+ return item.memberType === "property" && item.value && !item.value.href;
+ });
+
+ valueProperties = $.map( valueProperties, function(value, i) {
+ var dataType = generic.dataTypeFor(value)
+ return {
+ "id": value.id,
+ "value": value.value,
+ "dataTypeIsString": dataType === "string",
+ "dataTypeIsBoolean": dataType === "boolean"
+ }
+ } );
+
+ var valuePropertiesDiv = page.children(":jqmData(role=content)").find(".valueProperties");
+ var valuePropertiesTemplateDiv = page.children(".valueProperties-tmpl");
+ util.applyTemplateDiv(valueProperties, valuePropertiesDiv, valuePropertiesTemplateDiv);
+
+
+ // reference properties
+ var referenceProperties = json.members.filter(function(item) {
+ return item.memberType === "property" && item.value && item.value.href;
+ });
+ var referencePropertiesList = page.children(":jqmData(role=content)").find(".referenceProperties");
+ var referencePropertiesTemplateDiv = page.children(".referenceProperties-tmpl");
+ util.applyTemplateDiv(referenceProperties, referencePropertiesList, referencePropertiesTemplateDiv);
+
+ var collections = json.members.filter(function(item) {
+ return item.memberType === "collection";
+ }).map(function(value, i) {
+ var href = util.grepLink(value.links, "details").href
+ return {
+ "hrefUrlEncoded" : util.urlencode(value.links[0].href),
+ "id" : value.id,
+ "href" : value.links[0].href
+ }
+ });
+
+ // collections
+ var collectionsList = page.children(":jqmData(role=content)").find(".collections");
+ var collectionsTemplateDiv = page.children(".collections-tmpl");
+ util.applyTemplateDiv(collections, collectionsList, collectionsTemplateDiv);
+
+ page.page();
+ content.find( ":jqmData(role=listview)" ).listview("refresh");
+ page.trigger("create");
+
+ return generic.pageAndOptions(page, "genericDomainObjectView", urlHref)
+}
+
+
+generic.handleListRepresentation = function(urlHref, pageChangeData, json, xhr) {
+
+ var page = $("#genericListView");
+ var header = page.children(":jqmData(role=header)");
+ var content = page.children(":jqmData(role=content)");
+
+ var items = generic.itemLinks(json.value)
+
+ header.find("h1").html("Objects");
+
+ var div = page.find("ul");
+ var templateDiv = page.find(".tmpl");
+
+ util.applyTemplateDiv(items, div, templateDiv);
+
+ page.page();
+ content.find( ":jqmData(role=listview)" ).listview("refresh");
+ page.trigger("create");
+
+ return generic.pageAndOptions(page, "genericListView", urlHref)
+}
+
+generic.handleObjectCollectionRepresentation = function(urlHref, pageChangeData, json, xhr) {
+
+ var page = $("#genericObjectCollectionView");
+ var header = page.children(":jqmData(role=header)");
+ var content = page.children(":jqmData(role=content)");
+
+ var items = generic.itemLinks(json.value)
+
+ var parentTitle = util.grepLink(json.links, "up").title
+
+ var collectionId = json.id;
+ header.find("h1").html(collectionId + " for " + parentTitle);
+
+ var div = page.find("ul");
+ var templateDiv = page.find(".tmpl");
+ util.applyTemplateDiv(items, div, templateDiv);
+
+ page.page();
+ content.find( ":jqmData(role=listview)" ).listview("refresh");
+ page.trigger("create");
+
+ return generic.pageAndOptions(page, "genericObjectCollectionView", urlHref, "slideup")
+}
+
+
+generic.actionResultHandlers = {
+ "object": generic.handleDomainObjectRepresentation,
+ "list": generic.handleListRepresentation
+}
+
+generic.handleActionResultRepresentation = function(urlHref, pageChangeData, json, xhr) {
+ var resultType = json.resulttype
+ var handler = generic.actionResultHandlers[resultType];
+ if(!handler) {
+ alert("unable to handle result type")
+ return;
+ }
+ return handler(urlHref, pageChangeData, json.result, xhr)
+}
+
+generic.handlers = {
+ "application/json;profile=\"urn:org.restfulobjects/domainobject\"": generic.handleDomainObjectRepresentation,
+ "application/json; profile=\"urn:org.restfulobjects/domainobject\"": generic.handleDomainObjectRepresentation,
+ "application/json;profile=\"urn:org.restfulobjects/list\"": generic.handleListRepresentation,
+ "application/json; profile=\"urn:org.restfulobjects/list\"": generic.handleListRepresentation,
+ "application/json;profile=\"urn:org.restfulobjects/objectcollection\"": generic.handleObjectCollectionRepresentation,
+ "application/json; profile=\"urn:org.restfulobjects/objectcollection\"": generic.handleObjectCollectionRepresentation,
+ "application/json;profile=\"urn:org.restfulobjects/actionresult\"": generic.handleActionResultRepresentation,
+ "application/json; profile=\"urn:org.restfulobjects/actionresult\"": generic.handleActionResultRepresentation
+}
+
+generic.submitAndRender = function(urlHref, pageChangeData) {
+ $.ajax({
+ url : urlHref,
+ dataType : 'json',
+ success : function(json, str, xhr) {
+ var contentType = xhr.getResponseHeader("Content-Type");
+ var handler = generic.handlers[contentType];
+ if(!handler) {
+ alert("unable to handle response")
+ return;
+ }
+ var pageAndOptions = handler(urlHref, pageChangeData, json, xhr)
+
+ $.mobile.changePage(pageAndOptions.page, pageAndOptions.options);
+ }
+ })
+}
+
+generic.submitRenderAndNavigate = function(e, pageChangeData) {
+ if (typeof pageChangeData.toPage !== "string") {
+ return;
+ }
+
+ var url = $.mobile.path.parseUrl(pageChangeData.toPage)
+ var urlHref = generic.extract(url.href)
+ if(!urlHref) {
+ return;
+ }
+
+ generic.submitAndRender(urlHref, pageChangeData);
+ e.preventDefault();
+}
+
Propchange: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/generic.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/index.html
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/index.html?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/index.html (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/index.html Fri Feb 17 00:31:04 2012
@@ -0,0 +1,205 @@
+#set( $symbol_pound = '#' )
+#set( $symbol_dollar = '$' )
+#set( $symbol_escape = '\' )
+<!DOCTYPE html>
+<html>
+
+<head>
+<meta charset="utf-8">
+<meta name="viewport" content="initial-scale=1, width=device-width, target-densitydpi=device-dpi"/>
+
+<title>Apache Isis Online Demo</title>
+
+<link rel="stylesheet" href="../jquery.mobile/jquery.mobile-1.0.css" />
+
+<script src="../jquery/jquery-1.6.4.js"></script>
+<script src="../jquery.mobile/jquery.mobile-1.0.js"></script>
+<script src="../jquery.tmpl/jquery.tmpl-vBeta1.0.0.js"></script>
+
+<link rel="stylesheet" type="text/css" href="app.css" />
+
+<script type="text/javascript" src="namespace.js"></script>
+<script type="text/javascript" src="util.js"></script>
+<script type="text/javascript" src="generic.js"></script>
+<script type="text/javascript" src="app.js"></script>
+</head>
+
+<body id="pageHolder">
+ <div data-role="page" id="home">
+
+ <div data-role="header">
+ <h1>Home</h1>
+ </div>
+
+ <div data-role="content">
+ <br/>
+ <button>Tasks</button>
+ <ul data-role="listview" class="tasks"></ul>
+ </div>
+
+ <script class="tmpl" type="text/x-jquery-tmpl">
+ <li>
+ <a href="${symbol_dollar}{href}">${symbol_dollar}{title}</a>
+ </li>
+ </script>
+
+ <script type="text/javascript">
+ ${symbol_dollar}("${symbol_pound}home button").click(function(){
+ ${symbol_dollar}.mobile.changePage("../services/toDoItems/actions/notYetDone/invoke", "pop")
+ });
+ </script>
+
+ <div data-role="footer" data-id="global-footer" data-position="fixed">
+ <a href="../index.html" rel="external">home</a> | <a href="../services" rel="external">rest</a> | <a href="../logon.htmlviewer" rel="external">html</a> | <a href="../index.shtml" rel="external">scimpi</a>
+ </div>
+ </div>
+
+ <div data-role="page" id="genericListView">
+
+ <div data-role="header">
+ <a data-icon="back" data-rel="back">Back</a>
+ <h1>List</h1>
+ </div>
+
+ <div data-role="content">
+ <br/>
+ <ul data-filter="true" data-role="listview"></ul>
+ </div>
+
+ <script class="tmpl" type="text/x-jquery-tmpl">
+ <li>
+ <a href="${symbol_dollar}{href}">${symbol_dollar}{title}</a>
+ </li>
+ </script>
+
+ <div data-role="footer" data-id="global-footer" data-position="fixed">
+ <a href="../index.html" rel="external">home</a> | <a href="../services" rel="external">rest</a> | <a href="../logon.htmlviewer" rel="external">html</a> | <a href="../index.shtml" rel="external">scimpi</a>
+ </div>
+ </div>
+
+ <div data-role="page" id="genericObjectCollectionView">
+
+ <div data-role="header">
+ <a data-icon="back" data-rel="back">Back</a>
+ <h1>Collection</h1>
+ </div>
+
+ <div data-role="content">
+ <br/>
+ <ul data-filter="true" data-role="listview"></ul>
+ </div>
+
+ <script class="tmpl" type="text/x-jquery-tmpl">
+ <li>
+ <a href="${symbol_dollar}{href}">${symbol_dollar}{title}</a>
+ </li>
+ </script>
+
+ <div data-role="footer" data-id="global-footer" data-position="fixed">
+ <a href="../index.html" rel="external">home</a> | <a href="../services" rel="external">rest</a> | <a href="../logon.htmlviewer" rel="external">html</a> | <a href="../index.shtml" rel="external">scimpi</a>
+ </div>
+ </div>
+
+ <div data-role="page" id="genericDomainObjectView">
+
+ <div data-role="header">
+ <a data-icon="back" data-rel="back">Back</a>
+ <h1>Object</h1>
+ </div>
+
+ <div data-role="content">
+ <div class="valueProperties"></div>
+ <br/>
+ <p>References</p>
+ <ul data-role="listview" data-inset="true" class="referenceProperties"></ul>
+ <br/>
+ <p>Collections</p>
+ <ul data-role="listview" data-inset="true" class="collections"></ul>
+ </div>
+
+ <script class="valueProperties-tmpl" type="text/x-jquery-tmpl">
+ {{if dataTypeIsString}}
+ <label for="${symbol_dollar}{id}">${symbol_dollar}{id}:</label>
+ <input type="text"
+ name="${symbol_dollar}{id}" id="${symbol_dollar}{id}" value="${symbol_dollar}{value}" placeholder="${symbol_dollar}{id}"
+ class="required"/>
+ {{/if}}
+ {{if dataTypeIsBoolean}}
+ <div data-role="fieldcontain">
+ <fieldset data-role="controlgroup">
+ <legend>${symbol_dollar}{id}?</legend>
+ <input type="checkbox"
+ name="${symbol_dollar}{id}" id="${symbol_dollar}{id}" value="${symbol_dollar}{value}"
+ class="required"/>
+ <label for="${symbol_dollar}{id}">${symbol_dollar}{id}</label>
+ </fieldset>
+ </div>
+ {{/if}}
+ </script>
+
+ <script class="referenceProperties-tmpl" type="text/x-jquery-tmpl">
+ <li>
+ <a data-transition="slide" href="${symbol_dollar}{value.href}">
+ <p>${symbol_dollar}{id}</p>
+ <p><b>${symbol_dollar}{value.title}</b></p>
+ </a>
+ </li>
+ </script>
+
+ <script class="collections-tmpl" type="text/x-jquery-tmpl">
+ <li>
+ <a data-transition="slideup" href="${symbol_dollar}{href}">${symbol_dollar}{id}</a>
+ </li>
+ </script>
+
+ <div data-role="footer" data-id="global-footer" data-position="fixed">
+ <a href="../index.html" rel="external">home</a> | <a href="../services" rel="external">rest</a> | <a href="../logon.htmlviewer" rel="external">html</a> | <a href="../index.shtml" rel="external">scimpi</a>
+ </div>
+ </div>
+
+ <div data-role="page" id="settings" data-add-back-btn="true">
+
+ <div data-role="header">
+ <h1>Settings</h1>
+ </div>
+
+ <div data-role="content">
+
+ <fieldset id="settings-theme">
+ <legend>Theme:</legend>
+ <input type="radio" name="settings-theme" id="settings-theme-a" value="a" checked="checked" />
+ <label for="settings-theme-a">Dark</label>
+
+ <input type="radio" name="settings-theme" id="settings-theme-b" value="b"/>
+ <label for="settings-theme-b">Blue</label>
+
+ <input type="radio" name="settings-theme" id="settings-theme-c" value="c"/>
+ <label for="settings-theme-c">Grey</label>
+
+ <input type="radio" name="settings-theme" id="settings-theme-d" value="d"/>
+ <label for="settings-theme-d">White</label>
+
+ <input type="radio" name="settings-theme" id="settings-theme-e" value="e"/>
+ <label for="settings-theme-e">Yellow</label>
+ </fieldset>
+
+ </div>
+
+ <script type="text/javascript">
+ ${symbol_dollar}("${symbol_pound}settings input").change(function(e){
+ var theme = ${symbol_dollar}(this).attr("value");
+ ${symbol_dollar}("div").filter( function() {
+ var divDataRole = ${symbol_dollar}(this).attr("data-role")
+ var isPage = (divDataRole === "page");
+ return isPage;
+ }).attr("data-theme", theme);
+ });
+ </script>
+
+ <div data-role="footer" data-id="global-footer" data-position="fixed">
+ <a href="../index.html" rel="external">home</a> | <a href="../services" rel="external">rest</a> | <a href="../logon.htmlviewer" rel="external">html</a> | <a href="../index.shtml" rel="external">scimpi</a>
+ </div>
+ </div>
+
+</body>
+</html>
\ No newline at end of file
Propchange: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/index.html
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/namespace.js
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/namespace.js?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/namespace.js (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/namespace.js Fri Feb 17 00:31:04 2012
@@ -0,0 +1,13 @@
+namespace = function(namespaceString) {
+ var parts = namespaceString.split('.'),
+ parent = window,
+ currentPart = '';
+
+ for(var i = 0, length = parts.length; i < length; i++) {
+ currentPart = parts[i];
+ parent[currentPart] = parent[currentPart] || {};
+ parent = parent[currentPart];
+ }
+
+ return parent;
+}
\ No newline at end of file
Propchange: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/namespace.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/util.js
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/util.js?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/util.js (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/util.js Fri Feb 17 00:31:04 2012
@@ -0,0 +1,94 @@
+String.prototype.endsWith = function(pattern) {
+ var d = this.length - pattern.length;
+ return d >= 0 && this.lastIndexOf(pattern) === d;
+};
+
+
+var util = namespace('org.apache.isis.viewer.json.jqmobile.util');
+
+util.findPage = function(selector) {
+ var page = $("#pageHolder").find(selector);
+ if(page[0]) {
+ return page[0];
+ }
+ return null
+}
+
+util.removePage = function(id) {
+ var page = util.findPage(id)
+ if(page) {
+ page.remove();
+ }
+}
+
+util.cloneAndInsertPage = function(sourceId, targetId) {
+ var page = $("#"+sourceId).clone().attr("id", targetId);
+ page.appendTo("#pageHolder");
+ return page
+}
+
+util.grepLink = function(links, relStr) {
+ return $.grep(links, function(v) { return v.rel === relStr } )[0]
+}
+
+util.followLink = function(link) {
+ var response = {};
+ $.ajax({
+ url : link.href,
+ dataType : 'json',
+ async: false,
+ success : function(json, str, xhr) {
+ response = {
+ "json": json,
+ "str": str,
+ "xhr": xhr
+ }
+ }
+ })
+ return response;
+}
+
+util.grepAndFollowLink = function(links, rel) {
+ var link = util.grepLink(links, rel)
+ if (!link) { return null; }
+ var response = util.followLink(link);
+ if (!response) { return null; }
+ return response.json;
+}
+
+util.queryParamsFor = function (href) {
+ var vars = [], hash;
+ var hashes = href.slice(href.indexOf('?') + 1).split('&');
+ for(var i = 0; i < hashes.length; i++)
+ {
+ hash = hashes[i].split('=');
+ vars.push(hash[0]);
+ vars[hash[0]] = urldecode(hash[1]);
+ }
+ return vars;
+}
+
+// from http://phpjs.org/functions/urlencode:573
+util.urlencode = function(str) {
+ str = (str + '').toString();
+ return encodeURIComponent(str).replace(/!/g, '%21').replace(/'/g, '%27').replace(/\(/g, '%28').replace(/\)/g, '%29').replace(/\*/g, '%2A').replace(/%20/g, '+');
+}
+
+// from http://phpjs.org/functions/urldecode:572
+util.urldecode = function(str) {
+ return decodeURIComponent((str + '').replace(/\+/g, '%20'));
+}
+
+util.applyTemplate = function(data, selector, templateSelector) {
+ $(selector).empty();
+ $(templateSelector)
+ .tmpl(data)
+ .appendTo(selector);
+}
+
+util.applyTemplateDiv = function(data, div, templateDiv) {
+ div.empty();
+ templateDiv
+ .tmpl(data)
+ .appendTo(div);
+}
\ No newline at end of file
Propchange: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/mobile/util.js
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/custom/new-todo.shtml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/custom/new-todo.shtml?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/custom/new-todo.shtml (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/custom/new-todo.shtml Fri Feb 17 00:31:04 2012
@@ -0,0 +1,26 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<swf:page-title>New To Do</swf:page-title>
+
+<swf:template file="../style/template.shtml" />
+
+<swf:action-form object="service:toDoItems" method="newToDo" button-title="Save" />
+
+
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/images/scimpi-logo.png
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/images/scimpi-logo.png?rev=1245265&view=auto
==============================================================================
Binary file - no diff available.
Propchange: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/images/scimpi-logo.png
------------------------------------------------------------------------------
svn:mime-type = image/png
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/reset.css
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/reset.css?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/reset.css (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/reset.css Fri Feb 17 00:31:04 2012
@@ -0,0 +1,68 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+html, body, div, span, applet, object, iframe,
+h1, h2, h3, h4, h5, h6, p, blockquote, pre,
+a, abbr, acronym, address, big, cite, code,
+del, dfn, em, font, img, ins, kbd, q, s, samp,
+small, strike, strong, sub, sup, tt, var,
+dl, dt, dd, ol, ul, li,
+fieldset, form, label, legend,
+table, caption, tbody, tfoot, thead, tr, th, td {
+ margin: 0;
+ padding: 0;
+ border: 0;
+ outline: 0;
+ font-weight: inherit;
+ font-style: inherit;
+ font-size: 100%;
+ font-family: inherit;
+ vertical-align: baseline;
+}
+input, textarea {
+ margin: 0;
+ padding: 0;
+ outline: 0;
+}
+:focus {
+ outline: 0;
+}
+body {
+ line-height: 1;
+ color: black;
+ background: white;
+}
+ol, ul {
+ list-style: none;
+}
+table {
+ border-collapse: separate;
+ border-spacing: 0;
+}
+caption, th, td {
+ text-align: left;
+ font-weight: normal;
+}
+blockquote:before, blockquote:after,
+q:before, q:after {
+ content: "";
+}
+blockquote, q {
+ quotes: "" "";
+}
Propchange: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/reset.css
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/screen.css
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/screen.css?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/screen.css (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/screen.css Fri Feb 17 00:31:04 2012
@@ -0,0 +1,338 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements. See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership. The ASF licenses this file
+ * to you 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 express or implied. See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+body {
+ font-family: Arial, Sans-Serif;
+ margin: 0 0 10px 0;
+ color: black;
+ background-color: #0;
+ font-size: 16px;
+}
+em {
+ font-style: italic;
+}
+strong {
+ font-weight: bold;
+}
+h1, h2, h3, div#title, form .title {
+ margin-bottom: 0.8em;
+ font-weight: bold;'
+ letter-spacing: 2px;
+ text-shadow: 0.1em 0.1em 0.1em #bbb;
+}
+h1 {
+ font-size: 200%;
+}
+h2, form .title {
+ margin-top: 1.5em;
+ font-size: 160%;
+}
+ol, ul {
+ margin: 1em 0 2em 0
+}
+li {
+ margin: 0.3em 0;
+}
+/*
+* Overall Layout
+*/
+div#banner {
+ background-color: #dde;
+ width: 100%;
+ height: 76px;
+ border-bottom: 10px solid gray;
+}
+div#content {
+ position: absolute;
+}
+div#side {
+ height: 100%;
+ width: 300px;
+ margin-right: 30px;
+ padding-left: 20px;
+ min-height: 400px;
+ border-bottom: 70px transparent solid; /* should be the same as the #footer height */
+}
+div#main {
+ position: absolute;
+ min-width: 500px;
+ left: 321px; /* should math the width of #side */
+ top: 0;
+ border-bottom: 70px transparent solid; /* should be the same as the #footer height */
+}
+div#footer {
+ position: fixed;
+ width: 100%;
+ height: 70px;
+ bottom: 0;
+ padding-left: 20px;
+ background-color: #eee;
+ border-top: 1px solid gray;
+}
+/*
+* Banner
+*/
+div#logo {
+ position: absolute;
+ right: 30px;
+}
+div#title {
+ padding-top: 20px;
+ padding-left: 20px;
+ font-size: 200%;
+ font-weight: bold;
+ font-style: italic;
+}
+div#title a {
+ color: black;
+ text-decoration: none;
+}
+div.user {
+ position: absolute;
+ top: 4px;
+ right: 18em;
+ font-size: 70%;
+}
+form.login .field {
+ display: inline;
+}
+form.login .field * {
+ display: inline;
+ position: relative;
+ margin: 0;
+}
+form.login .field input {
+ margin-left: 0.6em;
+}
+
+
+
+/*
+* Footer
+*/
+div#debug {
+ padding: 10px 0;
+}
+div#debug > * {
+ font-size: 70%;
+ margin: 5px 0;
+}
+
+/*
+* Side bar
+*/
+div#side ol {
+ padding-left: 0px;
+}
+div#side li {
+ list-style: none;
+ line-height: 1.5em
+}
+xxdiv#side li a {
+ text-decoration: none;
+ color: inherit;
+}
+xxdiv#side li a:HOVER {
+ text-decoration: underline;
+}
+xxdiv#side li a:VISITED {
+ color: inherit;
+}
+
+
+
+a {
+ text-decoration: none;
+ color: inherit;
+}
+a:HOVER {
+ text-decoration: underline;
+}
+a:VISITED {
+ color: inherit;
+}
+
+
+
+/*
+* Forms
+*/
+.form {
+ margin-bottom: 2em;
+}
+.field {
+ position: relative;
+ min-height: 1.5em;
+ margin-bottom: 1em;
+}
+.field > * {
+ display: inline-block;
+ font-size: 100%;
+}
+.field > * {
+ margin-left: 10em;
+}
+.field > .label {
+ margin-left: 0;
+ position: absolute;
+ padding-top: 0.4em;
+ font-style: italic;
+ font-size: 90%;
+}
+.field > .value {
+ white-space: pre-wrap;
+}
+.field > .required {
+ margin-left: 0;
+ vertical-align: top;
+}
+textarea {
+ font-family: Arial, Sans-Serif;
+}
+
+
+.actions {
+ margin-bottom: 2.5em;
+}
+.action {
+ margin-bottom: 1em;
+ min-height: 20px;
+}
+
+xxxform.action a.button,
+xxxform.action,
+form.full input.button {
+ xxxmargin-top: 1em;
+ margin-left: 12.5em;
+}
+form.full input.button + input.button {
+ xxxmargin-top: 1em;
+ margin-left: 0.5em;
+}
+.action .form .label,
+.action.field label {
+ xxxvertical-align: 2px;
+ xxxpadding-top: 12px;
+ font-style: italic;
+}
+a.action > .button {
+ font-size: 90%;
+ border:1px red solid;
+}
+.edit > .button,
+.action > .button,
+.action > .disabled,
+.controls > .button,
+.controls > form > .button {
+ shadow: 1px 1px black;
+ border: 1px solid gray;
+ border-radius: 4px;
+ font-size: 80%;
+ text-decoration: none;
+ cursor: default;
+ padding: 5px 12px;
+ xxxsmin-height: 1em;
+}
+.edit > .button,
+.action > .button,
+.controls > .button,
+.controls > form > .button {
+ background-color: #666;
+ text-shadow: 1px 1px black;
+ color: #ddd
+}
+td input.button,
+td a.button {
+ vertical-align: 2px;
+}
+td form.element-delete {
+ margin-left: 4px;
+}
+.controls > form {
+ display: inline;
+}
+.action > .disabled {
+ background-color: #aaa;
+ xxtext-shadow: 1px 1px white;
+ color: #666;
+}
+xxxform#newToDo .title {
+ font-size: 140%;
+ font-weight: bold;
+ margin-top: 1.5em;
+ margin-bottom: 0.5em;
+}
+xxxform#newToDo label {
+ display: none;
+}
+xxxxform#newToDo input {
+ margin-left: 0;
+}
+p.alternative {
+ margin-top: 80px;
+ font-size: 80%;
+ font-style: italic;
+}
+table {
+ width: 100%;
+}
+thead, tfoot {
+ background-color: #aaa;
+ color: #fff;
+ font-size: 70%;
+}
+tr.even-row {
+ background-color: #eee;
+}
+tr.odd-row {
+ border-bottom: 1px solid #bbb;
+}
+tr.odd-row td {
+ border-bottom: 1px solid #bbb;
+}
+tr:HOVER {
+ background-color: #efe;
+}
+tr:HOVER a {
+ text-decoration: underline;
+}
+td, th {
+ padding: 7px 10px;
+ min-width: 150px;
+ max-width: 300px;
+}
+td.controls {
+ font-size: 80%;
+}
+th {
+ xxxfont-weight: bold;
+}
+span.error,
+.errors {
+ color: red;
+ font-size: 80%;
+}
+span.error {
+ maring-left: 6px;
+}
+
+
+
+input {
+ xxxborder: 1px red solid;
+}
\ No newline at end of file
Propchange: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/screen.css
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/site-template.shtml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/site-template.shtml?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/site-template.shtml (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/site-template.shtml Fri Feb 17 00:31:04 2012
@@ -0,0 +1,54 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
+<head>
+ <title>${title}</title>
+ <link rel="stylesheet" title="Style 1" href="${_context}/scimpi/style/reset.css" type="text/css" media="all" />
+ <link rel="stylesheet" title="Style 1" href="${_context}/scimpi/style/screen.css" type="text/css" media="all" />
+</head>
+
+<body id="demo">
+
+<div id="banner">
+ <div id="logo"><img src="${_context}/scimpi/images/scimpi-logo.png"/></div>
+ <div id="title"><a href="/">To-Do App</a></div>
+ <swf:user login-view="/login.shtml" logout-view="/login.shtml" />
+</div>
+
+<div id="content">
+ <swf:content />
+</div>
+
+<div id="footer">
+ <div style="float:right; margin-right: 40px;">
+ <a href="${_context}/index.html">home</a> | <a href="${_context}/logon.htmlviewer">html</a> | <a href="${_context}/services">rest</a> | <a href="${_context}/mobile/index.html">mobile</a>
+ </div>
+ <div id="debug">
+ <h1>Debug <a href="/debug.app">open</a></h1>
+ <p><strong>Template used:</strong> ${_directory}${_this}</p>
+ <p><strong>Request:</strong> ${_base}</p>
+ </div>
+ <div style="clear:both;"/>
+ <swf:diagnostics/>
+</div>
+
+</body>
+</html>
Added: incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/template.shtml
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/template.shtml?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/template.shtml (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/main/resources/archetype-resources/webapp/src/main/webapp/scimpi/style/template.shtml Fri Feb 17 00:31:04 2012
@@ -0,0 +1,35 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+ Licensed to the Apache Software Foundation (ASF) under one
+ or more contributor license agreements. See the NOTICE file
+ distributed with this work for additional information
+ regarding copyright ownership. The ASF licenses this file
+ to you 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 express or implied. See the License for the
+ specific language governing permissions and limitations
+ under the License.
+-->
+
+<swf:template file="../style/site-template.shtml" />
+
+<div id="side">
+ <h2>My To Dos</h2>
+ <swf:run-action object="service:toDoItems" method="notYetDone" result-name="todos" />
+ <swf:list object="${todos}" link="${_context}/_generic.shtml" />
+
+ <swf:button href="../scimpi/custom/new-todo.shtml">New To Do...</swf:button>
+
+</div>
+
+<div id="main">
+ <swf:feedback />
+ <swf:content />
+</div>
Added: incubator/isis/trunk/framework/quickstart-archetype/src/test/resources/projects/basic/archetype.properties
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/test/resources/projects/basic/archetype.properties?rev=1245265&view=auto
==============================================================================
--- incubator/isis/trunk/framework/quickstart-archetype/src/test/resources/projects/basic/archetype.properties (added)
+++ incubator/isis/trunk/framework/quickstart-archetype/src/test/resources/projects/basic/archetype.properties Fri Feb 17 00:31:04 2012
@@ -0,0 +1,5 @@
+#Thu Feb 16 23:58:59 GMT 2012
+package=it.pkg
+version=0.1-SNAPSHOT
+groupId=archetype.it
+artifactId=basic
Propchange: incubator/isis/trunk/framework/quickstart-archetype/src/test/resources/projects/basic/archetype.properties
------------------------------------------------------------------------------
svn:eol-style = native
Added: incubator/isis/trunk/framework/quickstart-archetype/src/test/resources/projects/basic/goal.txt
URL: http://svn.apache.org/viewvc/incubator/isis/trunk/framework/quickstart-archetype/src/test/resources/projects/basic/goal.txt?rev=1245265&view=auto
==============================================================================
(empty)
Propchange: incubator/isis/trunk/framework/quickstart-archetype/src/test/resources/projects/basic/goal.txt
------------------------------------------------------------------------------
svn:eol-style = native