Feature Wiki

Information about planned and released features

Tabs

URLs without cmd nodes

1 Requirements

Most URLs in ILIAS include a cmd_node-parameter, but I think the basic concept of cmd_nodes is kind of *broken*. As I understand this matter, they were introduced to have short URLs, which look nicer than long URLs. However the problem with these shortened URLs is that they are (a) unstable and (b) different across installations - even for identical ILIAS versions. It is better to have long but stable URLs than short but unstable URLs.

About (a): With each (minor) update there is a chance that all cmd_nodes change and most URLs are invalidated. This makes all previous URLs useless - at once. In reality this happens very often and can be quite a pain for users who did not know about this. It is not uncommon to copy the URLs from the browser address bar and paste them somewhere else. This works _until_ the control structure of the platform has to be updated due to an update. As already mentioned - this can be quite a pain. And it even has some irony - because cmd_nodes are supposed to bring us shortened URLs. But why would I need short URLs if I can not share them (safely)?

About (b): Another big pain is, that URLs can not be transparently shared across installations. It would be nice to just take the relative part of an ILIAS-URL and use it with another ILIAS installation (with compatible version of course). This would enable sharing of automated tests (jmeter/selenium/etc.).
Both are big pain points.

I suggest to abandon cmd_nodes and expand URLs (even if they will be much longer). If someone wants to have a short URL, there is a concept: goto-links.

1.1 Proof of Concept

Working proof of concept (quick and dirty by Michael Jansen). The change would be minimally invasive - 5 lines of code to be changed (10.10.2014)

Index: Services/UICore/classes/class.ilCtrl.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- Services/UICore/classes/class.ilCtrl.php (revision 54162)
+++ Services/UICore/classes/class.ilCtrl.php (revision )
@@ -801,6 +801,7 @@
//echo " - Next Node: ".$path[1];
$this->readCidInfo($this->getCurrentCidOfNode($path[1]));
//echo ":".$this->cid_class[$this->getCurrentCidOfNode($path[1])].":".$this->getCurrentCidOfNode($path[1]).":";
+ return $this->getCurrentCidOfNode($path[1]);
return $this->cid_class[$this->getCurrentCidOfNode($path[1])];
}
}
@@ -862,7 +863,7 @@
//if ($this->getCmdClass() == "ilmailfoldergui") echo "-".$a_source_node."-".$a_target_node."-";
//echo "-".$a_source_node."-".$a_target_node."-";
//echo "<br>:::$a_source_node:::";
- if ($a_source_node == "1")
+ if ($a_source_node == "1") // @todo: WTF
{
$a_source_node = "";
}
@@ -1650,6 +1651,7 @@
*/
private function getCidForClass($a_class, $a_check = false)
{
+ return $a_class;
if ($this->class_cid[$a_class] == "")
{
$this->readClassInfo($a_class);
@@ -1677,6 +1679,7 @@
*/
private function getClassForCid($a_cid)
{
+ return $a_cid;
if ($this->cid_class[$a_cid] == "")
{
$this->readCidInfo($a_cid);
@@ -1703,6 +1706,7 @@
return;
}

+ return $a_cid;
$cached_ctrl = ilCachedCtrl::getInstance();
$rec = $cached_ctrl->lookupCid($a_cid);

Index: Modules/Test/classes/class.ilTestExpressPage.php
IDEA additional info:
Subsystem: com.intellij.openapi.diff.impl.patch.CharsetEP
<+>UTF-8
===================================================================
--- Modules/Test/classes/class.ilTestExpressPage.php (revision 54162)
+++ Modules/Test/classes/class.ilTestExpressPage.php (revision )
@@ -5,6 +5,7 @@

public static function getNodeId($cls) {
global $ilDB;
+ return $cls;
$query = 'SELECT cid FROM ctrl_classfile WHERE class = %s';
$types = array('text');
$values = array($cls);
\ No newline at end of file

2 Additional Information

  • Idea / concept: Colin Kiegel
  • Interest in funding:
  • Maintainer: (will be set by Jour Fixe / maintainer)
  • Implementation of the feature is done by (will be set by Jour Fixe / maintainer)
  • Testcases by: (please add your name if you want to create the testcases for this feature)

3 Discussion

Matthias Kunkel, March 31, 2015: I do not understand this request at all. What exactly is meant with long and shortened URLs in the browser's address bar? IMHO they are all "long URLs" - and none of them is made for sharing. For this purpose we have the permalink - presented at the bottom of the page. Only this URL should be used to direct another user to the selected page in ILIAS. And these URLs are stable anyway. But maybe Colin can give a good example for his request.

Alex Killing, 1 Apr 2015: The ilCtrl router needs the path of GUI classes involved in a request - this information is represented in the cmdNode parameter. Personally I would not like to see the real class names in the path. But I also would like to have these IDs being stable against updates. And we should replace the ":" as a separator, since this separates the port information in URLs. It should be possible to find a short and stable representation of the path information.

Amstutz, Timon [amstutz], 9. November 2015: We (University of Berne) are as well very interested in stable URL's. I can not offer a clear concept of how this could be achieved, but I am sure there should be mulitple possibilties.

@Alex: "It should be possible to find a short and stable representation of the path information." Would this be a huge effort?

@Matthias: I do not think, that permalinks are a good replacement for stable URL's. They are nice to have, since they are much prettier than long URL's, nevertheless several problems arise by unstable URL's:

  • Users very often copy URL's to Mail or link them on other webpages. Those link will become invalid at least once a year (udpate). This is probably the most frequent issue of users contacting our helpdesk. Sure we try to teach our users to use the permalinks but this seems to be a battle we can not win.
  • For tools/scripts such as JMeter it would be much more comftable to have static URL's.
  • cmdNodes are hard to read if anything goes wrong and we receive a ticket of users. This is only a minor issue though.

Killing, Alexander [alex], 9 Nov 2015: Currently the ilCtrl structure reader scans all directories for GUI classes and assigns numbers to them. This is done every time "from scratch" (starting with the deletion of all number-class assignments).

A more stable numbering could be achieved, if the procedure would be more like an update that a delete-insert procedure. Means all classes that are in
the assignment table stay there and keep their number, if they still exist with the next scan.

However this would adress requirement (a) of Colin. If this should be really consistent over installations (requirement (b)), the current scanning mechanism is to error prone in my opinion. A consistent and stable version that does not come with the class names itself in the URL (which is not only a problem due to length, but also, if things are re-factored/renamed), could be achied by a numbering scheme and IDs e.g. written in the comments of the GUI classes. This could result in "cmdNode=pd-usr_set" instead of "cmdNode=33:81".

A completely different routing would be possible too but cost even more effort.

Amstutz, Timon [amstutz],11 Nov 2015: @Alex: Thanks for your remarks and insight.

"A more stable numbering could be achieved, if the procedure would be more like an update that a delete-insert procedure. Means all classes that are in
the assignment table stay there and keep their number, if they still exist with the next scan.

However this would adress requirement (a) of Colin." 

This would already solve our two main issues. The third is only a minor one.

"However this would adress requirement (a) of Colin. If this should be really consistent over installations (requirement (b)), the current scanning mechanism is to error prone in my opinion. A consistent and stable version that does not come with the class names itself in the URL (which is not only a problem due to length, but also, if things are re-factored/renamed), could be achied by a numbering scheme and IDs e.g. written in the comments of the GUI classes. This could result in "cmdNode=pd-usr_set" instead of "cmdNode=33:81".

What if such comments change? What can we do to prevent colliding comments? Is this really better than class names? I agree that taking classnames is bad though due to the real possibility of changing names. A few options that come to my mind (probably some points are complete rubish) to approach this problem:

  • ILIAS could try to find the class, if not the command is forwarded to some "Bucket-Class" which takes care of orphaned links and tries to locate the new class if possible. This would mean we would have to keep some kind of history of changing classnames somewhere.
  • We could just output a nice "Not Found" page indicating, that the link might have become invalid in the last update and propose some alternatives.
  • We create a fixed mapping of classname to int in the DB update (will still be hard to read though)
  • We use comments as you suggested
  • ...

4 Implementation

...

Last edited: 11. Nov 2015, 19:46, Amstutz, Timon [amstutz]