How to Make AIM Work on Secure Areas.

Release 1.0 - ...

By default, the AIM publication engine suppresses authentication in order to collect references in secure pages. This means that the (anonymous) guest account is used to while rendering pages in AIM mode (using the se:references macro as defined in the AIM rendertemplate). Your site however might contain references which are not shown when no user is logged on. For example, your xlinks macro could show links depending on the user's access:

Smartsite SXML CopyCode image Copy Code
<se:xlinks minimumbrowselevel="100"/>
or you could have code only accessible when the user has a certain access level:
Smartsite SXML CopyCode image Copy Code
<se:region access="forumadmin">
    ... code ...
</se:region>
.. or you could test for logged on users:
Smartsite SXML CopyCode image Copy Code
 <se:if expression="!user.isanonymous()">
    ... code ...
 </se:if>
In all these cases, the AIM scan would fail to retrieve any relations not available to the guest account. Luckily, there is an easy solution: just wrap all code in an impersonate macro:
Smartsite SXML CopyCode image Copy Code
<se:aim xmlns:se="http://smartsite.nl/namespaces/sxml/1.0">
 <se:impersonate username="aimuser" password="[my aim user password]">
  {session.enable(false)}
  <se:references channel="DEF" error="{html.tag(error, this.error())}"/>
  <se:aimscan/>
 </se:impersonate>
</se:aim>
This way, you can configure an aimuser account to have all the access rights needed to do the AIM scanning.