-
Notifications
You must be signed in to change notification settings - Fork 4
cdo
Routes, converters, and object path resolvers for exposing CDO repository content over HTTP.
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.
Renders folder content and dispatches requests to folder elements.
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.
Renders EObject, loads class resources or classloader resources or delegates to features, operations.
Subroutes of EObject are described below.
Routes to self, similar to this
in Java.
Routes to object returned by eContainer()
method.
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.
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 operationdoSomething
with arguments33
andHello
and rendering return value as HTML. -
router/nasdanika/elements/bank/L3/operation/doSomething/33/Hello/feature/someFeature/0.html
will result in invoking operationdoSomething
with arguments33
andHello
, retrieving many featuresomeFeature
of the return value and rendering its first element as HTML.
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
.
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.