public interface IUIBus
IUIBus
is responsible for brokerage between applications that
need to reach human users (in order to present information to them and / or
ask them for intervention) and the so-called UIHandler
s that can
handle the interaction with human users through UI channels under their
control. This bus is a call-based bus without any support for synchronized
delivery of replies (replies will always be delivered in a new thread). It
defines protocols for suspending and resuming dialogs, dynamic adaptation of
"rendering" by a previously selected UIHandler
during the dialog is
running, and transfer of responsibility to another UIHandler
. It
accepts registration parameters from UIHandler
s (when they register
to the bus) and allows removing and/or updating of these parameters.Modifier and Type | Method and Description |
---|---|
void |
abortDialog(String callerID,
String dialogID)
Aborts the dialog upon request from the application or Dialog Manager.
|
void |
adaptationParametersChanged(IDialogManager dm,
UIRequest uicall,
String changedProp)
Only the Dialog Manager (DM) can call this method.
|
void |
addNewProfile(String handlerID,
UIHandlerProfile uiHandlerProfile)
|
void |
brokerUIRequest(String callerID,
UIRequest uicall)
Can be used by applications to send a
UIRequest . |
void |
dialogFinished(String handlerID,
UIResponse uiResponse)
|
void |
dialogSuspended(IDialogManager dm,
String dialogID)
Only the Dialog Manager (DM) can call this method.
|
UIHandlerProfile[] |
getMatchingProfiles(String modalityRegex)
Retrieves all registered UIHandlerProfiles that has restriction for
modality matched by modalityRegex
|
void |
removeMatchingProfile(String handlerID,
UIHandlerProfile oldUIHandlerProfile)
|
void |
resumeDialog(String callerID,
String dialogID,
Resource dialogData)
Applications can use this method to ask the
IUIBus to resume a
dialog that was interrupted due to the activation of a sub-dialog of it. |
void |
unregister(String callerID,
UICaller uicaller)
Unregisters an application's caller from the bus.
|
void |
unregister(String handlerID,
UIHandler uiHandler)
Unregisters the given
UIHandler from the bus.. |
void |
userLoggedIn(String handlerID,
Resource user,
AbsLocation loginLocation)
|
void abortDialog(String callerID, String dialogID)
callerID
- ID of the application that had originally started the dialogdialogID
- ID of the dialogvoid adaptationParametersChanged(IDialogManager dm, UIRequest uicall, String changedProp)
IUIBus
by calling this
method. The IUIBus
may then either notify the UIHandler
in charge of that dialog to consider the changes (if the changes in the
adaptation parameters still match its profile -- see also
UIHandler.adaptationParametersChanged(String, String, Object)
) or
switch to another UIHandler
(if the new situation cannot be
handled by the previous UIHandler
). In the latter case, the
previous UIHandler
is notified to abort the dialog while
returning any intermediate user input collected so far (by calling
UIHandler.cutDialog(String)
), and then the new UIHandler
is mandated (by calling UIHandler.handleUICall(UIRequest)
) to
continue with the dialog presentation without loss of data.dm
- Dialog Manageruicall
- The whole call context that is affected by the change,
including the dialog ID and the the new value of the changed
propertychangedProp
- the property (from among all properties of the call context)
that has changedvoid addNewProfile(String handlerID, UIHandlerProfile uiHandlerProfile)
UIHandler
) with
regard to UIRequest
s that it can handle. Responsible (together
with removeMatchingProfile(String, UIHandlerProfile)
) for
changing the handler's profile dynamically.void dialogFinished(String handlerID, UIResponse uiResponse)
handlerID
- ID of the UIHandler
that has finished the dialog{@link
- UIHandler} response The user input constructed by calling
UIResponse.UIResponse(Resource, AbsLocation, Submit)
void dialogSuspended(IDialogManager dm, String dialogID)
UIRequest
with a higher priority than the running one is
addressing the same user, or because the user wants to switch to another
dialog using the "standard buttons"), then it must notify the
IUIBus
by calling this method. The IUIBus
will then ask
the UIHandler
in charge of handling the running dialog to cut
that dialog (see UIHandler.cutDialog(String)
) and return all user
input collected so far so that the dialog can be resumed later without
loss of data.dm
- Dialog ManagerdialogID
- ID of the dialog to suspendvoid removeMatchingProfile(String handlerID, UIHandlerProfile oldUIHandlerProfile)
UIRequest
s from the profile of the
UIHandler
. Responsible (together with
addNewProfile(String, UIHandlerProfile)
) for changing the
handler's profile dynamically.handlerID
- ID of the calling UIHandler
that had previously
registered 'oldProfile'oldProfile
- the profile registered previouslyvoid resumeDialog(String callerID, String dialogID, Resource dialogData)
IUIBus
to resume a
dialog that was interrupted due to the activation of a sub-dialog of it.
This is the only case where the applications are aware about a dialog
having been suspended because the resumption depends on them having
processed the user input in the context of the sub-dialog and having
incorporated it into the form data of the parent dialog if needed. Then,
they can activate the parent dialog using this method.callerID
- ID of the application that had originally started the dialogdialogID
- ID of the dialogdialogData
- dialog data (see Form.getData()
)void brokerUIRequest(String callerID, UIRequest uicall)
UIRequest
.callerID
- ID of the caller that is sending the UI requestuicall
- The actual UI requestvoid unregister(String callerID, UICaller uicaller)
callerID
- ID of the caller to be unregistereduicaller
- the caller to be unregisteredvoid unregister(String handlerID, UIHandler uiHandler)
UIHandler
from the bus..handlerID
- ID of the handler to be unregistereduiHandler
- the handler to be unregisteredvoid userLoggedIn(String handlerID, Resource user, AbsLocation loginLocation)
handlerID
- id of the UIHandler
which is received when registering
to the IUIBus
. It must be passed to the bus when
calling bus methods.user
- human User
. It is declared as Resource because the
type User is defined in the Profiling Ontology. The type is
not needed for for matchmaking Either.loginLocation
- login Location
of the User
UIHandlerProfile[] getMatchingProfiles(String modalityRegex)
modalityRegex
- - regular expression used for matching
UIHandlerProfile
s modalitiesUIHandlerProfile
sCopyright © 2018 universAAL Consortium. All rights reserved.