Skip over navigation

Roxen Interactive RXML Help

<insert/>

Inserts a file, variable or other object into a webpage.

Attributes

quote
quote={html, none}

How the inserted data should be quoted. Default is "html", except for the file plugin where it's "none".

Insert plugin cached-href

This tag inserts the contents of the provided URL, as read from a database. The database is updated repeatedly in the background by a background process that is initiated and run as soon as this module is loaded. If the database is empty when the tag is executed, the standard behavior is to fetch the data immediately. When providing values for the attributes fetch-interval, fresh-time, ttl, update-interval or timeout, the time can either be seconds, minutes, hours or days. If only a number is provided, it is interpreted as seconds, otherwise write the corresponding letter or word after the number, e.g: 10 days, 10d, 10 h, 10hours, 5 min, 5m, 2 hours and so on. Spaces between the number and the word are allowed. The values at the settings tab for fetch-interval, fresh-time, ttl and timeout are the standard values that the tag will be assigned if an attribute is left out. update-interval on the other hand, is central and common for all tags.

The data in the database for an URL is always shared by all tags at the same site. This means that when data for an URL is updated this affects all tags referring to this specific URL, even if the other attributes may differ. For example, if the same URL is referenced by one tag without the pure-db attribute and another tag WITH the pure-db attribute, the only guarantee is that the tag with the attribute pure-db never will generate a data fetch. The tag without the attribute still can.

Another implication of the data being shared is for example if the same URL is referenced by two tags with different fetch intervals. The data will then be updated at the smallest of these two fetch intervals. Providing the time-of-day attribute will however always make the module fetch data when that time of day occur, without interference by any other tag referencing the same URL.

Also important to note, is that since the fetching of the common data is performed centrally by the module, the timeout of every tag can not be used, of course. If several tags refer to the same URL but are provided with different timeouts, the longest timeout will be used. However, if there exists no data in the database for the URL of a tag when the tag is run, and the pure-db attribute is not provided, then the fetching of data will be performed for that specific tag and with the specified timeout.

Attributes

cached-href
cached-href=string

The URL of the page to be inserted.

fetch-interval
fetch-interval=string

States at what interval the background process will fetch the URL and update the database.

time-of-day
time-of-day=string

Can be provided as an alternative to fetch-interval, if a fetch should be performed once per day at a specific time. The provided time must be of the format hh:mm.

fresh-time
fresh-time=string

States how long the data for the URL in the database is considered fresh.

ttl
ttl=string

States how long unrequested data will exist in the database before being removed.

timeout
timeout=string

The timeout for the fetching of new data from a server.

pure-db

If provided, the tag will only return data stored in the database, i.e never fetch data immediately if the database is empty. Instead, the data will not be available until the background process has updated the database.

nocache
nocache=string

If provided the resulting page will get a zero cache time in the RAM cache. The default time is up to 60 seconds depending on the cache limit imposed by other RXML tags on the same page.

decode-xml
decode-xml=string

(DEPRECATED. All text content is now decoded automatically.) If provided the resulting content will be decoded to the internal charset representation by looking at a potential BOM (Byte Order Mark) and the specified encoding in the XML header. Defaults to UTF-8 if no BOM or encoding was found.

Insert plugin file

Inserts the contents of a file. It reads files in a way similar to if you fetched the file with a browser, so the file may be parsed before it is inserted, depending on settings in the RXML parser. Most notably which kinds of files (extensions) that should be parsed. Since it reads files like a normal request, e.g. generated pages from location modules can be inserted. Put the tag <eval> around <insert> if the file should be parsed after it is inserted in the page. This enables RXML defines and scope variables to be set in the including file (as opposed to the included file). You can also configure the file system module so that files with a certain extension can not be downloaded, but still inserted into other documents.

Attributes

file
file=string

The virtual path to the file to be inserted.

<eval><insert file='html_header.inc'/></eval>

decode-charset

Decode the character encoding before insertion.

Used to decode the transport encoding for the inserted file.

language
language=string

Optionally add this language at the top of the list of preferred languages.

Insert plugin href

Inserts the contents at that URL. This function has to be enabled in the Additional RXML tags module in the Roxen WebServer configuration interface. The page download will block the current thread, and if running unthreaded, the whole server.

Note: Requests are made in HTTP/1.0.

Attributes

href
href=string

The URL to the page that should be inserted.

nocache
nocache=string

If provided the resulting page will get a zero cache time in the RAM cache. The default time is up to 60 seconds depending on the cache limit imposed by other RXML tags on the same page.

method
method=string (GET)

Method to use when requesting the page. GET or POST.

silent
silent=string

Do not print any error messages.

status-variable
status-variable=variable

Prints the return code for the request in the specified varible.

<insert href='http://www.somesite.com/news/' status-variable='var.status-code' />

timeout
timeout=int

Timeout for the request in seconds. This is not available if your run the server without threads.

<insert href='http://www.somesite.com/news/' silent='silent' timeout='10' /> <else> Site did not respond within 10 seconds. Try again later. </else>

post-variables
post-variables="variable=rxml variable[,variable2=rxml variable2,...]"

Comma separated list of variables to send in a POST request.

<insert href='http://www.somesite.com/news/' method='POST' post-variables='action=var.action,data=form.data' />

post-data
post-data=string

String to send as the body content of the POST request. Mutually exclusive with the 'post-variables' argument.

<insert href='http://www.somesite.com/webservice/' method='POST' post-data='&var.data;' />

request-headers
request-headers="header=value[,header2=value2,...]"

Comma separated list of extra headers to send in the request.

ignore-unknown-ce
ignore-unknown-ce=int

If set, unknown Content-Encoding headers in the response will be ignored. Some servers specify the character set (e.g. 'UTF-8') in the Content-Encoding header in addition to the Content-Type header. (The real purpose of the Content-Encoding header is described here: http://www.w3.org/Protocols/rfc2616/rfc2616-sec14.html#sec14.11)

No documentation available for "plugin locate".

Insert plugin realfile

Inserts a raw, unparsed file. The disadvantage with the realfile plugin compared to the file plugin is that the realfile plugin needs the inserted file to exist, and can't fetch files from e.g. an arbitrary location module. Note that the realfile insert plugin can not fetch files from outside the virtual file system or files in a CMS filesystem.

Attributes

realfile
realfile=string

The virtual path to the file to be inserted.

Insert plugin scopes

Inserts a listing of all present variable scopes.

Attributes

scopes
scopes={full, plain}

Sets how the output should be formatted.

<insert scopes='plain'/>
ac, calendar, client, cookie, form, forms-and-response, header, modvar, page, request-header, roxen, user and var

Insert plugin variable

Inserts the value of a variable.

Attributes

variable
variable=string

The name of the variable.

scope
scope=string

The name of the scope, unless given in the variable attribute.

index
index=number

If the value of the variable is an array, the element with this index number will be inserted. 1 is the first element. -1 is the last element.

split
split=string

A string with which the variable value should be split into an array, so that the index attribute may be used.

Insert plugin variables

Inserts a listing of all variables in a scope. In a string or text context, the variables are formatted according to the "variables" attribute. Otherwise the scope is returned as-is, i.e. as a mapping.

It is possible to create a scope with an infinite number of variables. When such a scope is listed in string form (or iterated over with <emit source="values">), it is up to the implementation which variables are included in the list, i.e. it will not cause any problem except that all variables will not be listed. An implementation of a limited scope might also hide variables so that they don't get listed by this tag.

Compatibility note: If the compatibility level is less than 5.0 then a string list is always returned.

Attributes

variables
variables={full, plain}

Specifies how the output will be formatted in a string context, as shown by the following example. The default is "plain".

<set variable="var.a">hello</set> <set variable="var.b" type="int">4711</set> <set variable="var.c" split=" ">x y z</set> <pre><insert source="variables" variables="full" scope="var"/></pre> <hr /> <pre><insert source="variables" variables="plain" scope="var"/></pre>
a="hello"
b=4711
c=({ /* 3 elements */
    "x",
    "y",
    "z"
})

a, b and c

scope

The name of the scope that should be listed, if not the present scope.