#include <CSessionManager.h>
Inheritance diagram for CSessionManager:

Public Member Functions | |
| CSessionManager (string inSessions, string inConfiguration, string inI18nFileName) | |
| The session manager slurps in two XML files and generates out of this its initial state. | |
| CQuery * | makeQuery (const string &inBaseType, CAlgorithm &inAlgorithm) |
| this CSessionManager has all the information to make a query structure. | |
| istream & | read (istream &) |
| Initialization: read from a stream. | |
| ostream & | write (ostream &) |
| Write into a stream. | |
| CXMLElement * | openSession (string inUserName, string inSessionID, string inSessionName) |
| to be used by the Interface. | |
| CXMLElement * | renameSession (string inSessionID, string inSessionName) |
| to be used by the Interface. | |
| CXMLElement * | deleteSession (string inSessionID) |
| to be used by the Interface. | |
| CXMLElement * | closeSession (string inSessionID) |
| Closes the session, but keeps it in memory. | |
| CXMLElement * | query (const string &inSessionID, const CXMLElement &inRelevanceLevelList) |
| VeryImportantFunction:. | |
| CXMLElement * | getRandomImages (const string &inSessionID, const string &inAlgorithm, int inResultSize) |
| retrieving random images (as seeds for subsequent searches) | |
| list< CAccessorElement > * | getAllAccessorElements (const string &inSessionID, const string &inAlgorithm) |
| retrieving the URLs of all images (for generating distance matrices) | |
| list< TID > * | getAllIDs (const string &inSessionID, const string &inAlgorithm) |
| retrieving the IDs of all images (for generating distance matrices) | |
| bool | setAlgorithm (const string &inSessionID, CAlgorithm *inAlgorithm) |
| set the algorithm used in this session it will also lead to a new construction of the query. | |
| string | newSession (const string &inUser, const string &inSessionName) |
| making a new session and returning its ID | |
| string | newSession (const string &inID, const string &inUser, const string &inSessionName) |
| making a new session and for a given ID, returnig the ID | |
| void | setSessionName (const string &inOldSessionName, const string &inNewSessionName) |
| Set the name of the current session. | |
| string | toXML (bool isPrivate=false) const |
| turn this into a part of the welcome message | |
| string | toXMLSessions (const string &inUser, bool isPrivate=false) const |
| The sessions for one user only. | |
| string | toXMLSessionConfiguration () const |
| The sessions for everybody known to the system. | |
| pair< string, string > | toXMLHandshake (const string &inUser) |
| this is almost the complete shandshake message | |
| CXMLElement * | getPropertySheet (string inSessionID, string inAlgorithmID) const |
| Get the property sheet of the algorithm with ID inAlgorithmID. | |
| void | startPropertySheetSubtree () |
| Building a property sheet list I consider building a list on a call by call basis as tedious. | |
| CXMLElement * | getPropertySheetSubtree () |
| This function gets us the current property sheet subtree. | |
| void | endPropertySheetSubtree () |
| This function does the actual breaking down into a CPropertySheetList. | |
| CXMLElement * | getCollections () const |
| This function probably will quite soon be removed from this class, and it will become part of a class containing the CSessionManager. | |
| CXMLElement * | getAlgorithms () const |
| This function probably will quite soon be removed from this class, and it will become part of a class containing the CSessionManager. | |
| bool | clearSessionLanguages (const string &inSessionID) |
| i18n clear the preferred languages list of a given session | |
| bool | addSessionLanguage (const string &inSessionID, const string &inLanguageCode) |
| i18n: add one language code to the list of preferred languages | |
| bool | commitSessionLanguages (const string &inSessionID) |
| commit the languages to be used for a session. | |
| list< string > | getSessionLanguages (const string &inSessionID) const |
| i18n: get the list of preferred languages of this session | |
| void | translate (string inSessionID, CXMLElement &inoutToBeTranslated) const |
| i18n: get the list of preferred languages of this session | |
Protected Types | |
|
typedef map< string, list< CSession > > | CUserToSessions |
| point the user to all the sessions | |
| typedef map< string, CSession * > | CIDToSession |
Protected Attributes | |
| CAccessorAdminCollection | mAccessorAdminCollection |
| The accessor collection is needed for constructing queries. | |
| CI18nTranslator | mI18nTranslator |
| The Translator for this. | |
| CUserToSessions | mUserToSessions |
| CIDToSession | mIDToSession |
| CPropertySheetList * | mPropertySheetList |
| These are the building blocks of the property sheets to be generated by *this. | |
| CXMLElement * | mPropertySheetSubtree |
| The subtree from which the mPropertySheets will be built. | |
| CStaticQueryFactory * | mBaseTypeFactory |
| The base type factory is a factory for query base types. | |
Basically, it hands all requests through to the right sessions. It also handles the generation of new sessions etc.. In short, it is the configuration manager.
This class is now approaching what I would like it to be, however, cleaning is always wellcome
ATTENTION MULTITHREADING: WHAT TO LOCK AND WHAT TO UNLOCK IS NOT ENTIRELY TRIVIAL THIS MIGHT BE A SOURCE OF MISTAKES
|
|
Closes the session, but keeps it in memory. FUTURE: put the state of the session into a blob |
|
|
to be used by the Interface. Not yet implemented. |
|
||||||||||||
|
Get the property sheet of the algorithm with ID inAlgorithmID. We look for the attribute cui-property-sheet-id in the algorithm. If this exsists, we look for the right property sheet id in the CPropertySheetList. |
|
||||||||||||||||
|
retrieving random images (as seeds for subsequent searches)
|
|
||||||||||||||||
|
to be used by the Interface. Not yet implemented. |
|
||||||||||||
|
VeryImportantFunction:. This function looks for a CSession with CSession::mSessionID==inSessionID and hands through the rest of the parameter list to CSession::query. |
|
||||||||||||
|
to be used by the Interface. Not yet implemented. |
|
||||||||||||
|
set the algorithm used in this session it will also lead to a new construction of the query. We have to perform some comparisons here present version is probably a HACK |
|
||||||||||||
|
Set the name of the current session. Presently not implemented or tested |
|
|
Building a property sheet list I consider building a list on a call by call basis as tedious. So what I do is: I first build a tree, and then I break down this tree into our list. This function makes a new tree |
|
|
turn this into a part of the welcome message THIS CODE IS TO LEAVE SOON Reimplemented from CAlgorithmCollection.
|
|
||||||||||||
|
The sessions for one user only.
|