org.universAAL.middleware.ui
Class UIResponse

Package class diagram package UIResponse
java.lang.Object
  extended by org.universAAL.middleware.rdf.Resource
      extended by org.universAAL.middleware.rdf.FinalizedResource
          extended by org.universAAL.middleware.ui.UIResponse
All Implemented Interfaces:
Response

public class UIResponse
extends FinalizedResource
implements Response

Instances of this class can be used to exchange info about user input.

Author:
mtazari, Carsten Stockloew, eandgrg

Field Summary
static String MY_URI
          The Constant MY_URI.
static String PROP_DIALOG_DATA
          The Constant PROP_DIALOG_DATA.
static String PROP_DIALOG_ID
          The Constant PROP_DIALOG_ID.
static String PROP_IS_DIALOG_MANAGER_RESPONSE
          The Constant PROP_IS_DIALOG_MANAGER_RESPONSE.
static String PROP_IS_SUBDIALOG_CALL
          The Constant PROP_IS_SUBDIALOG_CALL.
static String PROP_SUBMISSION_ID
          The Constant PROP_SUBMISSION_ID.
static String PROP_SUBMISSION_LOCATION
          The Constant PROP_SUBMISSION_LOCATION.
 
Fields inherited from class org.universAAL.middleware.rdf.Resource
ANON_URI_PREFIX, blockAddingTypes, isXMLLiteral, ns_delim_index, PROP_RDF_FIRST, PROP_RDF_REST, PROP_RDF_TYPE, PROP_RDFS_COMMENT, PROP_RDFS_LABEL, PROP_SERIALIZATION_FULL, PROP_SERIALIZATION_OPTIONAL, PROP_SERIALIZATION_REDUCED, PROP_SERIALIZATION_UNDEFINED, PROP_uAAL_INVOLVED_HUMAN_USER, props, RDF_EMPTY_LIST, RDF_NAMESPACE, RDFS_NAMESPACE, TYPE_RDF_LIST, TYPE_RDFS_CLASS, uAAL_NAMESPACE_PREFIX, uAAL_SERVICE_NAMESPACE, uAAL_VOCABULARY_NAMESPACE, uri
 
Constructor Summary
UIResponse()
          This constructor is for the exclusive usage by deserializers.
UIResponse(Resource user, AbsLocation inputLocation, Submit submit)
          This constructor is used in the context of a running dialog.
 
Method Summary
 String getDialogID()
          Gets the dialog id.
 String getParentDialogURI()
          Gets the parent dialog uri.
 int getPropSerializationType(String propURI)
          Answers if the given property has to be considered when serializing this individual in a minimized way, and if not ignore-able, whether its value should be presented in its full form or can be reduced.
 String getSubmissionID()
          Gets the submission id.
 AbsLocation getSubmissionLocation()
          Gets the submission location.
 Resource getSubmittedData()
          Gets the submitted data.
 Resource getUser()
          Gets the User.
 Object getUserInput(String[] propPath)
          Gets the user input.
 boolean isForDialogManagerCall()
          Checks if is the response is for the IDialogManager.
 boolean isSubdialogCall()
          Checks if is subdialog call.
 boolean isSubdialogSubmission()
          Checks if is subdialog submission.
 
Methods inherited from class org.universAAL.middleware.rdf.FinalizedResource
addType, getLocalName, getNamespace, getProperty, getPropertyURIs, getType, getTypes, getURI, hasQualifiedName, isAnon, numberOfProperties
 
Methods inherited from class org.universAAL.middleware.rdf.Resource
addMultiLangProp, asList, asList, asRDFList, changeProperty, copy, deepCopy, equals, generateAnonURI, getDefaultLang, getFilename, getMultiLangProp, getOrConstructLabel, getResource, getResourceComment, getResourceLabel, getStaticFieldValue, hashCode, hasProperty, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, isWellFormed, literal, representsQualifiedURI, serializesAsXMLLiteral, setProperty, setPropertyPath, setPropertyPath, setPropertyPathFromOffset, setResourceComment, setResourceLabel, toString, toStringRecursive, toStringRecursive, unliteral
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

MY_URI

public static final String MY_URI
The Constant MY_URI.

See Also:
Constant Field Values

PROP_DIALOG_DATA

public static final String PROP_DIALOG_DATA
The Constant PROP_DIALOG_DATA.

See Also:
Constant Field Values

PROP_DIALOG_ID

public static final String PROP_DIALOG_ID
The Constant PROP_DIALOG_ID.

See Also:
Constant Field Values

PROP_SUBMISSION_LOCATION

public static final String PROP_SUBMISSION_LOCATION
The Constant PROP_SUBMISSION_LOCATION.

See Also:
Constant Field Values

PROP_IS_SUBDIALOG_CALL

public static final String PROP_IS_SUBDIALOG_CALL
The Constant PROP_IS_SUBDIALOG_CALL.

See Also:
Constant Field Values

PROP_SUBMISSION_ID

public static final String PROP_SUBMISSION_ID
The Constant PROP_SUBMISSION_ID.

See Also:
Constant Field Values

PROP_IS_DIALOG_MANAGER_RESPONSE

public static final String PROP_IS_DIALOG_MANAGER_RESPONSE
The Constant PROP_IS_DIALOG_MANAGER_RESPONSE.

See Also:
Constant Field Values
Constructor Detail

UIResponse

public UIResponse()
This constructor is for the exclusive usage by deserializers.


UIResponse

public UIResponse(Resource user,
                  AbsLocation inputLocation,
                  Submit submit)
This constructor is used in the context of a running dialog.

Parameters:
user - reference to the User
inputLocation - location of the User
submit - instance of a submit button that has finished the dialog
Method Detail

getDialogID

public String getDialogID()
Gets the dialog id.

Returns:
ID of the dialog in which this input has been provided

getSubmissionLocation

public AbsLocation getSubmissionLocation()
Gets the submission location.

Returns:
the submission location

getParentDialogURI

public String getParentDialogURI()
Gets the parent dialog uri.

Returns:
the ID of the parent dialog in case this event is about dialog being finished (which can be checked by calling isSubdialogSubmission() method)

getPropSerializationType

public int getPropSerializationType(String propURI)
Description copied from class: Resource
Answers if the given property has to be considered when serializing this individual in a minimized way, and if not ignore-able, whether its value should be presented in its full form or can be reduced. The return value must be one of Resource.PROP_SERIALIZATION_OPTIONAL, Resource.PROP_SERIALIZATION_REDUCED, or Resource.PROP_SERIALIZATION_FULL. It can be assumed that the given property is one of those returned by Resource.getPropertyURIs().
Decision criterion should be if the value of this property is absolutely necessary when this resource is being sent to a remote node. If the subclass rates it as unlikely that the receiver side would need this info, the answer should be PROP_SERIALIZATION_OPTIONAL in favor of lower communication traffic and higher performance even at risk of a possible additional query on the receiver side for fetching this info. With the same rationale, if a property should be included in the process of serialization, it is preferable to include it in a reduced form; in this case the return value should be PROP_SERIALIZATION_REDUCED, otherwise PROP_SERIALIZATION_FULL can be returned. Subclasses should normally overwrite this method as this default implementation returns always PROP_SERIALIZATION_FULL.

Overrides:
getPropSerializationType in class Resource
See Also:
Resource.getPropSerializationType(java.lang.String)

getSubmissionID

public String getSubmissionID()
Gets the submission id.

Returns:
ID of the submit button selected by the user when finishing the dialog

getSubmittedData

public Resource getSubmittedData()
Gets the submitted data.

Returns:
root of the tree with form data submitted.

getUser

public Resource getUser()
Gets the User.

Returns:
the 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.

getUserInput

public Object getUserInput(String[] propPath)
Gets the user input.

Parameters:
propPath - array of property URIs, path of a certain expected user input
Returns:
input from the tree with the form data

isSubdialogCall

public boolean isSubdialogCall()
Checks if is subdialog call.

Returns:
true, if is subdialog call

isSubdialogSubmission

public boolean isSubdialogSubmission()
Checks if is subdialog submission.

Returns:
true, if is subdialog submission

isForDialogManagerCall

public boolean isForDialogManagerCall()
Checks if is the response is for the IDialogManager.

Returns:
true, if the submit was in a standardButton group.


Copyright © 2014 universAAL Consortium. All Rights Reserved.