Method Overview
These examples introduce the use of
three basic virtual machines as they come with Askemos.
The initial setup process installs the corresponding ActionDocument's
under public, public/private
and public/xslt-method.
- public
- The
public method rejects all modification
requests implementing an invariant.
Upon read requests the data is delivered a
It is most suited for replication as there are no update problems
possible. As it is an invariant it's used to base the system protection
on it. - private
- This is the opposite of a public place.
It allow (minus insufficient permissions) to change
the data, content type and even the DublinCore slots date and creator.
Hence it's practical, but not suited for documents in the legal sense.
- xslt-method
- The xslt-method evaluates the stylesheet at the place
to produce outgoing signals and new state (see CoreAPI).
This method is always reflective,
as the state includes the
xslt program code, and there is no way to get around it
if the code at the place doesn't have special support.[1]
Note: the examples given here are stored in the
place, which is linked as /stylelib in the
repository created from the distribution.
The links at this page go to the
stylelib at askemos.org,
because it's not possible to predict which oid that place will have
in you installation.
If you can find the overview
here
(depends on your setup,
e. g., you installed the distribution and use it as user 'gonzo')
then you can use the embedded forms.
(also note that the formatting might be strange
as described there).
Preface: Creating Places
The users login page has a form
(inactive source here),
which allows to fetch data from any addressable object
(using a certain soap message body)
and create a place from it.
As distributed the form points into the stylelib
sending a form to apply a template to extract just the code.
The new place has public/xslt-method as ActionDocument.
Usually you change these values to your needs.
Hello World
The inevitable hello world example:
you simply write the html and create a place from that data.
This example is actually a bad example for the xslt method.
It works, but using the evaluating xslt-method,
is an overkill for invariant documents.
Those documents are better created using the public
method, which rejects all modifications
Sending Messages
The most simple example is
send to self
a test, which sends an empty message to the very same place.
Another example is part of the simple rights management interface
(all includes resolved here),
find the reply here
Ownership Transfer
The well commented MoneyDemo
(source)
illustrates ownership transfer but give a lot of other hints.
| .. and than find it here. |
Unfortune: it's not of much use until you
have a few users already.
Reflexive Changing the document at place
Actualy it's not the best practice to use reflective techniques
to keep track of state. But as a proof of concept that way
was used quite a lot.
The
editor
allows you to edit text in a web form
or alternativle use the file upload
(which let's you create non-xml (picture) content with ease.
| .. and than find it here. |
The editor was one of the first apps ever written
and sometimes it's referenced as "msged",
where you can directly link it here:
| .. and than find it here. |
See alsothis control
as a striped down version focusing on variable modification.
Using the Clock
Note: the way the clock has to be configured is
a temporary solution, which might change in future versions.
To use the system clock,
assign the OID of the designated place to $clock-oid.
The place will than receive signals.
See this example
how to make use of it.
When it come to time, beware of pitfalls.
Using XSQL
The xsql test
is a simple interface to send sql queries.
See XSQL for preconditions to use it.
| .. and than find it here. |
Using Perl compatible regular expressions
The pcre test
is a simple interface to test
Perl compatible regular expressions.
| .. and than find it here. |
A more complex example
The basics of a web calendar.