no.sesat.search.datamodel
Interface DataModel

All Superinterfaces:
Serializable

@DataNode
public interface DataModel
extends Serializable

The DataModel. The root DataNode to the DataModel. There exists a general pattern through the DataModel that there exists both getter and setter methods to child dataObjects in dataNodes, but there exists *only* getter methods on non-dataNode dataObjects. This allows dataObject, separated from their heirarchical context, to be immutable if the implementation so wishes. (The MapDataObject is an exception to this pattern). The original design documentation is at https://dev.sesat.no/confluence/display/TECHDEV/Search+Portal+DataModel+%28Sesam-3.0%29

Version:
$Id: DataModel.java 7225 2009-04-09 00:32:20Z ssmiweve $

Field Summary
static String KEY
          The key to be used when the datamodel is to be stored, eg in the request or velocity context.
 
Method Summary
 BrowserDataObject getBrowser()
          Get the BrowserDataObject associated to this session.
 JunkYardDataObject getJunkYard()
          Deprecated. Provides access to datamodel elements not yet migrated into the DataModel proper.
 NavigationDataObject getNavigation()
          Get the NavigationDataObject associated to the SearchMode.
 PageDataObject getPage()
          Get the PageDataObject associated to the SearchTab.
 ParametersDataObject getParameters()
          Get the ParametersDataObject associated to this request.
 QueryDataObject getQuery()
          The QueryDataObject holding all query related information associated to this request.
 SearchDataObject getSearch(String key)
          Get the SearchDataObject holding the given search's results
 Map<String,SearchDataObject> getSearches()
          Map containing all the search results.
 SiteDataObject getSite()
          Get the SiteDataObject holding site and skin information.
 UserDataObject getUser()
          Get the UserDataObject holding the user information.
 void setBrowser(BrowserDataObject browser)
          Assign the BrowserDataObject.
 void setJunkYard(JunkYardDataObject junkYard)
          Deprecated. Provides access to datamodel elements not yet migrated into the DataModel proper.
 void setNavigation(NavigationDataObject value)
          Set the NavigationDataObject.
 void setPage(PageDataObject value)
          Set the PageDataObject.
 void setParameters(ParametersDataObject parameters)
          Update the ParametersDataObject.
 void setQuery(QueryDataObject query)
          Set the QueryDataObject associated to this request.
 void setSearch(String key, SearchDataObject value)
          Set a search command's finished results.
 void setSite(SiteDataObject site)
          Assign the SiteDataObject.
 void setUser(UserDataObject user)
          Assign the UserDataObject when user logs in.
 

Field Detail

KEY

static final String KEY
The key to be used when the datamodel is to be stored, eg in the request or velocity context.

See Also:
Constant Field Values
Method Detail

getParameters

ParametersDataObject getParameters()
Get the ParametersDataObject associated to this request.

Returns:
the ParametersDataObject updated for this request.

setParameters

@AccessAllow(value={DATA_MODEL_CONSTRUCTION,REQUEST_CONSTRUCTION})
void setParameters(ParametersDataObject parameters)
Update the ParametersDataObject.

Parameters:
parameters - ParametsDataObject associated to this request.

getBrowser

BrowserDataObject getBrowser()
Get the BrowserDataObject associated to this session.

Returns:
the BrowserDataObject created at the beginning of the session.

setBrowser

@AccessAllow(value=DATA_MODEL_CONSTRUCTION)
void setBrowser(BrowserDataObject browser)
Assign the BrowserDataObject. Can only be called once.

Parameters:
browser - BrowserDataObject holding session-static information.

getUser

UserDataObject getUser()
Get the UserDataObject holding the user information.

Returns:
the UserDataObject.

setUser

@AccessAllow(value={DATA_MODEL_CONSTRUCTION,REQUEST_CONSTRUCTION})
void setUser(UserDataObject user)
Assign the UserDataObject when user logs in.

Parameters:
user - UserDataObject holding user information.

getSite

SiteDataObject getSite()
Get the SiteDataObject holding site and skin information.

Returns:
the SiteDataObject

setSite

@AccessAllow(value={DATA_MODEL_CONSTRUCTION,REQUEST_CONSTRUCTION})
void setSite(SiteDataObject site)
Assign the SiteDataObject. Usually only done once but some browsers don't use separate sessions for sub-domains.

Parameters:
site - the SiteDataObject holding site and skin information.

getQuery

QueryDataObject getQuery()
The QueryDataObject holding all query related information associated to this request.

Returns:
the QueryDataObject

setQuery

@AccessAllow(value={DATA_MODEL_CONSTRUCTION,REQUEST_CONSTRUCTION,RUNNING_QUERY_CONSTRUCTION})
void setQuery(QueryDataObject query)
Set the QueryDataObject associated to this request.

Parameters:
query - the QueryDataObject holding all query related information

getSearches

@AccessDisallow(value={RUNNING_QUERY_CONSTRUCTION,SEARCH_COMMAND_CONSTRUCTION})
Map<String,SearchDataObject> getSearches()
Map containing all the search results. See SearchDataObject. Keys match each search configuration's name. When a search command adds it's finished SearchDataObject, see setSearch(..) it is expected to call notifyAll() on the map. This enables others to use wait() on the map so to get access to the results once they are ready.

Returns:

getSearch

@AccessAllow(value={SEARCH_COMMAND_EXECUTION,RUNNING_QUERY_HANDLING,VIEW_CONSTRUCTION})
SearchDataObject getSearch(String key)
Get the SearchDataObject holding the given search's results

Parameters:
key - the search (commandName) to get SearchDataObject for
Returns:
the SearchDataObject

setSearch

@AccessAllow(value={DATA_MODEL_CONSTRUCTION,REQUEST_CONSTRUCTION,SEARCH_COMMAND_EXECUTION,RUNNING_QUERY_HANDLING})
void setSearch(String key,
                                                                                                                         SearchDataObject value)
Set a search command's finished results. Any call to this method must be followed by the code: synchronized(getSearches()){ getSearches().notifyAll(); } to inform any other parties waiting for the results that they are ready.

Parameters:
key -
value -

getNavigation

NavigationDataObject getNavigation()
Get the NavigationDataObject associated to the SearchMode.

Returns:
the NavigationDataObject

setNavigation

@AccessAllow(value={DATA_MODEL_CONSTRUCTION,RUNNING_QUERY_CONSTRUCTION})
void setNavigation(NavigationDataObject value)
Set the NavigationDataObject.

Parameters:
value - the NavigationDataObject associated to the SearchMode

getPage

PageDataObject getPage()
Get the PageDataObject associated to the SearchTab.

Returns:
the PageDataObject

setPage

@AccessAllow(value={DATA_MODEL_CONSTRUCTION,REQUEST_CONSTRUCTION})
void setPage(PageDataObject value)
Set the PageDataObject.

Parameters:
value - the PageDataObject associated to the SearchTab

getJunkYard

JunkYardDataObject getJunkYard()
Deprecated. Provides access to datamodel elements not yet migrated into the DataModel proper.

Returns:
all the old crap

setJunkYard

@AccessAllow(value={DATA_MODEL_CONSTRUCTION,REQUEST_CONSTRUCTION})
void setJunkYard(JunkYardDataObject junkYard)
Deprecated. Provides access to datamodel elements not yet migrated into the DataModel proper.

Parameters:
junkYard -


Copyright © 2005-2009 Schibsted ASA. All Rights Reserved.