What is a Resource Type

One could describe a resource as the atom of Yanel. Resources are responsible for processing requests and generating responses. Examples are

  • Node/File resource which helps to retrieve static content, for example images or PDF documents.
  • XML resource which helps to generate XHTML or generic XML pages by applying various XSLTs to some original XML
  • Calendar resource which helps to read/write calendars based on the ICS format (for example with Sunbird as a client)

The Yanel distribution (source and binary) contains many more examples, which can be reused or customized.

For complete customization, one can also create a resource from scratch very easily, whereas a resource from scratch doesn't do much in the first place. In order to actually get life into a from scratch resource one can implement various interfaces. In most cases one wants to implement the four basic functions called CRUD (Create, Read, Update and Delete).

A resource can also be used by another resource. For example the generic "user registration" resource can be extended by a custom user registration resource. In order to do so one makes the generic resource available by adding a pom file to this resource (e.g. YANEL_HOME/src/resources/registration/src/build/pom.xml) and by adding its dependency to the custom resource which is extending the generic resource (e.g. MY_REALM/resources/custom-registration/src/build/dependencies.xml). Please make sure to re-build Yanel in order to update the local maven repository based on the added pom file.

Your comments are much appreciated

Is the content of this page unclear or you think it could be improved? Please add a comment and we will try to improve it accordingly.