Oracle Fusion Applications Search Java API Reference for Oracle Enterprise Crawl and Search Framework
11g Release 1 (11.1.1.6)

E21908-05

oracle.ecsf
Interface SearchContext


public interface SearchContext

SearchContext is a runtime container for contextual information for applications search. It contains search related meta information.

It also holds a reference to an external context that might be useful for the purpose of search as well as security etc.

For example, when used for searching, it holds a reference to AppsWebContext and can be obtained by getAppsContext.

This context is passed to most applications plug-in code where custom implemenation can obtain runtime context information.


Field Summary
static java.lang.String ACL_KEY
          Access control list key value
static java.lang.String ECSF_IS_ADMIN_MODE
           
static java.lang.String GLOBAL
           
static java.lang.String LOCAL
           
 
Method Summary
 void bindProxySession(java.lang.Object sessionObj)
          Deprecated. Binds search engine proxy session to this context.
 void bindUser(java.lang.String userName)
          Binds user name of undeline user session
 ApplicationExtension getApplicationExtension()
          Returns application extension if exists, otherwise, null is returned.
 java.lang.Object getAttribute(java.lang.Object key)
          Returns a hashed object;
 java.util.Map getAttributes()
          Returns attributes assigned to the context.
 java.sql.Connection getConnection()
          Provides cross module service for connection management.
 java.util.Locale getCurrLocale()
          Returns locale of current session user.
 long getEngineInstanceId()
          Return engine instance id assigned to the context;
 java.lang.String getErrorMessage()
          Returns the error message for this search
 java.lang.Object getExternalContext()
          Returns Application Context assigned to this search context.
 java.lang.Object getProxySession()
          Deprecated. Returns search engine proxy session object.
 java.lang.String getScope()
          Returns the search scope associated with this context.
 SearchableObject getSearchableObject()
          Returns the searchable object associated with this context.
 java.lang.Object getSessionObject()
          Returns session bound to this context.
 java.lang.String getUserName()
          Returns user name of the user bound to this context.
 java.io.Writer getWriter()
          Returns a writer to write information to external systems.
 boolean isError()
          Returns the error status for the search
 void release()
          Releases the context, and clean up resources used by this context.
 void releaseConnection()
          Provides cross module service for connection management.
 void setAttribute(java.lang.Object key, java.lang.Object value)
          Sets a hash value for the given key.
 void setCurrLocale(java.util.Locale locale)
          Sets locale associated with this context.
 void setEngineInstanceId(long engineInstanceId)
          Associates an engineInstanceId with this context.
 void setError(boolean error)
          Flags that the search resulted in error
 void setErrorMessage(java.lang.String errorMessage)
          Sets the error message for this search, used by the searcher.
 void setExternalContext(java.lang.Object ctx)
          Sets external context.
 void setLoggingContext(ECSFLoggingContext ctx)
          Sets the logging context for the current search context.
 void setScope(java.lang.String scope)
          Sets the search scope associated with this context.
 void setSearchableObject(SearchableObject searchableObject)
          Associates a searhable object with this context.
 void setSessionObject(java.lang.Object sessionObject)
          Binds the context to a session.
 void setUserName(java.lang.String username)
          Sets username without binding.
 void setWriter(java.io.Writer writer)
          Assigns a writer to this context.
 

Field Detail

GLOBAL

static final java.lang.String GLOBAL
See Also:
Constant Field Values

LOCAL

static final java.lang.String LOCAL
See Also:
Constant Field Values

ECSF_IS_ADMIN_MODE

static final java.lang.String ECSF_IS_ADMIN_MODE
See Also:
Constant Field Values

ACL_KEY

static final java.lang.String ACL_KEY
Access control list key value

See Also:
Constant Field Values
Method Detail

getAttribute

java.lang.Object getAttribute(java.lang.Object key)
Returns a hashed object;


setAttribute

void setAttribute(java.lang.Object key,
                  java.lang.Object value)
Sets a hash value for the given key.

Parameters:
key - hash key.
value - hash value.

getWriter

java.io.Writer getWriter()
Returns a writer to write information to external systems. This writer could be used to write to rss feed to search engine.


setWriter

void setWriter(java.io.Writer writer)
Assigns a writer to this context. It is upto the host application determine how to use the writer. For example, the data service uses this writer to push Rss feed to search engine.

Parameters:
writer -

getExternalContext

java.lang.Object getExternalContext()
Returns Application Context assigned to this search context.

From an application context, User security context, locale etc can be objtained.


setExternalContext

void setExternalContext(java.lang.Object ctx)
Sets external context. This method associate this context with an external context. The implementation determines what context to be related to the search context.

For Oracle Applications, oracle.apps.fnd.common.WebAppsContext.

Parameters:
ctx - external context to be set.

getSessionObject

java.lang.Object getSessionObject()
Returns session bound to this context. Null if not bound yet.

Returns:
user session object.

setSessionObject

void setSessionObject(java.lang.Object sessionObject)
Binds the context to a session.

Parameters:
sessionObject -

bindProxySession

void bindProxySession(java.lang.Object sessionObj)
Deprecated. Binds search engine proxy session to this context.

Parameters:
sessionObj - session object.

getProxySession

java.lang.Object getProxySession()
Deprecated. Returns search engine proxy session object.


getSearchableObject

SearchableObject getSearchableObject()
Returns the searchable object associated with this context.


setSearchableObject

void setSearchableObject(SearchableObject searchableObject)
Associates a searhable object with this context.

Every context can only be associated with one searchable object at a time.

Parameters:
searchableObject - to be associated with this context.

setEngineInstanceId

void setEngineInstanceId(long engineInstanceId)
Associates an engineInstanceId with this context.

Parameters:
engineInstanceId - to be associated with this context.

getEngineInstanceId

long getEngineInstanceId()
Return engine instance id assigned to the context;

Returns:
engine instance id if assigned.

release

void release()
Releases the context, and clean up resources used by this context.
Once released, this context become unusable.


setLoggingContext

void setLoggingContext(ECSFLoggingContext ctx)
Sets the logging context for the current search context.

Parameters:
ctx - ECSF logging context

getConnection

java.sql.Connection getConnection()
Provides cross module service for connection management.

Returns:
JDBC connection.

releaseConnection

void releaseConnection()
Provides cross module service for connection management.


getCurrLocale

java.util.Locale getCurrLocale()
Returns locale of current session user.

Returns:

setCurrLocale

void setCurrLocale(java.util.Locale locale)
Sets locale associated with this context.

Parameters:
locale - the locale to be set.

getUserName

java.lang.String getUserName()
Returns user name of the user bound to this context.

Returns:
user name;

setUserName

void setUserName(java.lang.String username)
Sets username without binding.

Parameters:
username - to be associated with the context.

bindUser

void bindUser(java.lang.String userName)
Binds user name of undeline user session


getAttributes

java.util.Map getAttributes()
Returns attributes assigned to the context.

Returns:
hashmap of attributes.

getScope

java.lang.String getScope()
Returns the search scope associated with this context.

Returns:
scope

setScope

void setScope(java.lang.String scope)
Sets the search scope associated with this context.

Parameters:
scope - the scope

getApplicationExtension

ApplicationExtension getApplicationExtension()
Returns application extension if exists, otherwise, null is returned.

Returns:
ApplicationExtension

setError

void setError(boolean error)
Flags that the search resulted in error

Parameters:
error -

isError

boolean isError()
Returns the error status for the search

Returns:
boolean - whether the search resulted in an error

setErrorMessage

void setErrorMessage(java.lang.String errorMessage)
Sets the error message for this search, used by the searcher. Internal use only.

Parameters:
errorMessage -

getErrorMessage

java.lang.String getErrorMessage()
Returns the error message for this search

Returns:
String - error message if any

Oracle Fusion Applications Search Java API Reference for Oracle Enterprise Crawl and Search Framework
11g Release 1 (11.1.1.6)

E21908-05

Copyright © 2012 Oracle. All rights reserved.