XBEL file of links generated from Akara content
RSS feed

Style

(Cookies required)
Powered by 4Suite

An alias is a special type of resource that is a stand-in for another. It is similar to a soft link in UNIX, though there are some important differences, so be careful with this analogy.

If I have a resource, say an XML file /stuff/spam.xml, then I can define a alias

/home/uche/spam.xml

attached to that resource. Then whenever /home/uche/spam.xml is accessed, retrieved, etc., the system actually traverses the alias to the real resoruce at /stuff/spam.xml.

One common gotcha with aliases is that the system traverses them for all operations, by default. If you wanted to delete the alias /home/uche/spam.xml while keeping the actual resource intact at /stuff/spam.xml, you might be tempted to run the command line:

4ss delete resource /home/uche/spam.xml

This would, however, delete the actual resource instead of the alias instance. To erase the latter, you need to tell the systm not to traverse to the real resource:

4ss delete resource --no-traverse /alias/path

This is a matter of some controversy. As Mike Brown says in this message, echoing my sentiments in the thread,

"I think it is too dangerous. Every other system that people are likely to be using will treat aliases transparently except when deleting. If repo aliases aren't the same, I think it will continue to be a source of frustration. I can say I would've been bitten by it."

But some prefer it the way it is now. The important matter is to be aware of this potential gotcha.

You can also tell the server whether r not to traverse aliaes using a special RL path parameter ";no-traverse". For example, you could safely delete the alias, not the actual resource by using:

4ss delete resource /home/uche/spam.xml;no-traverse

This is also useful when manipulating the repository from the XSLT API.

For more notes and gotchas with aliases, see


Comments