org.eclipse.datatools.connectivity.oda.design.ui.designsession
Class DataSourceSessionHelper

java.lang.Object
  extended byorg.eclipse.datatools.connectivity.oda.design.ui.designsession.DataSourceSessionHelper

public class DataSourceSessionHelper
extends java.lang.Object

A helper to an ODA host designer to handle a design session used to create or edit an extended ODA data source design definition.


Constructor Summary
DataSourceSessionHelper(java.lang.String odaDataSourceId)
          Constructor of the helper class for the given type of ODA data source extension.
 
Method Summary
 OdaDesignSession cancelDesignSession()
          Performs cancel on the current ODA design session.
 OdaDesignSession createNewDesignFromProfile(java.lang.String newDataSourceName, java.lang.String profileInstanceId, java.io.File storageFile, boolean linkToProfile)
          Creates a design session with a new data source design, whose properties and their values are copied from, or referenced to, the given profile instance.
 OdaDesignSession finishEditDataSource()
          Performs finish on the current ODA design session to edit a data source design.
 OdaDesignSession finishNewDesignSession()
          Performs finish on the current ODA design session to create a new data source design.
 PropertyPage getEditorPage()
          Returns the customized editor page for use in an ODA design session to edit an extended ODA data source design definition.
 IAdaptable getEditPropertyPageElement()
          Returns the customized editor page's adaptable element for use in a Property dialog to edit an extended ODA data source design definition.
 Wizard getNewWizard()
          Returns the ODA wizard for use in an ODA design session to create a new, extended ODA data source design definition.
 java.util.Map getProfileIdentifiers(java.io.File storageFile)
          Returns a collection of identifiers of all connection profile instances for the helper's ODA data source extension type.
static java.util.Map getProfileIdentifiers(java.lang.String odaDataSouceId, java.io.File storageFile)
          A static method that returns a collection of identifiers of all connection profile instances for the given ODA data source extension type.
 IWizardPage getWizardStartingPage()
          Returns the customized starting wizard page for use in an ODA design session to create a new, extended ODA data source design definition.
 void startEditDataSource(OdaDesignSession requestSession)
          Starts a design session to edit the data source design defined in the given ODA design session instance.
 void startEditDataSource(OdaDesignSession requestSession, DataSourceEditorPage editorPage)
          Starts a design session with the given editor page to edit the data source design defined in the given ODA design session instance.
 void startNewDesignSession(java.lang.String aDataSourceName)
          Starts a design session to create a new data source definition with the given name for the data source design instance.
 void startNewDesignSession(java.lang.String newDataSourceName, java.lang.String profileInstanceId, java.io.File storageFile, boolean linkToProfile)
          Starts a design session to create a new data source definition with the properties specified in the given profile instance.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

DataSourceSessionHelper

public DataSourceSessionHelper(java.lang.String odaDataSourceId)
Constructor of the helper class for the given type of ODA data source extension.

Parameters:
odaDataSourceId - an ODA data source extension element id
Method Detail

getProfileIdentifiers

public static java.util.Map getProfileIdentifiers(java.lang.String odaDataSouceId,
                                                  java.io.File storageFile)
                                           throws OdaException
A static method that returns a collection of identifiers of all connection profile instances for the given ODA data source extension type. The profile instances are searched in the given profile storage file. It also caches the matching profiles for subsequent use.

Parameters:
storageFile - a file that stores profile instances; may be null, which means to use the default DTP profiles storage file
Returns:
a Map containing the instance Id and display name of all existing profiles of the given odaDataSourceId. The connection profiles' instance Id and display name are stored as the key and value strings in the returned Map instance. Returns an empty collection if there are no matching connection profiles found in given storageFile.
Throws:
OdaException - if error in reading from given storageFile, or in processing the found profiles

getProfileIdentifiers

public java.util.Map getProfileIdentifiers(java.io.File storageFile)
                                    throws OdaException
Returns a collection of identifiers of all connection profile instances for the helper's ODA data source extension type.

Throws:
OdaException - if error in reading from given storageFile, or in processing the found profiles
See Also:
getProfileIdentifiers(String, File)

getNewWizard

public Wizard getNewWizard()
                    throws OdaException
Returns the ODA wizard for use in an ODA design session to create a new, extended ODA data source design definition.

Returns:
a wizard instance to add in a wizard dialog
Throws:
OdaException

getWizardStartingPage

public IWizardPage getWizardStartingPage()
                                  throws OdaException
Returns the customized starting wizard page for use in an ODA design session to create a new, extended ODA data source design definition.

Returns:
a customized wizard page to add in a wizard dialog
Throws:
OdaException

getEditorPage

public PropertyPage getEditorPage()
                           throws OdaException
Returns the customized editor page for use in an ODA design session to edit an extended ODA data source design definition.

Returns:
a customized property page
Throws:
OdaException

getEditPropertyPageElement

public IAdaptable getEditPropertyPageElement()
                                      throws OdaException
Returns the customized editor page's adaptable element for use in a Property dialog to edit an extended ODA data source design definition.

Returns:
Throws:
OdaException

startNewDesignSession

public void startNewDesignSession(java.lang.String aDataSourceName)
                           throws OdaException
Starts a design session to create a new data source definition with the given name for the data source design instance.

Parameters:
aDataSourceName - a unique name that identifies a data source design instance
Throws:
OdaException

startNewDesignSession

public void startNewDesignSession(java.lang.String newDataSourceName,
                                  java.lang.String profileInstanceId,
                                  java.io.File storageFile,
                                  boolean linkToProfile)
                           throws OdaException
Starts a design session to create a new data source definition with the properties specified in the given profile instance.

Parameters:
profileInstanceId - profile instance id; such as the instance id returned by the getProfileIdentifiers method
storageFile - a file that stores profile instances; may be null, which means to use the default DTP profiles storage file
linkToProfile - "true" indicates to maintain a link to the given profile instance and storageFile, and applies its latest properties values at run-time. "false" indicates to work with a copy of the current properties specified in the profile instance; any future changes to the profile instance is not applied to the data source design.
Throws:
OdaException

finishNewDesignSession

public OdaDesignSession finishNewDesignSession()
                                        throws OdaException
Performs finish on the current ODA design session to create a new data source design. This gathers the data source definition collected in UI designer and maps into an OdaDesignSession with a response.
This method must be called only after the corresponding wizard or editor has performed finish.

Returns:
the completed design session containing the new data source design within the session response
Throws:
OdaException

createNewDesignFromProfile

public OdaDesignSession createNewDesignFromProfile(java.lang.String newDataSourceName,
                                                   java.lang.String profileInstanceId,
                                                   java.io.File storageFile,
                                                   boolean linkToProfile)
                                            throws OdaException
Creates a design session with a new data source design, whose properties and their values are copied from, or referenced to, the given profile instance.
This method should be used when an ODA host wants to finish a design session right away after a profile is selected, and skips adding the custom wizard page.

Parameters:
profileInstanceId - profile instance id; such as the instance id returned by the getProfileIdentifiers method
storageFile - a file that stores profile instances; may be null, which means to use the default DTP profiles storage file
linkToProfile - "true" indicates to maintain a link to the given profile instance and storageFile, and applies its latest properties values at run-time. "false" indicates to work with a copy of the current properties specified in the profile instance; any future changes to the profile instance is not applied to the data source design.
Returns:
the completed design session containing the new data source design within the session response
Throws:
OdaException

startEditDataSource

public void startEditDataSource(OdaDesignSession requestSession)
                         throws OdaException
Starts a design session to edit the data source design defined in the given ODA design session instance. This is responsible for creating the custom property page instance for use to edit the data source design.

Throws:
OdaException

startEditDataSource

public void startEditDataSource(OdaDesignSession requestSession,
                                DataSourceEditorPage editorPage)
                         throws OdaException
Starts a design session with the given editor page to edit the data source design defined in the given ODA design session instance.

Parameters:
editorPage - the property page instance created by the ODA host to edit the design
Throws:
OdaException

finishEditDataSource

public OdaDesignSession finishEditDataSource()
                                      throws OdaException
Performs finish on the current ODA design session to edit a data source design.
This method must be called only after performOk on the editor page is done.

Returns:
the completed design session containing the edited data source design within the session response
Throws:
OdaException

cancelDesignSession

public OdaDesignSession cancelDesignSession()
Performs cancel on the current ODA design session.

Returns:
the completed design session containing a session response with a user_cancelled state


Copyright © 2006 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.