RoxenCMS 5.4FAQMain

   

Database
Developer
Editor
Maintenance
Java
Performance
Managing multiple sites in one SiteBuilder
Security
Upgrading

Developer

Questions:


How do I compare if a date is older than 7 days in RXML?

Convert the date to seconds, add 7 days and compare with the current time. This solution is not accurate regarding turn of the day but is usualy sufficient.
<set variable="var.today"><date type="unix"/></set> <set variable="var.mod_date" ><date days="7" iso-time="&page.modification-date;" type="unix"/></set> <if expr="&var.mod_date; < &var.today;"> Older than 7 days! </if>

How to extract the last 7 characters from a string in RXML?

Calculate the number of characters to remove from the string and extract the other part with the string processing tag >sscanf< available in the "Additional RXML tags" module. Note, this module is not loaded by default and has to be loaded manualy.
<set variable="var.string">rapp12002kv4</set> <set variable="var.len"><strlen>&var.string;</strlen></set> <set variable="var.strip" expr="&var.len; - 7"/> <sscanf variables="var.left" format="%&var.strip;*s%s">&var.string;</sscanf> The new string: &var.left;

How do I make Forums from Instant usable from CMS?

Set up one Instant site and one CMS site and use "HTTP Relay module" to relay the request.

  • Install a CMS site on port 80 (for example).

  • Install an Instant site on another port (like port 81).

  • Configure Instant to use frames. (default behaviour)

  • Add the module 'Proxies: HTTP Relay module' to CMS, and use for example 'LOCATION /forums/ CALL http://localhost:81/JiveServlet' as 'Relay patterns'.

  • Now its possible to use links like <a href="/forums/?view=10&forumID=1">Forum 1</a> and <a href="/forums/?view=10&forumID=2">Forum 2</a> from the CMS site.

  • Using Instant's default templates a <a href="/JiveServlet">Home</a> link will be written. You probably don't want that so you'll have to edit modules/intrawise/intrawise/conf/master/looks/JiveServlet.looks from 'breadCrumbHome.active=<a href="{1}">{0}</a>' to for example 'breadCrumbHome.active=<a href="javascript:window.close();">Close</a>'.

    Or you can edit <instant site>.iw/default/settings/Common.settings from 'jive.servlet.url=/JiveServlet' to for example 'jive.servlet.url=/'.

  • Restart Roxen or reload the module 'CMS Instant: Main module' in Instant if you did some changes to Instant.

When we're using the sb-edit-area tags within Roxen 2.2, what encoding are XML files saved with and can we force a particular encoding when creating/saving a file?

The encoding of XML files in sitebuilder is default the one specified by the file language, usually ISO-8859-1, and can be specified by the XML declaration at the top of the file. When a file is saved Roxen encodes the internal representation of the string to the encoding specified in the declaration. The XML declaration is also used to decode the file when it is read.

Note that it is not permitted to have whitespaces before the XML-declaration. The tag <?xml version="1.0" encoding="utf-8"?> has to be in the absolute beginning of the file.

By the way, you might need to use the <roxen-automatic-charset-variable/> inside the <form> tag to make sure roxen decodes the request variables correctly.