Feature Wiki
Tabs
URLs without cmd nodes
Page Overview
[Hide]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 | |
2 Additional Information
- Idea / concept: Colin Kiegel
- Interest in funding:
- Colin Kiegel: possibly not neccessary :-)
- Amstutz, Timon [amstutz]: If necessary, University of Berne
- 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]