# Connection Profile

###### Identifier:

org.eclipse.datatools.connectivity.connectionProfile

###### Since:

DTP v. 0.x

###### Description:

This extension point provides a place for plug-ins to add support for different types of connection profiles. It also allows extensions to extend the capabilities of defined extension points.

Connection profiles are defined using the `connectionProfile` element. A connection profile will belong to a single category and a single configuration type. Categories are used for grouping like types of connection profiles (e.g. queue, database, etc.). Configuration types are used for specifying the type of configuration information provided by the profile (e.g. New Era Open Transport, JDBC, etc.).

The provider must define a corresponding `newWizard` element for creating the resource.

The provider must define a corresponding `org.eclipse.ui.propertyPages` for editing the connection profile's properties. The provider should ensure a `filter` element is defined to verify the selected connection profile's provider ID matches the `id` specified for the `connectionProfile` (this is accomplished using the `org.eclipse.datatools.profile.property.id` property). `org.eclipse.datatools.connectivity.ui.wizards.ProfileDetailsPropertyPage` is a base property page implementation intended to be extended by connection profile providers for this purpose.

Connection factories supporting a given profile may be registered using the `connectionFactory` element. Connection factories allow plug-ins to create a connection to a server from a connection profile. A connection profile provider should provide a connection factory extension. Ideally, a connection factory's ID should correspond with the type of object created when connected (e.g. `java.sql.Connection`). A connection profile provider should implement a `connectionFactory` with an ID of `org.eclipse.datatools.connectivity.connectionFactory.pingFactory` to enable the ping functionality provided in the base implementations and framework.

Connection profiles may be extended by other plug-ins by defining the following extension elements:

- `connectionFactory -`
This element enables a plug-in to provide connection creation support for the specified connection profile.
- `profileExtension -`
This element enables a plug-in to provide additional configuration properties for the specified connection profile. If you are extending a connection profile in this manner and these properties need to be specified when connecting to the server defined by the connection profile, you will need to provide a connection factory extension that makes use of the additional properties.

Tooling providers can choose to integrate with connection profiles using a variety of mechanisms. Tooling can be keyed to a specific profile type (by checking the profile's ID attribute; e.g. the mechanism used for contributing property pages as noted above). Tooling can also be keyed to work with profiles with a specified connection factory (e.g. DB specific tooling might be keyed to use any profile with a `java.sql.Connection` factory). This approach allows tooling to work with any type of connection profile that can be represented through a particular connection API.

The following filter properties are provided for filtering connection profile instances: (These are defined in `org.eclipse.datatools.connectivity.ui.IConnectionProfileActionFilter`.)

- `org.eclipse.datatools.profile.property.id` -
Use for filtering profile instances of a specific type.
- `org.eclipse.datatools.connectivity.profile.property.categoryID` -
Use for filtering profile instances belonging to a specific category.
- `org.eclipse.datatools.connectivity.profile.property.factoryID` -
Use for filtering profile instances implementing a specific type of connection factory.
- `org.eclipse.datatools.connectivity.profile.property.hasExtendedProperties` -
Use for filtering profile instances with one or more `profileExtension`s defined.
- `org.eclipse.datatools.connectivity.profile.property.extensionID` -
Use for filtering profile instances implementing a specific type of `profileExtension`.
- `org.eclipse.datatools.connectivity.profile.property.containingViewID` -
Use for filtering profile instances contained within a specific view.
- `org.eclipse.datatools.connectivity.profile.property.isConnected` -
Use for filtering profile instances based on their connection state.
- `org.eclipse.datatools.connectivity.profile.property.supportsPing` -
Use for filtering profile instances implementing a ping connection factory (shortcut for name=org.eclipse.datatools.connectivity.profile.property.factoryID, value=org.eclipse.datatools.connectivity.connectionFactory.pingFactory).

###### Configuration Markup:

<!ELEMENT extension (category* , configurationType* , connectionProfile* , connectionFactory* , profileExtension* , newWizard* , wizardCategory* , connectionFactoryAdapter*)*>

<!ATTLIST extension

point CDATA #REQUIRED

id CDATA #IMPLIED

name CDATA #IMPLIED

>

- point - a fully qualified identifier of the target extension point, `org.eclipse.datatools.connectivity.connectionProfile`
- id - an optional identifier of the extension instance
- name - an optional name of the extension instance

<!ELEMENT category EMPTY>

<!ATTLIST category

id CDATA #REQUIRED

parentCategory CDATA #IMPLIED

name CDATA #IMPLIED

>

This element is used to identify a category. Categories are used to group related connection profile types (e.g. databases).

- id - The id of this category. This value is referenced by `connectionProfile` elements.
- parentCategory - The id of a parent category, if this category has a parent.
- name - The display name for this category.

<!ELEMENT connectionProfile (migration?)>

<!ATTLIST connectionProfile

id CDATA #REQUIRED

name CDATA #IMPLIED

category CDATA #REQUIRED

configurationType CDATA #IMPLIED

icon CDATA #IMPLIED

maintainConnection CDATA #IMPLIED

pingFactory CDATA #IMPLIED

propertiesPersistenceHook CDATA #IMPLIED

>

This element is used to define a connection profile type.

- id - The id of this connection profile. This must uniquely identify this connection profile.
- name - The display name for this connection profile type.
- category - The category that this connection profile belongs to. This must map back to a `category/id`.
- Deprecated configurationType - The configuration type for this connection profile. This must map back to a `configurationType/id`.
- icon - The plug-in relative path to an image file. This image will be used to identify resources of this type in the servers view.
- maintainConnection -
- pingFactory - Connection factory used to implement "ping" functionality.
- propertiesPersistenceHook - Allows a plugin to specify which properties should be persisted by the framework, as well as given the framework a place to query for the "completeness" of a property set. Please see the javadoc for `org.eclipse.datatools.connectivity.IPropertiesPersistenceHook`. By default, all properties specified will be persisted and the property set will always be treated as "complete."

The configurationType element is deprecated

<!ELEMENT configurationType EMPTY>

<!ATTLIST configurationType

id CDATA #REQUIRED

name CDATA #IMPLIED

>

This element is used to identify a configuration type. A configuration type is used for determining the format of the configuration data used by a connection profile. For example, "New Era Open Transport" or "JDBC Connection URL"

- id - The unique identifier for this configuration type.
- name - The name of this configuration type.

<!ELEMENT connectionFactory EMPTY>

<!ATTLIST connectionFactory

profile CDATA #IMPLIED

name CDATA #IMPLIED

id CDATA #REQUIRED

class CDATA #REQUIRED

priority CDATA #IMPLIED

>

This element defines a connection factory that can be used to create connections to a server using the properties stored in a connection profile resource.

- profile - The connection profile supported by this factory. This should reference a `connectionProfile/id`. If this field is specified, this factory will only be available for the specified profile, otherwise this factory will be available for all profiles with the specified `factory`.
- name - The name of this connection factory.
- id - The unique identifier for this connection factory. This id may be used by plug-ins to retrieve an instance of this connection factory.
- class - The class that implements this connection factory. The specified class must be an instance of IConnectionFactory.
- priority - The priority is an integer value indicating which connection factory will take precedence when multiple connection factories are registered for a specific profile. Higher numbers will override lower numbers. If the priority is not specified then it will be considered the lowest priority.

<!ELEMENT profileExtension EMPTY>

<!ATTLIST profileExtension

profile CDATA #REQUIRED

name CDATA #IMPLIED

id CDATA #REQUIRED

propertiesPersistenceHook CDATA #IMPLIED

>

This element is used to define an extension that provides support for setting additional properties on a connection profile. When implementing this extension point, you should also implement a connection factory if required.

- profile - The connection profile that this extension supports. This should map to a `connectionProfile/id`.
- name - The name of this extension.
- id - A unique identifier for this extension.
- propertiesPersistenceHook - Allows a plugin to specify which properties should be persisted by the framework, as well as given the framework a place to query for the "completeness" of a property set. Please see the javadoc for `org.eclipse.datatools.connectivity.IPropertiesPersistenceHook`. By default, all properties specified will be persisted and the property set will always be treated as "complete."

<!ELEMENT newWizard EMPTY>

<!ATTLIST newWizard

id CDATA #REQUIRED

name CDATA #REQUIRED

class CDATA #REQUIRED

icon CDATA #IMPLIED

description CDATA #IMPLIED

profile CDATA #REQUIRED

category CDATA #IMPLIED

suppressedProfile CDATA #IMPLIED

>

This element is used to identify a connection profile wizard. A wizard is used to create a connection profile

- id - The unique identifier for the new wizard.
- name -
- class - The class that implements this new wizard. The specified class must be an instance of IWizard. `org.eclipse.datatools.connectivity.ui.wizards.NewConnectionProfileWizard` is a base implementation intended to be extended by connection profile providers. `org.eclipse.datatools.connectivity.ui.wizards.ConnectionProfileDetailsPage` is a base wizard page implementation intended for use with the above wizard implementation.
- icon - The plug-in relative path to an image file. This image will be used to identify the new wizard.
- description - Description of the new wizard.
- profile - The connection profile supported by this new wizard. This should reference a `connectionProfile/id`.
- category -
- suppressedProfile - The connection profile suppressed by this new wizard. This should reference a `connectionProfile/id`.

<!ELEMENT wizardCategory EMPTY>

<!ATTLIST wizardCategory

id CDATA #REQUIRED

parentCategory CDATA #IMPLIED

name CDATA #IMPLIED

icon CDATA #IMPLIED

description CDATA #IMPLIED

wizardTitle CDATA #IMPLIED

wizardDescription CDATA #IMPLIED

>

- id - This element is used to identify a wizard category. Categories are used to group related connection profile wizards (e.g. databases).
- parentCategory - The id of a parent category, if this category has a parent.
- name - The display name for this category.
- icon - The plug-in relative path to an image file. This image will be used to identify wizard category in the new connection profile wizard.
- description - Description of the new wizard category.
- wizardTitle - wizard title
- wizardDescription - wizard description

<!ELEMENT connectionFactoryAdapter EMPTY>

<!ATTLIST connectionFactoryAdapter

name CDATA #IMPLIED

class CDATA #REQUIRED

id CDATA #REQUIRED

factory CDATA #REQUIRED

profile CDATA #IMPLIED

>

This element defines a factory that can be used to create connections representing a specific type of view onto a server using an existing connection factory to generate the underlying connection object used by the view.

- name - The name of this connection factory.
- class - The class that implements this connection factory. The specified class must be an instance of IConnectionFactory.
- id - The unique identifier for this connection factory. This id may be used by plug-ins to retrieve an instance of this connection factory.
- factory - A connection factory ID to which this adapter applies. This matches a connectionFactory/@id value.
- profile - The connection profile supported by this factory. This should reference a `connectionProfile/@id`. If this field is specified, this factory will only be available for the specified profile, otherwise this factory will be available for all profiles with the specified `factory`.

<!ELEMENT migration (propertyMigration*)*>

<!ATTLIST migration

newProviderID CDATA #IMPLIED

class CDATA #IMPLIED

>

Use this element to add migration support for a deprecated profile type (e.g. ID changes, property changes, etc.).

- newProviderID - The ID of the new profile provider to which the old profile should be associated with. If this attribute is not specified, the ID of the profile provider is not changed. However, propertyMigration elements, if any, will still be processed and applied.
- class - A migration implementation that allows the provider to perform a specialized migration. Use this method if you require a more complex migration algorithm (i.e. anything other than simple name and property mapping).

<!ELEMENT propertyMigration EMPTY>

<!ATTLIST propertyMigration

oldPropertyKey CDATA #IMPLIED

newPropertyKey CDATA #IMPLIED

newValue CDATA #IMPLIED

>

This element is used to specify a simple mapping for property key names from a source profile to a target profile. If this element is used, the targetProfile attribute must be set.

- oldPropertyKey - The key name in the source profile. If this property is not specified, the new property will be defaulted with the value of newValue.
- newPropertyKey - The key name in the target profile. If this value is not specified, the old property will be deleted.
- newValue - Use this attribute for populating a default property value for a new property. newPropertyKey must be set.

###### Examples:

     <extension
       id="sample"
       name="Sample Server Extension"
       point="org.eclipse.datatools.connectivity.connectionProfile">
      <category
        name="Sample Server Category"
        id="org.eclipse.datatools.connectivity.example.sampleCategory">
      </category>
      <configurationType
        name="Sample Configuration Type"
        id="org.eclipse.datatools.connectivity.example.sampleConfigurationType">
      </configurationType>
      <connectionFactory
        profile="org.eclipse.datatools.connectivity.example.sampleConnectionProfile"
        name="Shared Connection Factory"
        id="org.eclipse.datatools.connectivity.example.sharedConnectionFactory"
        class="org.eclipse.datatools.connectivity.example.SharedConnectionFactory">
      </connectionFactory>
      <connectionFactory
        profile="org.eclipse.datatools.connectivity.example.sampleConnectionProfile"
        name="Ping Connection Factory"
        id="org.eclipse.datatools.connectivity.connectionFactory.pingFactory"
        class="org.eclipse.datatools.connectivity.example.SharedConnectionFactory">
      </connectionFactory>
      <profileExtension
        profile="org.eclipse.datatools.connectivity.example.sampleConnectionProfile"
        name="Sample Extraneous Properties"
        id="org.eclipse.datatools.connectivity.example.sampleConnectionProfileExtension">
      </profileExtension>
      <connectionProfile
        configurationType="org.eclipse.datatools.connectivity.example.sampleConfigurationType"
        name="Sample Connection Profile"
        icon="icons/sample.gif"
        category="org.eclipse.datatools.connectivity.example.sampleCategory"
        id="org.eclipse.datatools.connectivity.example.sampleConnectionProfile">
      </connectionProfile>
     </extension>

###### API Information:

[Enter API information here.]

Copyright (c) 2004-2005 Sybase, Inc.

All rights reserved. This program and the accompanying materials are made available under the terms of the Eclipse Public License v1.0 which accompanies this distribution, and is available at http://www.eclipse.org/legal/epl-v10.html

Contributors: rcernich - initial API and implementation