General Interface is an open source project hosted by the Dojo Foundation

Common Interface Format (CIF)

Common Interface Format (CIF)

The Common Interface Format (CIF) is a serialization format for storing General Interface component definitions. In the future, this format will replace the current serialization file format, which has the following namespace — xmlns="urn:tibco.com/v3.0". The CIF format provides improved readability and smaller file size.

The CIF format uses several new namespaces, the root of which is http://xsd.tns.tibco.com/gi/cif/2006. The new format is 100% compatible with the v3.0 serialization format. An XSLT is used for the conversion between CIF and v3.0 formats.

Currently, General Interface Builder can read but not save CIF files. Any edits made to a CIF file are saved in the old serialization format.

CIF Document Example

Here is an example of a CIF document that represents a dialog component. The dialog contains a window bar with buttons, a splitter with a grid layout, and so on. Some of the key aspects of the CIF are indicated in bold. For definitions, see CIF Definitions.

<component xmlns="http://xsd.tns.tibco.com/gi/cif/2006"
   *classpath*="jsx3.gui"
  xmlns:e="http://xsd.tns.tibco.com/gi/cif/2006/events"
  xmlns:\d="http://xsd.tns.tibco.com/gi/cif/2006/v3.2/dynamics"
  xmlns:\p="http://xsd.tns.tibco.com/gi/cif/2006/property"
  xmlns:\pe="http://xsd.tns.tibco.com/gi/cif/2006/property.eval"
  xmlns:x="http://xsd.tns.tibco.com/gi/cif/2006/xslparameters"
  xmlns:v="http://xsd.tns.tibco.com/gi/cif/2006/view"
  xmlns:id="http://xsd.tns.tibco.com/gi/cif/2006/inlinedata"
  xmlns:u="http://xsd.tns.tibco.com/gi/cif/2006/userdefined"
  xmlns:ue="http://xsd.tns.tibco.com/gi/cif/2006/userdefined.eval"
  >

  <meta name="onAfterDeserialize"><![CDATA[  jsx3.log("Here is an
    unescaped entity: >"); ]]></meta>
  <Dialog d:bgcolor="@Solid Medium" pe:width="400" pe:height="200"
    p:name="dlg1">

    <WindowBar p:name="cbar1" p:text="My Dialog" u:custom="this is
      custom">
      <ToolbarButton d:image="@Min Icon" p:name="tbbMin"
        e:execute="x();"/>
       <ToolbarButton d:image="@Close Icon" p:name="tbbClose"
      e:execute="y();"/>
    </WindowBar>

    <Splitter d:bgcolor="@Solid Shadow" p:name="splt1">

      <LayoutGrid d:bgcolor="@Solid Light" p:name="lg1"
        id:sizearray="AX1">
         <DatePicker pe:width="100" p:name="dp1" />
         <Button p:name="btn1" p:text="Click Me"
           e:execute="alert('hello');" />
         <Slider pe:length="100" p:value="100" p:name="sld1" />

         <id:\data href="AX1"
           handler-for="jsx3.lang.Serializeable.Array">
           <object>
             <item>38</item>
             <item>*</item>
             <item>26</item>
           </object>
         </id:\data>

      </LayoutGrid>


      <Block d:bgcolor="@Solid Light" p:name="pane2"
        p:\padding="8">
        <Select p:name="sel1" id:xml="HRTL129Q">

         <id:\data href="HRTL129Q">
           <![CDATA[
             <data jsxid="jsxroot">
               <record jsxid="TIBX" jsxtext="TIBCO"/>
               <record jsxid="MSFT" jsxtext="Microsoft"/>
               <record jsxid="YHOO" jsxtext="Yahoo!"/>
               <record jsxid="EBAY" jsxtext="Ebay"/>
               <record jsxid="GOOG" jsxtext="Google"/>
               <record jsxid="IBM" jsxtext="IBM"/>
             </data>
           ]]>
         </id:\data>

        </Select>
      </Block>

    </Splitter>
  </Dialog>

</component>

CIF Definitions

Node Name Namespace Description
component http://xsd.tns.tibco.com/gi/cif/2006 Root level node. Supports child elements belonging to the same namespace. Any child element (excluding those named meta, which is a reserved name) is understood to be an instance of jsx3.app.Modeland is deserialized as part of the standard General Interface DOM. In other words, any object hierarchy communicated by the XML serialization format would be a true reflection of the General Interface DOM once the XML is deserialized.
@classpath http://xsd.tns.tibco.com/gi/cif/2006 This attribute can belong to any node belonging to the http://xsd.tns.tibco.com/gi/cif/2006 namespace except for meta nodes. If bound to the root node, component, this is the default class path for all GUI controls defined in the serialization file. Any GUI control that implements this attribute can override the root node setting.
meta   Immediate child of the root node, component. Describes meta-related information about the component, including the following — name, icon, description, onAfterDeserailze, onBeforeDeserailize.
@name   Attribute of the meta node. Defines the name of the meta attribute. For example, onAfterDeserialize.
data http://xsd.tns.tibco.com/gi/cif/2006 Inline data node. Allows for the serialization of data according to an open format. The default implementation of this node assumes that it contains CDATA content. However, this node could provide a handler-for attribute as a means for serializing and deserialization custom data types.
@href   Provides the unique ID for the inline data node among all inline data nodes in the document.
@handler-for   Provides the name of the JavaScript object that handles the deserialization of either the component or the data. Applies only to the data node that belongs to the namespace, http://xsd.tns.tibco.com/gi/cif/2006/inlinedata.
namespace-qualified attributes   xmlns:e=
"http://xsd.tns.tibco.com/
gi/cif/2006/events"

xmlns:d=
"http://xsd.tns.tibco.com/
gi/cif/2006/dynamics"

xmlns:p=
"http://xsd.tns.tibco.com/
gi/cif/2006/property"

xmlns:pe=
"http://xsd.tns.tibco.com/
gi/cif/2006/property.eval"

xmlns:x=
"http://xsd.tns.tibco.com/
gi/cif/2006/xslparameters"

xmlns:v=
"http://xsd.tns.tibco.com/
gi/cif/2006/view"

xmlns:u=
"http://xsd.tns.tibco.com/
gi/cif/2006/userdefined"

xmlns:ue=
"http://xsd.tns.tibco.com/
gi/cif/2006/userdefined.eval"
In order to ensure proper compatibility with the existing serialization format and provide for good runtime deserialization performance, XML namespaces are used to uniquely identify how to deserialize a given property on a standard General Interface object definition. The use of namespaces allows the deserialized to quickly categorize the object properties. This prevents the need for expensive runtime lookups and the possibility of namespace collisions. For example, the drag property on a List definition may belong to the property namespace ( [http://xsd.tns.tibco.com/gi/cif/2006/property]), specifying whether or not the given List supports drag-and-drop. It could also belong to the event namespace ([http://xsd.tns.tibco.com/gi/cif/2006/events]) and relate to the handler code to fire when a drag event fires on the List. It could also be a user-defined property ([http://xsd.tns.tibco.com/gi/cif/2006]{{/userdefined}} or [http://xsd.tns.tibco.com/gi/cif/2006/userdefined.eval]). The drag property could also be a dynamic property.

Contents

Searching General Interface Docs

Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.