Reference URL Scheme

Last modified by Vincent Massol on 2024/02/26 17:56

 XWiki
 Feature
 Dormant
 

Description

Rationale of this new scheme: 

  • Be able to have more meaningful and shorter URLs
  • Consistency with entity references in wiki syntax
  • Be able to copy paste from URL to content

General

General format: http://<server>/<context>/<subsystem>/<depends on the subsystem>

Subsystem: entity

Format: http://<server>/<context>/entity/<action>/<entity reference type>/<entity reference>

Examples when context is ROOT:

  • http://localhost:8080/entity/view/page/wiki:space.page
  • http://localhost:8080/entity/export/attach/wiki:[email protected]
  • http://localhost:8080/entity/export/attach/wiki:[email protected]?format=xar|pdf|html

Shortcuts

For Entity subsystem:

  • If entity type = page then the entity type can be omitted. Example: http://localhost:8080/entity/view/wiki:space.page. This can be achieved by looking at the number of path segments after the action part. If more than 1 then first segment is the type.
  • If action = view then the action can be omitted. Example: http://localhost:8080/entity/wiki:space.page. This can be achieved by checking the number of path segments after the subsystem part. If 1 segment then action = view. If 2 segments then we just need to look at the segment name and this means not allowing actions to be named after entity types, otherwise need to use the full syntax.
  • Each action has a default entity type. For action = view the default is page. For action = export the default is attach. This allows to have a short URL for the main use cases for exports which is exporting an attachment (aka downloading an attachment); Example: http://localhost:8080/export/wiki:[email protected].

General:

  • If subsystem = entity then the subsystem type can be omitted. Example: http://localhost:8080/wiki:space.page. This means that actions cannot be named after subsystems and that reference types cannot be named after actions (or vice-versa). Otherwise need to use the longer and more explicit syntax. Note that since we want static resources to be handled by the servlet container directly without incurring the penalty cost of going through a Filter/Servlet we will need to add an explicit mapping for skins/resources in this case (see Short URLs)

Subsystem: rest

TODO

Subsystem: skins

TODO

Subsystem: resources

TODO


 


Get Connected