xwikisas / application-urlshortener

Create shortened URLs for XWiki pages.
GNU Lesser General Public License v2.1
0 stars 0 forks source link

Make the generated URLs shorter #12

Open oanalavinia opened 3 weeks ago

oanalavinia commented 3 weeks ago

Right now the generated URLs are of the following form http://localhost:8080/xwiki/rest/p/{pageID}. The idea of this issue is to remove the rest part, making the URLs as http://localhost:8080/xwiki/p/{pageID}.

Then all new links (links copied using the Get shortened URL button) will be of this form. Note that any link copied previously to this implementation will continue to work as expected, to not break backwards compatibility.

This needs to be done by using https://extensions.xwiki.org/xwiki/bin/view/Extension/Resource%20API#HAddinganewResourceTypeHandler

vmassol commented 3 weeks ago

Note that it's not just about making it shorter, it's also about making it more logical. Using a REST action for something that doesn't produce REST is weird and incorrect (REST is for machines and a REST endpoint is not supposed to produce rendered HTML for humans).

vmassol commented 3 weeks ago

BTW what does p stand for? :)

oanalavinia commented 3 weeks ago

p stands for page :)