org.universAAL.middleware.ui.rdf
Class Group

Package class diagram package Group
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.Group
Direct Known Subclasses:
Repeat

public class Group
extends FormControl

The structural unit of forms that serves as a container for other form controls.

Author:
mtazari, Carsten Stockloew

Field Summary
static String MY_URI
           
static String PROP_CHILDREN
          For each group, the list of form controls that have been created with that group as their direct container (parent) in the order of their creation.
 
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
  Group()
          For use by de-serializers only.
  Group(Group parent, Label label, PropertyPath ref, MergedRestriction valueRestriction, Resource initialValue)
          Constructs a new group.
protected Group(String typeURI, Group parent, Label label, PropertyPath ref, MergedRestriction valueRestriction, Object initialValue)
           
 
Method Summary
 void doModelBasedExpansion()
          Based on the knowledge about the type of this group (see FormControl.getTypeURI()), this method generates a hierarchy of form controls that reflects the exact structure known from the type of this group.
 FormControl[] getChildren()
           
 LevelRating getComplexity()
          This should help UI handlers to decide how to "render" a group.
 int getHierarchyLevel()
          Returns the level of this group in the hierarchical structure of a form.
 int getMaxLength()
          Overrides FormControl.getMaxLength() by returning always -1, because no standard string representation of a group exists.
 int getNumberOfSubgroups()
          Returns the number of direct subgroups in this group.
 boolean hasInput()
          Checks if there are any input controls in the subtree rooted at this group.
 boolean hasOutput()
          Checks if there are any output controls in the subtree rooted at this group.
 boolean isRootGroup()
          Checks if this group is one of the standard groups in the form (see the documentation of the class Form).
 FormControl searchFormControl(String formControlURI)
          look for a FormControl within the group with the given URI.
 boolean setProperty(String propURI, Object value)
          For usage 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

PROP_CHILDREN

public static final String PROP_CHILDREN
For each group, the list of form controls that have been created with that group as their direct container (parent) in the order of their creation.

See Also:
Constant Field Values
Constructor Detail

Group

public Group()
For use by de-serializers only.


Group

public Group(Group parent,
             Label label,
             PropertyPath ref,
             MergedRestriction valueRestriction,
             Resource initialValue)
Constructs a new group. The last three parameters will be ignored if the parent is a Repeat control.

Parameters:
parent - The mandatory parent group as the direct container of this group. See FormControl.PROP_PARENT_CONTROL.
label - The optional Label to be associated with this group. See FormControl.PROP_CONTROL_LABEL.
ref - See FormControl.PROP_REFERENCED_PPATH.
valueRestriction - See FormControl.PROP_VALUE_RESTRICTION. Because Groups may contain input controls, you may specify here a MergedRestriction to let the dialog package to derive the value restrictions for any input control whose FormControl.PROP_REFERENCED_PPATH starts with the path given for ref (the previous parameter in this constructor). If ref is null, this parameter will be ignored.
initialValue - A Resource to be used as the initial value for this group. If this is specified, then the initial values of any other control whose FormControl.PROP_REFERENCED_PPATH starts with the path given for the above ref might be derivable from this value.

Group

protected Group(String typeURI,
                Group parent,
                Label label,
                PropertyPath ref,
                MergedRestriction valueRestriction,
                Object initialValue)
Method Detail

doModelBasedExpansion

public void doModelBasedExpansion()
Based on the knowledge about the type of this group (see FormControl.getTypeURI()), this method generates a hierarchy of form controls that reflects the exact structure known from the type of this group. Info about the structure of the type of this group will be available only if FormControl.getTypeURI() returns a subclass of ManagedIndividual ; then, the structural info will be retrieved based on the standard properties of that class and the class restrictions on them. Properties with insufficient restrictions will be ignored. A property of type ManagedIndividual will create a subgroup; a property with a fixed set of values in its range will create a Select or Select1 control, depending on possibly known cardinalities; all other properties will create an InputField. All of the above may be packed in a Repeat control, if the corresponding property allows more than one value.


getChildren

public FormControl[] getChildren()
See Also:
PROP_CHILDREN

getComplexity

public LevelRating getComplexity()
This should help UI handlers to decide how to "render" a group. A group with no subgroups is assumed to have no complexity. Up to 3 non-complex subgroups cause low complexity. More than this or up to 3 subgroups with low complexity cause meddle complexity. More than this or up to 3 subgroups with middle complexity cause high complexity. In all other cases the group is assumed to be fully complex.

Returns:
The complexity of this group as a value between LevelRating.none and LevelRating.full.

getHierarchyLevel

public int getHierarchyLevel()
Returns the level of this group in the hierarchical structure of a form. The standard groups of a form (see the documentation of the class Form) have the level 1. Their direct subgroups have the level 2, and so forth.


getMaxLength

public int getMaxLength()
Overrides FormControl.getMaxLength() by returning always -1, because no standard string representation of a group exists.

Overrides:
getMaxLength in class FormControl

getNumberOfSubgroups

public int getNumberOfSubgroups()
Returns the number of direct subgroups in this group.


hasInput

public boolean hasInput()
Checks if there are any input controls in the subtree rooted at this group.


hasOutput

public boolean hasOutput()
Checks if there are any output controls in the subtree rooted at this group.


isRootGroup

public boolean isRootGroup()
Checks if this group is one of the standard groups in the form (see the documentation of the class Form).


setProperty

public boolean setProperty(String propURI,
                           Object value)
Description copied from class: FormControl
For usage 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)

searchFormControl

public FormControl searchFormControl(String formControlURI)
look for a FormControl within the group with the given URI.

Parameters:
formControlURI -
Returns:
the FormControl or null if not found.


Copyright © 2014 universAAL Consortium. All Rights Reserved.