Making changes to the SOA model and API - easysoa/EasySOA GitHub Wiki
Making changes to the SOA model and API
This page lists the different steps that might be needed when making changes to the model and the Discovery API.
General information
Model configuration
The EasySOA model extends the base Nuxeo model, whose configuration is in the contribution [CoreExtensions.xml] (http://explorer.nuxeo.org/nuxeo/site/distribution/current/viewComponent/org.nuxeo.ecm.core.CoreExtensions).
The current EasySOA model (still alpha) is configured & available in [easysoa-registry-core] (https://github.com/easysoa/EasySOA-Incubation/tree/master/easysoa-registry-v1/easysoa-registry-doctypes-core) at :
- property types : all schemas in [schemas] (https://github.com/easysoa/EasySOA-Incubation/tree/master/easysoa-registry-v1/easysoa-registry-doctypes-core/src/main/resources/schemas)
- document types : in [OSGI-INF/core-type-contrib.xml] (https://github.com/easysoa/EasySOA-Incubation/blob/master/easysoa-registry-v1/easysoa-registry-doctypes-core/src/main/resources/OSGI-INF/core-type-contrib.xml)
- document layout : in [OSGI-INF/ecm-type-contrib.xml] (https://github.com/easysoa/EasySOA-Incubation/blob/master/easysoa-registry-v1/easysoa-registry-doctypes-core/src/main/resources/OSGI-INF/ecm-type-contrib.xml)
Extending the model
The model can be further extended by providing Nuxeo bundles defining new data schemas and model contributions, as shown in the Nuxeo Book Model Tutorial.
Case 1: Adding/changing a property from a document type
Registry core
- Edit the XSD schemas accordingly.
Registry layout
- Update the widgets and layouts.
- Widget creation
- Use in a specific layout
- Update the localization files to add the needed properties.
Discovery API
- Update the doctypes Java classes to match the updated schema.
- Property constants
getPropertyList()
method
Case 2: Adding a new document type
Registry core
- Create one or several XSD schemas.
- Create the document definition (
core-type-contrib.xml
).
Registry layout
- Define the document widgets (one per property) & layouts (
layout-(doctype)-contrib.xml
).- Don't forget to update the
META-INF/MANIFEST.MF
.
- Don't forget to update the
- Set where the document can be created and how layouts are displayed (
ecm-type-contrib.xml
). - Update the localization files.
- Update (if required) the web templates (will at least include
incl/tabs/easysoa_content_view.xhtml
andincl/tabs/easysoa_document_view.xhtml
).
Discovery API
To be updated for EasySOA Reghistry V1
- Create a class in
easysoa-common
, packageorg.easysoa.doctypes
to describe the document in Java. - Complete the DocumentService (to implement creation and finding helpers) and the DiscoveryService (to allow for discovery notifications).
- Create the REST entry point in DiscoveryRest.
- Update the API by editing the RestNotificationFactory.