Skip to content

Discovery by browsing maintenance

mkalam-alami edited this page Dec 7, 2012 · 8 revisions

For using the discovery by browsing, see: Setting up the discovery by browsing tool, Discovery by Browsing introduction

How to update node libraries

  • Go to easysoa-discovery-browsing/js
  • Run npm update
  • Before to commit the files, you'll need to temporarily disable the .gitignore bin/ line (comment it with #), since some modules contain a bin folder that must be committed.
  • Commit the contents of easysoa-discovery-browsing/js
  • Cancel the change to the .gitignore

Discovery by browsing enrichment

The main bottleneck for improving the discovery by browsing tool is the model used by the ServiceFinder web service. Most of the logic is located in the easysoa-registry-doctypes-core, here, with the following limitations:

  • The service finding relies on the FoundService class, which hardcodes the properties that can be found by the various strategies.
  • The returned JSON message is formatted i* a specific & hard-coded way, towards the end of the ServiceFinderRest class

Some more specific logic also occurs on the easysoa-discovery-browsing project:

  • On the client side, the result of the request is first relayed by the node server, which converts the JSON data to another JSON format for the browser, again through a small hard-coded algorithm in dbb.js.
  • The browser finally grabs the data in App.js (see at l.40 the handling of the 'wsdl' event), which instantiates a new "Descriptor" (Backbone model) instance to both store the data & display a radio button to select the service.

A recommended refactoring is to replace the use of this(these) specific model(s) to the SoaNodeInformation model, which is already used for the Registry REST API. The main efforts will be to refactor the Nuxeo services to use & serialize the new model, and to update the Backbone code to handle it correctly. This refactoring will have the advantages of getting simpler & more maintainable code (discovering a new property will only require to update the corresponding strategy on Nuxeo), more coherent manipulation of SoaNodes across the different applications/formats, simplification of the Node & Backbone code.

Until then, changes to the discovered information will require to update, as pointed above:

  • The FoundService class (Nuxeo)
  • The conversion to a JSON object (Nuxeo)
  • The conversion from the Nuxeo message to a Socket.IO event (Node)
  • The handling of the updated message format (Backbone)