RoxenCMS 17Web Developer ManualSiteBuilder Tags

   

<sb-app-launcher>
<sb-block-dependencies>
<sb-edit-area>
<sb-error>
<sb-force-language>
<sb-get-permanent-link>
<sb-login>
<sb-notify-change>
<sb-precache-change>
<sb-register-dependency>
<sb-resolve-permanent-link>

<sb-edit-area></sb-edit-area>

Provided by module: CMS: Tags

Makes other tags inside the contents of the <sb-edit-area> tag behave like the page was fetched from the editarea even if the file was fetched from the viewarea. Pages are fetched from the viewarea until the user enters the content editor, then files will be fetched from the user's local editarea.

The tag also enables several subtags which can be used to manipulate SiteBuilder files.

The __sb_edit_area form variable may be set in a link to a file to ensure that the file is fetched from the edit area. If this variable is omitted and the user isn't logged on to the Content Editor, uncomitted files and changes will not be seen.

To better manage errors, use this plugin together with <sb-error>.

If the server is in frontend mode the tag will not emulate editarea behaviour inside the tag because editareas are not supported on frontends.


Attributes

quiet

If this attribute is set this tag will not generate rxml run errors. This attribute is useful to hide errors like access denied: No write access to workarea from appearing in the debug log.


<sb-add-language/>

Provided by module: CMS: Tags

This tag adds a new language to an already existing file.

To better manage errors, use this plugin together with <sb-error>.


Attributes

language="languagecode"

Add this language to a file.


file="absolute or relative path to a file"

The file that will have a new language. If this attribute is omitted, the new language will be added to the current file.


copy-from-language="languagecode"

Copies the content from the specified language in the file.


<sb-category></sb-category>

Provided by module: CMS: Tags

This tag sets none, one or more categories for a file. The subtag <category> with the required attributes file representing the category tree file and node representing the node id are used to set none, one or more categories.

Note!

File and node values cannot contain the "|" or "!" characters.

Note!

Old categories that were set for the file will be removed. To simply append new categories to the file do the following:
<sb-category file='&file.path;'> <!-- Set the old categories again --> <emit source='category' file='/path-to/category-file.xml' ref='&file.path;'> <category file='/path-to/category-file.xml' node='&_.node;'/> </emit> <!-- Add the new category --> <category file='/path-to/category-file.xml' node='1234567890-0'/> </sb-category>

To better manage errors, use this plugin together with <sb-error>.


Attributes

file="absolute or relative path to a file"

Specify the file to set categories for.


<sb-category file='/file-to/set-category-for.xml'> <category file='category-tree.xml' node='the-node-1'/> <category file='category-tree.xml' node='the-node-2'/> <category file='some-other-category-tree.xml' node='the-node-1'/> <category file='yet-another-category-tree.xml' node='the-node-4'/> </sb-category>

<sb-commit/>

Provided by module: CMS: Tags

This tag commits files within the SiteBuilder version system (CVS).

To better manage errors, use this plugin together with <sb-error>.


Attributes

message="text"

Specify a message for the repository. This message should specify what action has taken place and why it took place.


file="absolute or relative path to a file"

Specify which file to commit. If this attribute is omitted, the current file will be commited.


override

This attribute ignores any conflicts that might occur between this file and the file in the version system.

Note!

The file will be commited over the old one and previous changes to it will be lost.


<sb-copy/>

Provided by module: CMS: Tags

This tag copies files and directories within the SiteBuilder repository.

Note!

Files or directories that only exists in a user's edit area may also be copied. It is strongly advised to specify a message when copying files or directories as they automatically will be commited to the version system. If a message is omitted it is hard to tell the purpose of the action.

To better manage errors, use this plugin together with <sb-error>.


Attributes

from="absolute or relative path to a file or a directory"

Specify where the file's/directory's current location is. If this attribute is omitted, the current file will be used.


to="absolute or relative path to a file or a directory"

Specify where to copy the file or directory.


message="text"

Specify a message for the repository. This message should specify what action has taken place and why it took place.


<sb-delete/>

Provided by module: CMS: Tags

This tag deletes files and directories within the SiteBuilder repository.

To better manage errors, use this plugin together with <sb-error>.


Attributes

path="absolute or relative path to a file or a directory"

Specify the file or directory to be deleted. If a directory, a recursive delete is performed.


message="text"

Specify a message for the repository, only valid for directories. This message should specify what action has taken place and why it took place.


<sb-discard/>

Provided by module: CMS: Tags

This tag discards any uncommited changes to a file. Note: These changes will be lost and cannot be undone.

To better manage errors, use this plugin together with <sb-error>.


Attributes

path="absolute or relative path to a file or a directory"

Specify the file or directory that contains changes that is to be discarded. If a directory, a recursive discard is performed. If this attribute is omitted, the changes in the current file will be discarded.


<sb-download/>

Provided by module: CMS: Tags

Creates a local copy of a file in the viewarea. The copy is stored in the edit area.


Attributes

file="absolute or relative path to a file"

Specify the file that is to have a local copy in the editarea. If this attribute is omitted the current file will get a local copy.


<sb-export/>

Provided by module: CMS: Tags

Export a directory into the SiteBuilder's transport directory.

To better manage errors, use this plugin together with <sb-error>.

NOTE! If this tag is used in an sbjob the attribute file is needed.


Attributes

path

The path in the site to export


name

The name of the export


export-ppoints

Export eventual protection points as well


zip

Create a zip file of the export


overwrite

If an export with the same name already exist on disk, over write the old export


label="string"

Export a specific label


rm

Remove the exported directory when the export is done. This attribute only has effect if a zip file was created.


variable

Put the result of the export in this variable.

([ "time" : int, // Time in seconds the export took "dirs" : array(mapping), // List of exported directories "files" : array(mapping), // List of exported files, "num-files" : int, // Number of files exported "num-dirs" : int, // Number of directories exported "total-size" : int, // Total size in bytes of the export, "path" : string, // The full path of to export "zip-path" : string, // The full path to the zip file, if one was created ])

file="/"

NOTE! This attribute is needed if this tag is used in an sbjob. In this case the value can be set to /.


<sb-import/>

Provided by module: CMS: Tags

Import a transport directory into the SiteBuilder.

To better manage errors, use this plugin together with <sb-error>.

NOTE! If this tag is used in an sbjob the attribute file is needed.


Attributes

<catch> <sb-edit-area> <sb-import import-from='my_import_dir' import-to='/my-new-import/' variable='var.res' /> <ul> <li>Import took &var.res.time; seconds</li> </ul> </sb-edit-area> </catch>
import-from

The name of the directory in the site's transport directory to import. Use <emit sb-transport-dirs> do get a list of available directories


import-to

The path to import to in the site.


delete-old

If the import-to directory exist, delete it before importing


keep-uuids

Keep the UUIDs in the imported files, e.g. the imported files will retain their UUIDs from the site they were exported from


filter-invalids

Remove invalid file names from the import.


label="string"

Label the import and commit it.


commit-message

If label is given this will be the commit message


zone

ID of the zone to import protection points to


create-target

Create the target directory in the site if it's missing.


force-import

Continue with the import even if there are changed files in the directory importing into, e.g. over write existing changes.


rm

Remove the import directory in the transport directory after the import is done


variable

Variable to put the result of the import in. This will contain a mapping.

([ "time" : int // Time the import took in seconds "commit-id" : int // Only available if "label" was given as argument "new-groups" : array(string) // Only availabe if new groups were created in the import ])

file="/"

NOTE! This attribute is needed if this tag is used in an sbjob. In this case the value can be set to /.


<sb-move/>

Provided by module: CMS: Tags

This tag moves and renames files and directories within the SiteBuilder repository.

Note: Files or directories that only exists in a user's edit area may also be moved or renamed. It is strongly advised to specify a message when moving/renaming files or directories as they automatically will be commited to the version system. If a message is omitted it is hard to tell the purpose of the action.

To better manage errors, use this plugin together with <sb-error>.


Attributes

from="absolute or relative path to a file or a directory"

Specify where the file's/directory's current location is. If this attribute is omitted, the current file will be used.


to="absolute or relative path to a file or a directory"

Specify where to move the file or directory. Renaming and moving a file/directory within the SiteBuilder version system is the same procedure. The file/directory will be deleted from the version system and created anew with a different name or in a different place.


message="text"

Specify a message for the repository. This message should specify what action has taken place and why it took place.


<sb-new-dir/>

Provided by module: CMS: Tags

This tag creates new directories within the SiteBuilder repository.

To better manage errors, use this plugin together with <sb-error>.


Attributes

dir="absolute or relative path to a directory"

Specify the new directory and its path.

Note: Insert a '#' (hash) to give the file an automatically created unique name. This will only work if the attribute auto-name-info is given.


message="text"

Specify a message for the version system (CVS). This message should specify what action has taken place and why it took place.


auto-name-info="{variablename, empty}"

This attribute is useful when the directory-creating procedure is to be automated. To automatically create a unique name, a '#' (hash) has to be inserted somewhere in the filename. The '#' will be substituted with the user's unique idnumber and a counter. Each time a new directory is created, the counter will increase the number which creates unique and easily sorted files. Note: Remember to insert a '#' when specifying the filename in the dir attribute, or else the directory will not be given a unique name.

To make further work with the directory easier, it is possible to specify a variable that will contain the new directory's filename. Remember to use the correct syntax when creating the variable, e.g. 'var.dirname'.

Note!

If the variablename is omitted, the directory will be given a unique name, but the name won't be stored inside a variable.

<sb-new-dir dir="userdir_#" auto-name-info="var.dirname" />

The example will create a directory where the "#" will be expanded to the user's unique identity number and a number from a counter separated by an "_" (underscore). This ensures that the name will be unique. The new directory name, e.g. userdir_25_2 will be put into the variable var.dirname which can be reached through &var.dirname;.


<sb-new-file/>

Provided by module: CMS: Tags

This tag creates new files within the SiteBuilder repository.

To better manage errors, use this plugin together with <sb-error>.


Attributes

file="absolute or relative path to a file"

Specify a name for the new file.

Note: Insert a '#' (hash) to give the file an automatically created unique name. This will only work if the attribute auto-name-info is given.


stationery="path and filename"

The new file will be based on an existing template.


auto-name-info="{variablename, empty}"

This attribute is useful when the file-creating procedure is to be automated. To automatically create a unique name, a '#' (hash) has to be inserted somewhere in the filename. The '#' will be substituted with the user's unique idnumber and a counter. Each time a new file is created, the counter will increase the number which creates unique and easily sorted files. Note: Remember to insert a '#' when specifying the filename in the file attribute, or else the file will not be given a unique name.

To make further work with the file easier, it is possible to specify a variable that will contain the new file's filename. Remember to use the correct syntax when creating the variable, e.g. 'var.filename'.

Note!

If the variablename is omitted, the file will be given a unique name, but the name won't be stored inside a variable.

<sb-new-file file="articles/article_#.xml.html" auto-name-info="var.filename" />

The example will create a file where the "#" will be expanded to the user's unique identity number and a number from a counter separated by an "_" (underscore). This ensures that the file will be unique. The new filename, e.g. article_25_2.xml will be put into the variable var.filename which can be reached through &var.filename;.


mkdirhier

If the directories in the path to the file do not exist, they will be created.

Note, the auto-name-info can be used in the directory name as well as for the filename:

<sb-new-file file="/non-existing-dir/another-dir_#/index.xml.html" auto-name-info="var.created-path" mkdirhier="1" />

See explanation for auto-name-info. The variable var.created-path will e.g. contain the path "/non-existing-dir/another-dir_25_3/index.xml.html"


message="text"

Commit message for directories created through the use of mkdirhier.


content-type

Specify the new file's content-type.


content-type-from="filename"

The content type will be fetched from the given file's content type.

<sb-new-file file='new.img' content-type-from='picture.jpg' />

The example will create a file named new.img with the content type image/jpeg.


<sb-purge/>

Provided by module: CMS: Tags

This tag deletes files and directories within the SiteBuilder repository permanently, as well as there version history. Note! Using this tag is dangerous because actions can not be undone.

To better manage errors, use this plugin together with <sb-error>.


Attributes

path="absolute or relative path to a file or a directory"

Specify the file or directory to be purged. If a directory, a recursive purge is performed. It is not possible to purge the root ('/').


<sb-remove-language/>

Provided by module: CMS: Tags

This tag removes a language from a file.

To better manage errors, use this plugin together with <sb-error>.


Attributes

language="languagecode"

Remove this language from a file.


file="absolute or relative path to a file"

The file the language is to be removed from. If this attribute is ommited, the language will be removed from the current file.


<sb-repair-xml/>

Provided by module: CMS: Tags

Makes files XML-compliant by repairing broken tags.

To better manage errors, use this plugin together with <sb-error>.


Attributes

file="absolute or relative path to a file"

Repair this file. If this attribute is omitted, the current file will be repaired.


language="languagecode"

Repair this language in the file.


<sb-revert/>

Provided by module: CMS: Tags

This tag retrieves the previous version of a file and the discards the present version.

To better manage errors, use this plugin together with <sb-error>.


Attributes

revision="string"

Specify the revision to revert to.


file="absolute or relative path to a file"

Specify the file. If this attribute is omitted, the current file will be reverted to an earlier revision.


<sb-set-content></sb-set-content>

Provided by module: CMS: Tags

The contents inside the container will be written to a specified file within the SiteBuilder repository. The contents will automatically be HTML-decoded. This will transform &lt;, &gt; and &amp; to <, > and &. This makes it possible to write RXML expression inside the container, which will be evaluated before the contents are written to the file.

To better manage errors, use this plugin together with <sb-error>.


Attributes

operation="{replace, insert, append}"

Specify the type of edit operation to perform.

  • replace Replace with the content (default).

  • insert Insert the content before the existing.

  • append Append the content after the existing.


xpath="xpath expression"

Specify what XML nodes in the original file to edit.

Note that the presence of this attribute forces the tag into XML-mode.

Note that only a very limited subset of XPath is currently available.


file="absolute or relative path to a file"

Specify the file in which to add content. If this attribute is omitted, the content will be added to the current file.

<sb-set-content file="&var.filename;"> <article&gt; <intro&gt;<wash-html>&form.intro;</wash-html></intro&gt; <if not="" variable="form.link is "> <link href="&form.link;" /&gt;</if> <body&gt;<wash-html>&form.body:none;</wash-html></body&gt; <username&gt;&user.fullname;</username&gt; <date&gt;<date type="iso" date="" /></date&gt; </article&gt; </sb-set-content>

This example will add the content inside the <sb-set-content> containers to the file in the variable var.filename. However, before adding the content to the file, the information in the variables form.intro and form.body will be turned into HTML. See <wash-html> for more detailed information about its use.


language="languagecode"

Specify which language to use.


content-variable="variablename"

The content of the variable will be written to the file. Remember to use the correct syntax when creating the variable, e.g. 'var.variable'.


<sb-set-external-visibility/>

Provided by module: CMS: Tags

This tag sets the external visibility for a file within SiteBuilder.

To better manage errors, use this plugin together with <sb-error>.


Attributes

file="absolute or relative path to a file"

Specify the file in which to set the external visibility. If this attribute is omitted, the external visibility will be set in the current file.

<sb-edit-area> <sb-set-external-visibility file="article_3.xml.html" from="2001-10-01T03:00" to="2001-11-01T03:00"/> </sb-edit-area>

from="{ISO date and time, 'now', 'never'}"

Specify the time when the file should start to be visible. The format is [YYYY]-[MM]-[DD]T[HH]:[MM]. If the time part is omitted it will default to 00:00.


to="{ISO date and time, 'never', 'infinity'}"

Specify the time when the file should end to be visible. The format is [YYYY]-[MM]-[DD]T[HH]:[MM]. If the time part is omitted it will default to 00:00.


Always visible
<sb-edit-area> <sb-set-external-visibility from="now" to="infinity"/> </sb-edit-area>

Never visible
<sb-edit-area> <sb-set-external-visibility from="never" to="never"/> </sb-edit-area>

Visible until a specified time
<sb-edit-area> <sb-set-external-visibility from="now" to="2001-11-01T03:00"/> </sb-edit-area>

Visible after a specified time
<sb-edit-area> <sb-set-external-visibility from="2001-10-01T03:00" to="infinity"/> </sb-edit-area>

Visible during a specified time interval
<sb-edit-area> <sb-set-external-visibility from="2001-10-01T03:00" to="2001-11-01T03:00"/> </sb-edit-area>

<sb-set-metadata></sb-set-metadata>

Provided by module: CMS: Tags

This tag sets the metadata neccessary for a file within the SiteBuilder repository.

To better manage errors, use this plugin together with <sb-error>.


Attributes

name="See table below"
NameValueExample inputDocumentation

http-content-type

List available content types in SiteBuilder by clicking on the Configuration and click on the "File types" button.

"image/png"

This is the type of the file.

convert-content-type

"content-type"

"image/jpg"

Provides automatic type conversion of file contents. For imagefiles only. Convert to one of these content-types: "image/jpeg", "image/jpg" and "image/vnd.wap.wbmp".

template

Available templates in SiteBuilder can be found by clicking on the "Edit metadata" button in the Content Editor. A selectbox will show all available templates.

"common.xsl"

This is the template used on this page.

title

String

"Documentation "

This is the title of the page. Make sure that it accurately describes it.

keywords

keyword1[,keyword2,...]

"webserver,documentation,PDF"

Comma separated list of document keywords. These are primarily used when search-engines are indexing the site.

description

Text

"Documentation for Roxen WebServer."

Document description. This is primarily used when search-engines are indexing the site.

multilang-status

In progress: "" (empty string)

"done"

The document's language translation status.

original-language

Languagecode

"de"

The document's original language, i.e. default language.

author-id

User's unique id-number.

"5"

Document author.


file="absolute or relative path to a file"

Specify the file in which to set the metadata. If this attribute is omitted, the metadata will be set in the current file.


variable="variablename"

Set the metadata to the value of this variable. Remember to use the correct syntax when specifying the variable, e.g. 'var.title'. If this attribute is omitted, the tags content will be used as metadata value.


language="languagecode"

Specify in which language to set the metadata.

<sb-set-metadata file="&var.filename;" name="title"> &form.title;</sb-set-metadata> <sb-set-metadata file="&var.filename;" name="template"> article.xsl</sb-set-metadata>

The filename is stored in the entity &var.filename; which is defined within the <sb-edit-area> subtag <sb-new-file>.