Solprovider Lenya Kongregate Registration for Free Flash Games and Chat with solprovider

Most Common and Useful Variables

This page lists the most commonly used variables with comments about their usefulness.
VariableModule
Access ControlLenya's AccessControlModule
GlobalCocoon's GlobalInputModule
Page EnvelopeLenya's PageEnvelopeModule
RequestCocoon's RequestModule

global


global should be used for your own variables. A good example is {global:cache-dir} from the default publication's publication-sitemap.xmap

page-envelope


area = "live", "authoring", ...

breadcrumb-prefix = BROKEN. Always empty string.

context-prefix
{page-envelope:context-prefix} = "\" + pubid + "\" + area [ + "\pathToDoc" (if in subdirectory)] May start with "\lenya" when on Tomcat.

default-language = obvious.
document = pub:area:/path/documentID:language = "mypub:live:/doc1/doc2:en". I have no idea how this is useful.

The document-dc-* entries are from the lenya:meta section of the document:
document-dc-creator
document-dc-description
document-dc-date-created
document-dc-publisher
document-dc-rights
document-dc-subject
document-dc-title

document-extension = "html"

document-file = the full absolute path to the XML file. On MSWindows, this starts with the drive letter.

document-id
{page-envelope:document-id} = "\" + [path + "\" + ] document-name

document-label
{page-envelope:document-label} = the "label" from sitetree.xml for the document for the current language, also known as the "Navigation Title" in the CMS GUI.

document-language
{page-envelope:document-language} = languageCode chosen in URL, or default.

document-languages = Useless ("[Ljava.lang.String;@130671e")

document-languages-csv
{page-envelope:document-languages-csv} = comma separated list of all languages in publication. Useful for homepage, but elsewhere {page-envelope:document-languages} is probably better.

document-lastmodified = "2005-06-19 21:19:14"

document-name
document-node-id
Both of these are just the name of the document after the last slash with no language or extension. Very useful for programming Assets, since the link should be "document-name/assetname".

document-path
{page-envelope:document-path} = the path and filename under the current area without a starting slash. Example:
http://solprovider.com/lenya/live/basics/variables.html
http://solprovider.com/lenya/live/basics/variables.xxx
http://solprovider.com/lenya/live/basics/variables

all return:
basics/variables/index_en.xml

document-type = "xhtml", "homepage", ... This is extremely useful for testing.

document-url = the URL after the area "/doc1/doc2_en.html". The language only appears if it is in the calling URL.
document-url-without-language = the whole URL "/pub/live/doc1/doc2.html". The language is removed if it existed.
If you want the entire URL (including language if it exists), use {request:requestURI}.

publication = USELESS "org.apache.lenya.cms.publication.file.FilePublication@2739a1a9"

publication-id = The publication's identifier (directory name). VERY USEFUL.

publication-languages-csv = All languages allowed in the publication "en,de".

ssl-prefix = I have not tested with SSL. Blank for non-SSL.

request


{request:contextPath} = Always empty string on Jetty. "\lenya" on Tomcat.

{request:locale} = languageCode [ + "_" + countryCode]. Browser's language setting. Useful for choosing homepage. Otherwise use {page-envelope:document-language}

{request:queryString} = the full querystring, everything after the question mark. (Lenya does not support the exclamation mark as the querystring separator. It is assumed to be part of the document ID.)

{request:requestURI} - Great for return to the URL, if you are using Jetty:
<map:redirect-to uri="{request:requestURI}" />
When using Tomcat, Lenya is bad about the context. The requestURI is "/lenya/{pub}/...", and the pipeline will not be found. Remove the "/lenya" and it works: (Example assume "ret" contains the requestURI.)
if(ret.substring(0,6) == "/lenya") { ret = ret.substring(6); }
cocoon.sendPage(ret);


{request-param:myParameter} - gets a value from the "myParameter" parameter in the querystring of the request.

access-control


These are useful and obvious. The first 3 are empty if the visitor has not logged in.
user-id
user-name
user-email
ip-address
role-ids (separated by commas: "role1,role2")

These are useless for XMAPs:
user-manager
group-manager
role-manager
iprange-manager

<< UsageLenya >>

Contact Solprovider
Paul Ercolino