Charlie Configuration Reference

Application Configuration Levels

Summary

The second level of configuration.

Description

Application profiles (see profile) contain information applicable to particular applications.

Notes

Root element: app-profile

See Also

Groups [ Configuration Levels ]
Entries [ Directory | Global | app-profile | profile ]

Directory Configuration Levels

Summary

The third level of configuration.

Description

The directory meta-data (DMD.xml) may contain information specific to particular directories

Notes

Root element: dmd

This level is optional.

See Also

Groups [ Configuration Levels ]
Entries [ Application | Global | dmd ]

Global Configuration Levels

Summary

The first level of configuration.

Description

The global configuration (conf/charlie.conf) contains information applicable to entire Charlie engine.

Notes

Root element: charlie

See Also

Groups [ Configuration Levels ]
Entries [ Application | Directory | charlie ]

Introduction .description

Summary

The Charlie engine uses a cascading three-level configuration. The configuration holds key information on the request resolution (request-action mapping, data drivers) and thus contains a relevant part of the application logic.

Description

There are three configuration levels: Global, Application and Directory. Some configuration items are allowed in all three levels, while some other may be specific to particular level only.

See Also

Groups [ .description ]
Entries [ Application | Directory | Global ]

Rule Expressions .description

Summary

Rule expressions may be used in several configuration items, mostly named 'rule-*'.

Description

Rule expressions are used when one request is translated to another. This happens when a data driver retrieves a real document as a response a to former Charlie request, when the engine resolves document using links etc.

The rules say how to build a new request object from the original one. Each expression is a mix of literal characters and functions. Literals are copied unchanged (mostly a URI of the new request). Functions allows to reuse parts of the original request in the new one.

You may use the following functions:

$env(name): Returns the value of specified environment variable.

$scheme: Extracts the scheme part of the original URI.

$host: Extracts the host part of the original URI.

$path([from, to]): Extracts the path part of the original URI. If the parameters are given, the original path is split and only elements from 'from' to 'to' are returned. If the parameters are negative numbers, the path elements are indexed from the end to the beginning (e.g. $path(-1, -1) is the last element, probably the filename).

$query: Extracts the query part of the original URI.

$qfi(index): Extracts the i-th query field name of the original URI.

$qvi(index): Extracts the i-th query value of the original URI.

$qv(name): Extracts the value of original query field named 'name'.

$fragment: Extracts the fragment part of the original URI.

$ds: Returns the dollar sing ("$").

Example

       original request URI:

       charlie:/my.application/file/location/foo.xml?a=b&c=d

       with the expression of

       http://my.server.org/another/root/$path(3,-1)?renamed_a=$qv(a)

       results to:

       http://my.server.org/another/root/file/location/foo/xml?renamed_a=b

See Also

Groups [ .description ]
Entries [ rule-uri ]

action Items: Actions

Summary

Defines action URL for one or more files.

Syntax

       <action match="regexp">action-uri</action>
NameTypeDescription
matchattributeregular expression
action-uritextaction URI in 'charlie' scheme

Description

Level: Global, Application, Directory

Parent: actions

Children: n/a

Notes

See actions for an example.

See Also

Groups [ Items: Actions ]
Entries [ Application | Directory | Global | actions ]

action-policy Items: Policies

Summary

Defines action policy for one or more files.

Syntax

       <action-policy match="regexp">rule</action-policy>
NameTypeDescription
matchattributeregular expression
ruletextaction policy rule: 'action', 'both' or 'direct'

Description

Level: Global, Application, Directory

Parent: policies

Children: n/a

Notes

See policies for an example.

See Also

Groups [ Items: Policies ]
Entries [ Application | Directory | Global | policies ]

action-url Items: Files and Links

Summary

An action URL (relative to the processed request) may be specified using this element.

Syntax

       <action-url>action-url</action-url>
NameTypeDescription
action-urltextaction URL

Description

Level: Directory

Parent: file

Children: n/a

See Also

Groups [ Items: Files and Links ]
Entries [ Directory | file ]

actions Items: Actions

Summary

Specifies action URLs for incoming 'charlie:' URLs with the action policy resolved to 'action'. See policies for details.

Syntax

       <actions>

Description

Level: Global, Application, Directory

Parent: charlie, app-profile, dmd

Children: action

Example

       <actions>
         <action match='^charlie:/my_app/dir1'>charlie:/my_app/act1.act</action>
         <action match='^charlie:/my_app/dir2'>charlie:/my_app/act2.act</action>
       </actions>

See Also

Groups [ Items: Actions ]
Entries [ Application | Directory | Global | action | app-profile | charlie | dmd | policies ]

app-profile Items: Root

Summary

The root element for Application level configuration.

Description

Children: javascript, data-drivers, policies, actions

See Also

Groups [ Items: Root ]
Entries [ Application | actions | data-drivers | javascript | policies ]

application Items: Applications

Summary

Defines one Charlie application.

Syntax

       <application name="name">
NameTypeDescription
nameattributeapplication name

Description

Level: Global

Parent: applications

Children: profile

Notes

See applications for an example.

See Also

Groups [ Items: Applications ]
Entries [ Global | applications | profile ]

applications Items: Applications

Summary

Defines Charlie applications.

Syntax

       <applications>

Description

Level: Global

Parent: charlie

Children: application

Example

       <applications>
         <application name='my_app'>
           <profile>charlie:/profiles/my_app.xml</profile>
         </application>
         <application name='demo'>
           <profile>charlie:/profiles/demo.xml</profile>
         </application>
       </applications>

See Also

Groups [ Items: Applications ]
Entries [ Global | application | charlie ]

charlie Items: Root

Summary

The root element for Global level configuration.

Description

Children: javascript, mime-types, log, data-drivers, applications, policies, actions

See Also

Groups [ Items: Root ]
Entries [ Global | actions | applications | data-drivers | javascript | log | mime-types | policies ]

data-drivers Items: Data Drivers

Summary

Specifies data drivers to be used.

Syntax

       <data-drivers>

Description

Level: Global, Application

Parent: charlie, app-profile

Children: driver

Example

       <data-drivers>
         <driver dir='charlie:/my_app/local/' subdirs='yes'>
           <type>FILE</type>
           <rule-uri>file:/usr/local/my_application/xml/$path(3,-1)</rule-uri>
         </driver>
         <driver dir='charlie:/my_app/remote/' subdirs='yes'>
           <type>HTTP</type>
           <rule-uri>http://www.remote.org/$path(2,-1)?$query</rule-uri>
         </driver>
       </data-drivers>

See Also

Groups [ Items: Data Drivers ]
Entries [ Application | Global | app-profile | charlie | driver ]

dir Items: JavaScript

Summary

Specifies the directory for JavaScript include lookup.

Syntax

       <dir>$MY_LIB/js</dir>

Description

This element specifies a directory to be searched for JS libraries. The directory specification may contain the environment reference like '$MYLIB'.

The dir element may be repeated several times.

Level: Global, Application

Parent: includes

Children: n/a

Notes

See javascript for an example.

See Also

Groups [ Items: JavaScript ]
Entries [ Application | Global | includes | javascript ]

dmd Items: Root

Summary

The root element for Directory level configuration.

Description

Children: policies, actions, files, links

See Also

Groups [ Items: Root ]
Entries [ Directory | actions | files | links | policies ]

driver Items: Data Drivers

Summary

Defines a data driver for a set of Charlie URLs.

Syntax

       <driver dir="dir" [default="yes|no"] [subdirs="yes|no"]>
NameTypeDescription
dirattributedriver binding to the charlie namespace, trailing slash is required
defaultattributedefault driver
subdirsattributeapplies for subdirectories

Description

Level: Global, Application

Parent: data-drivers

Children: rule-uri, type, driver specific elements

Notes

See data-drivers for an example.

See Also

Groups [ Items: Data Drivers ]
Entries [ Application | Global | data-drivers | driver specific elements | rule-uri | type ]

driver specific elements Items: Data Drivers

Summary

For some data drivers, the driver element can contain driver specific elements.

Description

Level: Global, Application

Parent: driver

SOAP: x-uri-scheme, x-proxy, x-inner

Example

       <x-uri-scheme>urn</x-uri-scheme>
       <x-proxy>http://host:8080/soap/servlet/rpcrouter</x-proxy>
       <x-inner>inner_id</x-inner>

See Also

Groups [ Items: Data Drivers ]
Entries [ Application | Global | driver ]

extension Items: MIME types

Summary

Defines a content type for given file extension.

Syntax

       <extension name='extension' ct='mime-type'/>
NameTypeDescription
nameattributeextension
ctattributeMIME type

Description

Level: Global

Parent: mime-types

Children: n/a

Notes

See mime-types for an example.

See Also

Groups [ Items: MIME types ]
Entries [ Global | mime-types ]

file Items: Files and Links

Summary

Describes the file given in the 'name' attribute. While resolving a file, a default link item is always created.

Syntax

       <file name="filename" [link-index="number"] [primary="yes|no"] 
             [store="yes|no"] [action-policy="action|both|direct"]>
NameTypeDescription
nameattributefile name
indexattributespecifies the order which the default link is processed in
primaryattributesays if the the default link is the primary one
storeattributedefines if the default link has to be used while publishing the response
action-policyattributedefines action policy for this file

Description

Level: Directory

Parent: files

Children: link, action-url

Notes

See files for an example.

See Also

Groups [ Items: Files and Links ]
Entries [ Directory | action-url | files | link ]

files Items: Files and Links

Summary

Defines a resolution policy for files from the charlie namespace.

Syntax

       <files>

Description

Level: Directory

Parent: dmd

Children: file

Example

       <files>
         <file name='data.xml' store='yes' link-index='2'>
           <link index='1' store='no' primary='no'>
             <rule-uri>../services/script.pl?$query</rule-uri>
           </link>
         </file>
       </files>

See Also

Groups [ Items: Files and Links ]
Entries [ Directory | dmd | file ]

includes Items: JavaScript

Summary

Options to include JavaScript libraries.

Syntax

       <includes>

Description

Level: Global, Application

Parent: javascript

Children: dir, preload

Notes

See javascript for an example.

See Also

Groups [ Items: JavaScript ]
Entries [ Application | Global | dir | javascript | preload ]

javascript Items: JavaScript

Summary

Describes how to handle libraries passed to the engine JavaScript context.

Syntax

       <javascript>

Description

Level: Global, Application

Parent: charlie, app-profile

Children: modules, includes

Example

       <javascript>
         <includes>
           <dir>$MY_LIB/js</dir>
           <preload>ch-doc-std.js</preload>
           <preload>form.js</preload>
         </includes>
         <modules>
           <perl-lib>$MY_LIB/perl</perl-lib>
           <module lang='perl' name='XMLDirectory'/>
         </modules>
       </javascript>

See Also

Groups [ Items: JavaScript ]
Entries [ Application | Global | app-profile | charlie | includes | modules ]

level Items: Log

Summary

Defines the log level. The available values are: 'debug' (maximal information), 'info', 'warn', 'error' and 'critical' (minimal information).

Syntax

       <level>level</level>
NameTypeDescription
leveltextlevel of recorded information

Description

Level: Global

Parent: log

Children: n/a

Notes

See log for an example.

See Also

Groups [ Items: Log ]
Entries [ Global | log ]

link Items: Files and Links

Summary

Defines a link for a file.

Syntax

       <link match="regexp"* [primary="yes|no"] [index="number"] [store="yes|no"]>
NameTypeDescription
matchattributeregular expression, *this attribute applies to children of links only
primaryattributesays if the link is the primary one
indexattributespecifies the order which the link is processed in
storeattributedefines if the link has to be used while publishing the response

Description

Level: Directory

Parent: file, links

Children: rule-uri

Notes

See files and links for examples.

See Also

Groups [ Items: Files and Links ]
Entries [ Directory | file | files | links | rule-uri ]

links Items: Files and Links

Summary

Defines links for files from the charlie namespace.

Syntax

       <links>

Description

Level: Directory

Parent: dmd

Children: link

Example

       <links>
         <link match="^charlie:/my_app/dynamic/.*" index='1' store='no' primary='no'>
           <rule-uri>../services/script.pl?$query</rule-uri>
         </link>
       </links>

See Also

Groups [ Items: Files and Links ]
Entries [ Directory | dmd | link ]

log Items: Log

Summary

Specifies log options.

Syntax

       <log>

Description

Level: Global

Parent: charlie

Children: level

Example

       <log>
         <level>debug</level>
       </log>

See Also

Groups [ Items: Log ]
Entries [ Global | charlie | level ]

mime-types Items: MIME types

Summary

This section describes MIME types. It is used by data drivers giving a direct response.

Syntax

       <mime-types [default='mime-type']>
NameTypeDescription
defaultattributeMIME type to be returned when no other type is found

Description

Level: Global

Parent: charlie

Children: extension

Example

       <mime-types default='text/plain'>
         <extension name='jpg' ct='image/jpeg'/>
         <extension name='gif' ct='image/gif'/>
         <extension name='htm' ct='text/html'/>
         <extension name='html' ct='text/html'/>
       </mime-types>

See Also

Groups [ Items: MIME types ]
Entries [ Global | charlie | extension ]

module Items: JavaScript

Summary

Specifies a module to be loaded.

Syntax

       <module lang="lang" name="module-name"/>
NameTypeDescription
langattributeModule language. The only supported value is 'perl' so far.
nameattributeThe name of the module in common Perl syntax of the 'use' pragma.

Description

Loads the specified module of given language. The only supported language is Perl so far.

Level: Global, Application

Parent: modules

Children: n/a

Notes

See javascript for an example.

See Also

Groups [ Items: JavaScript ]
Entries [ Application | Global | javascript | modules ]

modules Items: JavaScript

Summary

Module options. This item makes it possible to plug external modules in.

Syntax

       <modules>

Description

Level: Global, Application

Parent: javascript

Children: perl-lib, module

Notes

See javascript for an example.

See Also

Groups [ Items: JavaScript ]
Entries [ Application | Global | javascript | module | perl-lib ]

perl-lib Items: JavaScript

Summary

Specifies where to look for Perl modules.

Syntax

       <perl-lib>$MY_LIB/perl</perl-lib>

Description

When Perl modules are loaded, all directories listed in perl-lib elements are prepended to the standard Perl include path.

Level: Global, Application

Parent: modules

Children: n/a

Notes

See javascript for an example.

See Also

Groups [ Items: JavaScript ]
Entries [ Application | Global | javascript | modules ]

policies Items: Policies

Summary

Specifies action policy for sets of 'charlie:' URLs.

Syntax

       <policies>

Description

Level: Global, Application, Directory

Parent: charlie, app-profile, dmd

Children: action-policy

Example

       <policies>
         <action-policy match='^charlie:/my_app/.*DMD\.xml$'>direct</action-policy>
         <action-policy match='^charlie:/my_app/\wview.*/'>action</action-policy>
       </policies>

See Also

Groups [ Items: Policies ]
Entries [ Application | Directory | Global | action-policy | app-profile | charlie | dmd ]

preload Items: JavaScript

Summary

Specifies JavaScript files to be preloaded (included) for each action.

Syntax

       <preload>my-lib.js</preload>

Description

Files specified in the preload element are searched in directories listed in dir elements. If no file is found, an error occurs. Files form dir can be also included using the include(); function in actions.

The files listed in preload are evaluated in the context of each action.

Level: Global, Application

Parent: includes

Children: n/a

Notes

See javascript for an example.

See Also

Groups [ Items: JavaScript ]
Entries [ Application | Global | dir | includes | javascript ]

profile Items: Applications

Summary

URI of the application profile (in the 'charlie' scheme). If no file name is given, 'profile.xml' is supposed.

Syntax

       <profile>uri</profile>
NameTypeDescription
uritextcharlie: URI of the application profile

Description

Level: Global

Parent: application

Children: n/a

Notes

See applications for an example.

See Also

Groups [ Items: Applications ]
Entries [ Global | application | applications ]

rule-uri Items: Data Drivers

Summary

Translation rule for uri part of request. See Rule Expressions for more details.

Syntax

       <rule-uri>rule-expression</rule-uri>
NameTypeDescription
rule-expressiontextrule expression

Description

Level: Global, Application, Directory

Parent: driver, link

Children: n/a

Notes

See data-drivers, files, links for examples.

See Also

Groups [ Items: Data Drivers ]
Entries [ Application | Directory | Global | Rule Expressions | data-drivers | driver | files | link | links ]

type Items: Data Drivers

Summary

Type of data driver.

Syntax

       <type>type</type>
NameTypeDescription
typetextthe type of data driver: FILE, HTTP, SOAP, SQL

Description

Level: Global, Application

Parent: driver

Children: n/a

Notes

See data-drivers for an example.

See Also

Groups [ Items: Data Drivers ]
Entries [ Application | Global | data-drivers | driver ]

© 2001-2002 Ginger Alliance
revision 02-04-02
This page was generated by APIDOC