org.universAAL.middleware.ui.rdf
Class Submit

Package class diagram package Submit
java.lang.Object
  extended by org.universAAL.middleware.rdf.Resource
      extended by org.universAAL.middleware.rdf.FinalizedResource
          extended by org.universAAL.middleware.ui.rdf.FormElement
              extended by org.universAAL.middleware.ui.rdf.FormControl
                  extended by org.universAAL.middleware.ui.rdf.Submit
Direct Known Subclasses:
SubdialogTrigger

public class Submit
extends FormControl

Represents a button in the form that finishes the dialog represented by that form. Each instance of Submit must be associated with a unique ID, called the submission ID in order to keep it decidable how the dialog was finished (i.e. by pressing which button). Critical submits may be associated with a confirmation message to be shown to users in order to make sure that the button was not pressed by mistake. Two types of confirmation messages are supported, either OK/Cancel or Yes/No; the type specifies which buttons should be added by a UI handler to the confirmation dialog.

Author:
mtazari, Carsten Stockloew

Field Summary
static int CONFIRMATION_TYPE_OK_CANCEL
          Critical submits may be associated with a confirmation message to be shown to users in order to make sure that the button was not pressed by mistake.
static int CONFIRMATION_TYPE_YES_NO
          Critical submits may be associated with a confirmation message to be shown to users in order to make sure that the button was not pressed by mistake.
protected  List mandatoryList
          The list of Manadatory Input Controls.
static String MY_URI
           
static String PROP_CONFIRMATION_MESSAGE
          Critical submits may be associated with a confirmation message to be shown to users in order to make sure that the button was not pressed by mistake.
static String PROP_CONFIRMATION_TYPE
          Critical submits may be associated with a confirmation message to be shown to users in order to make sure that the button was not pressed by mistake.
static String PROP_MANDATORY_INPUT
          For maintaining a list of mandatory input controls associated with each submit control that have to be filled by the user before submitting a form via that submit control.
static String PROP_SUBMISSION_ID
          The unique ID that helps to identify with pressing which button a dialog was finished.
 
Fields inherited from class org.universAAL.middleware.ui.rdf.FormControl
PROP_CONTROL_LABEL, PROP_HELP, PROP_HINT, PROP_PARENT_CONTROL, PROP_REFERENCED_PPATH, PROP_VALUE_RESTRICTION
 
Fields inherited from class org.universAAL.middleware.ui.rdf.FormElement
PROP_APPEARANCE
 
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
  Submit()
          For exclusive use by de-serializers.
  Submit(Group parent, Label label, String id)
          For exclusive use by applications.
protected Submit(String typeURI, Group parent, Label label, String id)
           
 
Method Summary
 void addMandatoryInput(Input in)
          For use by applications.
 String getConfirmationMessage()
           
 int getConfirmationType()
           
 String getDialogID()
          For use by UI handlers.
 String getID()
           
 Input[] getMandatoryInputControls()
           
 int getMaxLength()
          The length of a button is the length of its label.
 Input getMissingInputControl()
          UI handlers must call this method as soon as the user decides to submit the form using this submit in oder to make sure if all necessary input has been collected.
 Set getMissingInputControls()
          Same as getMissingInputControl() but returns ALL missing controls instead of the first one.
 FormControl[] getRelatedControls()
          Supports UI handlers that process a form by breaking it into several "subdialog"s, one for each alternative submission, by returning all of the UI controls that are somehow related to this submit.
 boolean hasMandatoryInput(Input fc)
          Checks if the given input control belongs to the list of mandatory inputs of this submit.
 void setConfirmationOkCancel(String msg)
           
 void setConfirmationYesNo(String msg)
           
 boolean setProperty(String propURI, Object value)
          For use by de-serializers.
 
Methods inherited from class org.universAAL.middleware.ui.rdf.FormControl
getAncestorRepeat, getFormObject, getHelpString, getHintString, getLabel, getParentGroup, getParentRepeat, getReferencedPPath, getRestrictions, getSuperGroups, getTypeURI, getValue, hasFocus, hasValue, isOfBooleanType, isOfPrimitiveType, isRepeatable, setHelpString, setHintString, toString
 
Methods inherited from class org.universAAL.middleware.ui.rdf.FormElement
addAppearanceRecommendation, getAppearanceRecommendations
 
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, getPropSerializationType, getResource, getResourceComment, getResourceLabel, getStaticFieldValue, hashCode, hasProperty, isAnon, isBlockingAddingTypes, isClosedCollection, isQualifiedName, isWellFormed, literal, representsQualifiedURI, serializesAsXMLLiteral, setPropertyPath, setPropertyPath, setPropertyPathFromOffset, setResourceComment, setResourceLabel, 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
See Also:
Constant Field Values

CONFIRMATION_TYPE_OK_CANCEL

public static final int CONFIRMATION_TYPE_OK_CANCEL
Critical submits may be associated with a confirmation message to be shown to users in order to make sure that the button was not pressed by mistake. Two types of confirmation messages are supported, either OK/Cancel or Yes/No; the type specifies which buttons should be added by a UI handler to the confirmation dialog.

See Also:
Constant Field Values

CONFIRMATION_TYPE_YES_NO

public static final int CONFIRMATION_TYPE_YES_NO
Critical submits may be associated with a confirmation message to be shown to users in order to make sure that the button was not pressed by mistake. Two types of confirmation messages are supported, either OK/Cancel or Yes/No; the type specifies which buttons should be added by a UI handler to the confirmation dialog.

See Also:
Constant Field Values

PROP_CONFIRMATION_MESSAGE

public static final String PROP_CONFIRMATION_MESSAGE
Critical submits may be associated with a confirmation message to be shown to users in order to make sure that the button was not pressed by mistake. Two types of confirmation messages are supported, either OK/Cancel or Yes/No; the type specifies which buttons should be added by a UI handler to the confirmation dialog.

See Also:
Constant Field Values

PROP_CONFIRMATION_TYPE

public static final String PROP_CONFIRMATION_TYPE
Critical submits may be associated with a confirmation message to be shown to users in order to make sure that the button was not pressed by mistake. Two types of confirmation messages are supported, either OK/Cancel or Yes/No; the type specifies which buttons should be added by a UI handler to the confirmation dialog.

See Also:
Constant Field Values

PROP_MANDATORY_INPUT

public static final String PROP_MANDATORY_INPUT
For maintaining a list of mandatory input controls associated with each submit control that have to be filled by the user before submitting a form via that submit control.

See Also:
Constant Field Values

PROP_SUBMISSION_ID

public static final String PROP_SUBMISSION_ID
The unique ID that helps to identify with pressing which button a dialog was finished.

See Also:
Constant Field Values

mandatoryList

protected List mandatoryList
The list of Manadatory Input Controls.

Constructor Detail

Submit

public Submit()
For exclusive use by de-serializers.


Submit

public Submit(Group parent,
              Label label,
              String id)
For exclusive use by applications.

Parameters:
parent - The mandatory parent group as the direct container of this input field. See FormControl.PROP_PARENT_CONTROL.
label - The optional Label to be associated with this input field. See FormControl.PROP_CONTROL_LABEL.
id - The mandatory submission ID. See PROP_SUBMISSION_ID.

Submit

protected Submit(String typeURI,
                 Group parent,
                 Label label,
                 String id)
Method Detail

addMandatoryInput

public void addMandatoryInput(Input in)
For use by applications.

See Also:
PROP_MANDATORY_INPUT

getConfirmationMessage

public String getConfirmationMessage()
See Also:
PROP_CONFIRMATION_MESSAGE

getConfirmationType

public int getConfirmationType()
See Also:
PROP_CONFIRMATION_TYPE

getDialogID

public String getDialogID()
For use by UI handlers.

Returns:
The ID of the dialog being finished by pressing this button.

getID

public String getID()
See Also:
PROP_SUBMISSION_ID

getMaxLength

public int getMaxLength()
The length of a button is the length of its label. Returns -1, if no label text is set.

Overrides:
getMaxLength in class FormControl

getMandatoryInputControls

public Input[] getMandatoryInputControls()
See Also:
PROP_MANDATORY_INPUT

getMissingInputControl

public Input getMissingInputControl()
UI handlers must call this method as soon as the user decides to submit the form using this submit in oder to make sure if all necessary input has been collected.

Returns:
The input control that is missing user input or null if the form is ready to be submitted.

getMissingInputControls

public Set getMissingInputControls()
Same as getMissingInputControl() but returns ALL missing controls instead of the first one.

Returns:
a Set of Inputs.

getRelatedControls

public FormControl[] getRelatedControls()
Supports UI handlers that process a form by breaking it into several "subdialog"s, one for each alternative submission, by returning all of the UI controls that are somehow related to this submit. An UI control is relevant if it is either a mandatory input for this submit or it has the same parent group as a mandatory input. For answering the demanded array, it first finds the least common parent group among the mandatory inputs and then the whole subtree of that group is traversed based on a depth-first search. The elements of the returned array will be instances of Input, Output, Repeat or SubdialogTrigger.


hasMandatoryInput

public boolean hasMandatoryInput(Input fc)
Checks if the given input control belongs to the list of mandatory inputs of this submit.


setConfirmationOkCancel

public void setConfirmationOkCancel(String msg)
See Also:
CONFIRMATION_TYPE_OK_CANCEL, PROP_CONFIRMATION_MESSAGE, PROP_CONFIRMATION_TYPE

setConfirmationYesNo

public void setConfirmationYesNo(String msg)
See Also:
CONFIRMATION_TYPE_YES_NO, PROP_CONFIRMATION_MESSAGE, PROP_CONFIRMATION_TYPE

setProperty

public boolean setProperty(String propURI,
                           Object value)
For use by de-serializers.

Overrides:
setProperty in class FormControl
Returns:
true if the property changed as a result of the call
See Also:
Resource.setProperty(String, Object)


Copyright © 2014 universAAL Consortium. All Rights Reserved.