chg: replaced ant with gradle

This commit is contained in:
Tobi Schäfer 2020-03-16 16:53:52 +01:00
parent cee0be52e0
commit 5cbeb9f01d
609 changed files with 87626 additions and 638 deletions

View file

@ -0,0 +1,11 @@
function onStart(name) {
if (!root.get('first')) {
root.name = 'root';
var firstNode = new HopObject();
firstNode.name = 'first';
root.add(firstNode)
var secondNode = new HopObject();
secondNode.name = 'second';
firstNode.add(secondNode)
}
}

View file

@ -0,0 +1,8 @@
function getChildElement(name) {
if (this.get(name))
return this.get(name);
var page = new Guide();
page.name = name;
page.parent = this;
return page;
}

View file

@ -0,0 +1,40 @@
<h1>actions</h1>
<p>Every request a Helma application receives is handled by an "action"
associated with the requested URL. For example, a request to
<a href="http://<% request.http_host %>/example">
http://<% request.http_host %>/example</a> will be handled by the
"example" action, defined at ./apps/welcome/code/Root/example.hac</p>
<pre>
res.write('Hello, this is the action defined \
at ./apps/welcome/code/Root/example.hac');
</pre>
<p>The file example.hac contains the Javascript code that Helma will
evaluate when handling that request. In this example, the code inside
the example.hac file automatically becomes a prototype method with an
"_action" suffix. By leveraging such conventions, Helma allows you to
structure your code in clean and uncluttered ways. Alternatively, you
can also define actions in generic Javascript files, an examples of
which can be found in ./apps/welcome/code/Root/example.js and tested via
the URL <a href="http://<% request.http_host %>/anotherexample">
http://<% request.http_host %>/anotherexample</a></p>
<pre>
function anotherexample_action() {
res.write('Hello again, this is the action \
defined in ./apps/welcome/Root/example.js');
}
</pre>
<p>Requests that do not specify a particular action are handled by the
"main" action. For example, a request to
<a href="http://<% request.http_host %>/">http://<% request.http_host %>/</a>
will be handled by the "main" action, defined at
./apps/welcome/code/Guide/main.hac</p>
<p>More information about the way Helma handles requests and maps them to
actions, and how Helma maps directories and filename extensions to
objects in the Javascript environment:
<br /><a href="http://dev.helma.org/docs/Request-Response-Cycle/">/docs/Request-Response-Cycle/</a></p>

View file

@ -0,0 +1,48 @@
<h1>applications</h1>
<p>Helma can serve multiple independent applications, each accessible
through a different mountpoint, using Javascript environments
running in their own global scope, and configurable to use separate
code repositories.</p>
<p>A Helma default installation, for example, is serving the applications
"manage" and "welcome" and makes them accessible through the
<a href="http://<% request.http_host %>/manage/">
http://<% request.http_host %>/manage/</a> and
<a href="http://<% request.http_host %>/">http://<% request.http_host %>/</a>
URLs respectively. The list of active applications is defined by the file
./apps.properties in Helma's home directory.</p>
<pre>
# Administrative application to manage all
# other apps on this server, accessible via its
# default mountpoint at http://host:port/manage
# and using its default repository at apps/manage
manage
# More complex example of an application with
# custom configuration:
welcome
welcome.mountpoint = /
welcome.repository.0 = apps/welcome/code/
welcome.repository.1 = modules/helmaTools.zip
welcome.static = apps/welcome/static
welcome.staticMountpoint = /static
welcome.staticHome = index.html,default.html
welcome.staticIndex = true
welcome.uploadLimit = 2048
</pre>
<p>Further application specific configurations can be defined in an app.properties
file inside an application's code repository. Examples of such a file you will
find in the "manage" app's default repository directory at
./apps/manage/app.properties and in the "welcome" application's repository at
./apps/welcome/code/app.properties.</p>
<p>More information about these files:
<br /><a href="http://dev.helma.org/docs/Properties+Files/apps.properties/">/docs/Properties+Files/apps.properties/</a>
<br /><a href="http://dev.helma.org/docs/Properties+Files/app.properties/">/docs/Properties+Files/app.properties/</a>
</p>

View file

@ -0,0 +1,56 @@
<h1>database mapping</h1>
<p>Helma allows you to map your HopObjects to relational database tables
instead of persisting them in the application's embedded XML database.</p>
<p>The list of available database connections is defined inside the file
./db.properties in Helma's home directory or for application specific
configurations in a db.properties file inside an application's code
repository.</p>
<pre>
myDataSource.url = jdbc:mysql://db.domain.com/space
myDataSource.driver = org.gjt.mm.mysql.Driver
myDataSource.user = username
myDataSource.password = xyz
</pre>
<p>In order to add the specified JDBC driver to the classpath, place it in
the ./lib/ext/ directory. Depending on the database system you are using,
you may want to <a href="http://developers.sun.com/product/jdbc/drivers">
download an appropriate JDBC driver</a>, for example a
<a href="http://www.mysql.com/downloads/api-jdbc-stable.html">driver for
MySQL</a>.</p>
<p>Using the <a href="sqlshell">SQLshell</a> from within your application,
you may at any time explore your database and issue SQL statements.
The SQLshell also allows you to map your database tables to properties
of your application's prototypes as desired. A simple configuration for
your object/relational mappings might look as follows:</p>
<pre>
_db = myDataSource
_table = PERSON
_id = ID
firstname = FIRSTNAME
lastname = LASTNAME
email = EMAIL
createtime = CREATETIME
modifytime = MODIFYTIME
</pre>
<p>These configurations would be placed in a type.properties file
inside the corresponding prototype directory, for example in
./apps/addressbook/Person/type.properties, when following the
"addressbook" tutorial.</p>
<p>To learn how Helma's relational database mapping is put to work and
how it relates and integrates with the other central aspects of the
framework, <a href="http://dev.helma.org/docs/Object-Relational+Mapping+Tutorial/">follow the
tutorial and build the full "addressbook" application</a>.</p>
<p>More information about the object/relational mapping of HopObject properties:
<br /><a href="http://dev.helma.org/docs/Properties+Files/db.properties/">/docs/Properties+Files/db.properties/</a>
<br /><a href="http://dev.helma.org/docs/Object-Relational+Mapping/">/docs/Object-Relational+Mapping/</a>
</p>

View file

@ -0,0 +1,37 @@
<h1>hopobjects</h1>
<p>HopObjects extend the standard Javascript object with Helma-specific
properties and functions. They are the central building blocks that allow
you to leverage the application framework Helma provides.</p>
<p>The main HopObject of every application is the "root" object. Every
HopObject can have a collection of attached additional HopObjects.
Each requested URL is resolved to a particular HopObject according
to these collections.</p>
<p>In the "welcome" application for example, a request to
<a href="http://<% request.http_host %>/first/second/">
http://<% request.http_host %>/first/second/</a> will be resolved by
checking the "root" object's collection for a HopObject named "first"
and the "first" object's collection for a HopObject named "second".</p>
<p>While this path resolution is by default performed based on the ID of
the attached HopObjects, collections can be custom configured to use
another property as access name. In this example, the HopObject prototype
is configured at ./apps/welcome/code/HopObject/type.properties to use the
"name" property for this purpose.</p>
<pre>
_children = collection(HopObject)
_children.accessname = name
name
</pre>
<p>When a new HopObject is added to such a collection, it is automatically
stored in Helma's embedded XML database. To see a detailed example of
how this works, go to <a href="http://<% request.http_host %>/first/">
http://<% request.http_host %>/first/</a> and add additional HopObjects.</p>
<p>Documentation of HopObject functions and built-in properties:
<br /><a href="http://helma.server-side-javascript.org/reference/HopObject.html">/reference/HopObject.html</a>
</p>

View file

@ -0,0 +1,33 @@
<h1>java packages</h1>
<p>Helma puts the whole wealth of Java libraries at your fingertips.
The "Packages" object in Helma's Javascript environment serves as
the doorway to leverage any Java packages in the CLASSPATH. You can
<a href="http://www.docjar.com/">add any Java packages</a> to the
CLASSPATH simply by putting the jar files in the ./lib/ext/ directory.</p>
<p>Any public methods that these Java classes define become callable from
your application's Javascript environment and you can create and work
with Java objects just like you do with Javascript objects. For example,
you could create a Java StringBuffer object and then append data to it
as follows:</p>
<pre>
var buffer = new Packages.java.lang.StringBuffer();
buffer.append('hello');
</pre>
<p>If your application makes extensive use of a Java class, it might be a
good idea to wrap that class in a Javascript prototype. That way, the
objects your applications works with become true Javascript objects, you
can control exactly which class methods are exposed to your application
and you can abstract the implementation, allowing you to change the Java
classes you use without requiring modifications to your application.</p>
<p>Various examples of such wrappers around Java classes can be found in the
helmaLib, which makes Mail, File, Ftp, Image, Search, SSH and Zip
functionality available in this way.</p>
<p>More information on how Helma makes Java scriptable:
<br /><a href="http://www.mozilla.org/rhino/ScriptingJava.html">/rhino/ScriptingJava</a>
</p>

View file

@ -0,0 +1,52 @@
<h1>macros</h1>
<p>Macros are methods of application logic that can be called through
custom macro tags contained in skins. Macros allow skins to pull
data from application logic, while other macro tags only push
pre-determined data to the skins.</p>
<p>You will find an example for such a skin in the "welcome" application
at ./apps/welcome/code/Root/example_using_macro.skin</p>
<pre>
&lt;p>This is an example of a skin calling a macro.&lt;/p>
&lt;p>You will find this skin at
./apps/welcome/code/Root/example_using_macro.skin&lt;/p>
&lt;p>This skin is rendered by the action defined at
./apps/welcome/code/Root/example_using_macro.hac&lt;/p>
&lt;p>The macro this skin calls is defined in
./apps/welcome/code/Root/example.js&lt;/p>
&lt;p>You can test it via the URL
&lt;a href="&lt;% this.pullLink part="url" %>">
&lt;% this.pullLink part="text" %>
&lt;/a>
&lt;/p>
</pre>
<p>In this example, the skin calls a "pullLink" macro twice, using a different
"part" parameter. Macro methods are defined using a corresponding function
name with a "_macro" suffix. The pullLink macro used in this example, you
will find defined in ./apps/welcome/code/Root/example.js</p>
<pre>
function pullLink_macro(params) {
switch (params.part) {
case 'text' :
return '/example_using_macro';
case 'url' :
return this.href('example_using_macro');;
}
}
</pre>
<p>You can test this macro and see the skin rendered via the URL
<a href="http://<% request.http_host %>/example_using_macro">
http://<% request.http_host %>/example_using_macro</a></p>
<p>Note that macros can again make use of skins, which may again contain
macro calls. This combination of skins and macros allows actions to
delegate the response generation through multiple tiers of "control"
and "presentation".</p>
<p>More information about macro tags and ways in which you can use custom defined macros:
<br /><a href="http://dev.helma.org/docs/Request-Response-Cycle/">/docs/Request-Response-Cycle/</a></p>

View file

@ -0,0 +1,41 @@
<h1>prototypes</h1>
<p>Helma's coding conventions revolve around the prototype based object
inheritance of Javascript. While Helma does not force you to leverage
these coding conventions, doing so will increase productivity and you
will achieve better maintainability due to a clean and well organized
code structure.</p>
<p>The HopObject prototype is the core prototype of every Helma application.
By default, other prototypes that you create will inherit from the
HopObject prototype. Every directory that you create inside your
application's code repository becomes automatically a prototype by that
name and will inherit the methods, actions, macros and skins that the
HopObject prototype provides.</p>
<p>In the "welcome" application's code repository at ./apps/welcome/code/
for example, you will find directories for the HopObject, Root and Guide
prototypes. Both the Root and Guide prototypes inherit automatically any
code from the HopObject prototype. Additionally, the Root prototype also
inherits from the Guide prototype, due to the "_extends" property that is
configured in ./apps/welcome/code/Root/type.properties</p>
<pre>
_extends = Guide
</pre>
<p>"Root" is the prototype of the application's root object. The root object
of the "welcome" application therefore uses the combined code from these
three prototypes, with code in "Root" overriding code from "Guide", which
in turn overrides code from "HopObject".</p>
<p>When Helma receives a request to <a href="http://<% request.http_host %>/">
http://<% request.http_host %>/</a> it will look for a "main" action to
handle the request. Since it will not find one in "Root", it will use the
one defined at ./apps/welcome/code/Guide/main.hac. Requests pointing to a
generic HopObject such as <a href="http://<% request.http_host %>/first/">
http://<% request.http_host %>/first/</a> on the other hand, will use the
main action defined at ./apps/welcome/code/HopObject/main.hac.</p>
<p>More information on how Helma puts prototypes to work:
<br /><a href="http://dev.helma.org/docs/Request-Response-Cycle/">/docs/Request-Response-Cycle/</a></p>

View file

@ -0,0 +1,14 @@
<div class="lead">
<p>Explore the introductions below and discover what you <br />
can do with Helma and Javascript on the server-side.</p>
</div>
<script> openbox('pageintro') </script>
<h3>introductions</h3>
<% response.listintro %>
<script> closebox() </script>
<script> openbox('content') </script>
<% response.content %>
<script> closebox() </script>

View file

@ -0,0 +1,44 @@
<h1>skins</h1>
<p>Helma allows you to cleanly separate presentation from application logic
through the use of skins. The skins are segments of HTML markup that can
contain macro tags, which are replaced with dynamic content when the
skin is rendered.</p>
<p>You will find an example for such a skin in the "welcome" application at
./apps/welcome/code/Root/example.skin</p>
<pre>
&lt;p>This is an example of a simple skin.&lt;/p>
&lt;p>You will find this skin at
./apps/welcome/code/Root/example.skin&lt;/p>
&lt;p>This skin is rendered by the action defined at
./apps/welcome/code/Root/example_using_skin.hac&lt;/p>
&lt;p>You can test it via the URL
&lt;a href="&lt;% response.pushLink %>">
&lt;% response.pushLinkText %>
&lt;/a>
&lt;/p>
</pre>
<p>The rendering of skins is controlled by an application's actions. In the
case of the "welcome" application, you will find an example of such an
action at ./apps/welcome/code/Root/example_using_skin.hac</p>
<pre>
res.data.pushLink = this.href('example_using_skin');
res.data.pushLinkText = '/example_using_skin';
this.renderSkin('example');
</pre>
<p>You can test this action and see the skin rendered via the URL
<a href="http://<% request.http_host %>/example_using_skin">
http://<% request.http_host %>/example_using_skin</a>
<p>Skins can contain various kinds of "macro tags" such as &lt;% response.pushLink %>
used in this example skin, where the value of a dynamic URL is determined by the
action and made available to the skin by setting the req.data.pushLink property.</p>
<p>More information about the way in which Helma defines and renders skins, and the
various kinds of available Macro Tags:
<br /><a href="http://dev.helma.org/docs/Request-Response-Cycle/">/docs/Request-Response-Cycle/</a></p>

View file

@ -0,0 +1,31 @@
<h1>static files</h1>
<p>The default mountpoint of a Helma application is always a code repository,
which means that requests will be handled by the application's Javascript
environment and will not reference specific server pages. Static files on
the other hand are served from separate "static" mountpoints.</p>
<p>In Helma's default installation, the "welcome" application is serving
static files from its "static" directory at ./apps/welcome/static/
and makes them accessible through URLs starting with
<a href="http://<% request.http_host %>/static/">
http://<% request.http_host %>/static/</a></p>
<p>For example, you should be able to access the file named "test.txt" inside
the ./apps/welcome/static/ directory via the URL
<a href="http://<% request.http_host %>/static/test.txt">
http://<% request.http_host %>/static/test.txt</a></p>
<p>Inside the ./apps.properties file, you will find the following settings,
which control the related behavior:</p>
<pre>
welcome.static = apps/welcome/static
welcome.staticMountpoint = /static
welcome.staticHome = index.html,default.html
welcome.staticIndex = true
</pre>
<p>More information about these and additional settings related to serving static files:
<br /><a href="http://dev.helma.org/docs/Properties+Files/apps.properties/">/docs/Properties+Files/apps.properties/</a>
</p>

View file

@ -0,0 +1,11 @@
<ul>
<li><a href="<% response.root %>intro/applications">applications</a></li>
<li><a href="<% response.root %>intro/staticfiles">static files</a></li>
<li><a href="<% response.root %>intro/actions">actions</a></li>
<li><a href="<% response.root %>intro/skins">skins</a></li>
<li><a href="<% response.root %>intro/macros">macros</a></li>
<li><a href="<% response.root %>intro/hopobjects">hopobjects</a></li>
<li><a href="<% response.root %>intro/prototypes">prototypes</a></li>
<li><a href="<% response.root %>intro/dbmapping">database mappings</a></li>
<li><a href="<% response.root %>intro/javapackages">java packages</a></li>
</ul>

View file

@ -0,0 +1,7 @@
<ul>
<li><a href="<% response.root %>tools/about_manage">manage</a></li>
<li><a href="<% response.root %>tools/about_shell">shell</a></li>
<li><a href="<% response.root %>tools/about_inspector">inspector</a></li>
<li><a href="<% response.root %>tools/about_sqlshell">sqlshell</a></li>
<li><a href="<% response.root %>tools/debugger">debugger</a></li>
</ul>

View file

@ -0,0 +1,14 @@
<ul>
<li><a href="http://dev.helma.org/">home</a></li>
<li><a href="http://dev.helma.org/mailing+lists/">mailing lists</a></li>
<li><a href="http://helma.server-side-javascript.org/hopbot/">irc channel</a></li>
<li><a href="http://dev.helma.org/docs/Documentation/">documentation</a></li>
<li><a href="http://helma.server-side-javascript.org/reference/">reference</a></li>
<li><a href="http://dev.helma.org/development/">project</a></li>
<li><a href="http://dev.helma.org/wiki/Helma+Roadmap/">roadmap</a></li>
<li><a href="http://dev.helma.org/bug+reporting/">bug reporting</a></li>
<li><a href="http://dev.helma.org/docs/Using+the+Source+Code+Repositories/">source</a></li>
<li><a href="http://dev.helma.org/wiki/">wiki</a></li>
<li><a href="http://dev.helma.org/wiki/Related+Projects/">related projects</a></li>
<li><a href="http://dev.helma.org/wiki/Sites+using+Helma/">sites using helma</a></li>
</ul>

View file

@ -0,0 +1,18 @@
// Prepare some response values used by the skins
res.data.href = this.href();
res.data.root = root.href();
// Render three nested skins
res.data.listtools = this.renderSkinAsString('list.tools');
res.data.listintro = this.renderSkinAsString('list.intro');
res.data.listwebsite = this.renderSkinAsString('list.website');
if (this.parent && this.parent.name) {
res.data.title = 'Welcome to Helma - '+ this.parent.name +' - '+ this.name;
res.data.content = this.renderSkinAsString( this.parent.name +'.'+ this.name );
res.data.body = this.renderSkinAsString( this.parent.name );
}
if (!res.data.body) {
res.data.title = 'Welcome to Helma - Overview';
res.data.body = this.renderSkinAsString('overview');
}
this.renderSkin('page');

View file

@ -0,0 +1,19 @@
<div class="lead">
<p>Welcome to Helma! Explore the tools, introductions and resources below and
discover what you can do with Helma and Javascript on the server-side.</p>
</div>
<script> openbox('tools') </script>
<h3>tools</h3>
<% response.listtools %>
<script> closebox() </script>
<script> openbox('intro') </script>
<h3>introductions</h3>
<% response.listintro %>
<script> closebox() </script>
<script> openbox('website') </script>
<h3>helma.org</h3>
<% response.listwebsite %>
<script> closebox() </script>

View file

@ -0,0 +1,21 @@
<h1>inspector</h1>
<p>The Inspector allows you to inspect and modify the properties of
HopObjects and to browse the HopObject tree. For example, you
can invoke the Inspector on the HopObject named "first" by
accessing the "inspector" action at
<a href="http://<% request.http_host %>/first/inspector">
http://<% request.http_host %>/first/inspector</a></p>
<img src="/static/guide/inspector.png" width="480" height="332" />
<p>Note that access to the Inspector is restricted for obvious security
reasons. If you have not yet done so, you will be directed on how
to configure administrative access when you attempt to use
this tool.</p>
<p>In order to be able to use the Inspector inside your own application,
you will need to add the helmaTools code repository to that
application. For example by adding modules/helmaTools.zip to the
<a href="/intro/applications">list of its repositories in the
./apps.properties file</a>.

View file

@ -0,0 +1,18 @@
<h1>manage</h1>
<p>The Manage application allows you to start and stop applications and
makes a variety of status information available. It also provides access
to the automatically generated API documentation of the application's
code repositories and libraries.</p>
<p>In Helma's default installation, the Manage application can be accessed
using the <a href="http://<% request.http_host %>/manage">
http://<% request.http_host %>/manage</a> mountpoint.</p>
<img src="/static/guide/manage.png" width="480" height="440" />
<p>Note that access to the Manage application is restricted for obvious
security reasons. You will first need to edit the ./server.properties
file and set adminAccess to your IP address. You then will be
directed on how to configure administrative access when you attempt to
use this tool.</p>

View file

@ -0,0 +1,31 @@
<h1>shell</h1>
<p>The Shell allows you to run commands and evaluate scripts within
your running application. This may be useful for administrative
and maintenance tasks for which you may not want to build a GUI
or pre-defined scripts. Certainly, the Shell can become very
useful during development and debugging.</p>
<p>By running commands you can inspect and manage data structures
beyond the capabilities of the Inspector. By running scripts you
can easily test and modify small portions of your application or
invoke actions, simulating specific circumstances and measuring
their performance.</p>
<p>For example, you can invoke the Shell on the HopObject
named "second" by accessing the "shell" action at
<a href="http://<% request.http_host %>/first/second/shell">
http://<% request.http_host %>/first/second/shell</a></p>
<img src="/static/guide/shell.png" width="480" height="475" />
<p>Note that access to the Shell is restricted for obvious security
reasons. If you have not yet done so, you will be directed on how
to configure administrative access when you attempt to use
this tool.</p>
<p>In order to be able to use the Shell inside your own application,
you will need to add the helmaTools code repository to that
application. For example by adding modules/helmaTools.zip to the
<a href="/intro/applications">list of its repositories in the
./apps.properties file</a>.

View file

@ -0,0 +1,43 @@
<h1>sqlshell</h1>
<p>The SQLshell allows you to query relational databases, explore
their schema, send SQL statements and create object/relational
mappings for your HopObject prototypes.</p>
<p>In order to be able to use the SQLshell, you need to define at least
one datasource inside the ./db.properties file in Helma's home
directory or for application specific configurations in a db.properties
file inside the application's code repository. An example of such a
file can be found inside the welcome application at
./apps/welcome/code/db.properties</p>
<pre>
myDataSource.url = jdbc:mysql://db.domain.com/space
myDataSource.driver = org.gjt.mm.mysql.Driver
myDataSource.user = username
myDataSource.password = xyz
</pre>
<p>In order to add the specified JDBC driver to the CLASSPATH, place it in
the ./lib/ext/ directory. Depending on the database system you are using,
you may want to <a href="http://developers.sun.com/product/jdbc/drivers">
download an appropriate JDBC driver</a>, for example a
<a href="http://www.mysql.com/downloads/api-jdbc-stable.html">driver for
MySQL</a>.</p>
<p>Now you should be able to use the SQLshell by accessing any URL
pointing to a HopObject with the added "sqlshell" action, such as
<a href="http://<% request.http_host %>/sqlshell">/sqlshell</a>.</p>
<img src="/static/guide/sqlshell.png" width="480" height="475" />
<p>Note that access to the SQLshell is restricted for obvious security
reasons. If you have not yet done so, you will be directed on how
to configure your administrative access when you attempt to use
this tool.</p>
<p>In order to be able to use the SQLshell inside your own application,
you will need to add the helmaTools code repository to that
application. For example by adding modules/helmaTools.zip to the
<a href="/intro/applications">list of its repositories in the
./apps.properties file</a>.

View file

@ -0,0 +1,33 @@
<h1>debugger</h1>
<p>The debugger can help you debug Helma applications, providing
facilities to set and clear breakpoints, control execution, view
variables, and evaluate arbitrary Javascript code in the current
scope, for example that of a request that is being processed.</p>
<p>To enable the debugger, set the rhino.debug property in the
application's app.properties file as follows:</p>
<pre>
rhino.debug = true
</pre>
<p>If this property is set when an application is started, the debugger
will open in a separate window. Since this window will open on the
server the application is running on, using the debugger is only
suitable for local development.</p>
<img src="/static/guide/debugger.png" width="480" height="876" />
<p>The "welcome" application comes with the debugger disabled. To enable
it and cause the debugger window to automatically open when Helma is
started, uncomment the corresponding property by removing the leading
hash in the ./apps/welcome/code/app.properties file:</p>
<pre>
#rhino.debug = true
</pre>
<p>More information on the functionality the debugger offers:
<br /><a href="http://www.mozilla.org/rhino/debugger.html">/rhino/debugger</a>
</p>

View file

@ -0,0 +1,14 @@
<div class="lead">
<p>Explore the tools below and discover what you <br />
can do with Helma and Javascript on the server-side.</p>
</div>
<script> openbox('pagetools') </script>
<h3>tools</h3>
<% response.listtools %>
<script> closebox() </script>
<script> openbox('content') </script>
<% response.content %>
<script> closebox() </script>

View file

@ -0,0 +1,19 @@
if (req.data.add && req.data.name) {
var obj = new HopObject();
obj.name = req.data.name;
this.add(obj);
res.redirect(obj.href())
}
res.data.root = root.href();
res.data.parenthref = this._parent.href();
res.data.parentname = this._parent.name;
res.data.href = this.href();
res.data.title = this.name;
res.data.list = '\
<ul>\
<li><a href="'+ this.href() +'">&lt;&lt; back</a></li>\
</ul>';
res.data.content = this.renderSkinAsString('add');
res.data.body = this.renderSkinAsString('main');
this.renderSkin('page');

View file

@ -0,0 +1,6 @@
<form method="post">
<p>In order to attach a new HopObject to "<% response.title %>",
<br />please specify its name below.</p>
<p>Name: <input type="text" name="name">
<input type="submit" name="add" value="Add"></p>
</form>

View file

@ -0,0 +1,24 @@
<p>This HopObject is named "<% response.title %>" and has the ID "<% response.id %>".</p>
<p>It is attached to the HopObject
<a href="<% response.parenthref %>">"<% response.parentname %>"</a>.</p>
<form method="post">
<p>The access counter for
<a href="<% response.href %>">this Hop Object</a> is at
<% response.counter %>
<input type="submit" name="counter" value="Reset">
</p>
</form>
<p>This HopObject is automatically persisted in Helma's
embedded XML database at ./db/welcome/<% response.id %>.xml</p>
<p>To explore this HopObject and its properties in more detail you
may utilize the <a href="<% response.href %>shell">web-based shell</a>.
In addition to the inspection of this HopObject, you will be able to
evaluate server-side Javascript in its scope.</p>
<p>In case you are curious: This request has been handled by the action
defined at ./apps/welcome/code/HopObject/main.hac and this text was
rendered from the skin ./apps/welcome/code/HopObject/hop.skin</p>

View file

@ -0,0 +1,8 @@
function hoplist(){
var list = '';
for (var subnode in this.list()) {
list += '<li><a href="'+ this.list()[subnode].href()
+'">'+ this.list()[subnode].name +'</a></li>';
}
return '<ul>'+ list +'</ul>';
}

View file

@ -0,0 +1,24 @@
// Prepare some response values used by the skins
res.data.root = root.href();
res.data.parenthref = this._parent.href();
res.data.parentname = this._parent.name;
res.data.href = this.href();
res.data.title = this.name;
res.data.id = this._id;
if (req.data.counter)
this.counter = 0;
else
this.counter = !this.counter ? 1 : this.counter + 1;
res.data.counter = this.counter;
res.data.list = this.hoplist();
res.data.add = '\
<blockquote>\
<form method="post" action="'+ this.href() +'add">\
<input type="submit" name="add" value="Add HopObject">\
</form>\
</blockquote>';
// Render three nested skins
res.data.content = this.renderSkinAsString('hop');
res.data.body = this.renderSkinAsString('main');
this.renderSkin('page');

View file

@ -0,0 +1,16 @@
<div class="lead">
<p>HopObject - the central building blocks of your Helma applications.</p>
</div>
<script> openbox('pagewebsite') </script>
<ul>
<li><a href="<% response.parenthref %>"><% response.parentname %></a></li>
</ul>
<h3><% response.title %></h3>
<% response.list %>
<% response.add %>
<script> closebox() </script>
<script> openbox('content') </script>
<% response.content %>
<script> closebox() </script>

View file

@ -0,0 +1,23 @@
<!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"DTD/xhtml1-transitional.dtd">
<html>
<head>
<title><% response.title %></title>
<meta http-equiv="Content-Script-Type" content="text/javascript">
<script src="<% response.href %>scripts.js"></script>
<link rel="stylesheet" href="<% response.href %>styles.css" media="screen" />
</head>
<body>
<div class="frame">
<img class="overview" onclick="location='/'" src="/static/helmaheader.png" /><br />
<% response.body %>
</div>
<br clear="all" /><br /><br />
</body>
</html>

View file

@ -0,0 +1,2 @@
res.contentType="application/javascript";
this.renderSkin('scripts_js');

View file

@ -0,0 +1,22 @@
function openbox(kind) {
document.write('\
<div class="'+ kind +'">\
<b class="rtop"><b class="r1"></b><b class="r2"></b>\
<b class="r3"></b><b class="r4"></b></b>\
');
if (kind != 'content') document.write('\
<div class="columnheight">\
');
else document.write('\
<div class="contentmargin">\
');
}
function closebox(kind) {
document.write('\
</div>\
<b class="rbottom"><b class="r4"></b><b class="r3"></b>\
<b class="r2"></b><b class="r1"></b></b>\
</div>\
');
}

View file

@ -0,0 +1,2 @@
res.contentType="text/css";
this.renderSkin('styles_css');

View file

@ -0,0 +1,112 @@
body {
background-color: #fff;
margin-top: 0px;
margin-left: 0px;
}
a {text-decoration: none;}
a:link {color: #00f;}
a:visited {color: #00b;}
a:active {color: #f66;}
a:hover {color: #c33;}
pre {
background: #ffe;
line-height:150%;
padding: 8px;
}
h3 {
font-family: "Trebuchet MS", sans-serif;
font-size: 16px;
margin-left: 15px;
}
ul {
font-family: "Trebuchet MS", sans-serif;
font-size: 13px;
color: #333;
// margin-left: 40px;
}
.overview {
width: 755px;
heigth: 92px;
}
.tools {
float:left;
margin-left: 15px;
width: 222px;
}
.intro {
float:left;
margin-left: 27px;
margin-right: 27px;
width: 222px;
}
.website {
float:left;
width: 222px;
}
.pagetools, .pageintro, .pagewebsite {
float:left;
margin-left: 15px;
width: 195px;
}
.frame {
width: 755px;
margin-top: 0px;
margin-right: auto;
margin-left: auto;
margin-bottom: 30px;
}
.lead {
font-family: "Trebuchet MS", sans-serif;
font-size: 16px;
color: #666;
margin-top: 20px;
margin-right: 45px;
margin-left: 125px;
margin-bottom: 25px;
}
.columnheight {
height: 300px;
}
.content {
font-family: "Trebuchet MS", sans-serif;
font-size: 13px;
line-height:135%;
float:left;
spacing: 10px;
margin-left: 25px;
width: 505px;
}
.contentmargin {
margin-left: 20px;
margin-right: 15px;
}
.tools, .tools b.rtop b, .tools b.rbottom b,
.pagetools, .pagetools b.rtop b, .pagetools b.rbottom b
{background: #bf7}
.intro, .intro b.rtop b, .intro b.rbottom b,
.pageintro, .pageintro b.rtop b, .pageintro b.rbottom b
{background: #fd6}
.website, .website b.rtop b, .website b.rbottom b,
.pagewebsite, .pagewebsite b.rtop b, .pagewebsite b.rbottom b
{background: #7cf}
.content, .content b.rtop b, .content b.rbottom b
{background: #eee}
b.rtop, b.rbottom{display:block;background: #fff}
b.rtop b, b.rbottom b{display:block;height: 1px;
overflow: hidden;}
b.r1{margin: 0 5px}
b.r2{margin: 0 3px}
b.r3{margin: 0 2px}
b.r4{margin: 0 1px;height: 2px}
b.rtop b.r4, b.rbottom b.r4{margin: 0 1px;height: 2px}

View file

@ -0,0 +1,3 @@
_children = collection(HopObject)
_children.accessname = name
name

View file

@ -0,0 +1,2 @@
res.write('Hello, this is the action defined \
at ./apps/welcome/code/Root/example.hac');

View file

@ -0,0 +1,11 @@
function anotherexample_action() {
res.write('Hello again, this is the action \
defined in ./apps/welcome/code/Root/example.js');
}
function pullLink_macro(params) {
switch (params.part) {
case 'text' : return '/example_using_macro';
case 'url' : return this.href('example_using_macro');;
}
}

View file

@ -0,0 +1,10 @@
<p>This is an example of a simple skin.</p>
<p>You will find this skin at
./apps/welcome/code/Root/example.skin</p>
<p>This skin is rendered by the action defined at
./apps/welcome/code/Root/example_using_skin.hac</p>
<p>You can test it via the URL
<a href="<% response.pushLinkUrl %>">
<% response.pushLinkText %>
</a>
</p>

View file

@ -0,0 +1 @@
this.renderSkin('example_using_macro');

View file

@ -0,0 +1,12 @@
<p>This is an example of a skin that calls a macro.</p>
<p>You will find this skin at
./apps/welcome/code/Root/example_using_macro.skin</p>
<p>This skin is rendered by the action defined at
./apps/welcome/code/Root/example_using_macro.hac</p>
<p>The macro this skin calls is defined in
./apps/welcome/code/Root/example.js</p>
<p>You can test it via the URL
<a href="<% this.pullLink part="url" %>">
<% this.pullLink part="text" %>
</a>
</p>

View file

@ -0,0 +1,3 @@
res.data.pushLinkUrl = this.href('example_using_skin');
res.data.pushLinkText = 'example_using_skin';
this.renderSkin('example');

View file

@ -0,0 +1,4 @@
_extends = Guide
_children = collection(HopObject)
_children.accessname = name
name

View file

@ -0,0 +1 @@
#rhino.debug = true