doc/sdd-content.tex
author agriesma
Thu, 17 Apr 2003 18:01:02 +0200
branchgriesmayer
changeset 306 4e47b9910234
child 686 cfeee73cf724
permissions -rw-r--r--
neues cvs-verzeichnis
     1 %nicht vergessen: auch sdd.tex ($Revision $) \"andern !
     2 \chapter{Software Design Document}
     3 
     4 
     5 \section{The Worksheet}
     6 %WN --- vvv -----------------Kopie aus UseCases am 2.9.02-----------------
     7 The worksheet is the component responsible for interaction with the user while doing a claculation.
     8 
     9 The functionality is split between a worksheet presentation layer (WPL) and the worksheet dialog guide (WDG). This makes it possible to change the logic of user-interaction (WDG) and the presentation or skin (WPL) independently from each other.
    10 
    11 The WPL is responsible for visible presentation of data (like formulas in a calculation) and user-interface objects (like buttons or menus). Moreover, the WPL accepts input from the user.
    12 The WDG makes decisions on which data and which choices of user-interaction to present in which order, depending on the role (student, teacher, author, ...), the preferences and the history of the user.
    13 
    14 \subsection{Elements of user-interaction}
    15 
    16 Any of the following elements can be activated by the user (e.g. clicked with a mouse) to get a choice of actions offered for the respective item. The actions available are determined by the WDG. The choice can be empty as well. 
    17 \begin{itemize}
    18 \item \textbf{Menus} in the usual sense of the word are filled in by the WDG. Several "types" of menus will be offered, including:
    19 \begin{itemize}
    20 \item global settings
    21 \item display options
    22 \item calculation options
    23 \item user profile
    24 \end{itemize}
    25 \item \textbf{Formulas} are the visual representation of mathematical formulas.
    26 Actions offered on formulas include:
    27 \begin{itemize}
    28 \item Edit
    29 \item Collapse (minimize) / Show
    30 \item Propose a tactic
    31 \item Make current
    32 \item Highlight
    33 \end{itemize}
    34 \item \textbf{Tactics} are rules applied to a formula yielding another formula (the next formula in the course of calculation).
    35 Actions offered on tactics include:
    36 \begin{itemize}
    37 \item Edit
    38 \item Choose from list of applicable tactics
    39 \item Get information from knowledge base
    40 \end{itemize}
    41 \end{itemize}
    42 
    43 \subsection{Data stored and manipulated by the WDG}
    44 \subsubsection{Draft for an user-model}
    45 The user-model stores an abstraction of the knowledge, abilities and learning progress of a user, based upon his history of interaction with \isac{} as well as his personal preferences and restrictions set by teachers and course designers. The user-model is persistent across sessions.
    46 
    47 At the moment, the uses of the user-model and the implications for the data abstractions stored cannot be foreseen in every detail. To avoid prejudicing decisions to be taken by dialog designers, the user model is designed to store data at a rather low level of abstraction suitable for being combined into high-level equivalents at a later time. Moreover, a mechanism transparent to future extensions is preferred.
    48 
    49 Elements of the user model envisioned at present include:
    50 \begin{itemize}
    51 \item \textbf{Specific examples already done by the user} will be logged together with information about success or failure. This "history" can be used to deduce flexible strategies for user-guidance.
    52 \item \textbf{Errors typical to the user} will be included as soon as a comprehensive classification of common errors is implemented in the system. This information can be used to automatically choose specific examples to be practised.
    53 \item \textbf{Tactics considered no longer interesting to the user} will be used to reduce the complexity of user-interaction by omitting steps in the calculation trivial to the specific user. Tactics having been applied several times withot error could be considered trivial in this sense of the word.
    54 \item \textbf{Tactics to be practised by the user} will be used to choose specific examples or to leave parts of the calculation blank to be filled in by the user.
    55 \item \textbf{Specific examples to be done by the user}
    56 \end{itemize}
    57 Preferences about the visual representation such as colors, fonts or visual layout of the worksheet depend heavily on the capabilities of the WPL and will be stored separately.
    58 Depending on the role and permissions of the user, some of these user-model data could be set directly by the user according to his preferences, whereas othe data may be modified only by the system or a privileged teacher.
    59 
    60 \subsubsection{Dialog state}
    61 The dialog state stores the momentary state of interaction in the current session.
    62 
    63 \subsection{The object world of the worksheet component}
    64 
    65 \subsubsection{The dialog guide object}
    66 Its local data represent the current state of the dialog. It has methods for interacting with the user at different levels of abstraction and for being queried about its interpretation of the proof tree.
    67 
    68 \subsubsection{The user model object}
    69 
    70 \subsubsection{The presentation layer object}
    71 The presentation layer object is an abstraction of the visible worksheet.
    72 It has methods for
    73 \begin{itemize}
    74 \item redisplaying itself
    75 \item showing menus, buttons and other objects of user-interaction
    76 \item highlighting parts of the displayed calculation
    77 \item editing the hot spot of the calculation
    78 \item being notified of changes in the data displayed
    79 \end{itemize} 
    80 It does not have methods for directly changing the data displayed, but reacts to update notifications by re-querying the data. 
    81 It notifies other objects of
    82 \begin{itemize}
    83 \item actions (e.g. mouse clicks) on the displayed elements
    84 \item completed edit operations
    85 \end{itemize} 
    86 
    87 \subsubsection{The proof tree object}
    88 The proof tree object represents a proof or course of calculation, consisting of a problem specification and a series of formulas an tactics.
    89 It has methods for
    90 \begin{itemize}
    91 \item being initialized with a problem specification
    92 \item checking a problem specification for completeness and consistency
    93 \item being queried about its inner structure (i.e. formulas and tactics)
    94 \item changing itself by doing steps in a calculation
    95 \item changing itself by adding detail to a step in the calculation, leaving the rest of the tree consistent and unchanged
    96 \item finding the origins of conditions, yielding highlights indicating the tactics which introduced a condition
    97 \item setting the hot spot, i.e. the current formula or tactic
    98 \item changing the data at the hot spot and verifying the consistency of the resulting proof
    99 \end{itemize} 
   100 It can notify other objects of updates, optionally indicating parts of the tree left unchanged.
   101 
   102 \subsubsection{The proof element selector object}
   103 The proof element selector object is intended for selecting a formula or a tactic in a proof. Its implementation is closely interwoven with the proof tree object.
   104 It has methods for
   105 \begin{itemize}
   106 \item attaching and detaching a proof tree
   107 \item navigating the attached proof tree, i.e. selecting a formula or tactic. Navigation is done by methods like the following 
   108 \begin{itemize}
   109 \item root - select the first formula
   110 \item down - select the next formula
   111 \item up - select previous formula
   112 \item tactic - select the tactic yielding the currently selected formula
   113 \item formula - select the formula resulting from the currently selected tactic
   114 \end{itemize} 
   115 \item extracting the selected formula yielding a new formula object
   116 \item extracting the selected tactic yielding a new tactic object
   117 \end{itemize}
   118  
   119 
   120 \subsubsection{The formula object}
   121 The formula object is intended for storing one mathematical formula, i.e. a term consisting of constants, variables, operators and functions.
   122 While the internal storage is not transparent to the outside and follows requirements of the implementation, the object has methods for storing and retrieving the formula in at least two formats:
   123 \begin{itemize}
   124 \item retrieve the formula in MathML content format
   125 \item store the formula in MathML content format
   126 \item retrieve the formula in isabelle text format
   127 \item store the formula in isabelle text format
   128 \item given a subterm selector, retrieve the formula in MathML content format leaving the selected subterm blank for being filled in by the user
   129 \end{itemize}
   130 Other formats can be supported by adding respective store/retrieve methods.
   131  
   132 \subsubsection{The subterm selector object}
   133 The subterm selector object is intended for selecting a subterm of a formula. Its implementation is closely interwoven with the formula object.
   134 It has methods for
   135 \begin{itemize}
   136 \item attaching and detaching a formula
   137 \item navigating the attached formula, i.e. selecting different subterms. Navigation is done by methods like the following (please imagine the term being stored in a tree structure with operators as nodes and variables \& constants as leaves).
   138 \begin{itemize}
   139 \item root - select the whole term
   140 \item down - select the leftmost subterm of the currently selected term
   141 \item up - select the superterm of the currently selected term
   142 \item left - select the previous term on the same level
   143 \item right - select the next term on the same level
   144 \end{itemize} 
   145 \item extracting the selected formula yielding a new formula object
   146 \end{itemize}
   147  
   148 \subsubsection{The tactic object}
   149 The tactic object stores a rule for transforming one formula into another.
   150 Methods implemented include:
   151 \begin{enumerate}
   152 \item retrieve the name of the tactic
   153 \item retrieve a short description of the tactic
   154 \item retrieve a formula illustrating the tactic, if available
   155 \item given a formula \textit{f} the tactic is applied to, retrieve a formula illustrating the application of the tactic on \textit{f}
   156 \end{enumerate} 
   157 
   158 \subsubsection{The problem specification object}
   159 
   160 \subsubsection{The menu object}
   161 
   162 \subsubsection{The worksheet highlight object}
   163 The worksheet highlight object is to the proof displayed on the worksheet what the proof element seletor object is to the proof tree. It is not yet clear whether both objects can be merged into one.
   164 
   165 \subsection{Interfacing with the worksheet}
   166 
   167 \subsection{Interface WPL-WDG}
   168 
   169 \subsubsection{Actions executed by the WPL on behalf of the WDG}
   170 \begin{itemize}
   171 \item \textbf{Redisplay tree}
   172 \item \textbf{Set active formula}
   173 \item \textbf{Highlight parts of the calculation}
   174 \item \textbf{Expand or collapse parts of the calculation}
   175 \item \textbf{Edit the current formula}
   176 \item \textbf{Choose a tactic from a list of applicable tactics}
   177 \item \textbf{Choose a tactic from the knowledge base}
   178 \item \textbf{Open Knowledge Browser}
   179 \item \textbf{Offer a menu of choices}
   180 \end{itemize}
   181 
   182 \subsubsection{User events passed from WPL to WDG}
   183 \begin{itemize}
   184 \item \textbf{Editing of formula completed}
   185 \item \textbf{Editing of tactic completed}
   186 \item \textbf{Menu item selected}
   187 
   188 \end{itemize}
   189 
   190 \subsection{Interface WDG-ME}
   191 
   192 \subsubsection{Actions executed by the ME on behalf of the WDG}
   193 Actions related to a specific calculation (proof-tree):
   194 \begin{itemize}
   195 \item \textbf{Set active formula}
   196 \item \textbf{Modifiy active formula}
   197 \item \textbf{Set next tactic}
   198 \item \textbf{Calculate one step}
   199 Apply the current tactic.
   200 \item \textbf{Calculate to the end of the current sub-problem}
   201 \item \textbf{Calculate to the end of the current problem}
   202 \item \textbf{Find origin of a condition}
   203 \end{itemize}
   204 
   205 Actions not related to a specific calculation (proof-tree):
   206 \begin{itemize}
   207 \item \textbf{Initialize calculation with a problem specification}
   208 \item \textbf{Mark parts of a formula suitable for being filled in by the student}
   209 \end{itemize}
   210 
   211 \subsubsection{Calculational events passed from ME to WDG}
   212 \begin{itemize}
   213 \item \textbf{Tree updated}
   214 \item \textbf{Calculation completed}
   215 Success.
   216 \item \textbf{Failure/Error condition}
   217 \end{itemize}
   218 
   219 \subsection{Interface WDG-Knowledge Browser}
   220 The WDG and the Knowledge Browser communicate at a rather high level of abstraction, contacting an instance of the other component and setting a starting point for further action.
   221 
   222 \subsubsection{WDG used by the Knowledge Browser}
   223 \begin{itemize}
   224 \item \textbf{Create a new Worksheet and initialize it to present an example from the Knowledge Base}
   225 \end{itemize} 
   226 
   227 \subsubsection{Knowledge Browser used by the WDG}
   228 \begin{itemize}
   229 \item \textbf{Use a new or existing KB Window to browse the KB, starting at a point specified by the item highlighted in the Worksheet.}
   230 \end{itemize} 
   231 
   232 
   233 \subsection{Resulting software design considerations for a worksheet component}
   234 
   235 \textbf{The contents of this section is OBSOLETE and kept temporarily for reference.}
   236 In this section, when IDs are mentioned, this is to be taken as a proposal.
   237 ID in this context means ``a way of passing access to a object''.
   238 Function prototypes are used as a short way of titling a paragraph, not as a definition of an interface.
   239 
   240 \subsubsection{Services/Methods offered by the worksheet component}
   241 
   242 \begin{itemize}
   243 \item \textbf{redisplay()} Redraws the display on demand from other components or
   244 the user. 
   245 \item \textbf{update(idFormulaFrom)} Notifies the worksheet of a change in the prooftree.
   246 The ID of the last unchanged formula is passed. The display will be updated
   247 to reflect the changes. Optionally, there could be a flag passing information
   248 whether the calculation is still in progress or the last requested calculation
   249 has completed. 
   250 \item \textbf{expand(idFormulaFrom, idFormulaTo)} (optional) Expands part of the prooftree,
   251 if collapsed. It is not decided yet whether other components will need a way
   252 of collapsing/expandig parts of the prooftree display. 
   253 \item \textbf{collapse(idFormulaFrom, idFormulaTo)} (optional) Collapses part of the
   254 prooftree, if expanded. \par\centering \resizebox*{11cm}{!}{\includegraphics{fig/design_alan.eps} 
   255 } \par{}
   256 \begin{figure}
   257 
   258 \caption{Environment for the worksheet component}
   259 \end{figure}
   260 
   261 \end{itemize}
   262 
   263 \subsubsection{Services/Methods needed by the worksheet component}
   264 
   265 Services needed for displaying the prooftree: Given a reference to a prooftree,
   266 the worksheet will manage its display starting from the ``top'', by asking
   267 (on demand) the prooftree for further elements of the tree.
   268 
   269 \begin{itemize}
   270 \item \textbf{idFormula getFirstFormula()} Get the ID of the first formula in the
   271 prooftree. 
   272 \item \textbf{idFormula getNextFormula(idFormulaCurrent)} Get the ID of the next formula
   273 in the prooftree, given the current formula. 
   274 \item \textbf{idTactic getTactic(idFormulaCurrent)} Get the ID of the next tactic
   275 in the prooftree, given the current formula. A special case arises if the tactic
   276 to continue the current calculation is solving a \textbf{subproblem}. The subproblem
   277 is a claculation on its own, represented by a separate proof(sub-)tree. The
   278 ID of the prooftree representing the subproblem is passed to the worksheet.
   279 The worksheet will handle the situation accordingly, e.g. by opening a new worksheet
   280 or displaying the (indented) new prooftree in the current worksheet. 
   281 \end{itemize}
   282 Services needed for controlling the progress of calculation: The worksheet controls
   283 the calculation by modifying the behaviour at the hot spot in the calculation,
   284 the selcted active formula.
   285 
   286 \begin{itemize}
   287 \item \textbf{setActiveFormula(idFormula)} Makes the passed formula the active formula,
   288 i.e. the formula the next tactic is applied to. 
   289 \item \textbf{indAccepted setEnteredFormula(idFormula)} Tries to replaces the active
   290 formula in the prooftree by the passed formula. This could fail if no valid
   291 derivation from the preceding formula to the (new) active formula can be found. 
   292 \item \textbf{setNextTactic(idTactic)} Set the tactic to be used in the next step
   293 of calculation. 
   294 \item \textbf{idTactic getProposedTactic()} Get the tactic proposed by the mathematics
   295 engine for the next step in the calculation. 
   296 \item \textbf{listTactics getApplicableTactics()} Get a list of tactics applicable
   297 to the active formula. 
   298 \item \textbf{autoCalculate(nSteps)} Calculate the next n steps starting from the
   299 active formula. 
   300 \end{itemize}
   301 Services to handle the underlying formalization have to be discussed and added
   302 yet.
   303 
   304 \begin{itemize}
   305 \item \textbf{idFormula getFirstFormula()} Get the ID of the first formula in the
   306 prooftree. 
   307 \item \textbf{idFormula getNextFormula(idFormulaCurrent)} Get the ID of the next formula
   308 in the prooftree, given the current formula. 
   309 \item \textbf{idTactic getTactic(idFormulaCurrent)} Get the ID of the next tactic
   310 in the prooftree, given the current formula. 
   311 \end{itemize}
   312 Services needed for controlling the progress of calculation: The worksheet controls
   313 the calculation by modifying the behaviour at the hot spot in the calculation,
   314 the selcted active formula.
   315 
   316 \begin{itemize}
   317 \item \textbf{setActiveFormula(idFormula)} Makes the passed formula the active formula,
   318 i.e. the formula the next tactic is applied to. 
   319 \item \textbf{setNextTactic(idTactic)} Set the tactic to be used in the next step
   320 of calculation. 
   321 \item \textbf{idTactic getProposedTactic()} Get the tactic proposed by the mathematics
   322 engine for the next step in the calculation. 
   323 \item \textbf{listTactics getApplicableTactics()} Get a list of tactics applicable
   324 to the active formula. 
   325 \item \textbf{autoCalculate(nSteps)} Calculate the next n steps starting from the
   326 active formula. 
   327 \end{itemize}
   328 Services to handle the underlying formalization have to be discussed and added
   329 yet.
   330 
   331 %WN --- ^^^ -----------------Kopie aus UseCases am 2.9.02-----------------
   332 
   333 \subsection{Draft for an interaction diagram}
   334 
   335 \begin{itemize}
   336 \item they are tired and ask the system to finish the calculation (automated calculation)
   337 \item they know the next step and type in a tactic (input a tactic)
   338 \item they want to find out the next step and request a list of tactics (list of tactics)
   339 \item they want to find out the next step and lookup the knowledge base (look-up knowledge)
   340 \item they input a formula as the next step (input a formula)
   341 \end{itemize}
   342 These choices are described in the respective use cases below, where 'student' is abbreviated by S, the worksheet is abbreviated by WS, the maths engine by ME, and the dialog guide by DG.
   343 
   344 \paragraph{Automated calculation} can be requested, if the proofstate is 'safe' (indicated by ???), i.e. if the students didn't do a misleading step before in this calculation, and the system thus 'knows' how to continue.
   345 \begin{enumerate}
   346 \item S pushes a button {\it Auto} on the WS 
   347 \item {\it Auto} sends the request {\it autoCalculate(nSteps)} to the ME %WN ODER:to the proofstate ???
   348 where {\it nSteps} are provided by the DG %WN(wenn vom DG, sollen wir da gleich genauer sein), oder: by the user ???
   349 \item the ME notifies the WS by {\it redisplay()} that the proofstate has changed
   350 \item the WS %WN ODER wer 'considers ...' ?
   351 considers the actual presentation of the proofstate (e.g. if the previously current formula is still visible), and eventually requests {\it getFromTo(currForm,Endproof)}  %WN... das find ich nicht mehr, sowas \"ahnliches haben wir aber gehabt, oder ???
   352 from the ME
   353 \end{enumerate}
   354 
   355 \paragraph{Input a tactic} is possible any time in order to propagate the calculation from the current formula towards the result.
   356 \begin{enumerate}
   357 \item S inputs the tactic, where the WS distinguishes the input of a tactic - eventually containing formulas - from input of a formula belonging to the calculation
   358 \item the WS requests {\it setNextTactic(idTactic)} from the ME
   359 \item the ME notifies the WS by {\it redisplay()} that the proofstate has changed by appending (or inserting) the formula resulting from the input tactic to the proofstate
   360 \item the WS eventually requests {\it getFromTo(currForm,oneForm)} in order to display the resulting formula
   361 \end{enumerate}
   362 
   363 \paragraph{List of tactics} can be requested any time in order to receive suggestions how to proceed with the calculation. Depending on the setting of the DG, only the tactics applicable to the current formula are displayed, or some larger list.
   364 \begin{enumerate}
   365 \item S pushes a button {\it Tactics} on the worksheet
   366 \item the WS requests {\it getTactics(Applicable)} %WN Applicable?!
   367 from the ME, which returns {\it idsTactics}, a list of tactics
   368 \item the WS performs {\it displayTactics} %WN ???
   369  displaying the list in such a position on the screen, that the current formula is not covered
   370 \item S selects a tactic from the list, and the WS requests {\it setNextTactic(idTactic)} from the ME
   371 \item \dots continuation as above
   372 \end{enumerate}
   373 
   374 \paragraph{Look-up knowledge} is possible any time during a calculation. In general the ME may provide for special views onto the knowledge base depending on the actual proofstate.  In this case the S wants to look for rules of differentiation, and we assume that there is no representation of the knowledgebase active.
   375 \begin{enumerate}
   376 \item S pushes a button {\it theories} %WN?!
   377 \item the WS requests {\it getCurrentTheory} %WN?!
   378 from the ME, which returns an {\it idTheory} %WN oder eine Liste von Theories ??? -- weiss ich selbst noch nicht genau
   379 \item the WS requests {\it getTheoryHierachy(idTheory)} %WN?!
   380 from the (???) knowledge browsers
   381 %WN: die Bezeichnungen 'WEB Browsers' und 'Browsers' in Andreas' Diagramm unterscheiden nicht klar genug zwischen Repr\"asentation und Steuerung; besser w\"are ???
   382 , which return a theory browser, with {\it idTheory} in the focus.
   383 \item S hits the focus, and the theory browser (???) requests {\it getTheory(idTheory)} %WN?!
   384 displaying the theory proposed by the ME
   385 \item after a while S selects the theorem {\it diff\_sum} in the theory browser, which sends the message {\it Selected(idTheorem)} to the WS
   386 \item the WS eventually performs {\it displayTactic} associating {\it Rewrite} and {\it diff\_sum} to the tactic {\it Rewrite diff\_sum} below the current formula
   387 \item {\it setNextTactic(idTactic)} as above \dots
   388 \end{enumerate}
   389 
   390 \paragraph{Input a formula} is interpreted as a derivation of the current formula w.r.t. the actual proofstate. The ME tries to construct this derivation (usually comprising several steps); in this case we assume that constructing the derivation is successful.
   391 \begin{enumerate}
   392 \item S inputs the formula, where the WS distinguishes the input of the formula from the input of a tactic (which may contain formulas, too)
   393 \item the WS requests {\it setNextFormula(idFormula)} %WN ?!
   394 from the ME
   395 \item the ME notifies the WS by {\it redisplay()} that the proofstate has changed by appending (or inserting) the formula resulting from the input tactic to the proofstate
   396 \item the WS eventually requests {\it getFromTo(currForm,nexEnd %WN??
   397 )} in order to display the resulting formula
   398 \end{enumerate}
   399 
   400 % WN-------------------------------------------------------------------------\\
   401 
   402 
   403 \subsection{}
   404 
   405 \subsection{}
   406 
   407 \subsection{}
   408 
   409 
   410 \section{The knowledge browsers}
   411 \label{SDD:knowledge_browser}
   412 
   413 %\subsection{knowledge browser}
   414 The knowledge browser mainly consists of three parts. 
   415 \begin{description}
   416   \item [Browser-Frontend = interface to the user] Is responsible to
   417   answer a user request, forward it to the next layer (processor)
   418   encode the result in a appropriate way and return it to the
   419   requestor. A HTML-browser-frontend will take the requests from the
   420   webbrowser and return HTML-Code to the browser-window. Other
   421   interfaces (like a shell like one) are conceivable.
   422 
   423   \item [processor] The processor has a set of functions to gather the
   424   correct informations to fulfill a frontends request. e.g. if a user
   425   browses the knowledge-base to select a problem, the processor asks
   426   the dialog for a problem description and a match result and returnes
   427   both to the encoder.
   428 
   429   The dialog to connect to is determined by the session which is given
   430   by the frontend. Access permissions are controlled by dinopolis ---
   431   the information-processor is only allowed to connect to the dialog
   432   if it was allowed to in first place (on login by the session-dialog)
   433 
   434   \item [dialog] adjust a processors request to a users needs and
   435   permissions. Each dialog has a usermodel assigned to log his history
   436   and get informations about his permissions. 
   437 \end{description}
   438 
   439 \begin{figure} [htb]
   440 \centerline{\psfig{figure=fig/browser_int.eps,width=11cm}}
   441 \caption{parts of the browser}
   442 \label{}
   443 \end{figure}
   444 
   445 The information processor can be replaced by a mock-object in the
   446 first development step. The ``mock information processor'' has to
   447 deliver example navigationtrees and the corresponding
   448 descriptions. So, the Information-Encoder can be developed and tested
   449 as disjoined Module.
   450 
   451 There is another advantage of splitting the Browser: We can excange
   452 the encoder part to present our information through other channels
   453 than HTML.
   454 
   455 \subsection{Browser Servlet}\label{SSD-browser-servelet}
   456  The servlet is activated whenever a User requests informations from
   457  the Browser. It decodes the request (URL), asks the \emph{Information
   458  Processor} for its infos and returns it using the \emph{Information
   459  Encoder} to present it.
   460 
   461  The browser-servlet is embedded within a servlet-engine
   462  (e.g. tomcat). The servlet-engine is working either as stand-alone
   463  webserver or collaborates with an running conventional web-server
   464  (e.g. apache). The running-mode of the servlet-engine does not affect
   465  the servlet - it communicates with the servlet-engine through
   466  well-defined interfaces. Because the running-mode depends on the
   467  needs of the \isac{}-host and not \isac{} itselve, the choice of its
   468  configuration is left to the hosts administrator.
   469 
   470  \subsubsection{request a problem-description} The request is
   471  recognized by the servlet-engine and forwarded to the servlet through
   472  its interface. Parameters contain the URL used to access the site as
   473  well as informations regarding the requestor. If the request occures
   474  the first time, the parameters have to contain a session-ID to
   475  determine the browser-dialog to connect to. If no session-ID is
   476  given, the sevlet can connect to a default browser-dialog which
   477  represents a ``default-user'' (or \emph{visitor}). Servlet-engines
   478  also support sessions to store informations about repeatedly
   479  connections. This feature can be used to store the dialog to
   480  connect. Note, that the first access has to contain the session-ID
   481  anyway\footnote{this can be fulfilled because the first authenticated
   482  access is always startet by an session-controller which first fetches
   483  the login-informations} and that the servlet-engines can only handle one
   484  session per instance of an webbrowser --- independently of the number
   485  of open browser-windows.
   486 
   487  The session-ID, the ID of the item to show and the presentation mode
   488  are used to gain the page-description from the
   489  information-processor. Missing informations are completed by the
   490  underlaying layers and does not bother the frontend. The returned
   491  informations can be used to generate a web-page in every case. In the
   492  worst case, the information-map contains a failure message to embed
   493  into an HTML-page.
   494 
   495  The information-encoder is used to generate a HTML-page out of the
   496  gained informations. Details to this process are given in section
   497  \ref{SDD:info_encoder}. The outcome of this method-call is the
   498  HTML-representation of the item to present and does not contain any
   499  navigational informations. The navigation tree has to be generated by
   500  an seperate method and is embedded when needed. The implementation
   501  depends of the structure of the resulting web-page. Either the
   502  navigation-tree is located in a seperate frame or it is delivered on
   503  every request. The decission is a matter of usability and should be
   504  left open till the usability can be tested. Therefore, content and
   505  navigation are built up seperatly and combined in the last step
   506  before deliveration to the web-browser.
   507 
   508  \subsubsection{needed methods}
   509 \begin{description}
   510   \item[String BrowserServlet.HTTP\_Request(URL)] This is a
   511   servlet-engine dependent method which is used by the servlet-engine
   512   to forward the request to the servlet\footnote{name and parameter
   513   might vary but the semantic of this method will be the same in all
   514   servlet-engines}. The URL and other context-informations (cookies
   515   and session-informations can be gailed from the environment) are
   516   used to encode the type (static, dynamic) of request and the
   517   information to present. This infos are used to forward the request
   518   to the \emph{information-processor}. The result of this request is
   519   combined with the navigation and returned to the servlet-engine (and
   520   thus to the browser-window).
   521 
   522   \item[HTMLText BrowserEncoder.encodeInformations(information\_map)]
   523     \ \\ see section \ref{SDD:info_encoder}
   524   \item[HTMLText BrowserEncoder.encodeNavigation(navigation\_map)]
   525     \ \\ see section \ref{SDD:info_encoder}
   526   \item[info\_map BProcessor.getInformation(session, descriptionID, mode)]
   527     \ \\ see section \ref{SDD:info_processor}
   528   \item[navigation\_map BProcessor.getNavigation(session, descriptionID)]
   529     \ \\ see section \ref{SDD:info_processor}
   530 \end{description}
   531 
   532 \subsection{Information encoder}
   533 \label{SDD:info_encoder}
   534 The information decoder knows about the way to present informations
   535 but does not have knowledge about the semantic of the
   536 informations. Informations are delivered inside a map. The keys are
   537 used to distinguish the different fields, the assigned values are then
   538 put into proper fields of templates. Because different kinds of
   539 information have to be displayed, a set of templates is used to
   540 generate the fitting HTML-page. Furthermore, there are some pages
   541 which require a strict layout rather than an automatically generated
   542 one (e.g. examples, example-collections). Therfore a first
   543 implementation might use predefined HTML-pages within the
   544 information-map while a more sophisticated version of the encoder
   545 might use a more general way to describe the layout
   546 (\emph{layout-hints}). 
   547 
   548 Besides the pure informations regarding the displayed item, further
   549 information have to be encodes as there are the navigation-tree and
   550 meta-information which enable search-engines to recognize the
   551 mathematical content of the page. 
   552 
   553 \subsubsection{needed methods}
   554 
   555 \begin{description}
   556   \item[HTMLText BrowserEncoder.encodeInformations(information\_map)]
   557   \ \\ encodes the given information. The generation is done with help
   558   of a ``template''. Basically, the template is a ready-made HTML-page
   559   with a few locations to fill in informations. This function has to
   560   parse the HTML and fill in the proper informations out of the
   561   information map. Different templates can be used for different
   562   datatypes. For instance a problem-description will have to present
   563   other informations than an Example or course-mainpage. Optionally, a
   564   predefined layout can be given within the information-map. This
   565   layout overrides the automatically generated one.
   566 
   567   To enhance usability of the system, some requirements regarding the
   568   layout have to be met:
   569   \begin{itemize}
   570 
   571      \item Highlite important informations: in some cases, there are
   572      some informations to be highlighted. e.g. if the user is forced
   573      to find a fitting problem for a calculation, the system can give
   574      feedback if the problem matches and if not it can give detailed
   575      informations wich requirements are not fulfilled. These
   576      ``matching-results'' have to be presented in a proper way.
   577 
   578      \item uniform presentation: The amount of information given
   579      depends on the users needs and permissions. It might be, that
   580      some fields available in one problem are missing in an other
   581      one. The encoder has to ensure, that these missing fields are
   582      handled in a way that the page keeps looking sound.
   583 
   584   \end{itemize}
   585 
   586   \item[HTMLText BrowserEncoder.encodeNavigation(navigation\_map)] \
   587   \\The navigation\_map is a hierarchical map which containes its
   588   nodes as labels and the next treelevel (a map of the same structure)
   589   as value. One node consists of the ID of an item to show and an
   590   ``weight'' for the order within one treelevel. The ID has to be
   591   translated into a link which in turn is used to load an other
   592   item. The structure should support expanding/collapsing of the
   593   branches to enhance clearness. This could be reached e.g. through
   594   java-script.
   595 
   596   \item[HTMLText BrowserEncoder.encodeMeta(information\_map)] \ \\
   597   There are several projects which try to give meta informations for
   598   mathematical content.\kommentar{links zu LOM, DC, MoWGLI einfuegen!} 
   599   This method should be designed to meet the requirements of these
   600   projects and be flexible enough to change between them if the
   601   requirements change. The result of this method is put into the
   602   header of the result-page.
   603 
   604 \end{description}
   605 
   606 \subsection{Information processor}
   607 \label{SDD:info_processor}
   608 The information-processor is responsible for gathering the
   609 information. Therefore it encapsules the communication to the rest of
   610 the isac-system (utilizing dinopolis). It also splits the users
   611 request to some subrequests to the browser-dialog.
   612 
   613 The processor has an internal table to find the assigned
   614 browser-dialog for a session. If no reference to a dialog is present,
   615 the session-dialog is called to get an object-proxy of the
   616 browser-dialog which in turn is used to get the requested
   617 informations. The session-dialog (which created the browser-dialog)
   618 created the browser-dialog with the assigned session-ID when it
   619 received the request to open a new browser. (see section
   620 \ref{SDD:dialog})\frage{authentifikation ?}
   621 
   622 \begin{description}
   623   \item [InfoMap processDescription(DescriptionID, Mode)] Processes
   624   the informations of the wantet Description and puts it into an
   625   map. The resulting \emph{InfoMap} containes copies of all
   626   informations - changes to this Map do not affect the stored
   627   data. The \emph{mode} specifies the way the informations have to be
   628   gathered. The main types are \emph{BROWSE} and \emph{FEEDBACK} where
   629   FEEDBACK also has to contain the adress of the ProveState upon which
   630   the feedback is built.
   631 
   632   \begin{description}
   633 
   634     \item[BROWSE] the \emph{information Processor} just forwards the
   635     request to the \emph{DescriptionStorage} and repacks the gained
   636     informations.
   637 
   638     \item[FEEDBACK] the \emph{information Processor} takes the result
   639     from the \emph{DescriptionStorage} and overloads it with the
   640     informations from the ProoveState. Therefore, the ProofeState
   641     needs a method wich returnes how far the active information fitts
   642     into the State. For Example: if the displayed information is an
   643     Problem, the ProoveState has to perform a match between its model
   644     and the Problem. The result is returned to the
   645     \emph{informationProcessor} which fits it into the
   646     \emph{informationMap}. Statical informations from the
   647     \emph{DescriptionStorage} (where, find, \dots) are replaced by the
   648     state and ``comment'' of the ProveState. (e.g. ``find: x'' becomes
   649     ``find: item missing'')
   650 
   651   \end{description}
   652 
   653 
   654   \item [DescriptionObject getDescription(DescriptionID)] internal
   655   Method to retrieve the Description for a Problem (or Example,
   656   \dots). This method has to establish a connection to the
   657   \emph{description-storage}, encode the ID in correct manner and ask
   658   for the \emph{description-object}.
   659 \end{description}
   660 
   661 \subsection{drowser-dialog}
   662 
   663 \section{description-storage}
   664  When the description-storage accesses the SML-knowledge-base, there
   665  is an helper-layer which encodes the SML-output (text-stream) into
   666  JAVA-Objects and vice versa. This mechanism is not mentioned
   667  explicitely within this explanation.
   668 
   669 \begin{description}
   670  \item[MEadress getBaseRecord(Datatype)] retrieves the Base record of
   671  a given Datatype. For instance \emph{getBaseRecord(PROBLEM)} returns
   672  a adress which is understandable by the mathematic engine and points
   673  to the outermost Problem (e.g. [equation]). This is necessary to get
   674  an entry point for the further query.
   675 
   676  \item[Map getDescription(MEAdress)] retrieves the mathematical
   677  informations about a given entry inside the ME. The Map consists of
   678  the field identifyer (as used within SML) and the assigned data. The
   679  datatype suits the SML-datatype but is delivered as JAVA-Object
   680  (e.g. a SML-List is encoded to a JAVA-List).  Among others, the Map
   681  containes ``children'' which contain a list like [[equation,
   682  univariate, linear], [equation, univariate, plain\_square],
   683  [equation, univariate, polynomial], \dots]
   684 
   685  \item[DescriptionID storeDescription(Map)] takes the information as
   686  given by the ME and stores it inside a database. Therefore it is
   687  neccessary to convert it into fitting Datatypes understood by the
   688  Database. 
   689 
   690  \item[void fetchData(Datatype)] fetches the BaseRecord of the
   691  Datatype (e.g. PROBLEM) and uses \emph{getDescription} to traverse
   692  recursively through the whole Datastructure to generate the
   693  information of the whole information-tree.
   694 
   695  \item[DescriptionObject getDescription(DescriptionID)] returnes the
   696  \emph{description-object} which handles the given description. If
   697  this method is called twice targeting the same description, one and
   698  the same \emph{description-object} is returned.
   699 
   700  \item[DescriptionID createDescription(Datatype)] creates a new
   701  Description of the given Type and return its ID. The Datatype
   702  identifies the number, type and names of fields which are mandatory
   703  and optional for the record\footnote{The datatype might be specified
   704  in a DLD and has to contain metadata as: is the data stored inside
   705  the ME, which fields are only to be changed by the ME, which
   706  identifyer has the Datatype within the ME, \dots}.
   707 
   708  \item[List queryDescriptions(criteria)] queries the database for
   709  Descriptions matching the given criteria. This criteria can be
   710  e.g. Datatype, modification Date, parts of the name, \dots. The
   711  identifyers of the matching Descriptions are returned to the caller.
   712 
   713  \item[navigationTree getNavigation(navId)] builds and returns a
   714  structure which describes a navigation Tree. navigationTree is a
   715  ``nested Map''-like structure but with an unique order of its
   716  keys. \\ A key represents a node inside the tree and contains name
   717  and reference of the related content - the assigned value is a
   718  structure of the same type or \emph{null}. So, the full tree is
   719  recursively built.
   720 
   721  \item[navId newNavigation(navigationTree)] store a new navigationTree
   722  in the description-store.
   723 
   724  \item[List queryNavigation(Criteria)] query the description-store for
   725  a list of Navigation Trees. Criteria can contain Informations like
   726  the content of the tree (e.g. differential equation).
   727 
   728  %\item[set navigation] ??? immuteable navigationtrees ? wenn ein tree
   729  %geaendert wird, muss er neu gesetzt werden ?
   730 
   731 \end{description}
   732 
   733 \subsection{description-object}
   734 \begin{description}
   735  \item[Map getFields()] Returnes a Map of the contained fields and
   736  their types (Maps fieldnames to a fielddescription: datatype,
   737  optional)
   738 
   739  \item[Object getField(fieldname)] Returnes the assigned Field. The
   740  returned values has to be immutable as a datachange is only allowed
   741  through the respective set-Method.
   742 
   743  \item[boolean setField(fieldname, value)] sets the field
   744  \emph{fieldname} to \emph{value}. This operation might fail if the
   745  user does not have the permission to change the field, or
   746  \emph{value} is of the wrong type.
   747 
   748  \item[boolean getWritelock()] request a writelock
   749 
   750  \item[void releaseWritelock()] release the writelock to let other
   751  users change the description
   752 
   753  \item[DescriptionID createChild()] create a new Child of the same
   754  Datatype for this description. This is useful for Examples but not
   755  possible for all types of descriptions. e.g. The children of a
   756  Problem are only created out of the ME - it is not possible for a
   757  user to create a new Problem!
   758 
   759 \end{description}
   760 
   761 \section{The Dialog}
   762 \label{SDD:dialog}
   763 The dialog represents the \isac{}-layer which connects the
   764 frontend-applications with the backend-ressources (math-engine,
   765 description-storage, \dots). It is responsible to adjust the behaviour
   766 of the system to the users needs and permissions. (see \ref{ADD:dialog})
   767 
   768 The ``heart'' of the dialog-layer is the \emph{session-dialog}. It
   769 instantiates new sessions and browser-- or worksheet-- dialoges when
   770 needed. It also registers them on the security system to grant
   771 access-permissions as needed. Therefore, the session-dialog has to be
   772 instantiated on system-startup and registered an the
   773 \emph{dinopolis}\/-NameService to be found by the frontend-applications.
   774 
   775 \subsection{create a new session}
   776 A new session is initiated by the session-controller. This is a
   777 client-side java-programm which queries the dinopolis-nameservice for
   778 the session-dialog and connects with it. The session-dialog requires a
   779 username and the assigned passwort. If the user is assigned to more
   780 then one user-group, it is necessary to enter the active group for the
   781 session (the group determines the behaviour of \isac).  The
   782 session-dialog prepares the user-model for the user and returns
   783 user-preferences to the session-controller if wanted.
   784 
   785 \subsubsection{needed methods}
   786 \begin{description}
   787   \item[groupset SessionDialog.login(username, password)] A public
   788   method to performs an user-login to \isac. If username and password
   789   fit, the set of possible groups for the user are returned to the
   790   caller and the caller is registered on the dinopolis-securityManager
   791   to be autorized to connect to the private methods (openSession)
   792   \frage{laesst sich der caller mit dino-mitteln
   793   feststellen?}. Otherwise \emph{null} is returned to inform the
   794   caller that the login was not successful.
   795 
   796   \item[boolean SessionDialog.openSession(group)] This method is only
   797   accessible for authenticated DinoObjects which performed a login
   798   previousely. If the group fits the assigned user, a new session is
   799   created and assigned to the gid of the caller\footnote{Usually, the
   800   caller will be of type \emph{SessionController}}
   801 
   802   \item[Map SessionDialog.getUserPreferences()] This method is only
   803   accessible for authenticated DinoObjects which performed a login
   804   previousely. A set of readable preferences (such as a
   805   ``default-group'') is returned. Note that there are preferences
   806   which might be readable but not writeable and others which are not
   807   even readable and therefore not included in the returnvalue of this
   808   method.
   809 
   810   \item[boolean SessionDialog.setUserPreferences()] This method is only
   811   accessible for authenticated DinoObjects which performed a login
   812   previously. It is used to alter a users preferences. The
   813   session-dialog checks if all contained preferences are writeable for
   814   the user before it trys to write them to the user-model.
   815     
   816 \end{description}
   817 
   818 \subsection{open a new browser (--window)}
   819 Anthough the WebBrowser runs on the client-side and connects to an
   820 already running WebServer (see Section \ref{SDD:knowledge_browser}),
   821 interaction with the session-dialog is necessary to prepare the system
   822 for the request. The request to open a new browser-window can result
   823 either from the user himself (through the session-controller) or from
   824 an other part of the dialog (worksheet-dialog if the user is forced to
   825 search an item by himselve or browser-dialog if the user jumps into an
   826 other part if the knowledge).
   827 
   828 For the session-dialog, it does not matter who opens the new
   829 browser-window - the behaviour is always the same (access-control is
   830 done through dinopolis)
   831 
   832 \subsubsection{needed methods}
   833 \begin{description}
   834   \item[boolean SessionDialog.openBrowser(params)] This method is only
   835   accessible, if the caller is explicitely allowed to
   836   connect\footnote{the session-dialog gave the permission before
   837   e.g. while login or because the caller was created by the
   838   session-dialog}. The session-dialog looks for the
   839   \emph{browser-dialog} which handles the knowledge-access for the
   840   current session. If no browser-dialog was found, a new one is
   841   created and registered to be allowed to access the current
   842   sessiondialog.
   843 
   844   \emph{params} contains information as start-point and mode of the
   845   access (e.g. problem to start the search from, mode:dynamic to tell
   846   the browser to present the match-results, id of the calculation
   847   within the worksheet-dialog to match with).
   848 
   849   Depending on the type of browser to use (stored in the preferences),
   850   this informations are encoded to an program-call and passed to the
   851   session-controller which executes it. (in case of the http-accessed
   852   browser this programm call could look like ``mozilla -remote 
   853   http://knowledge.isac.at//\-sid=12345\&type=passive'')
   854 
   855   \item[SessionController.execute(Object programmCall)] Executes the
   856   given program. \emph{programCall} can also contain information if
   857   the program to call is native or a java-program (the later can be
   858   called within the same java-machine)\footnote{for informations
   859   regarding the execution of the browser-call see section
   860   \ref{SDD:knowledge_browser}}
   861 
   862 %  This informations are
   863 %  passed to the browser-dialog to prepare it for the upcomming
   864 %  request. The browser-dialog stores the informations and returns an
   865 %  id
   866 
   867 \end{description}
   868 
   869 \subsection{open a new worksheet}
   870 Opening a new worksheet is similar than open open a new
   871 browserwindow. Additional to the single programcall, a new ProoveState
   872 has to be instantiated and filled with the correct informations. The
   873 request to open a new worksheet can result either from the user
   874 himselve or from an other part of the dialog (the browser can start
   875 the calculation of an example or start an empty
   876 calculation). Therefore the browser (-dialog) has to instantiate a new
   877 provestate and fill in the informations used to start the calculation
   878 (see Section \ref{SDD:knowledge_browser} for details) Afterwards, the
   879 provestate is given to the worksheet-dialog to enable the worksheet to
   880 continue the calculation.
   881 
   882 \subsubsection{needed methods}
   883 \begin{description}
   884   \item[boolean BrowserDialog.openWorksheet(params)] If the Browser is
   885   used to initiate a new worksheet, this method is called from the
   886   processor to initiate the ProofState and forward the request to the
   887   session-dialog. The \emph{params} contain the id of the example to
   888   calculate if any. First, the BrowserDialog has to connect the
   889   Description-Storage to gather the informations of the example. Then,
   890   the new ProofState is instantiated and filled with the data. This
   891   ProofState is used to call the SessionDialog which instantiates a
   892   new WorkSheet and connects it with the ProofState (through the
   893   worksheet-dialog).
   894  
   895   \item[boolean SessionDialog.openWorksheet(ProofState)] This method
   896   is only accessible, if the caller is explicitely allowed to
   897   connect. The \emph{ProofState} already containes all information
   898   which are needed to for the calculation. The session-dialog connects
   899   the responsible worksheet-dialog (or instantiates a new one if no is
   900   running) and passes the proof-state. The return-value containes an
   901   identifyer of the running calculation. The SessionController is
   902   called with this id to start a new worksheet. The new worksheet uses
   903   this number to establish an connection to its dialog. Any further
   904   communication bypasses the session-dialog.
   905 
   906   
   907 
   908 \end{description}
   909 
   910 \section{The browser generators}
   911 create a XML-description out of the knowledge-database.
   912 \subsection{}
   913 
   914 \subsection{}
   915 
   916 \subsection{}
   917 
   918 \subsection{}
   919 
   920 \subsection{}
   921 
   922 
   923 \section{The example browser and generator}
   924 
   925 %\subsection{}
   926 
   927 %\subsection{}
   928 
   929 %\subsection{}
   930 
   931