Loupe - Log - Monitor - Resolve
Loupe / Developer's Guide / Extending Loupe Server / Loupe Extensions - Managing Configuration
In This Topic
    Loupe Extensions - Managing Configuration
    In This Topic

    A common requirement of extensions is to have a small amount of configuration data to customize the extension to the current situation.  To enable this, Loupe manages multiple scopes of configuration on behalf of each Extension.

    Beyond general configuration data Loupe also supports secure credential storage in three separate scopes:

    It's recommend you utilize these facilities to store credentials since it ensures they will be encrypted using strong, hybrid key encryption whenever they are written to storage or transported to another computer.  The encryption is designed so that it can only be decoded within the scope it's sent to, so the files can't be copied to another computer and accessed.

     Defining your Configuration
    To create your own configuration for a particular scope you need to implement an object that is serializable to XML for each of the scopes you want to use.  Then specify the types as part of the LoupeExtensionAttribute on your extension.  As you update your configuration objects over time you should follow safe version tolerant serialization practices to ensure that users can seamlessly upgrade between versions.
     Accessing Configuration

    You can access all of the configuration from the Configuration Property of the IRepositoryContext Interface which is provided to every part of your Extension.  The information is internally cached to improve performance, and will not change except immediately before the ConfigurationChanged method of each Extension is called.

     Editing Configuration

    To provide a great user experience for managing configuration you should create a Configuration Editor.  This is a dialog that will be invoked automatically when the user requests it from the Extension manager or when your code calls the EditConfiguration method on the IRepositoryContext Interface.  When invoked, the configuration editor will be provided with a copy of the current configuration.  If the EditConfiguration method returns DialogResult.OK then the configuration will be persisted and the extension will be notified the configuration has been updated.

    Do not directly edit your configuration directly from the Repository Context.  Any changes you make outside of the EditConfiguration method of your configuration editor will not be persisted and will not cause the other parts of your Extension to be notified of a configuration change.

    Before your extension is enabled the first time your configuration editor (if specified) will be invoked.  The extension will only be enabled if the configuration editor returns DialogResult.OK.

     Sharing Configuration

    The User, Common and Server configuration is automatically replicated between computers using Loupe.  This allows you to configure your extension on the server from any Desktop subscribed to the server.  Loupe will automatically retrieve the latest configuration and then update it back to the server when the user completes the configuration dialog.  When each copy of Desktop starts it checks in with the Server for updated configuration files.

    Since Loupe Desktop may not be connected to its server (due to networking issues or other problems) when the configuration editor is invoked you can check if the server is available during the configuration process to determine if you want to allow them to edit server-related configuration.  Use the IsServerAvailable properties of the IRepositoryContext Interface to check this at runtime.

    See Also