The functionality explained here relies on the services mechanism. Make sure that you are familiar with the services mechanism in Lucy before reading this article.

When a user tries to open a data source using File→ Open, File→ Connect to, or drag-and-drop, the following sequence of actions is triggered:

  1. The string that represents the path to the file or the URL to the server is passed to the TLcyDataFormatManager, together with the ILcyGenericMapComponent on which the data must be loaded.

  2. The TLcyDataFormatManager retrieves all the ILcdModelDecoder and ALcyDataSourceHandler instances capable of handling that string from the ILcyLucyEnv.

  3. If it finds multiple instances, the TLcyDataFormatManager uses its TLcyDataFormatManager.ALcyHandlerChooser to determine the right model decoder or data source handler. The default implementation shows a pop-up dialog to let the user choose.

  4. If the ALcyHandlerChooser determines that the string input is handled by an ILcdModelDecoder, the model decoder is used to convert the string into an ILcdModel. For this model, the layer factories registered with the ILcyLucyEnv are used to create a layer: ILcdGXYLayerFactory for GXY views and ILspLayerFactory for Lightspeed views. The layer is added to the view of the map component.

    If the ALcyHandlerChooser determines that an ALcyDataSourceHandler will handle the string input, the string is passed to the ALcyDataSourceHandler together with the ILcyGenericMapComponent. It is up to the ALcyDataSourceHandler to determine what to do with the string. For example, a handler for a WMS URL could decide to present the users with a dialog that lets them choose which WMS layer they want to load.

  5. If the data cannot be loaded on the original ILcyGenericMapComponent, the TLcyDataFormatManager uses the TLcyDataFormatManager.ALcyMapComponentChooser to determine whether to repeat this process on another map component.