Skip to content
JGuillemotte edited this page Nov 18, 2011 · 17 revisions

Sources location

The source code for SCA import is distributed in several Maven projects :

  • easysoa-registry-api-frascati : Contains classes with no Nuxeo dependencies. This project contains an API which can be used to import SCA with the FraSCAti parser using a REST API to register discovered services in an EasySOA embeded Nuxeo engine or with an external Nuxeo engine.
  • easysoa-registry-core : Contains an XML SCA importer. This importer parse directly the composite file and use the Nuxeo core API to register the discovered stuff. This importer works only with an embeded Nuxeo engine.
  • easysoa-registry-frascati : Contains a FraSCAti SCA importer which use the Nuxeo core API. This importer works only with an EasySOA embeded Nuxeo engine.
  • easysoa-registry-web : Contains the XHTML file to display a import form in Nuxeo.

Current features

Parses any .composite (The composite can be included in a JAR or a ZIP file) file to import services to the model. For now, it recognizes:

  • <binding.ws> tags (WS bindings)
  • <binding.rest> tags (REST bindings)

Limitations: For now, the import is quite basic, since it assumes all services come from the same application.

Architecture

The .composite parsing is done using something close to the visitor pattern: the XML parsing is done once, and several visitor implementations are used to handle each piece of information as they come. There is one visitor per tag type.

The package containing all SCA-related sources is org.easysoa.sca. this package is distributed between three different bundles (See the description in the sources location section) :

  • easysoa-registry-api-frascati.
  • easysoa-registry-core.
  • easysoa-registry-frascati.

The import can be done by the HTML form available in Nuxeo. Choose a composite or a jar containing a composite file and click on the import button. The request is end to a SCAImportBean. This bean get informations form the user interface and pass them to a SCA importer. A ScaImporterComponent act as a factory to create the required importer. The importers are registered as Nuxeo contributions and are stored in an available importer list.

The composite analysis is done by the importer. At this time, there are 2 kinds of importers :

  • XML analysis : Done with an XML analisys of the composite file.
  • FraSCAti analysis : Done with the FraSCAti engine.

Each time a service or a reference is found in the composite, a corresponding visitor is called and the service or the reference is registered in the Nuxeo model.

Main classes or interfaces :

SCAImportBean is used to handle web requests send from the SCA import web page. This bean use a sca importer to parse the composite and register found services.

SCAImporter is the interface implemented by the sca importers. There are 3 differents importers :

  • XMLScaImporter : used by the bean to effectively import the SCA contents, by parsing the XML and call all visitors each time a tag of interest is found.
  • FraSCAtiScaImporter : Used to parse the composite with the FraSCAti parsing mechanism. The found services are registered by using the Nuxeo core API.
  • APIFrascatiImporter : Use also the FraSCAti parsing mechanism and use the REST API contained in the easysoa-registry-api bundle.

SCAVisitor is the common interface for the binding visitors. A binding visitor is called each time a service is found by the sca importer.

FraSCAtiService is the FraSCAti component registered in Nuxeo, this component is charged to start the FraSCAti instance inside Nuxeo.

ParsingProcessingContext : It is a custom processing context used to transform checking errors in warnings. FraSCAti uses processing contexts to make several operations : parse, check, generate, compile, instantiate, complete, start ... This custom processing context is based on the delegation pattern.


Obsolete informations about Sca Import

Sources location

The source code is available in the easysoa-model-demo repository. All code regarding SCA import is located in the plugins/easysoa-model-demo-core Maven project, except for the XHTML file (in plugins/easysoa-model-demo-web).

See Development Environment to install all needed programs, and easysoa-demo-dist's README.md to set up your projects and build them.

Current features

Parses any .composite file to import services to the model. For now, it recognizes:

  • <binding.ws> tags (WS bindings)
  • <binding.rest> tags (REST bindings)

Limitations: For now, the import is quite basic, since it assumes all services come from the same application.

Architecture

The .composite parsing is done using something close to the visitor pattern: the XML parsing is done once, and several visitor implementations are used to handle each piece of information as they come. There is one visitor per tag type.

The package containing all SCA-related sources is org.easysoa.sca. this package can be found in the easysoa-model-demo-core bundle.

  • SCAVisitor is the interface to be implemented by all visitors. It is currently implemented by four classes, that allow to browse Service and Service references data for both WS and REST services.

  • SCAImportBean is used to handle web requests.
  • SCAImporter is used by the bean to effectively import the SCA contents, by parsing the XML and call all visitors each time a tag of interest is found.
Clone this wiki locally