Skip to content
This repository has been archived by the owner on Feb 22, 2019. It is now read-only.
Pavel Vlasov edited this page Sep 15, 2014 · 3 revisions

Routes, converters, and object path resolvers for exposing CDO repository content over HTTP.

Routes

CDOViewRoute & CDOTransactionRoute

Object routes which matches CDOView and CDOTransaction respectively. GET renders shallow view content as json by default or with .json extension. .html extension renders a single page application which allows to explore view content.

Sub-routes:

  • elements - view elements such as resource folders and resources.
  • packages - lists registered packages and allows to navigate to package routes.

CDOResourceFolderRoute

Renders folder content and dispatches requests to folder elements.

CDOResourceRoute

Renders resource content and dispatches requests to resource elements by index if path element parses to integer, or by CDO id otherwise. For example /router/nasdanika/elements/bank/L3.html and /router/nasdanika/elements/bank/0.html resolve to the same object, in the first case by CDOID L4, in the second by its position 0 in bank resource.

EObjectRoute

Renders EObject, loads class resources or classloader resources or delegates to features, operations.

Subroutes of EObject are described below.

self

Routes to self, similar to this in Java.

feature

Routes to EObject feature. For example router/nasdanika/elements/bank/L3/feature/products/1.html routes to feature products, which is a many reference and then routes to the second element (with index 1) in the products collection.

operation

Invokes EObject operation and then routes to its result. Converts string path elements to operation parameter types. For example, let's assume that EObject with CDOID L4 has an operation doSomething with two parameters of type int and String returning another EObject. In this case request with path

  • router/nasdanika/elements/bank/L3/operation/doSomething/33/Hello/self.html will result in invoking operation doSomething with arguments 33 and Hello and rendering return value as HTML.
  • router/nasdanika/elements/bank/L3/operation/doSomething/33/Hello/feature/someFeature/0.html will result in invoking operation doSomething with arguments 33 and Hello, retrieving many feature someFeature of the return value and rendering its first element as HTML.

resource

Loads resource from classloader resolving it relative to object's class or one of its superclasses and implemented interfaces. For example, assuming object L3 is of type com.mycompany.myapp.MyClass, router/nasdanika/elements/bank/L3/resource/myscript.js will retrieve com/mycompany/myapp/MyClass$myscript.js.

code

Loads classloader resource. For example router/nasdanika/elements/bank/L3/code/java/lang/String.class. This sub-route can be used by application's JNLP clients or applets.

Clone this wiki locally