Eliminate unnecessary repetition of host name
Status: Beta
Brought to you by:
worden
It would be easier to work with and in Working wiki if Project descriptions (and underlying project directories) did not contain the host name. This is a particular problem when copying or moving wikis from host to host (even when it's done temporarily for maintenance reasons).
Anonymous
The long names are difficult in project descriptions, and when it's necessary to fish around in project directories. They reduce flexibility. There does not seem to be any advantage; as long as we assume that WW knows the hostname when running, it can plug it in with simple checks while running.
Yes, it would probably be better to
(a) support relative URIs in some way (need to sort out how exactly this would work)
(b) nest the project directories into paths like /var/cache/project-engine/persistent/pe-ww/lalashan.mcmaster.ca/theobio/projects/DemoProject rather than putting the entire URI in a single directory name.
Format for relative URIs??
A typical URI for a WW project is pe-ww:http://lalashan.mcmaster.ca/theobio/projects:Demos/X. It has three parts, separated by colons: the URI scheme (pe-ww), the base URL of the wiki housing the project, and finally the project name. The wiki URL typically contains another colon, so the separation into three parts is done by finding the first and last colon. If the project name contains colons, they need to be URL escaped so that this will work.
So we can easily define relative URIs within a single wiki - for instance, '../Y' ought to refer to pe-ww:http://lalashan.mcmaster.ca/theobio/projects:Demos/Y. It's less obvious how to make a relative reference to a different wiki, but I guess it's doable - for instance '../central:CentralProject' for a project on http://lalashan.mcmaster.ca/theobio/central. A relative URI built on a relative URL needs to contain an absolute project name, I think.
Relative URIs in the other schemes - pe-svn, pe-git, etc. - can be defined correspondingly (and more simply, probably).
In terms of implementation, I would just need to resolve any relative URI to an absolute one before using it, probably on the WW side before passing full URIs to PE.
The original request is for the cache directories as well as the prerequisite-project data to not contain the hostname at all. My proposal here doesn't satisfy that, though it does make it much simpler to rename the directories when migrating to a different server.
Eliminating them would probably require PE to be conceptually associated with a 'home URI base' such as http://lalashan.mcmaster.ca, and resolving URIs that have that base to a shorter, relative form, so they would be stored in something like /var/cache/project-engine/persistent/local/theobio/projects/ or such. This is not out of the question, but I would want it to be optional, so we could retain the possibility of a PE server that is used by multiple clients without having one as a 'home base'.
Another implementation note: if I change the URI -> cache directory mapping, I need to make PE smart about remembering the old mapping and silently migrating the cached files from the old location to the new one.
I've created a page on URIs, including a proposal for relative ones: http://lalashan.mcmaster.ca/theobio/projects/index.php/ProjectEngine/URIs
This tracker item deals with two conceptually different, though closely connected, issues: repetition of hostnames in project descriptions (in the URIs of prerequisites and postrequisites - anywhere else?), and repetition of hostnames in directory names in the ProjectEngine file cache.
There is a separate item for restructuring the file cache, where that issue is being dealt with:
cache structure alienating
https://sourceforge.net/tracker/?func=detail&aid=3300708&group_id=366300&atid=1527385
So let's confine discussion of the cache structure to that page, and keep discussion of URIs here and on the URIs wiki page.
Ticket moved from /p/workingwiki/feature-requests/45/