8.2.5 Representations
The XML files exported from MetaEdit+ will also contain the
graph representations and their elements. It is not necessary to include these
in files produced by other programs, but they can be included if desired. If you
do not include them, opening the graphs will create a layout, which you can
improve using the editor’s commands, e.g. Graph | Layout... in the
Diagram Editor.
The representation data is in the
http://www.metacase.com/gxlGOPRRRepr namespace, with a main element for each
type of representation: diagram, matrix and table. All representations share a
mandatory attribute for the timeStamp, in xsd:dateTime format (or as an empty
string to use the time of import), and an element pointing to their graph
(always as an href reference, since the graph will have already been defined).
They will contain elements for the representations of conceptual objects etc.,
and each of these will refer to its conceptual object with an object element
– once again using href. Note that the tags for these references to
conceptual data will be back in the standard namespace,
http://www.metacase.com/gxlGOPRR, so will have to declare that with an xmlns=
attribute.
Diagram
The start of a diagram looks like this:
<diagram
displayGrid="false"
grid="10,10"
timeStamp="2000-12-19T11:26:40.000Z"
useGrid="true"
xmlns="http://www.metacase.com/gxlGOPRRRepr">
<graph
href="#_22_792"
xmlns="http://www.metacase.com/gxlGOPRR">
</graph>An object representation specifies its
position and scale as x,y pairs. (The numbers are represented in the same way as
a single literal number in MERL
math..evaluate: see Section
6.5.6.)
<objectRepr id="_22_829" place="150,220" scale="1,1">
<object
href="#_22_4854"
xmlns="http://www.metacase.com/gxlGOPRR">
</object>
</objectRepr>Relationships and roles are specified
as part of a binding representation. This points directly to its conceptual
binding and its object representations, and indirectly via its connection
representations’ ids to its connections and their roles. The position and
scale of the relationship symbol are included as attributes in the bindingRepr
tag, along with an attribute specifying whether the relationship is binary and
straight.
<bindingRepr
isStraight="true"
place="179,160"
scale="1,1">
<binding
href="#_22_827"
xmlns="http://www.metacase.com/gxlGOPRR">
</binding>
<connectionRepr id="1">
<objectRepr href="#_22_830"></objectRepr>
</connectionRepr>
<connectionRepr id="2">
<objectRepr href="#_22_829"></objectRepr>
</connectionRepr>
</bindingRepr>A connectionRepr can also specify
the breakpoints along its line, starting from its object, and any manual offset
of its target point, i.e. where it intersects its object. Points are expressed
as x and y co-ordinates separated by a comma; the points themselves are
separated by a single space.
<connectionRepr
breakpoints="100,170 140,150"
id="2"
objTargetOffset="-3,-27">
Matrix
A large amount of the information for a matrix is at the level
of the matrix itself, expressing the layout choices made in the Matrix Editor
toolbar or menu bar.
<matrix
axisDisplayMode="axesDisplayText"
bindSelect="secondRole"
cellDisplayMode="displayText"
displayStringSelector="userPrintString"
rowLabelsWidth="86"
showFirst="false"
textStyleSymbol="default"
timeStamp="2006-11-14T14:00:52.781Z"
xmlns="http://www.metacase.com/gxlGOPRRRepr">
<graph
href="#_22_792"
xmlns="http://www.metacase.com/gxlGOPRR">
</graph>The display modes for the axes and
cells end in Text, TextAndSymbol or Symbol, corresponding to the choice in the
Axis and Cell menus. The choice in the View menu is shown
in the bindSelect attribute’s value, with Row Role represented as
firstRole, Column Role as secondRole, and Relationship as
relationship. The View | Directed? choice is represented in the showFirst
attribute. Finally, the displayStringSelector value is taken from Cell | Text
Display..., with values of userPrintStringWithType, userPrintString,
typeName, letter, and justX corresponding to the choices in the dialog shown by
that command.
The axis elements are represented by tags specifying on
which axis the object is, hAxis or vAxis, how wide the element is (a negative
value for a column renders it hidden), and which object it represents:
<hAxis width="45">
<object
href="#_22_4673"
xmlns="http://www.metacase.com/gxlGOPRR">
</object>
</hAxis>Relationships and roles are not directly
stored in a matrix, so are not represented in the XML: their presence is
calculated from the conceptual graph information, and their display format taken
from the attributes of the matrix tag.
Table
The table specifies its font and object type in attributes,
along with an export-only objectTypeName, ignored on import, that shows the
user-visible name of the object type. It specifies either one width element, for
the width of all columns, or a separate width element for each column.
<table
font="default"
objectType="Object_AppState_sysadmin_3150526244"
objectTypeName="State [Watch]"
timeStamp="2006-11-14T14:45:49.871Z"
xmlns="http://www.metacase.com/gxlGOPRRRepr">
<width>100</width>
<graph
href="#_22_792"
xmlns="http://www.metacase.com/gxlGOPRR">
</graph>Table elements are listed in order.
They have no information of their own, but simply point to their conceptual
object:
<tableElt>
<object
href="#_22_3617"
xmlns="http://www.metacase.com/gxlGOPRR">
</object>
</tableElt>