Home
cache - The XML Cover Pages
Contents
1. Lles The content eleme elements each of w gt lt ELEMENT content lt ATTLIST content id NMTOK source CDATA how union export hidde cons ny lt l eons tant gt elements lt ELEMENT constant lt ATTLIST constant id NMTOK source CDATA how union export hidde model CDATA value CDATA con ny Kiss The behavior elem specifies what act condition becomes Harmonia Inc 3 0 Language Specification DATA constant property reference call opl MTOKEN IMPLIED DATA IMPLIED union cascade replace replace hidden optional required optional MTOKEN IMPLIED MTOKEN IMPLIED MTOKEN IMPLIED MTOKEN IMPLIED MTOKEN IMPLIED MTOKEN IMPLIED gt e thought of as a property get operation to be read is a constant lement defined t s content section TY gt NMTOK NMTOK EN IMPLI I EN IMPLI I Ca E nt is composed of one or more constant hich specifies some fixed value Pane ji N IMPLIED IMPLIED cascade replace replace n optional required optional gt may be hierarchically structured stants gt N IMPLIED IMPLIE cascade replace replace nloptional required optional IMPLIED IMPLIED gt ent gives one or more rule s that ion is to be taken whenever an associated TRUE CJ Page 109 02 08 2002
2. lt param gt lt property event class MouseListener mouseClicked name X gt lt param gt lt lt call gt lt action gt lt rule gt 5 5 1 5 Resolving Conflicting Property Values A UIML document may contain more than one lt property gt element that sets the same property name for the same property This is illustrated by the following example lt uiml gt lt interface id myinterface gt lt structure gt lt part id Buttonl class JButton gt lt style gt lt property name text gt Am I yellow lt property gt lt property name background gt blue lt property gt lt style gt lt part gt lt structure gt lt style gt lt property part name Buttonl name background gt orange lt property gt lt property part name Buttonl name background gt yellow lt property gt lt style gt lt interface gt lt peers gt lt presentation base Java_1 3_Harmonia_1 0 gt lt peers gt lt uiml gt In the example above the background color of Button is set in three lt property gt elements to blue orange and yellow A rendering engine to resolve such a conflict must follow the following semantic rule Whenever a conflict arises between any two lt property gt elements in a UIML document the lt property gt element that appears last in the canonical representation of the document must be used and the others must be ignored By the above rule the button
3. lt ELEMENT script PCDATA gt lt ATTLIST script id NMTOKEN IMPLIED type NMTOKEN IMPLIED source CDATA IMPLIED how union cascade replace replace export hidden optional required optional gt lt Interface related elements gt lt a gt The structure element describes the initial organization of the parts that comprise the user interfac gt lt ELEMENT structure part gt lt ATTLIST structure id NMTOKEN IMPLIED source CDATA IMPLIED how union cascade replace replace export hidden optional required optional gt Harmonia Inc Page 107 02 08 2002 UIML 3 0 Language Specification lt Specifies a single abstract part of the user interfac gt lt ELEMENT part style content behavior part repeat gt lt ATILIST part id NMTOKEN IMPLIED class NMTOKEN IMPLIED source CDATA IMPLIED where first last before after Nikacyve where part NMTOKEN IMPLIED how union cascade replace replace export hidden optional required optional gt Siss A repeat element encapsulates a sub tree of the overall interface yirtual tr to be repeated 0 or more times Each repeat MUST have one iterator child gt lt ELEMENT repeat iterator part gt lt ATTLIST repeat EMPTY gt lt An iterator defines how many times a sub tree shoul
4. Description The lt event gt element is used in two contexts e As the child of a lt condition gt element The parent condition is satisfied whenever the event occurs For example see event labeled A in Section 5 7 1 e As the child of an lt action gt element The event is fired For example see event labeled 8 in 5 7 1 5 7 5 1 Exceptions as Events lt event gt elements are used to represent spontaneous events that happen in the system The most common example of these type pf events are user generated inputs like mouse clicks and keystrokes However user actions are not the only events that can be modeled by lt event gt elements of UIML exceptions generated programmatically also fit into this model Exceptions occur when something unexpected happens in the underlying system as the result of a lt call gt element s communication to that system see section 5 7 8 for more details on the lt call gt element In the example below the exception MyException is thrown by some method call to the underlying backend This code snippet would catch the exception and execute the action defined in the lt action gt element lt uiml gt lt rule gt lt condition gt lt event class MyException gt lt condition gt lt action gt lt action gt lt rule gt lt uiml gt Note that exceptions are treated differently from normal events in the following way exceptions cannot be associated wi
5. UIML version 3 is a refinement of the previous versions of UIML which were developed starting in 1997 Version 3 differs from UIML 2 in these ways Support for dynamic user interfaces A user interface is viewed as a virtual tree whose initial content is specified by the lt structure gt element and which can change during the lifetime of the user interface Support for multimodal user interfaces A user interface can contain multiple lt interface gt elements that are simultaneously used and kept synchronized For example a user interface might offer a voice UI and a screen based UI e g on a mobile phone and the user can at any time use either mode of interaction voice or display keypad Refinement of many language constructs based on implementation experience with UIML 2 These items are described by proposals for changes to UIML 2 posted in the past on www uimLorg It is Harmonia s intent that UIML 3 0 can be freely implemented by anyone UIML 3 0 may be implemented without any license cost due to Harmonia Inc Harmonia Inc Page 4 02 08 2002 UIML 3 0 Language Specification Contents 1 Introduction to UIML 3 0 ciccusescasciasscesswatetsosscussevicen cess ooicrstouvansseusastoasontenstoisansdecsecosionbdessoson 8 1 1 UIML an Open Specification ssesssecssooesooesoocesoeessecesocesocesoocessesssecssccssoosesossssesssose 11 1 2 Relationship of UIML to XML XSL XForms and CSS ccssssccsssscssssscs
6. ccescceescesceeseeeenseeneenseeeees 76 6 2 2 1 Defining Legal Part Class Names Via lt d class gt eeseeesceseceseeereeenseeeeeeees 76 6 2 2 2 Defining Legal Property Names for lt part gt Classes via lt d property gt 78 6 2 2 3 Defining Legal Events and Listeners for Part Classes Via lt d class gt 80 6 2 2 4 Defining Legal Event Property Names Via lt d class gt ue cee eeeeeeseesteeeeeeeees 84 OS THE lt logic gt Element iv ssccsssvesesssvncsscsaessseencevescosavncesuvees sesensevncncevevnsvossuvsnsensenatsestaveseeness 85 6 4 Subelements of lt presentation gt and lt lOQiC gt csscccssrrccssrcccssscccsssccsssscssssscssssscesenes 87 6 4 1 The lt d component gt Element vesccccvivickesstinieccctivas eeeradivaeet ec ones 87 6 4 2 ETI lt u class gt Element onde ke aly res atv vay acto se Apacer EO a LA Ea 87 6 4 3 Le lt 0 Dropers yo Element hoses diced E ecas E E ies aoe 88 6 4 4 The lt d miethod gt Element iscsi osese 89 6 4 5 bhe lt paraini gt Element eleri ee aa a E tomas aa aa aaa daca 90 6 4 6 The lt s ript gt Element e aA a E NAE 91 7 Reusable Interface Components esscessoesssecsocesocesoosesseessecssocesooesoosesseesoccesocssoosssossssesssose 92 TL Th lt femplate gt Elementsin sonnesvesessavececevees sosissevnsncvsenesdessuvsnscessvensseiavessenees 92 TZ Rules for Templates eccccssscatessacenccacacncsssaasenssoseences on ceanee as eaneee sasea esr seas aan 93
7. ff fl Page 111 call op event iterator gt denotes that a name defined with d class should be attached as a listener to the which contains this lt listener gt element 02 08 2002 UIML 3 0 Language Specification Appendix B Behavior Rule Selection Algorithm The lt behavior gt element contains one or more lt rule gt elements Sometimes the condition for more than one rule may be satisfied at the same time A UIML rendering engine must render UIML in such a way that when a condition of a lt rule gt element is true the associated lt action gt element is executed UIML does not define any order on evaluation of lt condition gt elements Non deterministically choose a lt rule gt element from UIML file foreach rule inside behavior do Evaluate the condition of the rule if eval rule condition TRUE then A condition is found that evaluates to true Scan lt action gt elements sequentially foreach element inside action do If the element is a property if element instanceof property then do property assignment If the element is a method lse if element instanceof method then do method call If the element is an event This must be the last element in the action lse if element instanceof method then do event firing RETURN end foreach End when a rule is found and its actions are executed RETURN endif end foreach Harmon
8. lt part class JCheckBox gt lt style gt lt property name text gt lt iterator id i gt lt property gt lt style gt lt part gt lt repeat gt lt part gt lt uiml gt The example above demonstrates the two uses of the lt iterator gt element and would result in the appearance of a JDialog containing ten JCheckBoxes The JCheckBoxes would be numbered 1 to 10 5 7 11 The lt restructure gt Element DTD lt ELEMENT restructure template gt lt ATTLIST restructure At part NMTOKEN IMPLIED how union cascade replace delete replace where first last before after ast where part NMTOKEN IMPLIED source CDATA IMPLIED gt Description The lt restructure gt element provides a way for the UI to change as a result of some condition being met Most conditions include but are not limited to user s interactions For example using the Java AWT Swing vocabulary for UIML a UI containing a window with a button and a panel is described like this lt StTruUcture gt lt part class JFrame name F gt lt part class JButton name B gt lt part class JPanel name A gt lt part gt lt structure gt Suppose when the initial UI is displayed we wanted only the button to appear When the user clicks the button the panel appears We would use the lt restructure gt element to define the necessary changes within the UI to remove the button and dis
9. lt presentation gt element lt component gt is no longer a valid child of lt presentation gt It has been replaced by lt d class gt Attribute name has been replaced by attribute id Harmonia Inc Page 114 02 08 2002 UIML 3 0 Language Specification Attribute base has been added lt property gt element Attribute name has been replaced by attribute id lt op gt lt event gt and lt iterator gt are now valid children of lt property gt lt reference gt element Attribute url name has been added lt restructure gt New element in UIML 3 0 lt returns gt element lt return gt is no longer a valid UIIML element Instead use the returns value attribute in element lt d method gt This change was made because the lt returns gt element was redundant with the type attribute in the lt d method gt element The type attribute has been replaced by attribute returns value hence lt returns gt is replaced by returns value lt rule gt element Attribute name has been replaced by attribute id lt script gt element Attribute name has been replaced by attribute id lt structure gt element Attribute name has been replaced by attribute id lt style gt element Attribute name has been replaced by attribute id lt system gt element lt system gt is no longer a valid UIML element lt template gt element lt component gt is no longer a valid child of lt template gt lt d class gt lt
10. Press me lt uiml gt lt interface gt lt part class JButton gt lt style gt lt property name text gt Press me lt property gt lt style gt lt part gt lt interface gt lt peers gt lt presentation base Java_1 3_Harmonia_1 0 gt lt peers gt lt uiml gt Now let s look at what is required in the lt presentation gt element to map the UIML property text to the proper Java set method for javax swing JButton This is defined in the two lt d property gt elements below lt uiml gt lt template gt lt presentation gt lt d class id JButton used in tag part maps type class maps to JjJavax swing JButton gt lt d property id text maps type setMethod maps to setText gt lt d param type java lang String gt lt d property gt lt d property id text return type Jjava lang String maps type getMethod maps to getText gt lt d class gt lt presentation gt lt template gt lt aiml gt The lt d property gt elements in the box above say that a property named fext can be used with JButtons In a lt property gt element that sets the property the Java method setText java lang String should be used To get the property use javax swing JButton getText A JButton has many other properties these are defined by additional lt d property gt elements e g to set color font icon where the ellipsis appears in the lt pr
11. The methods are e replace e union and e cascade When using the first choice replace all the children of the element on the main tree that sources the template are deleted and in their place all the children of the lt template gt element are added see Figure 1 With union all the children of the element on the main tree that sources the template are kept and all the children of the lt template gt element are added to the list as well see Figure 2 In both cases the children of the lt template gt element are given a fully qualified id to distinguish them from children of the sourcing element This fully qualified id is constructed by identifying the child s location in the UIML tree Thus the id is generated by starting with the lt uim1 gt element and tracing downward through the tree The original id of the element will be pre pended with the id of every element above it in the UIML tree e g id lt interface id gt __ lt structure id gt __ lt grandparent id gt __ lt parent id gt __ lt original id gt This rule applies to any element irrespective of whether the id attribute is specified or not This is because the DOM assigns an id value for elements for which an id is not specified To avoid conflicts with the naming conventions other languages use __ has been chosen as delimiter for id appending The last choice is cascade This is similar to what happens in CSS 2 The children fr
12. lt ATTLIST restructure at part NMTOKEN IMPLIED how union cascade replace delete replace where first last before after tast where part NMTOKEN IMPLIED source CDATA IMPLIED gt lt ELEMENT ca param gt lt ATTLIST ca name NMTOKEN IMPLIED class NMTOKEN IMPLIED gt ae event denotes one of three things 1 When a child of lt condition gt or lt op gt denotes that when the event is fired the condition should be evaluated 2 When a child of lt action gt denotes that the named event should Harmonia Inc Page 110 02 08 2002 3 gt UIML 3 0 Language Specification be fired Inside lt d class gt denotes that the named event can occur for the part class named by the lt d class gt ENT lt ELEM event EMP lt ATTLIST event name class part name part clas EYS NMTOK NMTOK NMTOK s NMTOK zZ IMPL IMPL IMPL IMPL ae o EI Ba C Z I I 11 Ty Be ef E Le Vv OUD param denotes a single actual parameter to a call able routine CDATA property referenc KEN IMPLIED gt lt a gt lt ELEMENT param P lt ATTLIST param name NMTO lt listener used in tag listener d cLlass gt lt ELEMENT istener lt ATTLIST listener class attacher Harmonia Inc EMPTY gt NMTOKEN IMPLI CDATA IMPLI
13. lt ELEMENT lt ATTLIST UIML 3 0 Language Specification behavior rule gt behavior id NMTOKEN IMPLIED source CDATA IMPLIE how union cascade replace replace export hidden optional required optional gt lt ELEMENT rule condition action gt lt ATTLIST rule id NMTOKEN IMPLIED source CDATA IMPLIED how union cascade replace replace export hidden optional required optional gt At the moment rule s may be associated with two types of condi expre EALOmS s ssion 1 whenever som xpression is equal to some other and 2 whenever som vent is triggered and caught lt ELEMENT condition equal event op gt lt ELEMENT lt ELEMENT lt ATTLIST lt ELEMENT equal event constant property reference op gt op constant property reference call op event gt op name CDATA REQUIRED gt action property call restructure event when true when false by default gt lt ELEMENT when true property call restructure op equal event gt lt ELEMENT when false property call restructure op equal event gt lt ELEMENT by default property call restructure op equal event gt lt ELEMENT restructure template gt
14. lt d param id pl type int gt K pl 26 40 Ib lt d param id p2 type int gt leap io an ine gt lt d method gt lt d component gt lt logic gt lt peer gt If the type attribute is omitted the parameter type is assumed to be string the value is then converted into the type required by the function to which the named method maps i e Harmonia Inc Page 60 02 08 2002 UIML 3 0 Language Specification myFunction in the example above This type conversion is performed in accordance with the rules of the language in which the rendering engine is implemented By default the return value from a method is ignored it is not made available to the element enclosing the lt call gt from which the invocation is made The return value can be made available by specifying the return type attribute of the lt d method gt element as in the following lt peer gt lt Logic gt lt d component id back1 maps to org uiml example myClass gt lt d method id m1 maps to myFunction return type int gt lt d param id pl type int gt lt d param id p2 type int gt lt d method gt lt d component gt lt logic gt lt peer gt 5 7 8 3 Invoking Methods Upon External Objects in RMI CORBA LDAP and EJB So far the examples shown have all made use of objects that are implicitly instantiated within and managed by the same rendering engine that manages the user interface UIML itself
15. lt rule gt lt Window Closing gt lt rule gt lt behavior gt lt interface gt This example demonstrates that by using templates UI designers can specify a set of operations common across platforms on a device or even possibly across devices Here the template defines a set of rules for common desktop UI interactions namely mouse movements and button clicks The UI implementer then sources the template using how union to add the rules defined in the template to their custom lt behavior gt element In this case the represented UI running on a X Windows platform would have a lt behavior gt element consisting of three rules a rule for mouse movements a rule for button clicks and a rule for middle mouse button clicks Similarly the UI running on a MS Windows platform would have a lt behavior gt element with a rule for mouse movements a rule for button clicks and a rule for window closing Notice that the UIML author only had to define the rules for the common interactions once 7 2 3 Combine Using Cascade When using several UIML files to define a user interface a UIML file may source other UIML files to include other parts not already within the interface defined in the current UIML file The sourced file may in turn source more files for more extensions to the set of interface components thereby increasing the richness of the presented interface Through the use of the cascade value of the attribute how this abilit
16. E21 Combine Using Replacers e a ESE EE O EEA at 95 V2 32 Combine Usmg UM OMG 1212544 sep eors tesh aaee a ert aE E EEEN EESE 96 7 2 3 Combine Using Cascadesss in onri ioii a as E ee 97 Tod M ltiple Incl sionSs ssissssiscsrssscsssressisieesssosessesizeessbss cessi ssesest tsa ot sakse seast o issoro takissa 99 TA The export Attrib t sssisssssossessisesscsissosessostesssssssssssossisssosssecsssssitonsst oi sassto osiers osis oss ess 99 8 Alternative Organizations of a UIML Document ssesssocessecssecssocesocsssocessccssocesocssooseso 101 8 1 Normal XML Mechanism ssesssesssooesoosssosssseessesssocssoosssosssoosesoesssesssoessoossssssssssssse 101 8 2 UIML Template Mechanism ssooesssooesssoocsesooecesosccssssocessscossesocesssssesesssoosessoossssso 101 CAA E EE A E A E EE E EE 103 Appendix A UIML 3 0 Document Type Definition csssccsssscssssccsssscessssceseeees 104 Appendix B Behavior Rule Selection Algorithm eessoessooessocssscessecesocesooesoossssesssecssosee 112 Appendix C Changes from UIML 2 0a Specification 1 17 2001 scscsccsssessseeseee 113 Harmonia Inc Page 7 02 08 2002 UIML 3 0 Language Specification 1 Introduction to UI ML 3 0 UI Markup Language 3 UIML3 is a declarative XML compliant meta language for describing user interfaces UIs that refines the UIML2 specification released in 2000 7 The original UIML specification was released in 1998 5 The
17. L1 TF A_T2_L3 A_T2_TA C As the UI is modified the virtual UI tree changes At any point in time when a lt restructure gt is processed the where attribute refers to the current virtual tree So if we executed the above restructures and then the following the resulting order of components in the panel would be A_T1_L2 L1 TF A_T2_L3 A_T2_TA A_T3_L4 C lt restructure at part A how append where before where part C gt lt template id T3 gt lt part gt lt part class JLabel id L4 gt lt part gt lt template gt lt restructure gt The template tag surrounding the part tag provides a resolution mechanism for any name conflicts that might occur when using append Consider the restructure tag below lt restructure at part A how append gt lt template id T4 gt lt part gt lt part class Label id L1 gt lt part gt lt template gt lt restructure gt There is already a part named L1 as a child of A but the part L1 being added gets renamed to A T4 L1 so now the panel A has the following children A_T1_L2 L1 TF A_T2_L3 A_T2_TA A_T3_L4 C A_T4_L1 Replace Example To replace the entire panel with a new panel containing just a label and a text field do this Harmonia Inc Page 67 02 08 2002 UIML 3 0 Language Specification lt restructure at part A how replace gt lt template id T5 gt lt part gt lt part class JLabel is L1 gt lt pa
18. The URI may either be an element in the same document as the source appears or in a different document URI names the same document The two elements must either have the same tag or the URI must name a lt tfemplate gt element lt style id Simple gt lt style gt lt style id Complex source Simple how cascade gt lt style gt URI names another document Again the two elements must either have the same tag or the URI must name a lt template gt element Note that this URI is for demonstration only and is not truly active lt part id Dialog source http uiml org templates Dialog uiml SimpleDialog how replace i gt A how attribute of cascade achieves behavior similar to cascading in CSS while replace allows a UIML document to be split into multiple files 5 2 3 The export Attribute The export attribute is used in the context of templates See Section 7 4 for details Harmonia Inc Page 31 02 08 2002 UIML 3 0 Language Specification 5 3 The lt interface gt Element DTD lt ELEMENT interface structure style content behavior gt lt ATTLIST interface id NMTOKEN IMPLIED source CDATA IMPLIED how append cascade replace replace export hidden optional required optional gt Description All lt uiml gt elements that describe a user interface are contained in the lt interface gt element The lt interface gt element describes a
19. create The value of the name attribute can either be symbols representing operators or the written name of the operator itself The following is a list of valid operators Name Operator Definition equal A B_ Returns true if A equals B notequal A B Returns true if A does NOT equal B and amp amp A amp amp B Returns true if and only if both A and B are true or II AIIB Returns true if either A or B is true lessthan lt A lt B Returns true if A is less than B greaterthan gt A gt B Returns true if A is greater than B The children of lt op gt are the operands for the conditional The following is a list of valid children elements each of which have different semantics from each other 1 The child is a lt constant gt lt property gt lt reference gt or lt call gt element The string value of the element is used as the operand for the conditional The following example illustrates a conditional that compares if two values are equal to each other lt condition gt lt op name equal gt lt property name value part name city gt lt constant value Los Angeles gt lt op gt lt condition gt 2 The child is an lt event gt element The operand for the conditional is the boolean value resulting from the evaluation of determining whether that specified event was caught The following conditional hold true if the event buttonClicked was caught and the v
20. e The value of base is case insensitive e If the value of base is x then the following URL must define x http uiml org toolkits x uiml This URL must contain a lt template gt element whose child is a lt presentation gt element whose children define the vocabulary x Requests to post a new file should be sent to info uiml org e Every rendering engine must implement one or more base vocabularies If a rendering engine implements vocabulary uiml org toolkits x uiml then the rendering engine must be able to render any document that contains lt presentation base x gt with or without the source attribute e For example a rendering engine could be created to display UIs using the Java 1 3 Swing and AWT toolkits in this case the rendering engine might recognize the vocabularies Java_1 3_Harmonia_1 0 uiml JavaAWT_1 3_Harmonia_1 0 uiml and JavaSwing_1 3_ Harmonia_1 0 uiml Such a rendering engine must also render custom classes that a UIML author creates that extend Swing classes by writing their own lt presentation gt element to extend the base vocabulary e Consider the following lt presentation gt element lt presentation source MySwing_1 0_JoeProgrammer_0 1 uiml vocab base Java_1 3_Harmonia_1 0 gt e The lt presentation gt element says that any rendering engine that implements vocabulary uiml org toolkits Java_1 3_Harmonia_1 0 uiml can render the UIML document Harmonia Inc Page 73 02 08 2002 UI
21. let such an element be E The source attribute names a lt template gt element either within the same document or in another document The lt template gt element named must be an element of the same type as the element E i e have the same tag name The source attribute causes the body of the element inside the template to be combined with the body of E The rules to control how this combining is done are explained later in Section 7 2 Simple Example Using the source Attribute lt xml version 1 0 gt lt DOCTYPE uiml PUBLIC _ Harmonia DTD UIML 3 0 Draft EN http uiml org dtds UIML3_0a dtd gt lt uiml gt lt peers gt lt presentation base Java_1 3_Harmonia_1 0 source http uiml org toolkits Java_1 3_Harmonia_1 0 uiml vocab gt lt peers gt lt waml gt The lt presentation gt element contains a source attribute that names a URL The effect of this is to insert as the body of the lt presentation gt element a fragment that is named by the URL The URL http uiml org toolkits JavaA WT_1 3_Harmonia_1 0 uimI in turn contains the following Harmonia Inc Page 92 02 08 2002 UIML 3 0 Language Specification lt xml version 1 0 gt lt DOCTYPE uiml PUBLIC UIT DTD UIML 3 0 Draft EN http uiml org dtds UIML3_0a dtd gt lt uiml gt lt template id vocab gt lt presentation base Java_1 3_Harmonia_1 0 gt lt d class id Frame used in tag part maps type class maps to j
22. part is centralized where the part is defined The UIML document can be split into multiple documents with different documents loaded only when an event triggers loading A rendering engine can start rendering before an entire UIML document is received to reduce latency for an end user in large UIML documents The DTD presented in Appendix A permits these combinations Refer to the DTD for precise information on what organizations are legal Often it is desirable to put UIML fragments into separate files and then include one file within another This can be accomplished in two ways in UIML 8 1 Normal XML Mechanism XML allows file inclusion as illustrated below lt xml version 1 0 encoding ISO 8859 1 gt lt xml version 1 0 gt lt IDPOCTYPE uiml PUBLIC _ Harmonia DTD UIML 3 0 Draft EN http uiml org dtds UIML3_0a dtd gt lt ENTITY peers SYSTEM http uiml org peers ui gt lt ENTITY parts SYSTEM parts wi gt lt ENTITY style SYSTEM style ui gt lt ENTITY content SYSTEM content ui gt lt ENTITY behavior SYSTEM behavior ui gt lt uiml gt amp peers lt interface gt parts amp style amp content behavior lt interface gt lt uiml gt 8 2 UI ML Template Mechanism Using the lt template gt element a UIML document can be broken down into multiple pieces as explained in Section 7 1 The major difference between the normal XML mechanism and UIML tem
23. www harmonia com products java gallery index htm http www harmonia com products html examples htm http www harmonia com products wml examples htm and http www harmonia com products voice gallery htm Harmonia Inc Page 103 02 08 2002 UIML 3 0 Language Specification Appendix A UIML 3 0 Document Type Definition lt xml version 1 0 encoding ISO 8859 1 gt ai User Interface Markup Language UIML Developed by Harmonia Inc Usage lt xml version 1 0 gt lt DOCTYPE uiml PUBLIC Harmonia DID UIML 3 0a Draft EN http uiml org dtds UIML3_0a dtd gt NOTE This URL has not yet been activated lt uiml gt lt head gt lt head gt lt template gt lt template gt lt peers gt lt peers gt lt interface gt lt interface gt lt uiml gt Description This DID corresponds to the UIML 3 0a specification Change History lt Content Models 2 lt a uiml is the root element of a UIML document lt ELEMENT uiml head template interface peers gt The head element is meant to contain metadata about the UIML document You can specify metadata using the meta tag this is similar to the head meta from HTML lt ELEMENT head meta gt lt ELEMENT meta EMPTY gt Harmonia Inc Page 104 02 08 2002 UIML 3 0 Language Specification lt ATTLIST meta
24. 66 5 7 12 The lt when true gt Element oesnsssessenssesseesseeesseessresseesseeessseesseesseesseeeseressseesseese 68 5 7 13 The lt when false gt Element 4cce0es ssccashececuswsi ccctdunt ovcaahes acca sucxasautiusctdaptncaneaaatceamante 69 S714 The lt by default gt Elementene en anon den E A E E 69 5 715 The lt param gt Element sssrinin r a a E A EE E A eee 69 Peer C mponentS os sess vse vs cava ecu e ccecien nebo vnsc conbdia yeas eu sees siea idaosas cieea tes Peo aeieea dso Eee 71 6 1 The lt peers gt Re ment sisiccieccisescinisavataceseitalacesslascaedsscussecdinesilucsesudspssvaeilectsiaadiurssiadsaave 71 6 2 The lt presentation gt Element sisissssssscscisssvscssincidevacesacaneadaasscdensassceaesisavaccaxcacsadnnscvaenssaess 72 6 2 1 Naming an Existing Vocabulary in lt presentation gt essssesececserereerrerereseee 12 6 2 1 1 Labeling Base Vocabularies with Attribute base eessseeccsreerereerrerereseee 73 6 2 1 2 Labeling Custom Vocabularies with Attribute source ci eeeeeeeeeseeeteeeteeeeee 75 6 2 1 3 Permitted Optimization for Rendering Engine eee eeeeeeeeeeeeeeeteeeesteeeees 75 6 2 1 4 Multiple Presentation Elements sseseseseeseeseeesesssesesseserssressereresressesereesersresees 75 6 2 1 5 Suggested Use of Base Attribute in Authoring Tools eeeeeseseeeeeresreereresee 76 Harmonia Inc Page 6 02 08 2002 UIML 3 0 Language Specification 6 2 2 Creating a New Vocabulary Using lt presentation gt
25. Section 22N The semantics of a lt reference gt element is to replace the element with the lt constant gt element whose id attribute matches the constant name attribute of the lt reference gt element Or if the url name attribute is specified to replace the lt constant gt element contained within the document located by the URI given as the value of the url name attribute If no such element exists then the UIML document cannot be rendered Implementations of UIML should retrieve content from lt reference gt elements during the context of rendering regardless of the context of from where the lt reference gt is being defined 5 7 The lt behavior gt Element DTD lt ELEMENT behavior rule gt lt ATTLIST behavior id NMTOKEN IMPLIED source CDATA IMPLIED how append cascade replace replace export hidden optional required optional gt Description The behavior element describes what happens when an end user interacts with a user interface For example the lt behavior gt element might describe what happens when an end user presses a button The lt behavior gt element also describes when and how the user interface invokes methods recall from Section 1 4 that a method refers to functions procedures database queries and so on The lt behavior gt element contains a sequence of rules Each rule contains a condition and a list of actions Whenever a condition holds the asso
26. Structune gt lt part id ok class JButton gt lt part id label class JLabel gt lt structure gt lt behavior gt lt rule gt From UIML2JAVAI referenceURLinAction uiml Harmonia Inc Page 37 02 08 2002 UIML 3 0 Language Specification lt condition gt lt event part name 0k class actionPerformed gt lt condition gt lt action gt lt property part name label name text gt lt reference url name referenceContent xml gt lt property gt lt action gt lt rule gt lt behavior gt lt peers gt lt presentation base Java_1 3_Harmonia_1 0 source http uiml org toolkits Java_1 3_Harmonia_1 0 uiml vocab gt lt peers gt Another lt property gt element The value of one property can be set to the value of another property For example suppose we want to set the font of part p to whatever font p2 currently has The following UIML achieves this lt property part name p1 name font gt lt property part name p2 name font gt lt property gt The nested lt property gt element gets the font of p2 The nested property does a get because it is nested in another lt property gt element as explained in Section 5 5 1 2 That returned value then becomes the value of the font property in part p It should be noted that defining a child lt property gt element of a nested lt property gt element is undefined and does not prov
27. UI and a user s interaction with a UI not the interaction of the UI and the backend application logic The lt ogic gt element is used to describe the Ul application logic interaction see Section 6 3 A UIML interface may be as simple as a single string or as complex as hundreds of lt interface gt elements that employ various interface technologies e g voice graphics and 3D An interface is composed of four elements structure see Section 5 4 style see Section 5 5 content see Section 5 6 and behavior see Section 5 7 5 4 The lt structure gt Element DTD lt ELEMENT structure part gt lt ATTLIST structure id NMTOKEN IMPLIED source CDATA IMPLIED how append cascade replace replace export hidden optional required optional gt Description An application program can have a UI with one or more organizations associated with it By organization we mean the set of UI widgets that are present in the interface and the relationship of those widgets to each other when the interface is initially rendered The relationship might be spatial e g in a graphical UI or temporal e g in a voice interface The lt structure gt element defines the initial organization of the interface represented by the UIML document This organization can be envisioned as a virtual tree of parts with each part s associated content behavior etc attached to it For example th
28. UI widget names Button List and so on The UIML author can then directly use these names as class names when defining parts lt Sstructure gt Harmonia Inc Page 42 02 08 2002 UIML 3 0 Language Specification lt part class Button id submitButton gt lt structure gt On the other hand suppose we want to design a UIML document that could be mapped either to Java AWT or to Java Swing And suppose the Web resource named in the lt peers gt element introduced all the Swing class names as vocabulary to use in the UIML document Now if we want to map the submitButton either to an AWT Button or to a Swing JButton then we could not make submitButton s class Button Instead UIML permits the introduction of a psuedo name chosen by the UIML author Suppose we choose as our class name AWTorSwingButton Our UIML fragment above then becomes this lt structure gt lt part class AWTorSwingButton id submitButton gt lt structure gt Now comes the key idea The style element is used to map AWTorSwingButton to either Button or JButton lt style id AWT specific gt lt property part class AWTorSwingButton name rendering gt Button lt property gt lt style gt lt style id Swing specific gt lt property part class AWTorSwingButton name rendering gt JButton lt property gt lt style gt If the rendering engine is invoked with style name AWT specific then the submitButton will map to an AWT but
29. a dictionary The dictionary contains a list box in which an end user can select a term i e Cat Dog Mouse The dictionary also contains a text area in which the definition of the currently selected term is displayed For example if Cat is selected on the left a definition of a cat replaces the string Select term on the left The style element in the UIML document that describes this interface uses the properties found in the Java AWT and Swing components Harmonia Inc Page 18 02 08 2002 UIML 3 0 Language Specification S Simple Dictionary Pick a term Definition Boxes are overlaid on the UIML document to make reading easier by identifying major elements Harmonia Inc Page 19 02 08 2002 UIML 3 0 Language Specification lt xml version 1 0 gt lt DOCTYPE uiml PUBLIC _ Harmonia DTD UIML 3 0a Draft EN http uiml org dtds UIML3_0a dtd gt lt l This ts Dictionary is Displays one window on the screen containing a list of animals and a textbox Clicking an animal s name displays a definition in the textbox gt lt uiml gt lt peers gt lt presentation base Java_1 3_Harmonia_1 0 gt lt peers gt lt interface gt lt structure gt lt part class JFrame id JFrame gt lt part class JLabel id TermLabel gt lt part class List id TermList gt lt part
30. a url name attribute that contains a URI to an external document containing lt constant gt elements Example uses of the lt reference gt element are given in Sections 5 5 1 3 and 5 6 There are several uses for references The same text string might be used in two or more places in a UIML document In this case a lt constant gt element can be defined containing the string and anywhere the string is required e g as values of a property the lt reference gt element can be used Thus if we can modify the text in the lt constant gt element the change propagates to all the places in the UIML document that is referenced Often an interface part is initialized to contain several text strings and when an event later occurs for the part an lt egual gt element tests to see which text string the end user selected in triggering the event For example lists and choices in Java AWT contain multiple text items In this case a lt constant gt element can be defined in the content element and then the part s values can be initialized in the style element using a lt property gt element Harmonia Inc Page 48 02 08 2002 UIML 3 0 Language Specification containing a lt reference gt element as its value In the lt behavior gt element the lt rule gt element handling events for the part can test whether the item selected corresponded to the lt constant gt element by using a lt reference gt element An example of this appears in
31. accomplished by XSL 8 or by a program written in a traditional programming language 2 By interpreting UIML meaning that a program reads UIML and makes calls to an API that displays the UI and allows interaction Interpretation is the same process that a Web browser uses when presented with an HTML document Rendering engine Software that performs the actual process or rendering a UIML document UI Widget UIML describes how to combine UI widgets The UI toolkit with which the UI is implemented provides primitive building blocks which we call widgets The term widget is traditionally used in conjunction with a graphical UI However we use it in a more general sense to mean presentation elements of any UI paradigm For example a widget might be a component in the Microsoft Foundation Classes or Java Swing toolkits or a card or a text field in a WML document In some toolkits a widget name is a class name e g the java awt Button class in the Java AWT toolkit or the CWindow class in Microsoft Foundation Classes If the toolkit is a markup language e g WML HTML VoiceXML then a widget name may be a tag name e g CARD or TEXT for WML The definition of names is outside the scope of this specification as explained in Section 2 1 Harmonia Inc Page 12 02 08 2002 UIML 3 0 Language Specification Render Time This is the period of time before the interface is displayed to the user During this time the renderi
32. author uses a custom vocabulary that he she creates a new UIML file containing a lt template gt element whose id attribute is vocab and whose body is a lt presentation gt element containing lt d class gt elements defining the custom vocabulary Unless this recommended practice is followed the custom vocabulary cannot be reused in multiple UIML documents Furthermore the name of the UIML file should use the following syntax lt custom vocab name gt _ lt custom vocab version gt _ lt your organization s name gt _ lt your version of vocab gt uiml For example if you developed a library of classes that extends Java 1 3 Swing and you call the library MySwing and the current version of MySwing is 1 0 and your name is JoeProgrammer and this is the first UIML file you wrote to define the vocabulary version 0 1 then you might name the custom vocabulary file MySwing_1 0_JoeProgrammer_0 1 uiml Any UIML documents that use this custom vocabulary should then contain the following element lt presentation source MySwing_1 0_JoeProgrammer_0 1 uiml vocab base Java_1 3_Harmonia_1 0 gt 6 2 1 3 Permitted Optimization for Rendering Engine An implementation of a rendering engine may omit reading the lt presentation gt element to reduce the execution time of and mitigate the effect of network delays upon rendering time Instead the engine might cache copies of the presentation files for the toolkits that it supports e g Jav
33. behavior gt lt template gt lt interface gt lt style id MyStyle source Graphical how cascade gt lt property name content part name myAbout gt About Harmonia Inc lt property gt lt style gt lt interface gt The example above contains a template that defines the style for all parts of the class ADialog The rendering property given in the template indicates that Adialog will be rendered as a Dialog which is mapped to some interface widget in the target vocabulary The rest of the properties defined in the template s lt style gt set the TitleColor property to blue set the TitleFont property to Arial and set the content of the ADialog to About UIT When the template is sourced in the interface each of these properties will be applied to the part element myAbout However since the content property has also been set in the style section of the interface and the template was sourced using how cascade the value assigned to content in the template will be overwritten Thus the result is that myAbout will be rendered as a Dialog the TitleColor property will be set to blue the TitleFont property will be set to Arial and the content will read About Harmonia Inc Elements are said to be conflicting if one of two conditions is true e The source and target element has the same value for the id attribute e Neither the source nor the tar
34. can be optionally modified Harmonia Inc Page 99 02 08 2002 UIML 3 0 Language Specification UIML allows the encapsulation of the elements inside a template by controlling what is visible and what is not with the export attribute Setting the export attribute to optional replicates the default behavior meaning that the element can be accessed remains visible by elements outside the lt template gt element Any element inside the template with the export attribute set to hidden cannot have its properties changed outside the template and a rendering engine must generate an error if an attempt is made to change a hidden property outside the template Also any element with the export attribute set to required must be assigned a value before the template can be rendered The semantics of lt part export hidden gt mean that no properties of the part listed in the template may be modified outside the template The semantics of lt part export required gt mean that all properties given in the template of the part must be defined outside the template The semantics of lt part gt lt property name x export hidden gt lt part gt mean that property x cannot be modified outside the template regardless of whether the lt part gt element has an export attribute The semantics of lt part gt lt property name x export required gt lt part gt mean that property x must be defined ou
35. events in a UIML document as well as the legal property names The formal definition of a vocabulary is done through a lt presentation gt element containing lt d class gt elements see Section 6 2 2 Each lt d class gt element defines a legal class name At present the list of standard vocabularies is posted on http uiml org toolkits in the form of a set of lt presentation gt templates that may be included into UIML documents In the remainder of this section we first discuss Section 6 2 1 UIML s use of a standard set of vocabulary names which is all that most UIML authors need to know about the lt presentation gt element Then Section 6 2 2 we discuss how to define a new vocabulary using the children of the lt presentation gt element 6 2 1 Naming an Existing Vocabulary in lt presentation gt Normally a UIML author uses an existing vocabulary Therefore UIML requires a way to label each UIML document with the vocabulary used in that document The labeling follows a convention and authors of new UIML vocabularies must follow this convention There are two categories of vocabularies e Vocabularies with widespread use whose definition is posted on uiml org in http uiml org toolkits Examples are vocabularies for Java 1 3 AWT and Swing HTML 3 2 WML and VoiceXML We call these base vocabularies e Custom vocabularies that individuals companies or other organizations define These may or may not be not post
36. for clicks on a JButton The UIML document below extends our previous example to provide a behavior for an event called ActionListener actionPerformed for our Java JButton lt uiml gt lt interface gt lt part class JButton gt lt behavior gt lt rule gt lt condition gt lt event class ActionListener actionPerformed gt lt condition gt lt action gt lt action gt lt rule gt lt behavior gt lt part gt lt interface gt lt peers gt lt presentation base Java_1 3_Harmonia_1 0 gt lt peers gt lt uiml gt Here are the elements in lt presentation gt in Java_1 3_Harmonia_1 0 uiml to define the event actionPerformed for a button click lt uimil gt lt template gt lt presentation gt lt Define Event Classes gt lt d class id ActionEvent used in tag event maps type class maps to java awt event ActionEvent gt lt d class gt lt i Define Event Listener Classes gt lt d class id ActionListener used in tag listener maps type class maps to JjJava awt event ActionListener gt lt d method id actionPerformed maps to actionPerformed gt lt d param id event type ActionEvent gt lt d param gt lt d method gt lt d class gt lt i Define Part Classes gt Harmonia Inc Page 82 02 08 2002 UIML 3 0 Language Specification lt d class id JButton used in tag part
37. generic tags The UIML syntax also defines tag attributes that map these elements to a particular toolkit However the vocabulary of particular toolkits e g a window or a card is not part of UIML because the vocabulary appears as the value of attributes in UIML Thus UIML only needs to be standardized once and different constituencies of end users can define vocabularies that are suitable for various toolkits independently of UIML Thus a UIML author needs more than this document which specifies the UIML language You also need one document for each UI toolkit e g Java Swing Microsoft Foundation Classes WML to which you wish to map UIML The toolkit specific document enumerates a Harmonia Inc Page 15 02 08 2002 UIML 3 0 Language Specification vocabulary of toolkit components to which each lt part gt element in a UIML document is mapped and their property names 2 1 4 First UIML Example Hello World Here is the famous Hello World example in UIML It simply generates a UI that contains the words Hello World lt xml version 1 0 gt lt DOCTYPE uiml PUBLIC Harmonia DTD UIML 3 0 Draft EN http uiml org dtds UIML3_0a dtd gt lt uiml gt lt interface gt lt SUCructure gt lt part id TopHello gt lt part id hello class helloc gt lt part gt lt structure gt lt style gt lt property part name TopHello name renderin
38. in the base attribute or by a URI e g http uiml org toolkits Java_1 3_Harmonia_1 0 uiml A compiler or interpreter that renders UIML documents should also access the URI to map property names in the UIML document to the desired UI toolkit Thus to use UIML one needs both a copy of this specification and a document defining the property names used in a particular peer element 5 5 1 2 Semantics of lt property gt Element The semantics of a lt property gt element are as follows e If the lt property gt element is a child element of a lt param gt see Section 5 7 15 lt op gt see Section 5 7 6 or another lt property gt element then the semantics for that child lt property gt element are to get a single property s value e Otherwise the semantics are to set a value for a single property of an interface part event or call Harmonia Inc Page 36 02 08 2002 UIML 3 0 Language Specification 5 5 1 3 Legal Values for lt property gt Elements The value for each lt property gt element can be one of the following A text string In this case the property has no children and its body is set to the character sequence If the string contains the ampersand character amp or the left angle bracket lt then they must be escaped using either numeric character references or the strings amp amp and amp lt respectively see 0 for more rules about strings and XML documents Note that A UIML parser must p
39. lt structure gt element then a UIML rendering engine must select by id exactly one lt structure gt element and ignore all other lt structure gt elements The id of the selected element is supplied by a mechanism outside the scope of this specification The lt structure gt element whose id matches the supplied id is then used and all other lt structure gt elements are ignored If the supplied id does not match the id attribute of any structure or if no id is supplied then the last lt structure gt element appearing in the UIML document must be used Example lt structure id ComplexUI gt lt part class c2 id n3 gt lt part class cl1 id n2 gt lt part gt lt structure lt structure id SimpleUI gt lt part class cl id n1 gt lt structure gt lt structure id default gt lt part class cl id n1 gt lt part class c2 id n2 gt lt structure gt 5 4 1 1 Dynamic Structure The question remains as to how this initial virtual tree can be modified over the lifetime of the interface Several types of dynamism exists in user interfaces The three types that can be represented in UIML are described below e Content is dynamically supplied when the UI is rendered This is handled by the lt reference gt element in section 5 6 2 Harmonia Inc Page 33 02 08 2002 UIML 3 0 Language Specification e The virtual tree of UI parts is modified during the lifetime of a UI See the lt rest
40. maps type class maps to JjJavax swing JButton gt lt listener class java awt event ActionListener attacher addActionListener gt lt d class gt lt presentation gt lt template gt lt uiml gt The section under the comment Define Event Classes defines a class named ActionEvent The children of lt d class id ActionEvent gt are discussed in Section 6 2 2 4 This is analogous to the lt d class id onClick gt element in the HTML lt presentation gt earlier The section under the comment Define Event Listener Classes uses the lt d class used in tag listener gt element to define a Java event listener This section has no analog in the HTML lt presentation gt earlier because the HTML event model Method 1 does not use listeners The section under the comment Define Part Classes was shown in our earlier examples and defines the JButton class Here we add lt listener gt elements to list which listeners are used with a JButton The lt istener gt element includes an attacher attribute that names the method that the JButton uses to attach the listener to itself For example the UIML above says that JButton has a method called addActionListener that is used to attach an ActionListener to a JButton To summarize the above UIML says that one of the events in Java AWT Swing is ActionEvent one of the listeners is ActionListener ActionListener has a method named actionPerformed that
41. may be helpful when developing applications using UIML UIML is intended to be an open standardized language which may be freely implemented without any licensing costs The goal of this document is to elicit feedback from the wider community Comments are encouraged please send them to uiml editor uiml org or participate in discussion on http www uiml org discussion A submission to a standards organization will occur after comments are received and this draft specification is finalized This document may be distributed freely as long as all text and legal notices remain intact 1 4 Terminology Certain terminology used in the specification is made precise through the definitions below Application When we speak of building a UI the UI along with the underlying logic that implements the functionality visible through the interface is called the application Canonical Representation A UI metaphor independent enumeration of the parts behaviors content and style of a user interface End user The person that uses the application s UI Harmonia Inc Page 11 02 08 2002 UIML 3 0 Language Specification Application Logic Code that is part of the application but not part of the UI Examples include business logic e g in the form of Enterprise Java Beans Common Object Request Broker Architecture CORBA objects databases and any type of service that might run on a server e g an a Lightweight Directory Access Protocol L
42. name NMTOKEN REQUIRED content CDATA REQUIRED gt a tee The peers element contains information that defines how a UIML interface component is mapped to the target platform s rendering technology and to the backend logic gt lt ELEMENT peers presentation logic gt lt ATTLIST peers id NMTOKEN IMPLIED source CDATA IMPLIED how union cascade replace replace export hidden optional required optional gt lt The interface element describes a user interface in terms of presentation widgets component structure and behavior specifications gt lt ELEMENT interface structure style content behavior gt lt ATTLIST interface ig NMTOKEN IMPLIED source CDATA IMPLIED how union cascade replace replace export hidden optional required optional gt ees The template element enables reuse of UIML elements When an element appears inside a templat lement it can sourced by another element with the same tag gt lt ELEMENT template behavior constant content d class d component interface logic part peers presentation property restructure rule script structure style gt lt ATTLIST template id NMTOKEN IMPLIED gt lt Peer related elements gt ea The presentation element specifies the mapping between abstract interface parts and platform depend
43. specify the rendering property not only for part class but also part name In this case the rendering specified only applies to the part with the specified part name Second the rendering property can also be specified for event class One of the powerful aspects of UIML is the naming of events In a conventional language e g Javascript events have names reflective of the interface components to which they correspond e g OnClick for a button However one UIML document may be mapped to several different platforms An interface part p might be a button on platform or a menu item on platform 2 Therefore the lt event gt element for part p specifies a class attribute that can be set to whatever the UIML author wishes e g ButtonOrMenuSelection The lt style gt element in the UIML document then map the name ButtonOrMenuSelection to a platform specific name In this case there would be lt style gt elements with two different ids lt style id Platforml gt lt style gt lt style id Platform2 gt lt style gt The lt style gt element then maps the generic name e g ButtonOrMenuSelected to a button selection in platform 1 and a menu item selection in platform 2 using the rendering property lt style id Platforml gt lt property event class ButtonOrMenuSelected name rendering gt ButtonSelected lt property gt lt style gt lt style id Platform2 gt lt property event class ButtonOrMenuSelecte
44. the document or portions thereof that you use 1 A link to or statement of the URL http www uiml org docs uiml30 2 The pre existing copyright notice of the original author If no such notice exists a notice of the form Copyright Harmonia Inc 1999 2002 All rights reserved THIS SPECIFICATION IS PROVIDED AS IS COPYRIGHT HOLDERS MAKE NO REPRESENTATIONS OR WARRANTIES EXPRESS OR IMPLIED INCLUDING BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY FITNESS FOR A PARTICULAR PURPOSE Harmonia Inc Page 3 02 08 2002 UIML 3 0 Language Specification Abstract UIML provides a highly device independent method to describe a user interface UIML factors any user interface description into six orthogonal pieces answering six questions Sl oe ele ale 6 What are the parts comprising the UI What is the presentation look feel sound used for the parts What is the content e g text images sounds used in the UI What is the behavior of the UI e g when someone clicks or says something What is the mapping of the parts to UI controls in some toolkit e g Java Swing classes or HTML tags What is the API of the business logic that the UI is connected to UIML is a meta language which is augmented by a vocabulary of user interface parts properties and events defined outside this specification In this way UIML is independent of user interface metaphors e g graphical user interface dialogs
45. used to make the interface are JFrame JLabel List JLabel and TextArea http uiml org toolkits Java_1 3_Harmonia_1 0 uiml defines these names as corresponding to the Java AWT and Swing classes javax swing JFrame javax swing JLabel java awt List javax swing JLabel and java awt TextArea So whenever these names are used as the class for a lt part gt element the default value of the rendering property for the parts defaults to the corresponding AWT or Swing class Thus the lt part gt with id DefnArea will be rendered as a java awt TextArea The lt style gt element comes next The lt style gt element in this example sets five properties on the part named JFrame the layout manager to GridBagLayout the frame background to blue the upper left corner of the frame to appear 100 pixels down and 100 pixels to the right of the upper left corner of the screen the frame dimensions to 500 pixels wide and 300 pixels high and the frame title the text that appears in the band at the top of the frame to Simple Dictionary The next four properties apply to all parts whose class name is JLabel There are two such parts TermLabel and DefnLabel The foreground color two properties associated with GridBagLayout gridx and gridy and the font are the same for all labels The remaining properties in the lt style gt element are properties of individual parts in the interface The next box contains the lt behavior gt element Th
46. will have a background color of yellow in the preceding UIML document Note that in canonical form lt property gt elements whose grandparent is interface are appended to the end of the lt style gt element whose parent is the part or parts to which the properties refer The relative order of the lt property gt elements is preserved when they are moved From UIML2JAVAI PropOrder0 uiml Harmonia Inc Page 40 02 08 2002 UIML 3 0 Language Specification In the following example the Button Button2 and Button3 have background colors red yellow and green respectively lt uiml gt lt interface id myinterface gt lt StTrUCTUrEe gt lt part id Buttonl class JButton gt lt style gt lt property name text gt Am I red lt property gt lt property name background gt yellow lt property gt lt style gt lt part gt lt part id Button2 class JButton gt lt style gt lt property name text gt Am I yellow lt property gt lt style gt lt part gt lt part id Button3 class JButton gt lt style gt lt property name text gt Am I green lt property gt lt style gt lt part gt lt structure gt lt style gt lt property part class JButton name background gt green lt property gt lt property part name Buttonl name background gt red lt property gt lt property part name Button2 name background gt yellow lt property gt lt style gt lt interface gt lt p
47. 0 Language Specification when a user interacts with the interface as a set of rules with conditions and actions the connection of the UI to the outside world e g to business logic and the definition of the vocabulary of part classes For a comparison of the separation in UIML to existing UI models such as the Model View Controller refer to Phanouriou 5 3 UIML views the structure of a UL logically as a tree of UI parts that changes over the lifetime of the interface There is an initial tree of parts which is the UI initially presented to a user when the interface starts its lifetime During the lifetime of the interface the tree of parts may dynamically change shape by adding or deleting parts For example opening a new window containing buttons and labels in a graphical interface may correspond to adding a sub tree of parts to the UIML tree UIML provides elements to describe the initial tree structure lt structure gt and to dynamically modify the structure lt restructure gt 4 UIML allows UI parts and part trees to be packaged in templates Templates may then be reused in various interface designs This provides a first class notion of reuse within UIML which is missing from other XML UI languages such as HTML and WML Due to these concepts UIML is particularly useful for creating multiplatform multimodal multilingual and dynamic UIs Here are some examples To create multiplatform UIs one uses concept 1 to cr
48. 2 type int gt lt d method gt lt d component gt lt logic gt lt peer gt As this example shows the value of the location attribute is a standard URL whose syntax varies with the URL s protocol in this case rmi This particular URL states that the remote object can be found on host myHost myCompany com and that the object is registered under the name Adder Once a reference to this object is obtained by the rendering engine the reference is downcast to a reference to class org uiml example myClass A rendering engine implementation may support any protocol for the location attribute as long as the protocol supports obtaining object references The Java Renderer version 1 0b supports the protocols and corresponding URL formats shown below PROTOCOL URL FORMAT rmi hostnamef port registeredname lioo iiop nostname port registeredname Idap hostname port entrypath entryname ejb hostname port jndi_name 5 7 9 The lt repeat gt Element DTD lt ELEMENT repeat iterator part gt lt ATTLIST repeat EMPTY gt Description A lt repeat gt element must enclose one lt iterator gt element and a set of one or more lt part gt elements The lt part gt elements denoted as children of the lt repeat gt element are repeated with their children a number of times designated by the lt iterator gt element The lt repeat gt elements parent lt p
49. DAP server In a three tier system architecture model the application logic is the middle layer that mediates communication between the database and presentation layers Device A device is a physical object with which an end user interacts using a UI such as a PC a handheld or palm computer a cell phone an ordinary desktop voice telephone or a pager UI Toolkit A toolkit is the markup language or software library upon which an application s UI runs Note that we use the word toolkit in a more general sense than its traditional use We use it to mean both markup languages that are capable of representing UIs e g Wireless Markup Language WML HTML and VoiceXML as well as APIs for imperative programming languages e g Java AWT Java Swing Microsoft Foundation Classes Platform A platform is a combination of a device operating system OS and a UI toolkit An example of a platform is a PC running Windows NT on which applications use the Java Swing toolkit Another example is a cellular phone running a manufacturer specific OS and a WML 11 renderer Rendering Rendering is the process of converting a UIML document into a form that can be displayed e g through sight or sound to an end user and with which an end user can interact Rendering can be accomplished in two ways 1 By compiling UIML into another language e g WML Java which allows display and interaction of the UI described in UIML Compilation might be
50. ML 3 0 Language Specification containing the lt presentation gt element even though the rendering engine was written without knowledge of what is in vocabulary MySwing_1 0_JoeProgrammer_0 1 uiml It is the responsibility of the UIML author to insure consistency between the values of the source and base attributes For example the UIML author should not define class names mapped to HTML tags in MySwing_1 0_JoeProgrammer_0 1 uiml and then set base to a vocabulary for Java e g Java_1 3_Harmonia_1 0 The following table gives the vocabulary that a rendering engine actually uses to render a 92 993 UIML document The table assumes that the lt presentation gt has the attribute base x Does lt presentation gt contain source pees Example ib lt presentation gt Vocabulary is defined by this see attribute e g have body below source y Combination of y and if the body of Yes Doesn t matter lt presentation gt is not empty anything 4 in the body of lt presentation gt No uiml org toolkits x uiml 1 2 3 No Yes uiml org toolkits x uiml augmented 5 by the body of lt presentation gt Here are some examples of legal lt presentation gt elements and their meanings La lt presentation base Java_1 3_Harmonia_1 0 gt UIML document must be rendered by rendering engines implementing vocabulary uiml org toolkits Java_1 3_Harmonia_1 0 uiml lt presentation base HTML_3 2_Harmo
51. New element in UIML 3 0 lt d component gt element New element in UIML 3 0 lt d method gt Harmonia Inc Page 113 02 08 2002 UIML 3 0 Language Specification New element in UIML 3 0 lt d param gt element New element in UIML 3 0 lt d property gt element New element in UIML 3 0 lt equal gt element lt op gt is now a valid child of lt equal gt lt interface gt element Attribute name has been replaced by attribute id lt listener gt element New element in UIML 3 0 lt logic gt element lt component gt is no longer a valid child of lt ogic gt It has been replaced by lt d component gt Attribute name has been replaced by attribute id lt method gt element lt method gt is not longer a valid UIML element It has been replaced by lt d method gt lt op gt element New element in UIML 3 0 lt param gt element This element has been split into two elements lt param gt which is used with the lt call gt element and lt d param gt which is used with the lt d method gt element PCDATA lt property gt lt reference gt lt op gt lt event gt and lt call gt are now valid children lt part gt element lt repeat gt is now a valid child of lt part gt Attribute name has been replaced by attribute id Attributes where and where part have been added for use with lt restructure gt lt peers gt element Attribute name has been replaced with the attribute id
52. User Interface Markup Language UIML Specification Document Version 08 February 2002 DRAFT Language Version 3 0 Send technical comments to uiml editor uiml org Harmonia Creating harmony between people and computers UIML 3 0 Language Specification User Interface Markup Language UIML Specification Version 3 0 Status First draft Release 02 08 2002 Editors Marc Abrams abrams uiml org Jim Helms jhelms harmonia com Harmonia Inc P O Box 11282 Blacksburg VA 24062 1282 U S A 1 540 951 5900 Latest UIML specification HTML http www uiml org specs This version HTML http www uiml org docs uiml30 15Aug01 html PDF http www uiml org docs uim130 15Aug01 pdf Previous versions UIML version 2 0a January 17 2000 http www uiml org specs docs uiml20 17Jan00 pdf UIML version 2 0 August 8 1999 http www uiml org specs docs uim120 990801 pdf http www uiml org specs docs uiml20 990801 html UIML version 1 0 December 1997 http www uiml org specs docs uiml_v10_ref PDF Harmonia Inc Page 2 02 08 2002 UIML 3 0 Language Specification Copyright 2002 Harmonia Inc Permission to use copy and distribute the contents of this document but not to excerpt it modify it or create derivative works in any medium for any purpose and without fee or royalty is hereby granted provided that you include the following on ALL copies of
53. a Inc Page 91 02 08 2002 UIML 3 0 Language Specification 7 Reusable I nterface Components UIML templates enable interface implementers to design parts of their UI or even the entire UI itself as reusable components to be exploited by other UIs For example many UIs for electronic commerce applications include a credit card entry form If such a form is described in UIML as a template then it can be reused multiple times either within the same UI or across other UIs This reduces the amount of UIML code needed to develop a UI and also ensures a consistent presentation across enterprise wide UIs This is desirable since end users tend to make fewer mistakes and are more efficient when presented with familiar UIs 7 1 The lt template gt Element DTD lt ELEMENT template behavior d class d component constant content interface logic part peers presentation proper ty restructure rule script structure style gt lt ATTLIST template id NMTOKEN IMPLIED gt Description The lt template gt element permits several handy shortcuts when writing UIML It allows e one fragment of UIML to be inserted in multiple places in a UIML document e one UIML document to include a UIML fragment from another document and e cascading style and other elements in a manner analogous to the CSS specification 2 Templates work as follows Most elements see 5 2 2 for a list can contain the source attribute
54. a class public class Demo static void f double then string 37 is converted by some intermediary to type double in Java Furthermore if there is ambiguity in which function of the target language a parameter maps to the rules of the target language are used to resolve the ambiguity For example suppose class Demo contains two functions fas follows Harmonia Inc Page 90 02 08 2002 UIML 3 0 Language Specification public class Demo static void double static void float In this case the rules of Java would determine whether string 37 would be converted to a double or to a float Note The semantics of Java are to use the method f float See Java Developer Connection sm JDC Tech Tips March 14 2000 http developer java sun com developer TechTips 2000 tt0314 html for more information on this aspect of Java s semantics See Section 5 7 15 on the significance of parameter order 6 4 6 The lt script gt Element DTD lt ELEMENT script lt ATTLIST script id type source how export PCDATA gt NMTOKEN NMTOKEN CDATA append cascade replace hidden optional required IMPLIED IMPLIED IMPLIED replace Optional gt Description The lt script gt element contains a program written in the scripting language identified by the type attribute This is similar to the lt script gt element in HTML 4 0 Harmoni
55. a_1 3_Harmonia_1 0 in the example in Section 2 2 1 Alternatively the lt presentation gt element s information might be hard wired into the rendering engine so that the engine does not even have to spend time reading and processing the information 6 2 1 4 Multiple Presentation Elements A UIML document may contain multiple lt presentation gt elements However each element must contain the id attribute A rendering engine selects one of them based on information outside the UIML document e g as a command line option to the rendering engine Harmonia Inc Page 75 02 08 2002 UIML 3 0 Language Specification 6 2 1 5 Suggested Use of Base Attribute in Authoring Tools When an authoring tool for UIML opens an existing UIML document the tool can quickly identify which vocabulary is used in the document from the base attribute perhaps to display an appropriate palette of user interface widgets for further editing of the document e g a palette of Java Swing objects if the file uses the Java 1 3 vocabulary 6 2 2 Creating a New Vocabulary Using lt presentation gt This section discusses two vocabulary files for HTML and Java Based on these examples one can define a new vocabulary file The full vocabularies for HTML and Java used here are available at the following URLs e http uiml org toolkits HTML_3 2_Harmonia_1 0 uiml e http uiml org toolkits Java_1 3_Harmonia_1 0 uiml 6 2 2 1 Defining Legal Part Class Na
56. alue of the lt property gt element was equal to the constant string Los Angeles lt condition gt lt op name and gt lt event class buttonClicked part name city gt lt op name equal gt lt property name value part name city gt lt constant value Los Angeles gt lt op gt lt op gt lt condition gt Harmonia Inc Page 57 02 08 2002 UIML 3 0 Language Specification 3 The child is an lt op gt element The operand for the condition is the boolean value resulting from the evaluation of the lt op gt statement Nested lt op gt statements allow expressions to contain multiple operators with multiple operands 5 7 6 2 Resolution of Conditional Statements The introduction of lt op gt element brings upon instances where certain actions may want to be defined as a result from the evaluation of the lt op gt element Three new elements lt when true gt lt when false gt lt by default gt have been introduced to define a set of actions when a conditional is found to be true false or undefined The elements are found as children of lt action gt 5 7 7 The lt action gt Element DTD lt ELEMENT action property call restructure event when true when false by default gt Description The lt action gt element contains one or more elements that are executed in the order they appear in the UIML document Each element can be either a lt proper
57. and images associated with UI parts from the lt part gt element Each lt constant gt element is identified by an id attribute and is referenced by the lt reference gt element Example The following example shows how to create lt constant gt elements that point to a string a sound clip and an image Similarly you can create constants that point to video clips binary files and other objects Note the following URI s are for demonstration purposes and may not be active Harmonia Inc Page 47 02 08 2002 UIML 3 0 Language Specification lt content gt lt constant id Name value UIML gt lt constant id Sound source http uiml org uiml wav gt lt constant id Image source http uiml org uiml jpg gt lt content gt The lt constant gt element can also be used to represent literal strings used inside the lt condition gt element see Section 5 7 3 For example lt condition gt lt equal gt lt event part name inYear class filled name content gt lt constant value 2001 gt lt equal gt lt condition gt 5 6 2 The lt reference gt Element DTD lt ELEMENT reference EMPTY gt lt ATTLIST reference constant name NMTOKEN IMPLIED url name NMTOKEN IMPLIED gt Description The lt reference gt element references the value of the lt constant gt element specified by the constant name attribute Alternatively the lt reference gt element may specify
58. ange the content of part DefnArea to display the text string Carnivourous domesticated mammal in other words the definition of a cat pops up in the text area on the right of the UI Similar condition action rules are given for Dog and Mouse 2 3 UIML Namespace UIML is design to work with existing standards This includes other markup languages that specify platform dependent formatting 1 e HTML for text JSGF for voice etc XML Namespaces remove the problem of recognition and collisions between elements and attributes of two or more markup vocabularies in the same file All lt uiml gt elements and attributes are Harmonia Inc Page 23 02 08 2002 UIML 3 0 Language Specification inside the uiml namespace identified by the URI http uiml org dtds UIML3_O0a dtd Note that this URI has not been activated yet Example Here is an example that combines UIML and HTML vocabularies lt uiml uiml xmlns uiml http uiml org dtds UIML3_0a dtd gt lt uiml interface gt lt uiml structure gt lt uiml part uiml name A gt lt uiml structure gt lt uiml style gt lt uiml property uiml name content uiml part name A gt lt html em xmlns html http www w3 org TR REC htm140 gt Emphasis lt html em gt lt uiml property gt lt uiml style gt lt uiml interface gt lt uiml uiml gt The above code can be simplified by making uiml the default namespace as fol
59. are independent of any UI metaphor e g graphical UIs target platform e g PC phone or target language to which UIML will be mapped e g VoiceXML HTML To use UIML one must add a toolkit vocabulary roughly analogous to adding a DTD to an XML document The vocabulary specifies a set of classes of parts and properties of the classes Different groups of people can define different vocabularies depending on their needs One group might define a vocabulary whose classes have a 1 to 1 correspondence to UI widgets in a particular target language i e the classes might match those in the Java Swing API Another group might define a vocabulary whose classes match abstractions used by a UI designer e g Title Abstract BodyText for UIs to documents UIML can be standardized once and tools can be developed for UIML independently from the development of vocabularies 2 UIML factors out or separates the elements of a Ul The design of UIML started with a clean sheet of paper and the question what are the fundamental elements needed to describe any man machine interaction The separation in UIML identifies what parts comprise the UI the presentation style for each part as a list of lt property gt elements the content of each part e g text sounds images and binding of content to external resources e g XML resources or method calls in external objects the behavior of parts Harmonia Inc Page 9 02 08 2002 UIML 3
60. art gt element will not be repeated A lt repeat gt element has the following legal children ordering of the children does not matter e Each lt repeat gt element must have one and only one lt iterator gt child The lt iterator gt element denotes how many times the specified interface components will be repeated If more than one lt iterator gt child is defined than the implementation must produce a warning and use the last lt iterator gt defined in textual order e Each lt repeat gt must have one or more lt part gt elements as children These lt part gt elements represent the components to be repeated If the components are named i e Harmonia Inc Page 62 02 08 2002 UIML 3 0 Language Specification have a defined name attribute then each repetition of the lt part gt will have _ appended onto the part name where is the integer representation of this iteration Nested repeats are allowed meaning that a lt repeat gt can be a child of another lt repeat gt s lt part gt element descendents not just first level children This allows for the dynamic construction of more complicated interfaces elements such as tables and static depth trees 5 7 10 The lt iterator gt Element DTD lt ELEMENT iterator PCDATA constant property call gt lt ATTLIST iterator id NMTOKEN REQUIRED gt Description The lt iterator gt element defines the number of times the
61. ass id onClick used in tag event aps type attribute maps to onClick gt 3 lt d class id Button used in tag part maps type tag aps to html INPUT gt 3 lt event class onClick gt lt d class gt Harmonia Inc Page 80 02 08 2002 UIML 3 0 Language Specification lt presentation gt lt template gt lt uiml gt The above UIML says that one of the events in HTML is OnClick and that a lt part gt whose class is Button can receive an OnClick event To summarize when writing rules the class attribute of an event element in a condition can be any of the names listed in an lt event gt element that is associated with the lt part gt in the lt presentation gt section In the UIML example above a Button s events include OnClick and therefore the following line was used in the UIML document given earlier lt condition gt lt event name onClick gt lt condition gt Java Case Java provides a much richer UI toolkit than HTML and so the information required in the lt presentation gt element is more complex There are two styles of events used by platforms e Method 1 A lt part gt defines how events for it are handled e Method 2 A lt part gt does not define how events for it are handled Method 1 is used in Java 1 0 and in HTML In Java 1 0 a java awt Component had a method called action Event Object This method was called when an event occurred for t
62. ate gt lt template gt Section 7 1 discusses the lt template gt element and its use in building libraries of reusable UI components c An optional UI description which describes the parts comprising the UI and their structure content style and behavior lt interface gt lt interface gt Section 5 3 discusses the lt interface gt element d An optional element that describes the mapping of classes and names used in the UIML document to a UI toolkit and to the application logic lt peers gt lt peers gt Discussion of the lt peers gt element is deferred until Section 6 1 because the lt peers gt element normally just sources an external file White spaces blank spaces new lines tabs and XML comments may appear before or after each of the above tags provided that the XML formatting rules are not violated To summarize here is a skeleton of a UIML document lt xml version 1 0 gt lt DOCTYPE uiml PUBLIC Harmonia DTD UIML 3 0 Draft EN http uiml org dtds UIML3_0a dtd gt lt uiml xmlns http uiml org dtds UIML3_0a dtd gt lt head gt lt head gt lt template gt lt template gt lt interface gt lt interface gt lt peers gt lt peers gt lt uiml gt 2 2 1 Second UIML Example This section contains a simple example of a UIML document which includes event handling The example below displays a single window representing
63. atform in the lt style gt and lt peers gt elements For example the end user might define an event with class selection and the lt peers gt element for a Java AWT interface might map class selection to a java awt MouseEvent 5 7 1 Examples of lt behavior gt lt rule gt lt condition gt and lt action gt Elements UIML allows the following actions in a behavior to be specified e Assign a value to a part s property The value can be any of the following a constant value a reference to a constant the value of property or the return value of a call lt behavior gt lt rule gt lt conditien gt lt looh gt lt event class ButtonSelected part name b1 gt lt condition gt lt action gt lt leailo gt lt property part name b1 name color gt blue lt property gt lt a 2 gt lt property part name b2 name color gt lt reference constant name green gt lt property gt AS Sg s gt lt property part name b2 name color gt lt property part name b1 name color gt lt property gt lt l 4 gt lt property part name b3 name color gt lt call name serverObject getColor gt lt property gt Harmonia Inc Page 50 02 08 2002 UIML 3 0 Language Specification lt dCELOn gt lt rule gt lt behavior gt The lt behavior gt element above consists of one rule The rule is executed whenever an event of
64. ation gt lt template gt lt uiml gt 6 3 The lt logic gt Element DTD lt ELEMENT logic d component gt lt ATTLIST logic id NMTOKEN IMPLIED source CDATA IMPLIED how append cascade replace replace export hidden optional required optional gt Description The lt ogic gt element describes how the UI interacts with the underlying application logic that implements the functionality manifested through the interface The underlying logic might be implemented by middleware in a three tier application or it might be implemented by scripts in some scripting language or it might be implemented by a set of objects whose methods are invoked as the end user interacts with the UI or by some combination of these e g to check for validity of data entered by an end user into a UI and then object methods are called or in other ways Thus the lt ogic gt element acts as the glue between a UI described in UIML and other code It describes the calling conventions for methods in application logic that the UI invokes Examples of such functions include objects in languages such as C or Java CORBA objects programs legacy systems server side scripts databases and scripts defined in various scripting languages Example of lt logic gt Element Here is an example of the lt ogic gt element lt logic gt lt d component name Counter maps to com harmonia example Counter2
65. ava in this example Here the lt d component gt element maps the name back to the class org uiml example myClass which in turn contains a method named myFunction to which the name m1 is mapped In order to make the invocation myClass myFunction p1 p2 the UIML lt call gt element should refer to the corresponding values of the id attributes of the lt d component gt and lt d method gt elements hence backl m1 Given the lt action gt element above the rendering engine then converts the expression back1 m1 5 10 into an evaluation of myClass myFunction 5 10 Note that the id attributes in the lt d param gt elements are optional they serve merely to document myFunction s parameter list 5 7 8 2 Method Parameters and Return Values Types Often an object whose methods are to be invoked defines two or more methods which share the same name but have different numbers and or types of formal parameters in which case parameter count and type information must be supplied so that the rendering engine can invoke the proper method Within a lt d method gt element the number of lt d param gt elements denotes the number of parameters taken by that particular method Type information is introduced by means of the type attribute as in the following lt peer gt lt logic gt lt d component id back1 maps to org uiml example myClass gt lt d method id m1 maps to myFunction gt
66. ava awt Frame gt lt d class gt lt presentation gt lt template gt lt uiml gt Note that the vocab portion of the URL refers to the lt template gt element with an id attribute of vocab In the case where only one template exists in the file then this name can be omitted If the name is omitted and multiple templates exist then the first one is used Also note that the lt DOCTYPE gt element is included in the template file just as it is in the sourcing UIML document The lt DOCTYPE gt is required in the template because tools that process UIML files may process template files separately from a document which sources the template and such a tool may use a validating XML parser that requires the DTD Including lt DOCTYPE gt in all UIML files has a second benefit it permits discovery of mismatches between the DTD version used in a template file and a sourcing file If the source attribute is not a URL but a relative path and file name or just a file name then a rendering engine must first look for the source file relative to the directory in which the sourcing document was obtained Thus suppose that a UIML file X was located in the directory C uimlFiles Any source attribute specifying a relative file name as its value would be resolved relative to C uimlFiles 7 2 Rules for Templates In the example of Section 7 1 the element containing the source attribute E has no body Theref
67. ayData with two parameters The first is the return value of a call to method getColor in object serverObject The second is the return value of a call to method getParam 5 in object g e Fire an event An event can be fired from the lt action gt element An lt action gt element may contain at most one lt event gt element and this lt event gt element must appear as the last child of lt action gt lt behavior gt lt rule gt Harmonia Inc Page 52 02 08 2002 UIML 3 0 Language Specification lt condition gt lt le G lt event class ButtonSelected part name 1 gt lt condition gt lt action gt lt 8 gt lt xecuted when b1 is clicked gt lt event class ButtonSelected part name b2 gt lt action gt lt rule gt lt rule gt lt condition gt lt i D gt lt event class ButtonSelected part name b2 gt lt condition gt lt action gt lt 9 gt lt xecuted when b1 or b2 is clicked gt lt call name f1 gt lt param gt 10 lt param gt lt call gt lt action gt lt rule gt lt behavior gt Assume that both b1 and b2 are rendered as buttons and ButtonSelected is mapped to the event that is fired when a button is pressed Whenever the end user clicks button b1 then the first rule will evaluate to true event labeled C and fire another event that wil
68. cal Here is an example Harmonia Inc Page 89 02 08 2002 UIML 3 0 Language Specification lt d component name Math gt lt d method name findMean returns value true maps to calcMean gt lt d param name a gt lt d param name b gt lt script type text javascript gt lt CDATA calcMean int a int b return atb 2 Pace lt seript gt lt d method gt lt d component gt 3 The method represents a combination of the above This is useful if you want to do some error checking locally before calling a remote method or manipulate the result after it is returned The semantics of how to do this are under revision 6 4 5 The lt d param gt Element DTD lt ELEMENT d param PCDATA gt lt ATTLIST d param id NMTOKEN IMPLIED type CDATA IMPLIED gt Description Describes a single formal parameter of the function described by the parent lt d method gt element Note that all parameters are character strings The string value of a matching lt d param gt element will be converted to a platform specific data type specified by the type attribute and that type is the type of the formal parameter of the function e g java lang String Itis up to some intermediary to convert parameters from UIML character strings to other data types For example if we have lt d param gt 37 lt d param gt which is mapped to the parameter of function f double in this Jav
69. ce name label gt Harmonia Inc Page 46 02 08 2002 UIML 3 0 Language Specification lt reference constant name negativeLabel gt lt property gt lt style gt lt content id English gt lt constant id affirmativeLabel gt Yes lt property gt lt constant id negativeLabel gt No lt property gt lt content gt lt content id German gt lt constant id affirmativeLabel gt Ja lt property gt lt constant id negativeLabel gt Nein lt property gt lt content gt lt content id EnglishSlang gt lt constant id affirmativeLabel gt OK lt property gt lt constant id negativeLabel gt No lt property gt lt content gt The last lt content gt element could also be shortened by using the source attribute discussed in Section 7 2 so that EnglishSlang inherited the negativeLabel from English as follows lt content id EnglishSlang source English how cascade gt lt constant id affirmativeLabel gt OK lt constant gt lt content gt 5 6 1 The lt constant gt Element DTD lt ELEMENT constant constant gt lt ATTLIST constant ig NMTOKEN IMPLIED source CDATA IMPLIED how append cascade replace replace export hidden optional required optional model CDATA IMPLIED value CDATA IMPLIED gt Description lt constant gt elements contain the actual text strings sounds
70. ciated action is performed If the condition for more than one rule holds simultaneously the algorithm in Appendix A is used to determine order of execution e UIML allows two types of conditions o The first type of condition holds when an event fires e g a button is pressed in the UD o The second holds when an event fires and some logical expression of the data associated with the event evaluates to be true e g a list selection is made and the selected item is cat the first lt condition gt element in the dictionary example in Section 2 2 1 Harmonia Inc Page 49 02 08 2002 UIML 3 0 Language Specification UIML does not allow other conditions to avoid implementations that are computationally expensive e g continuous polling to determine when a condition holds or impossible with simple UI toolkits e g WML e Actions can be internal to the UIML document specifying a change in a property s value or external invoking a method in a script program and so on The list of actions within a rule is executed in the order they appear in a UIML document as described in Appendix A A unique aspect of UIML is that events are also described in a device independent fashion by giving each event a name and identifying the class to which it belongs As was the case for lt part gt elements the UIML author chooses the name and class identifiers for events and those names are mapped to an event in the underlying pl
71. class ButtonSelected for part b1 fires Let s assume that b1 b2 and b3 are buttons established in lt part gt elements not shown and ButtonSelected is a button click established in a lt peers gt element not shown There is one lt action gt element associated with the rule That action contains four elements that set properties in the interface labeled 1 to 4 by comments 1 The first action labeled lt 1 gt sets property color of the button to blue when button b1 is clicked 2 The second action sets the color of button b2 to a constant named green and defined in the lt content gt element see Section 5 6 not shown here 3 The third action sets the color of button b2 to whatever color b1 currently has Note that this action is executed after 1 and 2 above were executed so button b2 s color is set to blue because button b1 s color was set to blue in action 1 above 4 The fourth action sets the color of button b3 to the return value of a call to something called serverObject getColor The lt d component gt element in the lt logic gt element discussed in Section 6 4 1 defines what serverObject getColor is mapped to for example a method called getColor that takes no parameters in an object instance named serverObject Note that no parameters are passed by the lt call gt element so method getColor either must take no arguments or m
72. class JLabel id DefnLabel gt lt part class TextArea id DefnArea gt lt part gt lt structure gt lt style gt lt property part name JFrame name layout gt java awt GridBagLayout lt property gt lt property part name JFrame name background gt blue lt property gt lt property part name JFrame name location gt 100 100 lt property gt lt property part name JFrame name size gt 500 300 lt property gt lt property part name JFrame name title gt Simple Dictionary lt property gt lt property part class JLabel name foreground gt white lt property gt lt property part class JLabel name gridx gt RELATIVE lt property gt lt property part class JLabel name gridy gt RELATIVE lt property gt lt property part class JLabel name font gt Helvetica bolditalic 20 lt property gt lt property part name TermLabel name text gt Pick a term lt property gt lt property part name DefnLabel name text gt Definition lt property gt lt property part name DefnLabel name gridx gt 1 lt property gt lt property part name DefnLabel name gridy gt 0 lt property gt lt property part name DefnLabel name insets gt 0 10 0 0 lt property gt lt property part name TermList name background gt yellow lt property gt lt property part name TermList name gridx gt 0 lt property gt lt property part name TermList name gridy gt RELATIVE lt property
73. condition gt Element isinne aea EEE E rE 54 5 7 4 Th lt e gqual gt Element sanra a i ana ness les EEEE VEE ai 54 5 7 5 The lt e vent gt Element eeose E R a A N 55 a e E E gt PUM E EAA O EEEE E E nc eae aaa EE EE E areoaueiaes 55 D7 Extracting Data from Events sions rcepton erea ee e oiis 56 Ded Dd Special BV SMUG cisscsiaciveseheadi gn deenas no a E E E A E a 56 5 7 6 Th e lt op gt Elementa innana a a Ea aa ei aasian 56 Sol Semantics of SOD saath tall a e R E aan hain T RENE 57 5 7 6 2 Resolution of Conditional Statement ss esseeesseesseesseesseesssetesseesseessseesseessee 58 5 7 7 The lt action gt Element ss dee rse ee ae a a eeo ie Saes 58 5 7 8 Whe Calle Element e E E E e a aaa R aeueand 58 5 1 0 ly Oyervie y on scal n nn E E E a NE 59 5 7 8 2 Method Parameters and Return Values Types ccccceescceceeceeceeeeeeeeeeeeeteeeees 60 5 7 8 3 Invoking Methods Upon External Objects in RMI CORBA LDAP and EJB 61 5 7 9 Geren eas r Elemento s ee e e a a aa a A oas 62 5710 The lt iterator gt Element seide ei E REE E E R TE A E 63 5 7 10 1 Using lt iterator gt in lt property gt and lt param gt ssssssssssssssesssesesseeessressersseessee 63 Skell _ The lt srestr ct re gt Elem nt einir a a E ea as tas 64 5 7 11 1 Syntax Of lt reStFUCTUTE Soti scl E R eee EAEE ARIN E RSE 65 5 7 11 2 Semantics Of lt rEStrUCUTES AEn RE R RS AE A R T E REAT 65 5 7 11 3 Exampl s of lt restructUr S annin a ea oia ea ete iiias
74. d name rendering gt MenuSelected lt property gt lt style gt The values ButtonSelected and MenuSelected are part of the vocabulary of the target platform defined in the lt peers gt element As a second example the dictionary example of Section 2 2 1 contains the following lt style gt lt property event class LSelected name rendering gt itemStateChanged lt property gt lt style gt lt behavior gt lt event part name Terms class LSelected gt lt behavior gt The behavior element describes what actions to take in response to various user interface events see Section 5 7 The lt event gt element refers to an event of class LSelected named to represent a list selection of one of the animals in the dictionary list The lt style gt element specifies that all events with class LSelected are mapped to invocations of the itemStateChanged event in the Java Harmonia Inc Page 44 02 08 2002 UIML 3 0 Language Specification AWT class ItemEvent If we were to modify the code in Section 2 2 1 to map to another platform we could then map LSelected to something else in another toolkit by specifying a different rendering property for event class LSelected 5 5 2 1 Rules to Assign rendering Property A UIML renderer must obey the following rules in assigning each part and event element a rendering property 1 If a lt property gt element exists that contains attribute name renderi
75. d be repeated in an interface and serves as an indicator of the current iteration gt lt ELEMENT iterator PCDATA constant property call gt lt ATTLIST iterator 1d NMTOKEN REQUIRED gt a A style element is composed of one or more property elements each of which specifies how a particular aspect of an interface component s presentation is to be presented gt lt ELEMENT style property gt lt IATTLIST style id NMTOKEN IMPLIED source CDATA IMPLIED how union cascade replace replace export hidden optional required optional gt lt i A property element is typically used to set a specified property for some interface component or alternatively a class of interface components using the element s character data content as the value If the operation attribute is given as get the element is equivalent to a property get operation the value of which may be returned as the content for an enclosing property element Harmonia Inc Page 108 02 08 2002 UIML lt ELEMENT property PC event iterator gt lt ATTLIST property name source how export part name part class event name event class call name call class lt li A reference may b where the property in the UIML documen gt lt ELEMENT lt ATTLIST EMP reference reference constant name url name
76. d component gt and lt restructure gt are now valid children of lt template gt Attribute name was replaced by attribute id lt uiml gt element The DTD has changed to allow any number of lt template gt lt interface gt and lt peers gt children in any order lt when false gt element New element in UIML 3 0 Harmonia Inc Page 115 02 08 2002 UIML 3 0 Language Specification lt when true gt element New element in UIML 3 0 General changes in the DTD append is no longer a valid value for the source attribute present on many UIML elements It has been replaced with union Harmonia Inc Page 116 02 08 2002
77. document Compare this approach to implementing the same transform algorithm only to transform HTML documents then reimplementing the transform algorithm to only transform C interfaces and so on In any language design there is a fundamental tradeoff between creating something general versus special purpose UIML is for general purpose use by people that implement UIs and people that build tools for authoring UIs It is envisioned that UIML will be used with other languages with a more focused purpose such as UI design languages Ultimately most people may never write UIML directly they may instead use a particular design language suited to a certain design methodology and then use tools to transform the design into a UIML representation that is then mapped to various XML or programming languages Four key concepts underlie UIML 1 UIML is a meta language To understand this consider XML XML does not define tags such as lt p gt Instead one must add to XML a specification of the legal tags and their attributes for example by creating a document type definition DTD Therefore the XML specification does not need to be modified as new tag sets are created and a set of tools can be created to process XML independent of the tag sets that are used UIML while it is an XML schema defines a small set of powerful tags such as lt part gt to describe a part of a UI or lt property gt to describe a property of a UI part UIML tags
78. does not require or even specify this particular behavior however additional details are typically needed when the object instance whose method is to be invoked resides outside the rendering engine s execution space These details include the class of which the object is an instance and the object instance s location For example consider the mechanics involved in making a Java RMI invocation upon an external object instance The location of the Java virtual machine that hosts the external object instance e g a hostname must be specified additionally the name by which that instance is registered with the associated RMI registry must also be given Once the object instance is found and a reference of type java lang Object to it is obtained that reference must then be downcast into the proper object class The maps to attribute of the lt d component gt element is used to specify the external object s class as in the case where the object resides inside the rendering engine s execution space The needed location information is supplied by means of the location attribute as in the following example lt peer gt lt logic gt lt d component id backi maps to org uiml example myClass location rmi myHost myCompany com Adder gt lt d method id m1 maps to myFunction Harmonia Inc Page 61 02 08 2002 UIML 3 0 Language Specification return type int gt lt d param id pl1 type int gt lt d param id p
79. e lt condition gt Element DTD lt ELEMENT condition equal event op gt Description The lt condition gt element contains as a child either an lt event gt element or a Boolean expression The lt action gt element associated with this lt condition gt by the parent lt rule gt element is executed whenever either the event named in the lt event gt element fires or the Boolean expression in the lt equal gt or lt op gt element evaluates to true See Section 5 7 1 for examples 5 7 4 The lt equal gt Element DTD lt ELEMENT equal event constant property reference op gt Description The lt equal gt element is a Boolean expression with value true or false Every lt equal gt element must have exactly two children Each child must be a lt constant gt lt property gt lt reference gt or lt op gt element The semantics of lt egual gt are as follows Whenever the two children named in the lt equal gt element resolve to the same value then the lt equal gt element has value true Otherwise the lt equal gt element has value false Section 2 2 1 illustrates the lt equal gt element Harmonia Inc Page 54 02 08 2002 UIML 3 0 Language Specification 5 7 5 The lt event gt Element DTD lt ELEMENT event EMPTY gt lt ATTLIST event class NMTOKEN IMPLIED part name NMTOKEN IMPLIED part class NMTOKEN IMPLIED gt
80. e Element issisisnscisssssiiscrreeiissrtcrserdsi eissernitz eeit 35 5 5 1 he lt property gt Elements ineen e aa aa a a a eaa ioan 35 5 5 1 1 Where Property Names Are Defined ssonssoeesssessessseesseeessseessresseesseesssresseesse 36 5 5 1 2 Semantics of lt property gt Element ssssssssessseesssseessesseessessseresseessseessresseessee 36 5 5 1 3 Legal Values for lt property gt Elements sssssssesssseesseessessseesseeesseeesseesseesseessee 37 Harmonia Inc Page 5 02 08 2002 UIML 3 0 Language Specification 5 5 1 4 Using event class with lt property gt Elements 00 ceceeesceeesseceesneceeneceneeeenes 39 5 5 1 5 Resolving Conflicting Property Values e cc ceesceceeneeceeececeeneeceeeeeceeeeeeeeeeeees 40 55 2 Using Properties to Achieve Platform Independence ec eeecceeeseeeeeteeeeeeeees 42 5 5 2 1 Rules to Assign rendering Property vsisvsisisesscdsesesdegnsadeedasecpeatsevevacedsacy denneavant 45 5 6 The lt content gt Element sessoeseessesooesoessessossoossesooesoosseesoesoossoesoossoesoesoossoessesooesossseesose 45 5 6 1 Th lt constant gt Elementen nner a 47 5 6 2 The lt reference gt Element iccse iis ai iinan 48 5 7 The lt behavior gt Elementin essees sro isss essei 49 5 7 1 Examples of lt behavior gt lt rule gt lt condition gt and lt action gt Elements 50 oe The lt rule gt Element Gace toe Sesh E our sagt E R E E pane maaan edness 54 5 7 3 The lt
81. eate a vocabulary of part classes e g defining class Button and then uses concept 2 to separately define the vocabulary by specifying a mapping of the classes to target languages e g mapping UIML part class Button to class java awt Button for Java and to tag lt button gt for HTML 4 0 One can create a highly device independent UI by creating a generic vocabulary that tries to eliminate bias toward particular UI metaphors and devices By device we mean PCs various information appliances e g handheld computers desktop phones cellular or PCS phones or any other machine with which a human can interact In addition because UIML describes the interface behavior as rules whose actions are applied to parts concept 2 the rules can be mapped to code in the target languages e g to lines of Java code or JavaScript code To create multimodal UIs one creates a multiplatform UI and then annotates each part with its mode e g which target platforms use that part and the behavior section from concept 2 is used to keep the interface modes synchronized For example one might define a UIML part class Prompt the mapping of Prompt parts to VoiceXML and HTML and the behavior that synchronizes a VoiceXML and HTML UI to simultaneously prompt the user for input To create multilingual UIs one uses concept 2 to separate the content in each language from the rest of the UI To create dynamic UIs such as a Web page containing a tab
82. ece of metadata as a name value pair 29 Define a conditional expression or operation 56 Actual parameter used in a lt call gt element 69 Specifies a single abstract part of the user interface 34 Describes mapping from class property event and names usedin 71 lt call gt elements to identifiers in a UI toolkit and the application logic Contains mappings of part and event classes property names and 72 event names to a UI toolkit Specify or retrieve a property for a lt part gt element or a class of 35 lt part gt elements Reference to a constant or resource external to the UIML document 48 Groups parts which are repeated one of more times in a user 62 interface Page 26 02 08 2002 lt restructure gt lt rule gt lt script gt lt structure gt lt style gt lt template gt lt uiml gt lt when true gt lt when false gt Harmonia Inc UIML 3 0 Language Specification Modify the current virtual tree of parts A condition action pair A container for executable script code Defines the initial virtual tree organization physical or temporal of the parts comprising a user interface Specify a set of style properties for the interface A container for reusing lt uiml gt elements Root element in a UIML document Set of actions to execute when lt op gt condition is true Set of actions to execute when lt op gt condition is false Page 27 64 54 91 32 35 92 28 68 69 02 08 2002 UIML 3 0 Language Spec
83. ed in tag part maps type class maps to JjJavax swing JButton gt lt d class gt lt presentation gt lt template gt lt uiml gt Note these differences between the HTML and Java lt d class gt elements e The maps type is tag for a mapping to a markup language like HTML and class for a mapping to an imperative object oriented language like Java e The maps to attribute lists a namespace and tag in that namespace html INPUT for HTML or a string whose syntax is at present not defined in this spec javax swing JButton for Java Next we will discuss what goes in the inside each lt d class gt in the above lt presentation gt elements This part answers the following questions e What property names can be used with the part class e g the color of a button e What events and event listeners are used with the part class e g the event of clicking a button e What properties exist for events e g the X and Y positions for a mouse click event These are discussed in turn below Harmonia Inc Page 77 02 08 2002 UIML 3 0 Language Specification 6 2 2 2 Defining Legal Property Names for lt part gt Classes via lt d property gt HTML Case The UIML document below extends our previous example to give our HTML button a text label that says Press me lt uiml gt lt interface gt lt part class Button gt lt style gt lt property name VALUE gt Press me lt property gt
84. ed on uiml org The vocabularies may be posted on web sites around the world of interest to specific communities or posted in a company s internal network or not posted at all We call these custom vocabularies Typically a custom vocabulary extends a base vocabulary e g a company creates custom Java UI classes that extend Swing classes The unlikely exception is when someone creates a custom vocabulary from scratch that does not rely on any base vocabulary yet a rendering engine for some base vocabulary can render that custom vocabulary For example someone might create a Harmonia Inc Page 72 02 08 2002 UIML 3 0 Language Specification new UI toolkit for Java from scratch that does not use AWT or Swing but design the classes so that a rendering engine for UIML using the Java 1 3 or Swing base vocabulary can still render the custom classes A UIML document must be labeled by a base vocabulary name and may be labeled by a custom vocabulary name in the manner described next 6 2 1 1 Labeling Base Vocabularies with Attribute base To easily determine the base language used within the UIML document the lt presentation gt element requires an attribute named base which identifies the base target language of the UIML document The syntax of values for the base attribute must follow this convention lt vocab name gt _ lt vocab version gt _ lt author of vocab gt _ lt author s version of vocab gt Several rules apply to base
85. eers gt lt presentation base Java_1 3_Harmonia_1 0 gt lt peers gt lt uiml gt In canonical form a lt property gt element with attribute part class is copied to the lt style gt element of each lt part gt element in the part class Thus the canonical form of the preceding UIML becomes the following lt uiml gt lt interface id myinterface gt lt structure gt lt part id Buttonl class JButton gt lt Style gt lt property name text gt Am I red lt property gt lt property name background gt yellow lt property gt lt property name background gt green lt property gt lt property name background gt red lt property gt lt style gt lt part gt t From UIML2JAVAI PropOrder3 uiml Harmonia Inc Page 41 02 08 2002 UIML 3 0 Language Specification lt part id Button2 class JButton gt lt style gt lt property name text gt Am I yellow lt property gt lt property name background gt green lt property gt lt property name background gt yellow lt property gt lt style gt lt part gt lt part id Button3 class JButton gt lt style gt lt property name text gt Am I green lt property gt lt property name background gt green lt property gt lt style gt lt part gt lt structure gt lt interface gt lt peers gt lt presentation base Java_1 3_Harmonia_1 0 gt lt peers gt lt uiml gt Therefore the last lt property gt element for each lt part g
86. en of P 5 7 11 3 Examples of lt restructure gt Consider the button and panel introduced at the beginning of the proposal where the panel contains three components a label a text field and a check box The UIML looks like this lt structur gt lt part class JFrame id F gt lt part class JButton id B gt lt part class JPanel id A gt lt part class JLabel id L1 gt lt part class JTextField id TF gt lt part class JCheckbox id C gt lt part gt lt part gt lt structure gt Append Examples To add another label before L1 do this lt restructure at part A how append where first gt Harmonia Inc Page 66 02 08 2002 UIML 3 0 Language Specification lt template id T1 gt lt part gt lt part class JLabel id L2 gt lt pact gt lt template gt lt restructure gt The panel now contains the parts in this order A_T1_L2 L1 TF C Note the naming convention used for parts that are added from a template is discussed in Section 7 2 To add a label and a text area between TF and C do this lt restructure at part A how append where after where part TF gt lt template id T2 gt lt part gt lt part class JLabel id L3 gt lt part class JTextArea id TA gt lt part gt lt template gt lt restructure gt Alternately one could have used where before where part C The order of parts in the panel is now A_T1_L2
87. ent an application method if it is inside a lt ogic gt element or scripting code with scripting nested inside the lt d method gt element If the method described returns a value the returns value attribute should be specified and assigned the value true The return value will be converted to a string before being used Otherwise the returns value attribute defaults to false and any value that might be returned by the method is discarded The lt d method gt element supports three different execution models 1 The method represents a remote outside the rendering engine executable code This code executes outside the run time context of the rendering engine and is treated as a black box The rendering engine packages all the parameters sends them to the server executing the code which can be on the same machine or across the network and waits for a reply Here is an example lt d component name Math maps to myClass Math CommonRoutines gt lt d method name findMean returns value true maps to calcMean gt lt d param name a gt lt d param name b gt lt d method gt lt d component gt 2 The method represents a local script This script is embedded inside the method and is executed within the run time context of the rendering engine i e it executes locally with respect to the rendering engine If the maps to attribute for the component is missing this means that all the code is lo
88. ent User Interfaces XML 99 Philadelphia Dec 1999 Constantinos Phanouriou UIML A Device Independent User Interface Markup Language http scholar lib vt edu theses available etd 08 122000 1951005 1 unrestricted PhanouriouETD pdf UIML1 0 specification http www uiml org specs uiml1 index htm 1997 UIML2 0 specification http www uiml org specs uim12 DraftSpec htm 2000 J Clark and S Deach eds Extensible Style Language XSL W3C Proposed Recommendation 12 January 2000 http www w3 org TR xsl J Clark XSL Transformations XSLT W3C Recommendation 16 November 1999 http www w3 org TR xslt S Bradner Key words for use in RFCs to Indicate Requirement Levels http www ietf org rfc rfc2119 txt March 1997 Wireless Markup Language WML Wireless Application Protocol June 16 1999 http www wapforum org Voice Extensible Markup Language VoiceXML VoiceXML Forum August 17 1999 http www voicexmlforum org W3C XForms The Next Generation of Web Forms 31 January 2002 http www w3 org MarkUp Forms W3C Document Object Model DOM http www w3 org XIML Forum extensible Interface Markup Language XIML http www ximl org R Cover The XML Cover Pages Extensible User Interface Language XUL http www oasis open org cover xul html August 2000 Harmonia Inc UIML Java rendering engine User Manual http www harmonia com products java manual htm Harmonia Inc UIML Example Gallery http
89. ent widgets gt lt ELEMENT presentation d class gt lt ATTLIST presentation id NMTOKEN IMPLIED source CDATA IMPLIED base CDATA REQUIRED how union cascade replace replace Harmonia Inc Page 105 02 08 2002 UIML 3 0 Language Specification export hidden optional required optional gt See The logic element specifies the connection between the interfac and the backend application including support for scripting gt lt ELEMENT logic d component gt lt ATTLIST logic ig NMTOKEN IMPLIED source CDATA IMPLIED how union cascade replace replace export hidden optional required optional gt lt The d component element maps the name used in a lt call gt element to application logic external to the UIML document e g a class in an object oriented language or a function in a scripting langauge gt lt ELEMENT d component d method gt lt ATTLIST d component id NMTOKEN REQUIRE source CDATA IMPLIE how union cascade replace replac export hidden optional required optional maps to CDATA IMPLIE location CDATA IMPLIE les Maps class names that can be used for parts and events as well as property and event data names to UI toolkit gt
90. eplace replace export hidden optional required optional part name NMTOKEN IMPLIED part class NMTOKEN IMPLIED event name NMTOKEN IMPLIED event class NMTOKEN IMPLIED gt Description A property associates a name and value pair with a part or event see Section 5 7 5 For example a UI part named button might be associated with a property name color and value blue The lt property gt element provides the syntax to make the association between the name color and value blue with the part button 5 5 1 1 Where Property Names Are Defined Property names are not defined by the UIML specification This is a powerful concept because it permits UIML to be extensible one can define whatever property names are appropriate for a particular device For example a color might be a useful property name for a device with a screen while loudness might be appropriate for a voice based device Property names instead are defined by a lt presentation gt element see Section 6 2 A set of lt presentation gt elements for Java HTML WML VoiceXML and other toolkits are provided at http uiml org toolkits lt presentation gt elements and hence property names are created occasionally by experts on a target toolkit like Java AWT and are listed in a published location such as http uiml org toolkits Many authors of UIML documents then reuse such lt presentation gt elements referring to them
91. erarchy For example the Java AWT classes are organized in a hierarchy with each child class inheriting the parent class s attributes thus avoiding redefining the attributes for each class For example the Window inherits its layout attributes from Container which inherits its formatting attributes from Component Unfortunately this presents the possibility that a template may directly or indirectly source itself causing a sourcing cycle It is an error if a template directly or indirectly sources itself The following example demonstrates how a template can indirectly source itself lt template id A gt lt part name al source B gt lt template gt lt template id B gt lt part name b1 source C gt lt template gt lt template id C gt lt part name cl source A gt lt template gt In the example above template A sources template B which in turn sources template C Template C then sources template A forming a sourcing cycle A gt B gt C gt A Such a cycle cannot be resolved without special assumptions and must produce an error 7 4 The export Attribute DTD lt ENTITY ExportOptions export hidden optional required optional gt Description By default all elements that appear inside a lt template gt element are visible can be accessed from the elements at the location it is included and their children
92. ere may be one interface organization for a desktop PC and another organization for a voice interface The two interfaces may be radically different in terms of which UI widgets Harmonia Inc Page 32 02 08 2002 UIML 3 0 Language Specification are present For example the voice interface may have fewer widgets allowing an end user to select only a subset of the operations available in the PC interface In addition the two interfaces may be organized differently The voice interface might be a hierarchy of menus implementing the paradigm of a voice activated response system Meanwhile the PC interface might be in the form of a wizard and consist of a sequence of dialog boxes Thus a UIML document needs to enumerate which interface parts are present in each version of the interface and how those parts are organized e g hierarchically This is the purpose of the lt structure gt element Just as a bridge over a river is a structure that consists of many parts e g steel beam bolts a UI consists of a structure its organization and many parts e g widgets All interface descriptions must include at least one structure description There may be more than one lt structure gt element each representing a different organization of the interface Thus in the PC and voice interface example above there are two lt structure gt elements Each lt structure gt element is given a unique name If a UIML document contains more than one
93. esentation gt element in Java_1 3_Harmonia_1 0 uiml Harmonia Inc Page 79 02 08 2002 UIML 3 0 Language Specification The box above could also contain lt d method gt elements This is useful for exposing methods in the Java class that are not properties and hence should not be accessed in UIML lt property gt elements but could be invoked via a lt call gt element For example java awt List contains a method add to add another item to a list An lt action gt in a UIML document might contain a lt call gt to the add method 6 2 2 3 Defining Legal Events and Listeners for Part Classes Via lt d class gt HTML Case The UIML document below extends our previous example to provide a behavior for an event called onClick for our HTML button lt uiml gt lt interface gt lt part class Button gt lt behavior gt lt rule gt lt condition gt lt event name onClick gt lt condition gt lt action gt lt action gt lt rule gt lt behavior gt lt part gt lt interface gt lt peers gt lt presentation base HTML_3 2_Harmonia_1 0 gt lt peers gt lt uiml gt The lt behavior gt element in the box above causes the lt action gt element to be executed whenever an onClick event occurs for the button The meaning of onClick is defined by additional lines in the lt presentation gt element lt su iml gt lt template gt lt presentation gt lt d cl
94. for each part text sounds image e What behavior do parts have e How to connect to outside world business logic data sources UI toolkit UIML is modeled by the Meta Interface Model 5 pictured below Device Platform Applications UI Metaphors Be cere Data Sources Tay a Ni a Stniciune Vocabularies Style Content Behavior 2 1 1 Dynamic Interfaces Through a Virtual UI Tree The interface portion of a UIML document defines a virtual tree of parts with their associated content behavior and style This virtual tree is then rendered according to the specification of the presentation component and communicates with application logic via the logic definitions Harmonia Inc Page 14 02 08 2002 UIML 3 0 Language Specification The virtual tree can be modified dynamically by repeating deleting replacing or merging sub trees and tree fragments in the main tree This allows for a canonical description of a user interface through the lifetime of it interaction with the user 2 1 2 Interface Behavior UIML describes in a lt behavior gt element the actions that occur when an end user interacts with a UI The lt behavior gt element is built on rule based languages Each rule contains a condition and a sequence of actions Whenever a condition is true the associated actions are executed Whenever an end user interacts with a UI events are triggered which cause some action to execute In this vers
95. g gt Container lt property gt lt property part name TopHello name content gt Hello lt property gt lt property part class helloC name rendering gt String lt property gt lt property part name hello name Ccontent gt Hello World lt property gt lt style gt lt interface gt lt peers gt lt peers gt lt uiml gt To complete this example we must provide something for the lt peers gt element A VoiceXML rendering engine 12 using the above UIML code and the following lt peers gt element lt peers gt lt presentation name VoiceXML gt lt component name Container maps to vxml form gt lt component name String maps to vxml block gt lt attribute name content maps to PCDATA gt lt component gt lt presentation gt lt peers gt would output the following VoiceXML code lt xml version 1 0 gt lt vxml gt lt form gt lt block gt Hello World lt block gt Harmonia Inc Page 16 02 08 2002 UIML 3 0 Language Specification lt form gt lt vxml gt A WML 11 Rendering engine using the above UIML code and the following lt peers gt element lt peers gt lt presentation name WML gt lt component name Container maps to wml card gt lt attribu name Ccontent maps to wml card title gt lt component gt lt component name String maps to wml p gt lt attribu name content maps to PCDATA gt lt component gt lt
96. get element has an author specified id and they both have the same value for their class attribute Under the rules for cascade if an element in the sourcing document conflicts with an element of the target document the original element takes precedence over the target element This allows UIML authors to overwrite values being sourced from the template Harmonia Inc Page 98 02 08 2002 UIML 3 0 Language Specification However the depth at which this comparison between elements takes place is important In the UIML 2 0 specification only the top level elements in the sourced and sourcing file are compared Any children of those elements are not compared In this specification the how cascade attribute is interpreted to propagate down the element tree for which it was specified for If there is a conflict between the top level elements any children of the sourcing element will also be compared In turn grandchildren of the sourcing element will also be compared if there is a conflict between the child elements and so on These comparisons would continue till the conflicting elements are all resolved The purpose of this is to compare elements from a bottom up perspective rather than a top down perspective 7 3 Multiple Inclusions Elements inside a template can source elements inside other templates This allows a hierarchical inclusion of UIML templates This is useful when describing the peer components to a language with an object hi
97. gt lt d method name count return type int maps to count gt lt d method name reset return type int maps to setCount gt lt d param name newVal type int gt lt d method gt lt d component gt lt Logic gt Harmonia Inc Page 85 02 08 2002 UIML 3 0 Language Specification The fragment above says that there is an external object reached by name com harmonia example Counter2 This object is given the name Counter in the UIML document The component has two methods named count and reset in the UIML document These map respectively to count and setCount in com harmonia example Counter2 Each returns a value of type int where the meaning of int is whatever meaning ascribed by the language in which com harmonia example Counter2 is implemented Finally count takes no arguments when called and setCount takes one argument an int Example The following UIML fragment describes the calling conventions for a variety of functions in external application logic and functions in scripts Note that URLs given below are for example purposes only lt logie gt lt d component name back1 maps to org uiml example myClass gt lt d method name m1 maps to myfunction gt lt d param name p1 gt lt d param name p2 gt lt d method gt lt d method name m2 returns value true maps to m2 gt lt d method name master returns value true maps to m3 gt lt d param name p3 g
98. gt lt property part name TermList name fill gt BOTH lt property gt lt property part name TermList name font gt Helvetica 20 lt property gt lt property part name TermList name content gt lt constant model list gt lt constant id Cat value Cat gt lt constant id Dog value Dog gt lt constant id Mous value Mouse gt lt constant gt lt property gt Harmonia Inc Page 20 02 08 2002 UIML 3 0 Language Specification lt property part name DefnArea name background gt yellow lt property gt lt property part name DefnArea name gridx gt 1 lt property gt lt property part name DefnArea name gridy gt RELATIVE lt property gt lt property part name DefnArea name text gt Select term on the left lt property gt lt property part name DefnArea name columns gt 20 lt property gt lt property part name DefnArea name rows gt 4 lt property gt lt property part name DefnArea name editable gt false lt property gt lt property part name DefnArea name insets gt 0 10 0 0 lt property gt lt property part name DefnArea name font gt Helvetica 20 lt property gt lt style gt lt behavior gt lt rule gt lt condition gt lt op name amp amp gt lt event part name TermList class ItemListener itemStateChanged gt lt op name gt lt
99. gt element and the associated methods that assign or retrieve a value for the property Example lt peers gt lt presentation gt lt d component name button maps to java awt Button gt lt d property name Color gt lt d method returns value true maps to getColor gt lt d method gt lt d method maps to setColor gt lt d param name color gt lt d method gt lt d property gt lt d component gt lt presentation gt lt peers gt lt interface gt lt style gt lt property name Color part name bElem gt Blue lt property gt lt style gt lt interface gt Harmonia Inc Page 88 02 08 2002 UIML 3 0 Language Specification 6 4 4 The lt d method gt Element DTD lt ELEMENT d method d param script gt lt ATTLIST d method id NMTOKEN REQUIRED source CDATA IMPLIED how append cascade replace replace export hidden optional required optional maps to CDATA REQUIRED return type CDATA IMPLIED gt Description The lt d method gt element describes a method in the external application logic or presentation toolkit in terms of its optional formal parameters and optional return value The maps to attribute specifies the name that is being bound The value of maps to gives the name of a method that can be executed The method can represent a toolkit method if it is inside a lt presentation gt elem
100. gt lt DOCTYPE gt and the lt uiml gt tag which start every UIML document Next comes the lt peers gt element enclosed by the first box The lt presentation gt element inside peers contains base Java_1 3_Harmonia_1 0 which means that this UIML document uses the vocabulary defined in http uiml org toolkits Java_1 3_Harmonia_1 0 uiml The vocabulary defines among other things the legal class names for lt part gt elements the legal property values for each part class Setting the base attribute to Java_1 3_Harmonia_1 0 implies that most of the Java AWT and Swing class names e g JButton JLabel can be used as part names in UIML and names similar to AWT and Swing property method names can be used as UIML property names e g foreground for a JLabel Element lt presentation base Java_l 3_Harmonia_1 0 gt specifies that any renderer that implements vocabulary Java_1 3_Harmonia_1 0 can render this UIML document In general If a UIML document contains lt presentation base x gt then that document can be rendered by any rendering engine that implements vocabulary uiml org toolkits x uim1 The lt interface gt element comes next The first element inside interface is structure which appears in the second box The lt structure gt element in this example describes a UI consisting of five parts The first is named JFrame and contains the other four parts named TermLabel TermList DefnLabel and DefnArea The class names
101. h lt property gt Elements Just as lt part gt elements may have properties so too may lt event gt elements have properties There are some restrictions on using lt property gt with the event class attribute A lt property gt with the event class attribute can only be used if the following apply e The lt property gt is a property get operation unless the name is rendering Therefore the parent of lt property gt must be another lt property gt lt op gt or lt param gt e The lt property gt has lt action gt as an ancestor e The ancestor lt rule gt of the lt property gt has in its lt condition gt child an lt event gt element The lt property gt naming an event class always returns the value corresponding to the event occurrence named in the lt condition gt The three restrictions above arise because events normally represent transient events in a program so it makes sense to query date associated with an event when the event occurs but not later in the lifetime of the user interface Example In the following UIML fragment whenever a mouse click occurs for part P method doSomething in object O is called with the x position of the mouse when clicked as an argument lt rule gt lt condition gt lt event part class P class MouseListener mouseClicked gt lt condition gt lt action gt lt call name 0 doSomething gt Harmonia Inc Page 39 02 08 2002 UIML 3 0 Language Specification
102. he Component In HTML many tags representing lt part gt s in UIML can contain attributes denoting events An example in HTML is lt input type Button onClick myfunction gt In this case the lt part gt defines the event handling calling myfunction In UIML this association between the event onClick and myfunction is made by a lt rule gt Method 2 is used in Java 1 1 and later UIML adopts the Java model of requiring a Listener entity that defines how events are handled on behalf of a lt part gt If there exists a target language for UIML that uses Method 2 and also uses a concept entirely different than listeners then UIML will need modification In this case a Listener class defines how events are handled In UIML the association between the event mouseClicked and the actions to perform in response is made by a lt rule gt The UIML user is not aware of the Listener or Event classes involved Thus UIML must contain a rich enough syntax to define the following e Class names representing events such as OnClick for HTML or MouseEvent for Java e Class names representing event listeners for Method 2 such as MouseListener e Methods in event listeners such as MouseListener mouseClicked e A means to associate components listeners and events e Event property names such as X and Y coordinates for a MouseEvent Harmonia Inc Page 81 02 08 2002 UIML 3 0 Language Specification Next we show what these look like
103. ia Inc Page 112 02 08 2002 UIML 3 0 Language Specification Appendix C Changes from UIML 2 0a Specification 1 17 2001 Following are changes from the Document Type Definition given in the 17 Jan 2000 specification named UIML2_0a dtd Elements not listed have not changed lt action element lt action gt can now have two possible sets of children 1 Any number of lt property gt lt call gt or lt restructure gt elements followed by one or zero lt event gt elements or 2 A lt when true gt element followed by a lt when false gt element followed by a lt by default gt element lt attribute gt element lt attribute gt is no longer a valid UIML element It has been replaced by lt d property gt lt behavior gt element Attribute name has been replaced by attribute id lt by default gt element New element in UIML 3 0 lt component gt element lt component gt is no longer a valid UIML element It has been replace by two elements lt d class gt and lt d component gt for use in lt presentation gt and lt logic gt respectively lt condition gt element lt op gt is now a valid child of lt condition gt lt constant gt element Attribute name has been replaced by attribute id PCDATA is no longer a valid child of lt constant gt Instead the attribute value has been added Attribute model added lt content gt element Attribute name has been replaced by attribute id lt d class gt
104. iants e g HTML XHTML VoiceXML JavaScript Java C etc Each language differs in its syntax and its abstractions For example the syntax in HTML 4 0 to represent a button is lt button gt and in Java Swing JButton b new JButton The work on UIML asks the fundamental question Do we inherently need different syntaxes or can one common syntax be used The benefit of using a single syntax is analogous to the benefit of XML Software tools can be created for a single syntax UIML yet process UIs destined for any existing language For example a tool to author UIs can store the design in UIML and then map UIML to target languages in use today e g HTML Java or invented in the future Progress in the field of UI design can move faster because everyone can build tools that either map interface designs into UIML or map UIML out to existing languages Tools can then be snapped together using UIML as a standard interchange language Harmonia Inc Page 8 02 08 2002 UIML 3 0 Language Specification There is a second benefit of a canonical UI description By using a single syntax to represent any UI an interface is in a very malleable form For example one technique gaining popularity in the human computer interface community is transformation With a canonical representation for any UI someone that designs a transform algorithm can simply implement the algorithm to transform an input UIML document to a new output UIML
105. ide any additional meaning A lt call gt element As explained in Section 5 7 8 a call is an invocation of code such as calling a method in an object or a function in a script described in the lt ogic gt element In this case the property is set to the return value of the invocation The following example is an HTML user interface in which the content of a paragraph is set to the return value of method random in object DoMath The call is performed at render time lt uiml gt lt interface gt lt structure gt lt Pre id prl content Number 1 gt lt P id ranl gt lt structure gt lt style gt lt property part name ranl name content gt lt call name DoMath random gt From UIML2HTML LocalExternalCall RenderTime uiml Harmonia Inc Page 38 02 08 2002 UIML 3 0 Language Specification lt property gt lt style gt lt peers gt lt presentation how replace source HTML_3 2_Harmonia_1 0 uiml vocab base HTML 3 2 _Harmonia_1 0 gt lt logic gt lt d component id DoMath maps to TestFunctionCalls gt lt d method id random maps to generateRandom return type int gt lt d component gt lt logic gt lt peers gt lt uiml gt The lt logic gt element contained in the lt peers gt element of a UIML document defines the code to which DoMath random corresponds and how to invoke that code see Section 6 3 5 5 1 4 Using event class wit
106. ification 4 The lt uiml gt and lt head gt Elements Whenever a new element is introduced in the remainder of the document we first give the appropriate DTD fragment 4 1 The lt uiml gt Element DTD lt ELEMENT uiml head template interface peers gt Description The lt uiml gt element is the root element in a UIML document All other elements are contained in the lt uiml gt element The lt uiml gt element appears as follow suiml gt 0S uM lS Usually one lt uiml gt element equates to one file in much the same way that there is one HTML element per file when developing HTML based applications However other arrangements are possible For example the lt uiml gt element might be retrieved from a database or the elements contained within the lt uiml gt element might be stored in multiple files When multiple markup vocabularies are used within the same UIML file then the uiml namespace must be specified as follow lt uiml xmlns http uiml org dtds UIML3_0a dtd gt lt uiml gt 4 2 The lt head gt Element DTD lt ELEMENT head meta gt Description The lt head gt element contains metadata about the current UIML document Elements in the lt head gt element are not considered part of the interface and have no effect on the rendering or operation of the UI UIML authoring tools should use the lt head gt element to store inf
107. ill be rendered on various devices such as fonts colors layout and so on For example the following fragment will make all parts with class c1 use the Comic font and the single part named n1 have size 100 by 200 lt style id Graphical gt lt property part class c1 name font gt Comic lt property gt lt property part name n1 name size gt 100 200 lt property gt lt style gt The use of the style sheet helps achieve device independence This is discussed in Section 5 5 2 There must be at least one lt style gt element and there may be more than one There is often one lt style gt element for each toolkit to which the UIML document will be mapped For a given toolkit there may be multiple lt style gt elements serving a variety of purposes to generate different interface presentations for accessibility to support a family of similar but not identical devices e g phones that differ in the number of characters that their displays support to support different target audiences e g children versus adults and so on Style sheets may also use the mechanism for cascading described in Section 7 2 5 5 1 The lt property gt Element DTD Harmonia Inc Page 35 02 08 2002 UIML 3 0 Language Specification lt ELEMENT property PCDATA constant property reference call iterator gt lt ATTLIST property name NMTOKEN IMPLIED source CDATA IMPLIED how append cascade r
108. interface components should be repeated lt iterator gt elements can have only one child but that child can be of four forms e 6A text string e A lt call gt element e A lt property gt element e A lt constant gt element The form of the child is irrelevant so long as it resolves to an integer value N This integer N is then used as the maximum number of iterations that the repeat will perform counting from 1 to N Note that the step value for an lt iterator gt element is currently always one 5 7 10 1 Using lt iterator gt in lt property gt and lt param gt The lt iterator gt element can be used in lt property gt and lt param gt elements to provide an integer value representing the iteration number that is currently processing In this way the lt iterator gt element behaves very similarly to the lt property gt element It is important to note that an lt iterator gt is defined within the scope of the lt repeat gt it is a child of Thus no other lt iterator gt elements may have the same id if they are defined within a descendent of the current lt repeat gt This also implies that an lt iterator gt whose lt repeat gt is an ancestor of another lt iterator gt can be accessed within the scope of the descendent lt iterator gt Example lt uiml gt lt part class JDialog gt lt repeat gt lt iterator id i gt 10 lt iterator gt Harmonia Inc Page 63 02 08 2002 UIML 3 0 Language Specification
109. ion Each of these names is then mapped in the lt peers gt section to implementing entities e g Swing user interface components methods in memory or remote object instances entry points in remote procedures functions in user scripts etc For Swing components the hard work of creating the lt peer gt mappings has already been done UIML authors need only import an existing body of predefined mappings instead of writing an appropriate lt peers gt section For object methods the UIML author must write one lt d component gt element for each object instance whose method or methods are to be invoked note that lt d component gt is a child of lt logic gt which in turn is a child of lt peers gt The lt call gt element has one mandatory attribute name A rendering engine executes a lt call gt element as follows 1 The engine must locate the method to be invoked If the method to be invoked takes arguments the rendering engine then matches the lt param gt elements in the call body to the method s formal arguments 3 The rendering engine converts the argument values from character strings to the type of the formal parameters 4 The rendering engine invokes the method 5 Ifthe method returns a value attribute return type in element d method must have a non null value see Section 6 4 4 then the value is converted to a character string Examples of the lt call gt element are shown in Section 5 5 1 3 and Sec
110. ion of the UIML specification each condition is evaluated only when an event associated with the condition occurs This simplifies the rendering of UIML by compilation to other languages Each action can do one or more of the following 1 change a property of some part in the UI 2 invoke a function in a scripting language 3 invoke a function or method from a backend object or 4 throw an event In cases 2 and 3 UIML gives a syntax for describing the calling convention but does not specify an implementation of how the call is performed e g RPC RMI CORBA Finally a UIML document provides sufficient information to allow a developer to implement application logic that modifies a UI programmatically 2 1 3 Philosophy Behind UI ML s Tags UIML can be viewed as a meta language or an extensible language analogous to XML XML does not contain tags specific to a particular purpose e g HTML s lt H1 gt or lt IMG gt Instead XML is combined with a document type definition DTD to specify what tags are legal in a particular markup language that is XML compliant The advantage is that an extensible language can be standardized once rather than requiring periodic standardization committee meetings to add new tags as the language evolves Analogously UIML does not contain tags specific to a particular UI toolkit e g lt WINDOW gt or lt MENU gt UIML captures the elements that are common to any UI through a simple set of
111. is consists of a sequence of rules each containing a condition and an action Each condition holds true when some event occurs The lt event gt element in each condition names a Java event through its class attribute Whoever defines the vocabulary for a UI toolkit defines the class names used for events The vocabulary defined in Java_1 3_Harmonia_1 0 uses the following convention for choosing UIML event Harmonia Inc Page 22 02 08 2002 UIML 3 0 Language Specification class names method names in Java AWT and Swing listener classes are used as UIML event names For example clicking items in an AWT List are handled by an instance of java awt event ItemListener Hence Java_ 3_Harmonia_1 0 defines ItemListener s methods such as itemStateChanged as UIML event class names Returning to the UIML document above the first condition holds true when someone clicks on term number zero in the list or when someone clicks on Cat Let s examine the first condition in detail lt condition gt lt op name amp amp gt lt event part name TermList class ItemListener itemStateChanged gt lt op name gt lt property event class ItemListener itemStateChanged name item gt lt constant value 0 gt lt op gt lt op gt lt condition gt The lt condition gt has as its child an lt op gt for operand element The name attribute of lt op gt is amp amp or logical AND which means that the lt op g
112. l simulate the end user pressing b2 action labeled 8 Then the rendering engine will evaluate the condition for all the rules again due to the algorithm in Appendix A and the second rule will evaluate to true event labeled D and call f1 10 action labeled 9 This feature must be used with care to avoid creating an infinite loop e g if the second lt action gt element was lt event class ButtonSelected part name b1 gt to simulate a click on button b1 instead of the lt call gt element Harmonia Inc Page 53 02 08 2002 UIML 3 0 Language Specification 5 7 2 The lt rule gt Element DTD lt ELEMENT rule condition action gt lt ATTLIST rule id NMTOKEN IMPLIED source CDATA IMPLIED how append cascade replace replace export hidden optional required optional gt Description The lt rule gt element defines a binding between a lt condition gt element and an lt action gt element Whenever the lt condition gt element within the rule is satisfied then any elements inside the lt action gt element are executed sequentially i e property assignment external function or method call or event firing See Section 5 7 1 for an example and further explanation Also it is possible for multiple rules to be satisfied at any time Appendix A defines how a rendering engine must handle this situation See Section 5 7 1 for examples 5 7 3 Th
113. le whose size and content comes from a database call made each time the page is loaded can be achieved by binding the separated content to calls to methods in say Java beans concept 2 Harmonia Inc Page 10 02 08 2002 UIML 3 0 Language Specification Alternately a behavior rule concept 2 can specify that the page be restructured to dynamically add a table to the tree of interface parts concept 3 For further discussion of the motivation for and uses of UIML please see Abrams et al 3 and 4 1 1 UIML an Open Specification It is Harmonia s intent that UIML 3 0 can be freely implemented by anyone UIML 3 0 may be implemented without any license cost due to Harmonia Inc 1 2 Relationship of UIML to XML XSL XForms and CSS UIML is compliant with the W3C XML 1 0 specification 1 Appendix A contains the UIML 3 0 DTD When UIML is rendered to HTML CSS style sheets or XSL formatting objects 8 can be used with the resultant HTML In addition XSLT 9 can be used to transform UIML to other XML compliant markup languages In some cases Xforms Models 13 can be used to represent complex data objects being passed to or from the user interface 1 3 Purpose of This Document This document serves as the official language reference for UIML 3 0 It describes the syntax of the elements and their attributes the structure of UIML documents and usage examples It also gives pointers to other reference documentation that
114. led button is rendered it may be rendered as radio buttons or a voice response The button labels are references to constant name affirmativeLabel and negativeLabel There are three alternative definitions of these constant names corresponding to three languages English German or slang English Thus three content elements are defined one for each language Within each lt content gt element one or more lt constant gt elements are used to provide the actual literal string that appears in the UI e g Yes for English but OK for slang English When the interface is rendered a mechanism outside the scope of this specification supplies a content name either English German or EnglishSlang The lt content gt element whose name matches the supplied name is then used and all other lt content gt elements are ignored This then determines whether the value of the label property for the affirmativeChoice button is Yes Ja or OK If the supplied name does not match the id attribute of any lt content gt element then the interface cannot be rendered Example lt structure id GUI gt lt part class button id affirmativeChoice gt lt part class button id negativeChoice gt lt structure gt lt style gt lt property part name affirmativeChoice name label gt lt reference constant name affirmativeLabel gt lt property gt lt property part name negativeChoi
115. lementation from the template Example UIML enables the interface implementer to build a library of reusable interface components and then include them as needed in new UIML documents In the following UIML fragment a dialog box defined in the lt template gt named DialogBox is inserted into the UIML document in place of the following lt part gt element Note that the dialog box can then be customized elsewhere in the UIML document by setting various properties including the content of the dialog box lt template id DialogBox gt lt part id TopLevel gt lt part id CompanyLogo class ImageContainer gt lt part id Message class Label gt lt part id Accept class Button gt lt part gt lt template gt lt interface gt lt SCructure gt lt part id FileNotFoundBox class DialogBox source DialogBox how replace gt lt Default implementation gt lt foart gt lt structure gt lt interface gt This example demonstrates how a template can be used to represent a complex re usable interface object Here the template represents what is commonly called an OK Box This is a simple dialog that contains a message and a button to hide or close the message box The construct is complex in that it is made up of multiple lt part gt elements yet represents a commonly used interface object This particular OK Box has been customized to hold the company logo as well as the message a
116. low lt uiml xmlns http uiml org dtds UIML3_0a dtd gt lt interface gt lt structurne gt lt part name A gt lt structure gt lt Sty Les lt property name content part name A gt lt html em xmlns html http www w3 org TR REC htm140 gt Emphasis lt html em gt lt property gt lt style gt lt interface gt lt uiml gt To learn more about XML name spacing refer to http www w3 org 2000 xmlns 2 4 UIML Mime Type The following mime type should be used for UIML documents text uiml Furthermore the mime type could include the value of the base attribute in the lt presentation gt element see Section 6 2 which identifies that any recipient software that processes the UIML document must implement the vocabulary identified in the base attribute Here are some examples text uiml Java_1 3_Harmonia_1 0 Harmonia Inc Page 24 02 08 2002 UIML 3 0 Language Specification text uiml Html_4 0lframeset_Harmonia_0 1 Harmonia Inc Page 25 02 08 2002 UIML 3 0 Language Specification 3 Table of UIML Elements The table below is both an overview of all elements in UIML and an index to where they are discussed in the remainder of this document The UIML 3 0 DTD is given in 0 Element lt action gt lt behavior gt lt by default gt lt call gt lt condition gt lt constant gt lt content gt lt d class gt lt d component gt lt d method gt lt d param gt lt d proper
117. lt ELEMENT d class d method d property event listener gt lt lATTULS T d class id NMTOKEN REQUIRED source CDATA IMPLIED how union cascade replace replace export hidden optional required optional used in tag event listener part REQUIRED maps type attribute tag class REQUIRED maps to CDATA REQUIRED gt Maps a property name to methods in UI toolkit that get and set property s value gt lt ELEMENT d property d method d param gt lt ATTLIST d property id NMTOKEN REQUIRED maps type attribute getMethod setMethod method REQUIRED Harmonia Inc Page 106 02 08 2002 UIML 3 0 Language Specification maps to CDATA REQUIRED return type CDATA IMPLIED gt Lles Maps a method to a callable method or function in the API of the application logic gt lt ELEMENT d method d param script gt lt ATTLIST d method id NMTOKEN REQUIRED source CDATA IMPLIED how union cascade replace replace export hidden optional required optional maps to CDATA REQUIRED return type CDATA IMPLIED gt Liss Defines a single formal parameter to a lt d method gt gt lt ELEMENT d param PCDATA gt lt ATTLIST d param id NMTOKEN IMPLI type CDATA IMPLI i C The script element contains executable script code The type specifies the scripting language see HTML4 0 gt
118. lt style gt lt part gt lt interface gt lt peers gt lt presentation base HTML_3 2_Harmonia_1 0 gt lt peers gt lt uiml gt Now let s look at what is required in the lt presentation gt element to map the UIML property VALUE to the corresponding VALUE attribute of the HTML lt JNPUT gt tag This is defined in the third lt d property gt element below lt uiml gt lt template gt lt presentation gt lt d class id Button maps type tag maps to html INPUT gt lt d property id type maps type attribute maps to TYPE gt lt d param type String gt BUTTON lt d param gt lt d property gt lt d property id name maps type attribute maps to NAME gt lt d param type String gt lt d property gt lt d property id value maps type attribute maps to VALUE gt lt d param type String gt lt d property gt lt d class gt lt presentation gt lt template gt lt uiml gt The three lt d property gt elements above say that an HTML 3 2 button has three properties its type which is always BUTTON and therefore cannot be set in a UIML document its name and its value or the string text that appears in the button Harmonia Inc Page 78 02 08 2002 UIML 3 0 Language Specification Java Case Now consider the Java JButton The UIML document below extends our previous example to give our Java Swing button a text label that says
119. ment in which the parts are not nested For example the Java Swing toolkit has a notion of containers and components Containers contain other containers or components forming a hierarchy Or in a voice based language the oral equivalent of menus can be nested again forming a hierarchy Each part must be associated with a single class However if multiple lt structure gt elements exist then a part can be associated with a different class in each structure see example in Section 5 4 When the interface is rendered only one structure is used as discussed in Description under Section 5 4 thus a part is always associated with a unique class UIML allows the style content and behavior information associated with a particular part to be specified within the part itself Usually this information is specified in the corresponding lt style gt lt content gt and lt behavior gt elements Harmonia Inc Page 34 02 08 2002 UIML 3 0 Language Specification 5 5 The lt style gt Element DTD lt ELEMENT style property gt lt ATTLIST style id NMTOKEN IMPLIED source CDATA IMPLIED how append cascade replace replace export hidden optional required optional gt Description The lt style gt element contains a list of properties and values that are used to render the interface Like the CSS and XSL specifications UIML properties specify attributes of how the interface w
120. mes Via lt d class gt HTML Case To start with suppose a UIML document contains the following lt uiml gt lt interface gt lt part class Button gt lt interface gt lt peers gt lt presentation base HTML_3 2_Harmonia_1 0 gt lt peers gt lt uiml gt The mapping of the Button part to HTML is defined by uiml org toolkits HTML_3 2_Harmonia_1 0 uiml which maps any part of class Button to the HTML 3 2 lt INPUT gt tag lt uiml gt lt template gt lt presentation gt lt d class id Button used in tag part maps type tag maps to html INPUT gt lt d class gt lt presentation gt lt template gt lt uiml gt UIML uses a set of elements that start with lt d gt The d prefix means that this element defines a class property or parameter name Thus lt d class gt defines a class name Harmonia Inc Page 76 02 08 2002 UIML 3 0 Language Specification Java Case In contrast suppose a UIML document uses a Java JButton lt uiml gt lt interface gt lt part class JButton gt lt interface gt lt peers gt lt presentation base Java_1 3_Harmonia_1 0 gt lt peers gt lt uiml gt The mapping of the JButton part to Java is defined by uiml org toolkits Java_1 3_ Harmonia_1 0 uiml which maps any part of class JButton to the Swing JButton class lt uiml gt lt template gt lt presentation gt lt d class id JButton us
121. nd button Since the part sources the template using how replace the body of the sourcing element represented in the example by lt Default Implementation gt will be removed and the body of the part in the template will become the body of the sourcing part 7 2 2 Combine Using Union Runtime behavior varies significantly from device to device However on the same device different platforms may share the same behavior For example both MS Windows and X Windows have events like mouse movement and button clicks It is therefore convenient when Harmonia Inc Page 96 02 08 2002 UIML 3 0 Language Specification describing the behavior of similar platforms to specify the common behavior rules in a template and source the template in the behavior for each platform Using union as the value for the how attribute the UIML parser will append the list of common behavior rules to the lt behavior gt element in the main document Example The following example shows how to reuse behavior rules lt template id GUI_Rules gt lt behavior gt lt rule gt lt Mouse Movement gt lt rule gt lt rule gt lt Button Click gt lt rule gt lt behavior gt lt template gt lt interface gt lt behavior id X Windows source GUI_Rules how union gt lt rule gt lt Middle Mouse Click gt lt rule gt lt behavior gt lt behavior id MS Windows source GUI_Rules how union gt
122. ng and one of the attributes part class event class part name or event name use the lt property gt element value as the rendering 2 Otherwise the value of the rendering property is the value of the class attribute for the lt part gt or lt event gt element that is found to be associated with this instance of lt property gt this instance refers to the property in question For example lt part class JButton id B1 gt lt style gt lt property name rendering gt The above defines that rendering of B1 is JButton The lt presentation gt element then defines the mapping of JButton to a UI widget in the toolkit such as javax swing JButton 5 6 The lt content gt Element DTD lt ELEMENT content constant gt lt ATTLIST content id NMTOKEN IMPLIED source CDATA IMPLIED how append cascade replace replace export hidden optional required optional gt Description A part in a UI can be associated with various content such as words characters sounds or images UIML permits separation of the content from the structure in a UI Separation is useful when different content should be displayed under different circumstances For example a UI might display the content in English or French Or a UI might use different words for an expert versus a novice user or different icons for a color blind user UIML can express this Normally one would set the content as
123. ng engine interprets the UIML and may make calls to the backend as specified in the UIML Runtime This is the period of time during which the UI is displayed e g through sight or sound to an end user and the end user can interact with the UI Method This spec uses the term method to generically represent any code entity that uses a language other than UIML that a rendering engine can invoke and which may optionally return a value Examples include functions procedures and methods in an object oriented language database queries and directory accesses User Interface Lifetime The period of time beginning when the interface is first displayed to the user and concluding when the interface is closed exited or otherwise terminated Other terms The following are terms and conventions used throughout this specification The key words MUST MUST NOT REQUIRED SHALL SHALL NOT SHOULD SHOULD NOT RECOMMENDED MAY and OPTIONAL in this document are to be interpreted as described in RFC2119 10 Ellipses indicate where attribute values or content have been omitted Many of the examples given below are UIML fragments and additional code maybe needed to render them URLs given inside the code segments in this document are for demonstration only and may not actually exist 1 5 Note about Harmonia Inc Rendering Engines Rendering engines developed as part of LiquidUI versions 1 0d and 1 la by Harmo
124. nia Inc were written for and have evolved from the UIML 2 0 specification As such the examples contained herein may or may not render correctly when using these versions Harmonia Inc Page 13 02 08 2002 UIML 3 0 Language Specification 2 Structure of a UIML Document This section gives several examples of UIML documents Further examples are available at 17 2 1 Overview In UIML version 3 0 a UI is a set of interface elements with which the end user interacts Each interface element is called a part just as an automobile or a computer is composed of a variety of parts so is a UI The interface parts may be organized differently for different categories of end users and different families of devices Each interface part has content e g text sounds images used to communicate information to the end user Some interface parts can receive input from the end user This is usually achieved through the use of interface artifacts like a scrollable selection list pressable button etc Since the artifacts vary from device to device the actual mapping rendering between an interface part and the associated artifact widget is done using either a lt presentation gt element or a special lt property gt element in the lt style gt element Defining a user interface in UIML answers the following five questions e What parts comprise the UI e What presentation style for each part rendering font size color e What content
125. nia_1 0 gt UIML document must be rendered by rendering engines implementing vocabulary uiml org toolkits HTML_3 2_Harmonia_1 0 uiml lt presentation base GenericJH_1 0_Harmonia_1 0 gt UIML document must be rendered by rendering engines implementing vocabulary uiml org toolkits GenericJH_1 0_Harmonia_1 0 uiml lt presentation base Java_1 3_Harmonia_0 8 source http xyz com MySwing_1 0_xyz_0 1 uiml vocab gt UIML document must be rendered by rendering engine implementing vocabulary uiml org toolkits Java_1 3_Harmonia_0 8 uiml but the vocabulary used in this UIML document is the combination of Java_1 3_Harmonia_0 8 and the presentation defined in http xyz com MySwing_1 0_xyz_0 1 uiml vocab Note that http xyz com MySwing_1 0_xyz_0 1 uiml vocab must contain a lt template gt element see Section 7 1 whose id is vocab Harmonia Inc Page 74 02 08 2002 UIML 3 0 Language Specification 5 lt presentation base Java_1 3_Harmonia_0 8 gt lt d class name MySuperCoolButton used in tag part gt lt d class gt lt presentation gt UIML document must be rendered by a rendering engine implementing vocabulary uiml org toolkits Java_1 3_Harmonia_0 8 uiml but the actual vocabulary used in this UIML document is Java_1 3_Harmonia_0 8 augmented by the part class MySuperCoolButton defined in the d class element 6 2 1 2 Labeling Custom Vocabularies with Attribute source It is recommended that if a UIML
126. nt gt will be executed before the page is rendered Thus users of UIML can use the init event for operations like initializing data objects in the backend or ensuring that pre conditions to rendering are met before actual rendering 5 7 6 The lt op gt Element DTD lt ELEMENT op constant property reference call op event gt lt ATILIST op name CDATA REQUIRED gt Description The lt op gt element allows multiple complex logic conditions to be expressed in UIML In the previous examples simple conditions were used to control whether or not elements under lt action gt were executed The simplicity of the previous examples allow for only one condition to hold true usually this was reserved to see if a particular lt event gt had occurred Even with the functionality introduced with the lt equal gt tag an author could only evaluate two different conditions furthermore the lt equal gt tag provided a limited logical condition testing only if two values were equal However with the lt op gt element basic logical conditions less than greater than equal not equal and or may be expressed along with the ability to structure complex condition statements involving multiple values Harmonia Inc Page 56 02 08 2002 UIML 3 0 Language Specification 5 7 6 1 Semantics of lt op gt The name attribute of lt op gt describes the conditional applied to the expression that you wish to
127. o entities external to the UIML document The lt peers gt element has two child elements for two types of mappings e The lt presentation gt element contains mappings of part and event classes property names and event names to a UI toolkit This mapping defines a vocabulary to be used with a UIML document such as a vocabulary of classes and names for VoiceXML Normally a UIML author does not write a lt presentation gt element but instead uses names in a UIML document that have been defined in the list of vocabularies at http uiml org toolkits Section 6 2 1 discusses vocabularies e The lt ogic gt element maps names and classes used in lt call gt elements to application logic external to the UIML document In large scale software development the lt logic gt element is defined once to represent the API of the application logic typically as a lt template gt element and then included in each UI for the project Harmonia Inc Page 71 02 08 2002 UIML 3 0 Language Specification 6 2 The lt presentation gt Element DTD lt ELEMENT presentation d class gt lt ATTLIST presentation id NMTOKEN IMPLIED source CDATA IMPLIED how append cascade replace replace export hidden optional required optional base CDATA REQUIRED gt Description Every UIML document uses a vocabulary The vocabulary defines the legal class names that can be used for parts and
128. ocssesoossosssesoossosssessossocssessossocesessossoossessoessossossosse 26 4 The lt uiml gt and lt head gt Elements se sseessoossoossssesssesssesssooesoossosssssessssesssosesoosssossssssssesssose 28 4 1 The lt uiml gt Element sssssssssissssssssosssscoessssessossossonoesssossososssosssocsoe sasso ssb stora opo sissoo bises 28 4 2 The lt head gt Element jp scsictssssocscdaiesseuvscusstadsdoessrcntseuvesacesevsdenvsndaterietenivoansladessuvesisaveabars 28 4 2 1 Gee a Element isni eere i naai aaa aa E a von san i e anatia ain 29 5 Interface DES CHIP GR ONN sos des cok sieges escsiiedscacessecytawsansuauaeusevansceusenaebueyonnscuawvnsaneusacansenenianecesbenaeieeee 30 Dal CUVORVICW EEIN EIE EE ENN 30 5 2 Attributes Common to Multiple Elements eesseessooesooessoessscsssccesocssoossoocessecssocesoceeo 30 5 2 1 Theid and elass Attributes i Dinas EE E R R 30 52 2 The source and how ACTA US cscs cos asad oki citcenlesah dp scide cous suadaddesiadunedasdeabeciees 31 5 2 3 THE export AMABUtE erena a aa ea a iaaii 31 5 3 The lt interface gt LCM oe sieanedisvosevcdsvacentesvenceveccuvavaace evanoesnncevseaveceandeveanseesnecneetuseventess 32 SA Th lt structure gt Element eiscesscscscesssocncscssasscesdcconcnsaseeacsoacssnnebaccondeseaniicedncsdavesenesacecusesse 32 DAMA Dyami Str ct re a e 3g sdekcsust a o Aaea ea a Aaaa ee e aioe a d aeri 33 5 4 2 The part gt Element nesses nonin oint n a a a oe ae a aa nalts 34 5 5 VG shy f
129. of formal parameters in the method being called then the following hold Harmonia Inc Page 69 02 08 2002 UIML 3 0 Language Specification e The name attribute is optional and is ignored by the rendering engine if present e The order of lt param gt elements within the lt call gt element must match the order of the formal parameters in the method being called Otherwise there must be fewer lt param gt elements than formal parameters in the method being called and the following holds e The name attribute is required on all param elements e The name attribute must be used by the rendering engine to match each lt param gt element to a formal parameter in the method being called A lt param gt element must have exactly one child Harmonia Inc Page 70 02 08 2002 UIML 3 0 Language Specification 6 Peer Components This section describes the elements that go inside the lt peers gt element their attributes and their syntax Examples are provided to help show common usage of each element 6 1 The lt peers gt Element DTD lt ELEMENT peers presentation logic gt lt ATTLIST peers id NMTOKEN IMPLIED source CDATA IMPLIED how append cascade replace replace export hidden optional required optional gt Description To facilitate extensibility UIML includes a lt peers gt element that defines mappings from class property event and call names used in a UIML document t
130. om the template are added to the element on the main tree If there is a conflict e g two elements with the same id then the element on the main tree is retained see Figure 3 See section 7 2 3 for a more detailed explanation of conflict resolution and deep cascading Harmonia Inc Page 94 02 08 2002 UIML 3 0 Language Specification Note that the figures below use the old naming convention which separate pieces of the fully qualified name with Instead of _ D D DDD SS gt Figure 1 Part A sources part B using replace D a ZS GD ED ED gt D Figure 2 Part A sources part B using union Figure 3 Part A sources part B using cascade Below are common usage examples of templates that demonstrate the different rules 7 2 1 Combine Using Replace Interface parts can be reused by placing them inside a template and then sourcing that template at the appropriate places in the lt interface gt element The element that sources the template can also include a default implementation of the element inside the template If the template is for some reason inaccessible e g network problems then the rendering engine can ignore the template Harmonia Inc Page 95 02 08 2002 UIML 3 0 Language Specification and still render the part Using replace as the value for the how attribute the UIML parser will delete the default implementation and add the imp
131. on defined by the element lt op gt results to be the Boolean value true Harmonia Inc Page 68 02 08 2002 UIML 3 0 Language Specification 5 7 13 The lt when false gt Element DTD lt ELEMENT when false property call restructure op equal event gt Description The lt when false gt element defines a set of actions to be executed when the evaluation of a conditional expression defined by the element lt op gt results to be the Boolean value false 5 7 14 The lt by default gt Element DTD lt ELEMENT by default property call restructure op equal event gt Description The lt by default gt element defines a set of actions to be executed when the evaluation of a conditional expression defined by the element lt op gt results to be undeterminable or undefined 5 7 15 The lt param gt Element DTD lt ELEMENT param PCDATA property reference calli op event Constant iterator gt lt ATTLIST param name NMTOKEN IMPLIED gt Description Describes a single actual parameter of the method call specified by the parent lt call gt element Note that the values of all parameters in UIML are character strings See Section 6 4 5 for information on conversion of the arguments to the types required by the formal parameters of the method being called If the number of lt param gt elements equals the number
132. ore the body of the fragment is inserted as the child of E However it is also possible for E to have a body In this case a set of rules must be specified on how to combine the bodies of the two elements For example consider this UIML file lt interface gt lt SCructure gt lt part class label name 11 gt lt structure gt lt style source file phone ui model_508 gt lt property name position part name label gt 2 lt property gt Harmonia Inc Page 93 02 08 2002 UIML 3 0 Language Specification lt style gt lt interface gt Next suppose that file phone ui contains the following lt template name model_508 gt lt style gt lt property name font_style part name label gt bold lt property gt lt property name position part name label gt 1 lt property gt lt style gt lt template gt The lt style gt element in the main document already has a body and both lt style gt elements have a property named position which one should be used A lt template gt element is like a separate branch on the UIML tree think of a DOM tree 13 A template branch can be joined with the main UIML tree anywhere there is a similar branch i e the first and only child of template must have the same tag name as the element on the UIML tree where the branches are joined The interface implementer has three choices on how to combine the lt template gt element with another element
133. ormation about the document e g author date version etc and other proprietary information Harmonia Inc Page 28 02 08 2002 UIML 3 0 Language Specification 4 2 1 The lt meta gt Element DTD lt ELEMENT meta EMPTY gt lt ATTLIST meta name NMTOK EN R EQUIR content CDATA R EQUIR ED ED gt Description The lt meta gt element has the same semantics as the lt meta gt element in HTML It describes a single piece of metadata about the current UIML document This may includes author information date of creation etc The name attribute specifies an identifier for the meta information the content attribute gives its content UIML Editor gt lt meta name Date content November 1 2001 gt This is an example of how to use the meta tag in UIML The content of the meta tag can include white space gt content Example lt head gt lt meta name Author lt meta name Description content lt head gt Harmonia Inc Page 29 02 08 2002 UIML 3 0 Language Specification 5 Interface Description This section describes the elements that go inside the lt interface gt element their attributes and their syntax Examples are provided to help show common usage of each element 5 1 Overview The lt interface gt element contains four elements structure style content and behavior lt interface gt lt s
134. ource template location gt The lt restructure gt element may not contain a body if one of the following holds e The source attribute is present e how delete is present Otherwise the lt restructure gt element must contain a body and that body must contain exactly one lt template gt element which must contain exactly one lt part gt element that matches the part specified in the at part attribute 5 7 11 2 Semantics of lt restructure gt The semantics of lt restructure gt are to modify the virtual UI tree as follows how delete Delete from the current virtual UI tree the sub tree rooted at the part named in the at part attribute Also delete any properties or rules of the part There can be no body for lt restructure gt Attributes where where part and source cannot be used how replace Replaces the part specified by the at part attribute with the parts defined as children of the template T where T is defined as the child of the restructure how append Appends parts defined as children of the template T where T is defined as the child of the restructure The way parts are appended to the structure is defined through use of the where and where part attribute see below Harmonia Inc Page 65 02 08 2002 UIML 3 0 Language Specification how cascade Cascades parts defined as children of the template T where T is defined as the child of the restruct
135. perty name VALUE gt Press me lt property gt lt style gt lt behavior gt lt rule gt lt condition gt lt event name MouseListener mouseClicked gt lt condition gt lt action gt lt property name VALUE gt lt property event class MouseListener mouseClicked name X gt lt property gt lt action gt lt rule gt lt behavior gt lt part gt lt interface gt lt peers gt lt presentation base Java_1 3_Harmonia_1 0 gt lt peers gt lt uiml gt Here are the elements in lt presentation gt in Java_1 3_Harmonia_1 0 uiml to define the property named X for a mouse click lt uiml gt lt template gt lt presentation gt lt d class id MouseEvent used in tag event maps type class maps to java awt event MouseEvent gt lt d method id source maps to getSource return type java lang Object gt lt d method id id maps to getID return type int gt lt d method id clickCount maps to getClickCount return type int gt lt d method id point maps to getPoint return type int gt lt d method id X maps to getX return type int gt lt d method id yY maps to getY return type int gt lt d method id isPopupTrigger maps to getIsPopupTrigger return type boolean gt Harmonia Inc Page 84 02 08 2002 UIML 3 0 Language Specification lt d class gt lt present
136. philosophy used in developing the UIML specifications has been to design and gain experience implementing the language for a variety of devices to insure that the concepts in the language are sound and that the language is suited to real world applications Among the motivations of UIML are the following e allow individuals to implement UIs for any device without learning languages and application programming interfaces APIs specific to the device e reduce the time to develop UIs for a family of devices e provide a natural separation between UI code and application logic code e allow non programmers to implement UIs e permit rapid prototyping of UIs e simplify internationalization and localization e allow efficient download of UIs over networks to client machines and e allow extension to support UI technologies that are invented in the future The design objective of the UIML is to provide a canonical representation of any UI suitable for mapping to existing languages UIML is no more and no less than this UIML provides a puzzle piece to be used in conjunction with other technologies including UI design methodologies design languages authoring tools transformation algorithms and existing languages and standards especially W3C specifications UIML is not a silver bullet that replaces human decisions needed to create UIs Why is a canonical representation useful Today UIs are built using a variety of languages XML var
137. plates is that templates provide more control on what information is visible to the main document see Section 7 4 For example a template may encapsulate the implementation of a dialog box and export only the content property of the input widget Also a smart rendering Harmonia Inc Page 101 02 08 2002 UIML 3 0 Language Specification engine may delay the loading and parsing of templates until that part of the code is reached whereas in the XML mechanism all the inclusions must be done during parsing Harmonia Inc Page 102 02 08 2002 UIML 3 0 Language Specification References 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 T Bray et al Extensible Markup Language XML W3C Proposed Recommendation 10 February 1998 REC xml 19980210 February 10 1998 http www w3 org TR REC xml B Bos H W Lie C Lilley I Jacobs Cascading Style Sheets level 2 CSS2 Specification W3C Recommendation 12 May 1998 http www w3 org TR REC CSS2 Marc Abrams Constantinos Phanouriou Alan L Batongbacal Stephen M Williams Jonathan E Shuster UIML An Appliance Independent XML User Interface Language 8 International World Wide Web Conference Toronto May 1999 http www8 org w8 papers 5b hypertext media uiml uiml html Also appeared in Computer Networks Vol 31 pp 1695 1708 Marc Abrams Constantinos Phanouriou UIML An XML Language for Building Device Independ
138. play the panel The semantics of UIML are changed to include the concept of a virtual UI tree During the lifetime of a UI the parts comprising the UI may change All parts that exist but are invisible to an end user are still part of the tree The parts present in the UI have a hierarchical relationship therefore forming a tree At any moment during the UI lifetime one could enumerate the tree of parts that currently exist and this is the virtual UI tree Each node in this tree corresponds to a lt part gt element in the UI generated by UIML We call the tree virtual because it may or may Harmonia Inc Page 64 02 08 2002 UIML 3 0 Language Specification not be physically represented as a data structure on a computer depending on how a rendering engine is implemented The initial value of the virtual UI tree is the content of the lt structure gt element in a UIML document During the UI lifetime the virtual UI tree can be modified by deleting nodes or adding nodes using the lt restructure gt tag The lt restructure gt tag is so named because it modifies the lt structure gt section s representation in the virtual UI tree The lt restructure gt tag can only appear inside an lt action gt element in UIML 5 7 11 1 Syntax of lt restructure gt The syntax of lt restructure gt follows lt restructure at part part namel how append cascade replace delete where first last before after where part part name2 s
139. presentation gt lt peers gt cr set would output the following WML code lt xml version 1 0 gt lt DOCTYPE wml PUBLIC WAPFORUM DTD WML 1 0 EN http www wapforum org DTD wml xml1 gt lt wml gt lt card title Hello gt lt p gt Hello World lt p gt lt card gt lt wml gt 2 2 UI ML Document Structure A typical UIML 3 0 document is composed of these two parts 1 A prolog identifying the XML language version encoding and the location of the UIML 3 0 document type definition DTD lt xml version 1 0 gt lt DOCTYPE uiml PUBLIC _ Harmonia DTD UIML 3 0 Draft EN http uiml org dtds UIML3_0a dtd gt Note This prolog should appear in the beginning of every UIML file even files containing only UIML templates see Section 7 1 but for ease of readability some of the examples given in this document omit it 2 The root element in the document which is the uiml tag lt uiml xmlns http uiml org dtds UIML3_0a dtd gt lt uiml gt See Section 4 1 for more information on the root element uiml The lt uiml gt element contains four child elements a An optional header element giving metadata about the document Harmonia Inc Page 17 02 08 2002 UIML 3 0 Language Specification lt head gt lt head gt The lt head gt element is discussed in Section 4 2 b An optional element that allows reuse of fragments of UIML lt templ
140. processes ActionEvents and a listener named ActionListener handles events for any lt part gt whose class is JButton Recall the following lines from the UIML document earlier lt condition gt lt event class ActionListener actionPerformed gt lt condition gt When writing rules the class attribute of an event element in a condition uses a dotted notation consisting of the form lt listener class name gt lt method class name gt The lt listener class name gt is a class name defined by a lt d class used in tag listener gt element such as ActionListener in the UIML example above The lt method class name gt is a method name defined in a lt d method gt element that is a child of the lt d class used in tag listener gt element such as actionPerformed in the UIML above Whenever a JButton is clicked the Java Virtual Machine calls the actionPerformed method The lt rule gt above is therefore executed when actionPerformed is called on a JButton Harmonia Inc Page 83 02 08 2002 UIML 3 0 Language Specification 6 2 2 4 Defining Legal Event Property Names Via lt d class gt Let s consider our UIML document again Suppose we want to display the x coordinate of the mouse pointer when it is clicked inside a button The label on the button will be changed to display the x coordinate The following UIML document accomplishes this lt uiml gt lt interface gt lt part class Button gt lt style gt lt pro
141. property event class ItemListener itemStateChanged name item gt lt constant value 0 gt lt op gt lt op gt lt condition gt lt action gt lt property part name DefnArea name text gt Carnivourous domesticated mammal that s fond of rats and mice lt property gt lt action gt lt rule gt lt rule gt lt condition gt lt op name amp amp gt lt event part name TermList class ItemListener itemStateChanged gt lt op name gt lt property event class ItemListener itemStateChanged name item gt lt constant value 1 gt lt op gt lt op gt lt condition gt lt action gt lt property part name DefnArea name text gt Domestic animal related to a wolf that s fond of chasing cats lt property gt lt action gt lt rule gt lt rule gt lt condition gt lt op name amp amp gt lt event part name TermList class ItemListener itemStateChanged gt lt op name gt lt property event class ItemListener itemStateChanged name item gt lt constant value 2 gt lt op gt lt op gt lt condition gt lt action gt lt property part name DefnArea name text gt Small rodent often seen running away from a cat lt property gt lt action gt lt rule gt lt behavior gt Harmonia Inc Page 21 02 08 2002 UIML 3 0 Language Specification lt interface gt lt uiml gt The UIML document above starts with lt xml
142. reserve white space A UIML rendering engine may ignore leading and trailing spaces when rendering text on certain UI toolkits lt property part name p1 name font gt Helvetica bold lt property gt lt property part name p1 name title gt Char amp lt property gt lt property part name p1 name content gt lt CDATA Character amp gt lt property gt A lt reference gt element In this case the property is set to the value of the lt reference gt element see Section 5 6 2 In the following example the value of font in the part with id pl is set to the value Helvetica bold lt property part name pl name font gt lt reference constant name font name gt lt property gt lt Concent gt lt constant id font name gt Helvetica bold lt constant gt lt content gt In the following example the user interface contains a Java button When the button is pressed the label of the button is set to the content of URL referenceContent xml It should be noted that content from a lt reference gt element is retrieved during the rendering of the UIML document and not during the context from where the lt reference gt is defined Thus if the contents of referenceContent xml were changed after the interfaces was initially rendered but before the button was pressed the button would not reflect the changes See Section 5 6 2 for more information on lt reference gt lt interface gt lt
143. rt class JTextField is TF gt x part gt lt template gt lt restructure gt The set of children of A in the virtual UI tree is replaced with the set of children listed in the restructure tag So now the panel has only the following children A_T5_L1 A_T5_TF Cascade Example When cascade is used parts in the template that have the same name as a child of the lt part gt specified by at part are not used but any other parts in the template are added as children of the lt part gt For example lt restructure at part A how cascade where last gt lt template id T6 gt lt part gt lt part class JLabel id L1 gt lt part class JLabel id L5 gt lt part gt lt template gt lt restructure gt Since A already has a child named L1 A_T5_L1 the L1 in template T6 is not used but part L5 from the template is added as a child of A So A s children are now A_TS5_L1 A_T5_TF A_T6_LS5 Note that when checking for a part with the same name only the last part of a fully qualified name is checked so A_T5_L1 matches L1 Delete Example To delete the panel simply do this lt restructure at part A how delete gt 5 7 12 The lt when true gt Element DTD lt ELEMENT when true property call restructure op equal event gt Description The lt when true gt element defines a set of actions to be executed when the evaluation of a conditional expressi
144. ructure gt element in section 5 7 11 e The Ul contains a sub tree of parts that is repeated 1 or more times where the number of times is determined at render time This is the purpose of the lt repeat gt element 5 4 2 The lt part gt Element DTD lt ELEMENT part style content behavior part repeat gt lt ATTLIST part id NMTOKEN IMPLIED class NMTOKEN IMPLIED source CDATA IMPLIED where first last before after last where part NMTOKEN IMPLIED how append cascade replace replace export hidden optional required optional gt Description Each lt part gt element represents either one instance of a class of UI widgets or nothing null It is sometimes useful to associate a part with nothing for example a part might be needed for a large screen UI but is omitted from a small device screen In the former case the part corresponds to a UI widget and in the later case the part corresponds to nothing Parts may be nested to represent a hierarchical relationship of parts Let a and b denote two lt part gt elements If part b is nested inside part a and both a and b correspond to UI widgets i e neither a nor b correspond to null then b s UI widget must be contained in a s widget where contained in is defined in terms of the UI toolkit If the UI toolkit does not define nesting then nesting part b in part a in a UIML document is equivalent to a UIML docu
145. sociated with a UI part through the lt property gt element lt structure id GUI gt lt part class button id affirmativeChoice gt lt structure gt Harmonia Inc Page 45 02 08 2002 UIML 3 0 Language Specification lt style gt lt property part name affirmativeChoice name label gt Yes lt property gt lt style gt In the UIML fragment above the button label is hard wired to the string Yes Suppose we wanted to internationalize the interface In this case UIML allows the value of a property to be what a programmer would think of as a variable reference using the lt reference gt element lt style gt lt property part name affirmativeChoice name label gt lt reference constant name affirmativeLabel gt lt property gt lt style gt The lt reference gt element refers to a constant name which is defined in the lt content gt element in a UIML document The important concept is that there may be multiple lt content gt elements in a UIML document each with a different name When the interface is rendered one of the lt content gt elements is specified and the lt content gt elements inside are then used to satisfy the lt reference gt elements This is illustrated in the following example The UI contains two parts The class name button suggests that each part be rendered as a button in a graphical UI The lt style gt element Section 5 5 actually determines how the class cal
146. sseeees 11 1 3 Purpose of This Document eessossssesssecssocesocesoocesocessecesooesoosssosessecssocesocesooessossesosessee 11 LA Termnini lo gy ves sssievcssccsccdsassaccvsscvccuuddssacsesdss cacddassasadavusscdesddsedissdesdvscacdistssidptedisccsecddssieets 11 1 5 Note about Harmonia Inc Rendering Engines ccscccssscccsssscssssscesssssssseseess 13 2 Structure of a UIML Document 3 sccsisssiccssveisstsscteetssnedanedocessdesvneatanstadonnisooeniivaversededseoasarneesen 14 DM OVervieW sssivisadeccacdevesesvckdndunsedssncedevcctsiedsessdvauedveud dadtSacdsdedsscuss SuSE os eos ie ioe sii ios 14 2 1 1 Dynamic Interfaces Through a Virtual UI Tree eee eeseceeeeeeeeeeeeenneenees 14 2 1 2 Interface Behaviors mi o isra a E E E E A A Seat 15 2 1 3 Philosophy Behind UIML s Tags sseesseseeseeeseesesseseresressessresreesessresrreseseresresseseess 15 2 1 4 First UIML Example Hello World sseeseseseeeesesseeeesessseseesseesrrserssresseseresressesse 16 2 2 UIML Document Structure eessesooesoessesoossosssesoossosssessossocssessossocssessossoossossosssossesssss 17 2 2 1 Second UIME Examples eai aria a a e a aneaddees 18 2 3 UIML NAMeOs Pace sivsisscsssiessisacsaisnssccrscisatenstvssnouewiaiiccterdiotscanslindaniaesvechesesacascaisnscvectinais 23 2 4 UIME Mim Ey Pe idccssecsvoiecuidsacucsiesssatevaadonceccapsccevaadadasedonnsccassseededdaduavssssescodedsvensanvesves 24 Table of UIML Elements sesssesoosseesoesoces
147. t lt d method gt lt d component gt lt d component name back2 maps to org uiml example myClass1 gt lt d method name m3 maps to m9 gt lt d param name p4 gt lt d method gt lt d component gt lt d component name S1 gt lt d method name m1 returns value true maps to Cube gt lt d param name i gt lt script type application ecmascript gt lt CDATA Cube int i tetura 24a Fh l gt lt seript gt lt d method gt lt d component gt Harmonia Inc Page 86 02 08 2002 UIML 3 0 Language Specification lt d component name S2 maps to http somewhere vb gt lt d method name m101 maps to f2 gt lt d param name p5 gt lt d method gt lt d component gt lt logic gt 6 4 Subelements of lt presentation gt and lt logic gt 6 4 1 The lt d component gt Element DTD lt ELEMENT d component d method gt lt ATTLIST d component id NMTOKEN REQUIRED source CDATA IMPLIED how append cascade replace replace export hidden optional required optional maps to CDATA IMPLIED location CDATA IMPLIED gt Description The lt d component gt a child of lt logic gt only acts as a container for application methods e g a class in an object oriented language A d component contains d methods The maps to attribute specifies the platform specific type of the component or container tha
148. t element is used resulting in Button1 Button2 and Button3 having background colors red yellow and green respectively A rendering engine must evaluate all lt property gt elements for a given part in textual order and adhere to the conflict resolution policy described above when dealing with multiple conflicting lt property gt elements Implementations of this policy are beyond the scope of this document provided that the end result guarantees that the effect is equivalent to evaluating all conflicting lt property gt elements 5 5 2 Using Properties to Achieve Platform Independence One of the powerful aspects of UIML is the ability to design a UIML document that can be mapped to multiple platforms This is achieved by a special property called rendering To illustrate the use of rendering let s look at an example Suppose we were going to create a UI specifically for Java AWT First our UIML document would need to specify that it uses a vocabulary for Java AWT This is done by a presentation element exemplified earlier in Section 2 2 1 lt peers gt lt presentation base JavaAWT_1 3_Harmonia_1 0 gt lt peers gt The above UIML fragment names base attribute that maps to a URI that defines the vocabulary JavaAWT_1 3_Harmonia_1 0 uiml can be viewed as a black box by the UIML author It actually contains a lt presentation gt element discussed in Section 6 2 JavaAWT_1 3_Harmonia_1 0 uiml uses all Java AWT class names as
149. t holds true when both of its children are true The first child of lt op name amp amp gt is lt event gt so this child is true when the event ItemListener itemStateChange fires for the part named TermList Vocabulary Java_1 3_Harmonia_1 0 uses as UIML event names L m where L is a Java listener e g ItemListener and m is a method in the listener e g itemStateChange See 6 2 2 3 for further information Put another way the lt event gt is true when a user clicks on a term Cat Dog or Mouse The second child of lt op name amp amp gt is another lt op gt element this time lt op name gt This inner lt op gt element is true when its children are equal The first child is lt property gt which evaluates to the property called item of an ItemListener itemState Changed event Vocabulary Java_1 3_Harmonia_1 0 uses the method names in each Java event as property names for UIML events The Java itemStateChanged method takes an temEvent as an argument which in turn has a method named getltem Method getItem returns the index number of the item selected in the list either 0 1 or 2 in our Dictionary example Hence the UIML event has a property named item Therefore the inner lt op gt is true when the item number selected equals zero In summary the entire condition is true when the user clicks on an animal name and the item clicked on is item zero or Cat The action associated with clicking Cat is to ch
150. t lt call name serverObject getColor gt lt param gt lt param gt lt call name q getParam gt lt param gt 5 lt param gt lt call gt lt param gt lt call gt lt action gt lt rule gt lt behavior gt The lt behavior gt element above consists of one rule The rule is executed whenever an event of class ButtonSelected for part b1 fires Let s assume that b1 is a button established in a lt part gt element not shown and ButtonSelected is a button click established in a lt peers gt element not shown There is one lt action gt element associated with the rule That action contains three elements that set properties in the interface labeled 1 to 3 by comments 1 The first action labeled lt 1 gt calls a method named m storeData when button b1 is clicked The method takes two arguments the first is 5 and the second is the value of a constant named green and defined in the lt content gt element see Section 5 6 not shown here 2 The second action is to call method m storeColor with one parameter whose value is the current color of button b1 The attribute name a3 in the lt param gt element is used in the following situation m storeColor has more than one formal parameter and one formal parameter is named a3 and all other formal parameters have default values 3 The third action calls method n Displ
151. t is being bound The location attribute gives additional information e g a URD that is used by the rendering engine to locate the widget event or application class at runtime 6 4 2 The lt d class gt Element DTD lt ELEMENT d class d method d property event listener gt lt ATTLIST d class id NMTOKEN REQUIRED Source CDATA IMPLIED how append cascade replace replace export hidden optional required optional maps to CDATA REQUIRED maps type CDATA REQUIRED used in tag event listener part REQUIRED gt Harmonia Inc Page 87 02 08 2002 UIML 3 0 Language Specification Description The lt d class gt a child of lt presentation gt only element binds a name used in the rendering property of a part or an lt event gt element elsewhere in the interface to a component that is part of the presentation toolkit The maps to attribute specifies the platform specific type of the component or container that is being bound 6 4 3 The lt d property gt Element DTD lt ELEMENT d property d method d param gt lt ATTLIST d property id NMTOKEN REQUIRED maps type attribute getMethod setMethod method REQUIRED maps to CDATA REQUIRED return type CDATA IMPLIED gt Description The lt d property gt element specifies the mapping between the name appearing in a lt property
152. th any particular part Rendering engines should produce a warning if the part name attribute is associated with an lt event gt element that represents an exception Harmonia Inc Page 55 02 08 2002 UIML 3 0 Language Specification lt event gt elements defining exceptions as shown above will result in the named exception being caught no matter where it is thrown from 5 7 5 2 Extracting Data from Events Events often contain useful data that may be needed by other aspects of the user interface For example if the system detects a mouse click it may be useful to extract the coordinates of the mouse click for display elsewhere in the interface To facilitate this type of interaction UIML recognizes lt property gt elements as children of lt event gt elements These properties represent data wrapped up in the event and can be used to extract the data from the event Data of this type can be accessed using the following lt property gt syntax lt property event class MyEvent name MyEventData gt Since lt event gt s cannot be named this always refers to the last event of the specified class to occur 5 7 5 3 Special Events UIML facilitates initializing a page similar in effect to an onLoad event in HTML through the use of a special event class named init The init event class is used as a child of a lt condition gt element and the lt action gt associated with the condition containing the init lt eve
153. tion 5 7 1 If a lt call gt element has as its grandparent a lt style gt element and is not the descendent of a lt restructure gt element then the call must be evaluated at render time Otherwise the call must be evaluated at runtime Therefore if an lt action gt element describing what to do when a button is pressed in a UI contains a call then the call is executed every time the button is pressed Invocation via Direct Specification Suppose that the UIML document contained an lt action gt element to invoke method m1 in object back1 with actual parameters 5 and 10 as in the expression back1 m1 5 10 The lt action gt element might look like the following lt behavior gt lt rule gt lt ACtLON gt lt call name back1 m1 gt lt param gt 5 lt param gt lt param gt 10 lt param gt lt call gt lt action gt Harmonia Inc Page 59 02 08 2002 UIML 3 0 Language Specification lt rule gt lt behavior gt The d component element defining back1 might look like the following lt peer gt lt logic gt lt d component id back1l maps to org uiml example myClass gt lt d method id m1 maps to myFunction gt lt d param id pl1 gt lt d param id p2 gt lt d method gt lt d component gt lt Logic gt lt peer gt The value of the maps to attribute of the lt d component gt element follows the syntax imposed by the language in which the rendering engine in use is implemented J
154. ton otherwise if Swing specific is used then the submitButton maps to JButton The above example is also very useful in a dynamic UI where the binding of a part e g submitButton to Button versus JButton can change every time the UI is rendered In the example below each time the UIML document is rendered the renderer executes the lt call gt element and the return value of the call is either the string Button or JButton Therefore sometimes when the UI is rendered part swbmitButton will be an AWT Button and other times a Swing JButton This might be useful if the UI is sometimes displayed on various devices all of which implement AWT and only some of which implement Swing lt part class AWTorSwingButton id submitButton gt lt style gt lt property name rendering gt lt call name X getRendering gt lt property gt lt style gt lt part gt Another example of the use of rendering for a part name or part class is for UIs that contain the results of searches The search result might be a table and one column of the table might contain images on one search but text on another search The choice of table column parts being images versus text would be determined by a lt call gt element to get the part rendering similar to the one illustrated above Harmonia Inc Page 43 02 08 2002 UIML 3 0 Language Specification Given this basic example some variations are possible First the style element can
155. tructure gt lt structure gt lt style gt lt style gt lt content gt lt content gt lt behavior gt lt behavior gt lt interface gt The lt structure gt element enumerates a set of interface parts and their organization for various platforms The lt style gt element defines the values of various properties associated with interface parts analogous to style sheets for HTML The lt content gt element gives the words sounds and images associated with interface parts to facilitate internationalization or customization of UIs to various user groups e g by job role The lt behavior gt element defines what UI events should be acted on and what should be done 5 2 Attributes Common to Multiple Elements Before explaining each of the elements introduced in Section 1 we first describe some attributes that are used in several of the elements 5 2 1 The id and class Attributes The lt part gt lt event gt and lt call gt elements in UIML may have an id and a class attribute The id attribute assigns a unique identifier to an element No two elements can have the same id within the same UIML document The class attribute assigns a class name to an element Any number of elements may be assigned the same class name The use of the attribute class is based on the CSS 2 concept of class a class specifies an object type while the element s id uniquely identifies an instance of that type A st
156. tside the template regardless of whether the lt part gt element has an export attribute Example In the following template a message box has three parts It requires that the content of one part be assigned a value but hides the other two parts Now assume that this template is rendered as a dialog window with a logo image a label and an Ok button The UI that sources this template must provide the content for the label and thus display a custom message but cannot modify the logo or the Ok button lt template id MyDialog gt lt part id TopLevel gt lt part id MyLogo class Logo export hidden gt lt part id MyMessage class Label gt xstyle gt lt property name content export required gt lt style gt lt part gt lt part id 0k class OKButton export hidden gt lt part gt lt template gt Harmonia Inc Page 100 02 08 2002 UIML 3 0 Language Specification 8 Alternative Organizations of a UIML Document Until now UIML documents shown have followed a rigid format appearing in the lt uiml gt element is first the optional lt head gt element followed by the lt peers gt element and then the lt interface gt element Alternative document organizations are possible The lt content gt lt style gt and lt behavior gt elements can be embedded within the lt part gt element This makes it easier to write UIML because all information about an interface
157. ty gt lt equal gt lt event gt lt head gt lt interface gt lt iterator gt lt logic gt lt meta gt lt op gt lt param gt lt part gt lt peers gt lt presentation gt lt property gt lt reference gt lt repeat gt Harmonia Inc Purpose Page Perform an action if the condition of a rule is true 58 Specify rules for runtime behavior 49 Set of actions to be executed when lt op gt conditional is undefined 69 Call a function or method external to UIML document 58 Specify a condition for a rule 54 Define a constant value 47 Specify a set of constant values 45 Maps class names that can be used for parts and events to a UI 87 toolkit Maps a name used in a lt call gt element to application logic external 87 to UIML document Maps a method to a callable method or function in the API of the 89 application logic Defines a single formal parameter to a lt d method gt 90 Maps a property name for parts or events to methods in a UI 88 toolkit that get and set the property s value Compares the property value of an event with another value 54 Specify a UI or system event to be thrown or caught 55 A container for metadata information 28 A container for all UIML elements that describe a user interface 32 A tag controlling the number of times a virtual tree containedina 63 lt repeat gt element is replicated Describes mappings of names and classes used in lt call gt elements 85 to application logic Define a pi
158. ty gt element to set a property of a part e g 1 to 4 in Section 5 7 1 a lt call gt element to invoke a method e g 5 to 7 in Section 5 7 1 a lt restructure gt element to restructure an interface Section 5 7 11 an lt event gt element to fire another event e g 8 in Section 5 7 1 or a lt when true gt lt when false gt lt by default gt element to determine a set course of actions depending on the value of the conditional expressed in the lt condition gt element Sections 5 7 12 5 7 13 5 7 14 The lt event gt element if present must be the last element inside the action As result of this you can only fire one event within the lt action gt element 5 7 8 The lt call gt Element DTD lt ELEMENT call param gt lt ATTLIST call name NMTOKEN IMPLIED Description The lt call gt element is an abstraction of any type of invocation of code that uses a language other than UIML The code is referred to in this specification as a method which in Section 1 4 is defined to include functions procedures and methods in an object oriented language database queries and directory accesses Harmonia Inc Page 58 02 08 2002 UIML 3 0 Language Specification 5 7 8 1 Overview on lt call gt UIML s philosophy on specifying function invocations is to allow the UIML author to freely choose a set of names for widgets events and functions referenced in the lt interface gt sect
159. ure The way parts are cascaded to the structure is defined through use of the where and where part attribute see below The cascading behavior exhibits the same behavior as found in Section 7 2 3 The where attribute can only be used when the source attribute is present and how cascade or how append is present The where part attribute can be used only when where before or where after is used The attributes have the following semantics Let the part element specified by at part be lt part name P gt If attribute where first is present All children of part P in the lt template gt named in the source attribute must be inserted as children of part P before the existing children If attribute where last is present All children of the part P in lt template gt named in the source attribute must be inserted as children of part P after the existing children If attribute where before and where part part name is present All children of part P in the lt template gt named in the source attribute must be inserted as children of part P before the child of P with part name part name but after any children appearing before the child part name If attribute where after and where part part name is present All children of part P in the lt template gt named in the source attribute must be inserted as children of part P after the child of P with part name part name but before any subsequent childr
160. ust have default values for all its formal arguments Note that the return value of the call is converted to a character string because the value of the lt property part name b3 name color gt element is a character string Finally note that white space spaces tabs line breaks is significant in an XML document Therefore the right angle bracket of the lt property gt tag must be immediately followed by the left angle bracket of the lt call gt tag and similarly the right angle bracket of lt call gt must be immediately followed by the left angle bracket of the lt property gt tag e Calla method The function or method call can take any number of arguments Each argument to the call can be any of the following a constant value a reference to a constant the value of property or the return value of another call lt behavior gt lt rule gt lt condition gt xl S B gt lt event class ButtonSelected part name b1 gt lt condition gt lt action gt AE e lt call name m storeData gt Harmonia Inc Page 51 02 08 2002 UIML 3 0 Language Specification lt param gt 5 lt param gt lt param gt lt reference constant name green gt lt param gt lt call gt lt 6 gt lt call name m storeColor gt lt param name a3 gt lt property part name b1 name color gt lt param gt lt call gt lt l 7 gt lt call name n DisplayData gt lt param g
161. y to include any other parts from external sources can be achieved Style is what dictates how an interface looks and feels Many companies want the interfaces of their applications to share a common look and feel when presented on the same platform For example they want all the about dialogs to show their company logo and copyright statement they want the name of their company to be in a special font and color everywhere it appears and Harmonia Inc Page 97 02 08 2002 UIML 3 0 Language Specification they want the menus to have a special structure e g File Edit View etc etc UIML allows this and more All the common style information can be specified in a template and then included in each of the interface descriptions Using cascade as the value for the how attribute will include the common style information but will also give the ability to customize certain properties Any local property with the same name will override the property in the template Example The following example demonstrates how to use common style properties and customize them lt template id Graphical gt lt style gt lt property name TitleColor part class ADialog gt Blue lt property gt lt property name TitleFont part class ADialog gt Arial lt property gt lt property name rendering part class ADialog gt Dialog lt property gt lt property name content part class ADialog gt About UIT lt property gt lt
162. yle associated with all instances of a class is associated with all elements that specify the same value for their class attribute a style associated with a specific instance of a class is only associated with the element that specifies the value denoted in the style declaration for their id attribute Harmonia Inc Page 30 02 08 2002 UIML 3 0 Language Specification 5 2 2 The source and how Attributes Certain lt uiml gt elements behavior d component d class d method constant content interface logic part peers presentation property rule script structure and style may contain a source attribute Like HTML the source attribute specifies a link from the UIML document to a Web resource identified by a URI However the reason for using a link in UIML differs from HTML A source attribute can refer to two things A URI to a resource that does not contain UIML code In this case the resource file can be textual e g HTML or binary e g JPEG This case is analogous to the IMG tag in HTML lt constant id Logo source http uiml org images UIMLLogo jpg gt A URI to a resource that does contain UIML code The UIML code is inserted into the element that contains the source as explained in Section 7 2 Inserting code has several uses explained in section 7 o Splitting a UI definition into several UIML documents o Creating a library of reusable UI components o Achieving the cascading behavior of CSS style sheets
Download Pdf Manuals
Related Search
Related Contents
gystech 3800_FR_EN_V3 Nokia 1110 Manual do Usuário (Rev. 0, 07-15) PDF handisecure™ - Handicare.dk PDC-812iR 取扱説明書 Copyright © All rights reserved.
Failed to retrieve file