SControl
From TechWiki
Contents |
Introduction
The sControl is a special kind of Semantic Component. The sControl is basically just a canvas in the layout. However, depending on the input record(s), schema(s) and the target attribute(s) and type(s), it will embed different other Semantic Components in order to properly display information about the input record(s). Thus, sControl can be seen as a "shapeshifter component.
The sControl component is quite useful to system developers. It deals with the selection of components depending on the inputs. The system developer only has to properly insert that sControl canvas into the layout of the application in order to properly craft the input schemas. Once done, the sControl will do its best to properly display the input data to the users of that system.
Component Selection
Semantic Components are selected by the sControl depending on the target attributes and types, the records description and the schema definitions. When a user or system developer interact with a semantic component, it tries to visualize specific information about a record, for a given purpose. The purpose of the user is defined by two things: (1) target attributes and/or (2) target types. Once the sControl know what the user wants (attributes and types) for given record(s) and schema(s), the sControl select different semantic component to display that information to the user. The definition of the target attributes and types, in the input schema definition(s), will tells the sControl what control to use to visualize the record(s)' information.
Styles
| Style | Description |
| sControl | Style for the main sControl canvas (the one that embed the other semantic components). |
AS3 Usage Examples
var targetAttributes:Array = ["http://purl.org/ontology/foo#bar"];
var targetTypes:Array = [];
/** Create a resultset object instance from the input structXML data */
var resultset:Resultset = new Resultset(XML(inputData));
/** Createthe sControl component */
var semanticControl:sControl = new sControl();
/** Initialize the semantic control */
semanticControl.percentWidth = 100;
semanticControl.percentHeight = 100;
semanticControl.targetAttributes = targetAttributes;
semanticControl.targetTypes = targetTypes;
semanticControl.semanticDataProvider = resultset;
semanticControl.schema = schema;
/** Add the sControl to the main application
this.addChild(semanticControl);
MXML Usage Examples
targetAttributes="foaf_thumbnail"
semanticDataProvider="{semanticDataProvider}" />
In this example, we assume that the {semanticDataProvider},/code> variable is a <code>Resultset, where the record description is defined, accessible at the creation time of the sControl. We also assume that the {schema} variable has a Schema that specifies how to interpret information describing the target record.
Related Libraries
No related external libraries.