From dc6043cba8ec3e51a75d7c0f339ad94f39e8f2c3 Mon Sep 17 00:00:00 2001 From: Jani Laakso Date: Mon, 2 Apr 2007 14:25:00 +0000 Subject: [PATCH] Added many new demos. svn changeset:1096/svn branch:trunk --- WebContent/EmbeddedToolkit.jsp | 65 + WebContent/WEB-INF/web.xml | 130 +- WebContent/index.html | 122 +- .../openajax/HubTest-BasicConformance.js | 62 + WebContent/openajax/OpenAjax.js | 1063 +++++++++++++++++ WebContent/openajax/index.html | 212 ++++ WebContent/styles/demos.css | 282 ++--- 7 files changed, 1777 insertions(+), 159 deletions(-) create mode 100644 WebContent/EmbeddedToolkit.jsp create mode 100644 WebContent/openajax/HubTest-BasicConformance.js create mode 100644 WebContent/openajax/OpenAjax.js create mode 100644 WebContent/openajax/index.html diff --git a/WebContent/EmbeddedToolkit.jsp b/WebContent/EmbeddedToolkit.jsp new file mode 100644 index 0000000000..d8fce6280a --- /dev/null +++ b/WebContent/EmbeddedToolkit.jsp @@ -0,0 +1,65 @@ +<% + // + // Demonstrates how Toolkit application can be integrated into jsp pages + // + String test = "This text comes from EmbeddedToolkit.jsp file"; + // Toolkit application name. This is servlet URL pattern, see web.xml + String applicationName = "TableDemo"; +%> + + + + + + + Embedding Toolkit to JSP pages + + + + + + + + + + + + + + + + + + + + + +
+

<%=test %> before Toolkit application.

+
+ + + +
Loading...
+
+ + + + + + +
+

<%=test %> after Toolkit application.

+
+
+
+ + + + \ No newline at end of file diff --git a/WebContent/WEB-INF/web.xml b/WebContent/WEB-INF/web.xml index 30fa1923ee..0ce0ba0bd4 100644 --- a/WebContent/WEB-INF/web.xml +++ b/WebContent/WEB-INF/web.xml @@ -2,37 +2,125 @@ IT Mill Toolkit - - hello + features com.itmill.toolkit.terminal.web.ApplicationServlet application - com.itmill.toolkit.demo.HelloWorld + com.itmill.toolkit.demo.features.FeaturesApplication - hello - /hello/* + features + /features/* - + + Parameters + com.itmill.toolkit.terminal.web.ApplicationServlet + + application + com.itmill.toolkit.example.Parameters + + + + Parameters + /Parameters/* + + + + Login + com.itmill.toolkit.terminal.web.ApplicationServlet + + application + com.itmill.toolkit.demo.Login + + + + Login + /Login/* + + - features + QueryContainerDemo com.itmill.toolkit.terminal.web.ApplicationServlet application - com.itmill.toolkit.demo.features.FeaturesApplication + com.itmill.toolkit.demo.QueryContainerDemo - features - /features/* + QueryContainerDemo + /QueryContainerDemo/* + + + + TableDemo + com.itmill.toolkit.terminal.web.ApplicationServlet + + application + com.itmill.toolkit.demo.TableDemo + + + + TableDemo + /TableDemo/* + + + + TreeFilesystemContainer + com.itmill.toolkit.terminal.web.ApplicationServlet + + application + com.itmill.toolkit.demo.TreeFilesystemContainer + + + + TreeFilesystemContainer + /TreeFilesystemContainer/* + + + + TreeFilesystem + com.itmill.toolkit.terminal.web.ApplicationServlet + + application + com.itmill.toolkit.demo.TreeFilesystem + + + + TreeFilesystem + /TreeFilesystem/* + + + + ModalWindow + com.itmill.toolkit.terminal.web.ApplicationServlet + + application + com.itmill.toolkit.demo.ModalWindow + + + + ModalWindow + /ModalWindow/* + + + + HelloWorld + com.itmill.toolkit.terminal.web.ApplicationServlet + + application + com.itmill.toolkit.demo.HelloWorld + + + + HelloWorld + /HelloWorld/* - - calc + Calc com.itmill.toolkit.terminal.web.ApplicationServlet application @@ -40,9 +128,23 @@ - calc - /calc/* + Calc + /Calc/* + + + + KeyboardShortcut + com.itmill.toolkit.terminal.web.ApplicationServlet + + application + com.itmill.toolkit.demo.Shortcut + + + + KeyboardShortcut + /shortcut/* + index.html diff --git a/WebContent/index.html b/WebContent/index.html index 971990a86a..fe2acbc698 100644 --- a/WebContent/index.html +++ b/WebContent/index.html @@ -10,28 +10,137 @@
- +

Feature Browser

Autodetected mode Use AJAX if supported by browser, otherwise fallback to HTML mode
-
AJAX mode Select AJAX-based technology mode
-
HTML mode Select page based request/response technology mode
- +
+
+ +
+

Simple applications

+
+ HelloWorld + Simple Toolkit application. +
+
+ Calc + Simple Toolkit application where events are used. +
+
+
+ +
+

OpenAjax Hub Conformance tests

+
+ Integrates sample Toolkit application to HTML page which performs basic OpenAjax hub conformance tests. + See HTML source what is required for integration. + Note: Embedded FeatureBrowser application is the same + application instance that can be accessed as standalone application, see FeatureBrowser. +
+
+ +
+

Embedding Toolkit application to other frameworks

+
+ Integrates sample Toolkit application to JSP page. See HTML source or respective jsp + file what is required for integration. Note: Embedded TableDemo application is the same + application instance that can be accessed as standalone application, see TableDemo. +
+
+ +
+

QueryContainerDemo

+
+ This example shows how Table, Select and Tree UI components can use Containers. + QueryContainer is used to bind SQL table rows into Toolkit UI components. + Table has few example actions added. Also embedding XHTML through Label components is used. + Demonstrates: how to create com.itmill.toolkit.data.Container and set it as + datasource to UI components com.itmill.toolkit.ui.Component.Tree, how to + receive ExpandEvent and implement com.itmill.toolkit.ui.Tree.ExpandListener, + how to use com.itmill.toolkit.event.Action. +
+
+ +
+

TableDemo

+
+ Similar to QueryContainerDemo but uses table only. Two buttons demonstrate another + possibility how event framework works, in this example specific methods are + registered for button click events. Note: This application instance is embedded + to jsp page also, see EmbeddedToolkit.jsp above. +
+
+ +
+

TreeFilesystemContainer

+
+ Browsable file explorer using Toolkit Tree component. Demonstrates: how to + use com.itmill.toolkit.ui.Component.Tree datasource container, + how to create com.itmill.toolkit.data.util.FilesystemContainer, + how to read com.itmill.toolkit.ui.Component.Event objects, how + to receive and handle any event by implementing + com.itmill.toolkit.ui.Component.Listener. +
+
+ +
+

TreeFilesystem

+
+ Browsable file explorer using Toolkit Tree component. Demonstrates: how + to add items hierarchially into + com.itmill.toolkit.ui.Component.Tree, how to receive + ExpandEvent and implement + com.itmill.toolkit.ui.Tree.ExpandListener. +
+
+ +
+

Modal window

+
+ Example of Modal Window. +
+
+ +
+

Keyboard events demo

+
+ Contains few Toolkit UI components that can be interacted by pressing keys in keyboard. +
+
+ +
+

URI and Parameter handling demo

+
+ This is a demonstration of how URL parameters can be recieved and handled. + Parameters and URL:s can be received trough the windows by registering + URIHandler and ParameterHandler classes window. +
+ +
+

Upgrading from Millstone 3 to Toolkit 4.0.0

+
+ Login + Simple Millstone 3.1.1 application that was upgraded to Toolkit 4.0.0 by updating three import rows. +
+
+
+
+ + diff --git a/WebContent/openajax/HubTest-BasicConformance.js b/WebContent/openajax/HubTest-BasicConformance.js new file mode 100644 index 0000000000..ca8ce23d50 --- /dev/null +++ b/WebContent/openajax/HubTest-BasicConformance.js @@ -0,0 +1,62 @@ +/******************************************************************************* + * HubTest-BasicConformance.js: + * JavaScript for test case HubTest-BasicConformance.html. + * + * This JavaScript MUST NOT BE CHANGED. + * + * Copyright 2007 OpenAjax Alliance + * + * 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 express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + ******************************************************************************/ + +var checkPrefix = HubTest_BasicConformance_MyPrefix; +var publishSubscribeWorking = false; +var markupScannerWorking = false; +var loadHandlerWorking = false; + +function TestWasSuccessful(idstring) { + var elem = document.getElementById(idstring); + elem.innerHTML = 'TEST SUCCEEDED!!!'; +} + +function subscribeTestCB(prefix, name, subscriberData, publisherData) { + publishSubscribeWorking = true; +} + +/* This function updates the HTML DOM based on whether the various test succeeded. + It is invoked when the document 'load' event is raised. */ +function ConformanceChecks() { + var elem = document.getElementById("LibraryName"); + elem.innerHTML = 'For library: '+checkPrefix+''; + if (OpenAjax.libraries[checkPrefix]) { + TestWasSuccessful("registerLibraryResult"); + } + if (OpenAjax.globals[checkPrefix]) { + TestWasSuccessful("registerGlobalsResult"); + } + if (loadHandlerWorking) { + TestWasSuccessful("addOnLoadResult"); + } + OpenAjax.subscribe("foo","bar",subscribeTestCB); + OpenAjax.publish("foo","bar"); + if (publishSubscribeWorking) { + TestWasSuccessful("PublishSubscribeResult"); + } + if (markupScannerWorking) { + TestWasSuccessful("MarkupScannerResult"); + } +} + +/* This logic verifies that the markup scanner is working */ +function markupScannerCB(element) { + markupScannerWorking = true; +} +OpenAjax.registerAttrScanCB("foo", "class", "match", "HubTestResult", markupScannerCB); + diff --git a/WebContent/openajax/OpenAjax.js b/WebContent/openajax/OpenAjax.js new file mode 100644 index 0000000000..9f50c09a81 --- /dev/null +++ b/WebContent/openajax/OpenAjax.js @@ -0,0 +1,1063 @@ +/******************************************************************************* + * OpenAjax.js / OpenAjaxBootstrap.js: + * + * Component of the OpenAjax Hub, as specified by OpenAjax Alliance. + * Specification is under development at: + * + * http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification + * + * In the current implementation, the OpenAjax.js file is created by simply + * concatenating the individual component JavaScript files in a particular order, with + * where this file must be the first one in the list. + * + * Copyright 2006-2007 OpenAjax Alliance + * + * 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 express or implied. See the License for the + * specific language governing permissions and limitations under the License. + * + ******************************************************************************/ + +/* + * OpenAjax Hub configuration parameters. + * These configuration parameters are meant for use by the application developer, + * not the Ajax runtime library developer. + * + * The following is a quick summary of available parameters. + * Refer to the OpenAjax Hub Specification for the official and detailed definition of these features. + * + * bootstrapFile = string + * Holds name of JavaScript file that initializes OpenAjax object and includes definition of + * OpenAjax.require() function for dynamic module loading. + * idsToScan = array of strings (Default is []) + * Provides to the OpenAjax Hub a list of element IDs upon which to invoke the + * markup scanner. + * scanPage = boolean (Default is true) + * Tells the OpenAjax Hub whether to auto-invoke its markup scanner + * on the BODY element in the document. + */ +if (typeof OpenAjaxConfig == "undefined") { + OpenAjaxConfig = {}; +} + +/* + * Only create an OpenAjax object if it doesn't exist already. + * (If it already exists, then assume the prior instance provides the services that are needed. + * Also, attempts to initialize a second time probably will clobber key data from existing OpenAjax object.) + */ +if (typeof OpenAjax == "undefined") { + + OpenAjax = { + + implementer: "http://openajax.org", + implVersion: "0.3", + specVersion: "0.3", + implExtraData: {}, + _allModules: {"Libraries":1,"LoadUnload":1,"Globals":1,"PublishSubscribe":1,"MarkupScanner":1}, + loadDone: false, + unloadDone: false, + + + // Public function. If module has not been loaded already, load it now. + require: function(modules) { + var head = document.head; + if (!head) { + // Overcome bug in Mozilla when XSLT generates the HTML document. + head = document.getElementsByTagName("head").item(0); + } + if (!head) { + return; + } + var reqmods = modules.split(","); + var allmods = OpenAjax._allModules; + for (var i=0; i= 2) { + nsuri = OpenAjax.libraries[t[0]].namespaceURI; + nodeName = t[1]; + } else { + nsuri = null; + // No namespace prefix, so nodeName already has correct value. + } + } + arrayToAdjust.push({ + "prefix": prefix, + "nsuri": nsuri, + "nodeName": nodeName, + "checkType": checkType, + "checkString": checkString, + "func": refOrName + }); + } + + /* Remove callback functions from the appropriate private array. */ + OpenAjax._unregScanCB = function ( + functionName, // Public function name for error messages + arrayToAdjust, // The array from which registrations will be removed. + prefix){ // The prefix that corresponds to this library. + for (var i=arrayToAdjust.length-1; i >=0 ; i--) { + if (arrayToAdjust[i].prefix == prefix) { + // Use 'slice' instead of 'splice' due to bug in IE7. + var tail = arrayToAdjust.slice(i+1); + var len = arrayToAdjust.length; + for (var p=i; p + + + + + + + + + OpenAjax Hub Basic Conformance Test: IT Mill Toolkit 4 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
X
+ + + +
+

+ + OpenAjax Alliance banner + +

+

OpenAjax Hub Basic Conformance Test

+

For library: (unknown)

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + +
1OpenAjax Conformance Requirement (Libraries): Library RegistrationTEST NOT SUCCESSFUL
2OpenAjax Conformance Requirement (Libraries): Globals RegistrationTEST NOT SUCCESSFUL
3OpenAjax Conformance Requirement (Libraries): Load/Unload Handlers Registered Indirectly Through the HubTEST NOT APPLICABLE
4OpenAjax Hub Publish/Subscribe TestTEST NOT SUCCESSFUL
5OpenAjax Hub Markup Scanner TestTEST NOT SUCCESSFUL
+

Notes:

+
    +
  • A library completely passes this test if all boxes say TEST SUCCEEDED.
  • +
  • Some toolkits do not initialize themselves during 'load' event processing. + Because of these situations, it is OK if the load/unload test case says TEST NOT APPLICABLE.
  • +
+
+ + +
+ + + +
Loading...
+
+ + + + \ No newline at end of file diff --git a/WebContent/styles/demos.css b/WebContent/styles/demos.css index fc4f082d2f..c0501a5aec 100644 --- a/WebContent/styles/demos.css +++ b/WebContent/styles/demos.css @@ -1,140 +1,144 @@ -/* Basic styles */ - -body { - background-color: #c7e4ff; - font-family: Georgia, Arial, Tahoma, Verdana, sans-serif; - margin: 0; - padding: 0; - letter-spacing: 0.01em; - color: #4c4c4c; - font-size: 62.5%; -} - -h1,h2,h3,h4,h5,h6 { - font-family: Arial, Tahoma, Verdana, sans-serif; - color: #ee4411; - font-weight: normal; -} -h1 { - font-size: 3em; -} -h2 { - font-size: 2.4em; -} -h3 { - font-size: 2em; -} -h4 { - font-size: 1.8em; - color: #3798f3; - margin-bottom: 0.4em; -} -h5 { - font-size: 1.5em; -} -h6 { - font-size: 1.2em; - font-weight: bold; -} - -a:link { - color: #ee4411; - text-decoration: none; - border-bottom: dotted 1px #539dc9; -} -a:visited { - color: #5d7178; - text-decoration: none; - border-bottom: dotted 1px #539dc9; -} -a:active { - color: #3a9bff; - text-decoration: none; -} -a:hover { - color: #3b62b1; - background-color: #e7f3fa; - border-bottom: solid 1px #ee4411; - text-decoration: none; -} - -ul { - list-style-type: square; -} - -/* Layout */ - -#container { - margin: 30px 30px; - text-align: left; - padding: 35px 30px 30px 30px; - overflow: hidden; - margin-right: 30px; - background-color: #fff; -} - -#itmilllogo { - background-image: url(itmill-logo-small.gif); - width: 195px; - height: 32px; - overflow: hidden; - text-indent: -90000px; - float: left; -} - -#toolkit { - float: left; - width: 100px; - height: 25px; - background: transparent url(frontpage_logo.png) no-repeat; - margin: 3px 0 30px 10px; -} - -pre { - background-color: #f7f7f7; - border: solid 2px #e6e6e6; - font-family: monospace; - font-size: 1.1em; - padding: 0.5em 1em; -} - -hr { - height: 1px; - overflow: hidden; - color: #b2d2e5; - background-color: #b2d2e5; - border: none; -} - -#feature-browser, -#sample-code { - clear: both; - padding: 10px 10px 20px 50px; - background-color: #f7f7f7; - border: solid 2px #e6e6e6; - font-size: 1.2em; - line-height: 1.6em; - margin: 30px 0; -} - -#feature-browser { - background: #f7f7f7 url(feature_browser_bg.gif) no-repeat top right; -} - -#sample-code { - background: #f7f7f7 url(sample_code_bg.gif) no-repeat top right; -} - -.option { - clear: both; - height: 2em; - overflow: hidden; -} - -.option .link { - float: left; - width: 15em; -} -.option .desc { - float: left; +/* Basic styles */ + +body { + background-color: #c7e4ff; + font-family: Georgia, Arial, Tahoma, Verdana, sans-serif; + margin: 0; + padding: 0; + letter-spacing: 0.01em; + color: #4c4c4c; + font-size: 62.5%; +} + +h1,h2,h3,h4,h5,h6 { + font-family: Arial, Tahoma, Verdana, sans-serif; + color: #ee4411; + font-weight: normal; +} +h3 a { + color: #ee4411; +} +h3 a:visited { + color: #ee4411; +} +h1 { + font-size: 3em; +} +h2 { + font-size: 2.4em; +} +h3 { + font-size: 2em; +} +h4 { + font-size: 1.8em; + color: #3798f3; + margin-bottom: 0.4em; +} +h5 { + font-size: 1.5em; +} +h6 { + font-size: 1.2em; + font-weight: bold; +} + +a:link { + color: #ee4411; + text-decoration: none; + border-bottom: dotted 1px #539dc9; +} +a:visited { + color: #5d7178; + text-decoration: none; + border-bottom: dotted 1px #539dc9; +} +a:active { + color: #3a9bff; + text-decoration: none; +} +a:hover { + color: #3b62b1; + background-color: #e7f3fa; + border-bottom: solid 1px #ee4411; + text-decoration: none; +} + +ul { + list-style-type: square; +} + +/* Layout */ + +#container { + margin: 30px 30px; + text-align: left; + padding: 35px 30px 30px 30px; + overflow: hidden; + margin-right: 30px; + background-color: #fff; +} + +#itmilllogo { + background-image: url(itmill-logo-small.gif); + width: 195px; + height: 32px; + overflow: hidden; + text-indent: -90000px; + float: left; +} + +#toolkit { + float: left; + width: 100px; + height: 25px; + background: transparent url(frontpage_logo.png) no-repeat; + margin: 3px 0 30px 10px; +} + +pre { + background-color: #f7f7f7; + border: solid 2px #e6e6e6; + font-family: monospace; + font-size: 1.1em; + padding: 0.5em 1em; +} + +hr { + height: 1px; + overflow: hidden; + color: #b2d2e5; + background-color: #b2d2e5; + border: none; +} + +#feature-browser, +#sample-code { + clear: both; + padding: 10px 10px 20px 50px; + background-color: #f7f7f7; + border: solid 2px #e6e6e6; + font-size: 1.2em; + line-height: 1.6em; + margin: 30px 0; +} + +#feature-browser { + background: #f7f7f7 url(feature_browser_bg.gif) no-repeat top right; +} + +#sample-code { + background: #f7f7f7 url(sample_code_bg.gif) no-repeat top right; +} + +.option { + clear: both; +} + +.option .link { + float: left; + width: 15em; +} +.option .desc { + float: left; } \ No newline at end of file -- 2.39.5