Spirit Logicsheets
Index
Main
Spirit
Logicsheet
insight:
operations
insight-topic:
create
rename
fetch
fetch-tree
fetch-list
current
get-id
get-name
get-fqname
insight-publication:
create
make-default
fetch
fetch-list
get-id
get-state
get-format
get-topic
fetch-fragments
get-fragment-path
get-fragment-locator

Abstract

Logicsheets can be seen as XML elements with a dynamic behavior. Those elements are intended to be used in Cocoon XSPs. See Cocoon documentation for more details.

Note Current documentation is a clean rewriting of Logicsheet API. It does not reflect code in all cases. Please refer to XSL code if any doubt.

Code samples

The best way to understand how Spirit Logicsheets should be used is to have a look at $SHAMAN_ROOT/src/spirit-webapp/xsp.

Namespaces

In order to avoid a huge, unmaintainable Logicsheet, features are split across several logicsheets :

  • insight: core features
  • insight-topic: Topic-related stuff
  • insight-publication: Publication-related stuff

Coding standards
Java language

Java is the only language supported by Spirit Logicsheets. We believe that a compiled language is less error-prone than a fully interpreted one.

Reserved names

All names beginning with _insight are reserved, and should not be used in XSPs.

Parameters

As recommanded by Cocoon documentation, parameters to a given tag may be passed as attributes or elements. Passing parameters as elements is useful when the value is in a Java variable.

Following code doesn't produce expected effect ("bar" is not the value passed in):

<xsp:logic>
  String foo = "bar" ;
</xsp:logic>

<my-ns:my-element my-parameter="<xsp:expr>foo</xsp:expr>" />

Use following syntax instead:

<xsp:logic>
  String foo = "bar" ;
</xsp:logic>

<my-ns:my-element>
  <my-ns:my-parameter>
    <xsp:expr>foo</xsp:expr>
  </my-ns:my-parameter>
</my-ns:my-element>

Note Namespace has been used explicitely when passing parameter as element.

Database updates and Cocoon Actions handling

XSPs located in $SHAMAN_ROOT/src/spirit-webapp/xsp/demo don't handle Insight database update correctly. A same page merges several things: update form, update action, giving a feedback to the User.

This behavior will be corrected in a later version of Shaman, using org.apache.cocoon.acting.ServerPagesAction. This class allows to create Cocoon Actions using XSPs. Please refer to Cocoon documentation for further information.




Copyright 2002 Laurent Caillette and l'Université René Descartes, Paris 5.
All rights reserved.