oracle.odi.interfaces.interactive.support.xrefs
Class ContextManager

This class is a helper to provide expression contexts for each <@link DataSet> in an interface, as well as a context for target expressions.
An ODI interface expression context (<@link IExpressionContext>) is an object that is able to produce all the recognizable parsing tags that will be used when parsing the expression, for a specified language and technology.
Each of the context returned by this class ensures that they refer to:

source <@link DataStore> columns in the given DataSet

project and global objects (variables, sequences, user functions), referred to in this class as "external objects" (because they are outside the interface itself).

See method giveContext to learn how to retrieve a context for a given dataset.

dataSetRemoved(DataSet pDataSet)
This method must be called by the user when a <@link DataSet> is removed from the current interface, so that the cache can be cleaned up.
Note that there is no need for a dataSetAdded method, as the cache will be automatically populated when the context for the new <@link DataSet> is requested using the giveContext method.

void

dataStoreAdded(SourceDataStore pSourceDataStore)
This method will be called by <@link oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions InteractiveInterfaceHelperWithActions> after a <@link SourceDataStore> has been added to a DataSet.

void

dataStoreRemoved(SourceDataStore pSourceDataStore)
This method will be called by <@link oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions InteractiveInterfaceHelperWithActions> after a <@link SourceDataStore> is removed from a DataSet.

ContextManager

Create a context manager that will include tags for the specified project.

Parameters:

pProject - The project in which this context manager will pick project objects (variables, etc)

pOdiEntityManager - The current entity manager.

pUseFindersForProjectObjects - if true, finders will be used to fetch project objects, if false the getters on the project will be used. Use finders if other editors or SDK calls might change the context between the time the manager is created and when the context is actually used, since finders will pick up the new information.

refreshGlobalAndProjectObjects

public void refreshGlobalAndProjectObjects()

Refreshes all global and project objects (variables, sequences, user functions). This should be called if the global or project objects have been changed since this context manager was created, before calling giveContext to retrieve the context object.

refreshDatastores

public void refreshDatastores()

Clear all caches concerning DataStore objects: they might have changed. This should be called if the data store objects have been changed since this context manager was created, before calling giveContext to retrieve the context object.

giveContext

Return an IExpressionContext for a given DataSet. Note that this method is optimized and caches the contexts to return the context as fast as possible. Thus if a context for a specified DataSet object is requested multiple times, the context will be created and cached during the first call. For subsequent calls the cached context object will be returned. This means that if the context information changes, for example if a new DataStore object is added to the DataSet, or if a new column has been added to the DataStore, then the cache must be updated.
To reset the cache that stores context information for DataStore objects, use refreshDatastores.
To reset the cache that stores context information for global and project (external) objects, DataStore objects, use refreshGlobalAndProjectObjects.

Parameters:

pDataSet - A DataSet for which we want an expression context. If pDataSet is null, a context will be returned for target expressions.

Returns:

The context for the given DataSet.

dataStoreAdded

This method will be called by <@link oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions InteractiveInterfaceHelperWithActions> after a <@link SourceDataStore> has been added to a DataSet. For internal use only.

Parameters:

pSourceDataStore - The SourceDataStore that has been added.

dataStoreRemoved

This method will be called by <@link oracle.odi.interfaces.interactive.support.InteractiveInterfaceHelperWithActions InteractiveInterfaceHelperWithActions> after a <@link SourceDataStore> is removed from a DataSet. For internal use only.

Parameters:

pSourceDataStore - The SourceDataStore that is being removed.

dataSetRemoved

This method must be called by the user when a <@link DataSet> is removed from the current interface, so that the cache can be cleaned up.
Note that there is no need for a dataSetAdded method, as the cache will be automatically populated when the context for the new <@link DataSet> is requested using the giveContext method.

Parameters:

pDataSet - The DataSet that is being removed.

isUseFindersForProject

public boolean isUseFindersForProject()

A method to return the current setting for how to get external objects, such as variables, sequences, and procedures.

Returns:

true if this instance of ContextManager uses finders to find external objects, false if it uses the project's getters.

setUseFindersForProject

public void setUseFindersForProject(boolean pUseFindersForProject)

Change the behaviour of this ContextManager to force it to use finders or not for external project objects.