Skip to main content



      Home
Home » Modeling » GMF (Graphical Modeling Framework) » How to extend the diagram xml/xmi file?
How to extend the diagram xml/xmi file? [message #169976] Fri, 25 January 2008 18:51 Go to next message
Eclipse UserFriend
Originally posted by: raedler.inf.uni-konstanz.de

Hi,

first of all I have to say that both, model and diagram are written into
the same file. Here called pad file. Now I want to add new attributes to
the model as shown below.

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:Designer="http://www.notnecessary.com/designer"
xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation">
<Designer:PipeArea xmi:id="_lE21oMuCEdys2vun_V9mYA">
<pumpingStations xmi:type="Designer:Tracking"
xmi:id="_mH9RYMuCEdys2vun_V9mYA" name="Trancking_Name"/>
<pumpingStations xmi:type="Designer:Peeking"
xmi:id="_59qJIMuFEdyQ9a1Rsyvaew" name="Peek1" m_noise="0.5" e_noise="0.1"/>
</Designer:PipeArea>

to

<?xml version="1.0" encoding="UTF-8"?>
<xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
xmlns:Designer="http://www.notnecessary.com/designer"
xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation">
<Designer:PipeArea xmi:id="_lE21oMuCEdys2vun_V9mYA">
<pumpingStations xmi:type="Designer:Tracking"
xmi:id="_mH9RYMuCEdys2vun_V9mYA" name="Trancking_Name"/>
<pumpingStations xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:type="Designer:Peeking" xmi:type="Designer:Peeking"
xmi:id="_59qJIMuFEdyQ9a1Rsyvaew" name="Peek1" m_noise="0.5" e_noise="0.1"/>
</Designer:PipeArea>

Is it possible to manipulate the model/diagram output and extend it with
more information?

Thank You!
Re: How to extend the diagram xml/xmi file? [message #169993 is a reply to message #169976] Sat, 26 January 2008 08:57 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------090704070107070404060403
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Roman,

This XMIResource option can be forced to make it use xmi:type or
xsi:type, but not both:

/**
* Write the type of an element as "xmi:type" instead of "xsi:type"
* which is useful for models with multiple inheritance that may
* conflict with XML schema types
*/
String OPTION_USE_XMI_TYPE = "USE_XMI_TYPE";

Deserialization should handle either form the same.


Roman Raedle wrote:
> Hi,
>
> first of all I have to say that both, model and diagram are written
> into the same file. Here called pad file. Now I want to add new
> attributes to the model as shown below.
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:Designer="http://www.notnecessary.com/designer"
> xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation">
> <Designer:PipeArea xmi:id="_lE21oMuCEdys2vun_V9mYA">
> <pumpingStations xmi:type="Designer:Tracking"
> xmi:id="_mH9RYMuCEdys2vun_V9mYA" name="Trancking_Name"/>
> <pumpingStations xmi:type="Designer:Peeking"
> xmi:id="_59qJIMuFEdyQ9a1Rsyvaew" name="Peek1" m_noise="0.5"
> e_noise="0.1"/>
> </Designer:PipeArea>
>
> to
>
> <?xml version="1.0" encoding="UTF-8"?>
> <xmi:XMI xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI"
> xmlns:Designer="http://www.notnecessary.com/designer"
> xmlns:notation="http://www.eclipse.org/gmf/runtime/1.0.1/notation">
> <Designer:PipeArea xmi:id="_lE21oMuCEdys2vun_V9mYA">
> <pumpingStations xmi:type="Designer:Tracking"
> xmi:id="_mH9RYMuCEdys2vun_V9mYA" name="Trancking_Name"/>
> <pumpingStations
> xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
> xsi:type="Designer:Peeking" xmi:type="Designer:Peeking"
> xmi:id="_59qJIMuFEdyQ9a1Rsyvaew" name="Peek1" m_noise="0.5"
> e_noise="0.1"/>
> </Designer:PipeArea>
>
> Is it possible to manipulate the model/diagram output and extend it
> with more information?
>
> Thank You!
>


--------------090704070107070404060403
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Roman,<br>
<br>
This XMIResource option can be forced to make it use xmi:type or
xsi:type, but not both:<br>
<blockquote><small>
Re: How to extend the diagram xml/xmi file? [message #170100 is a reply to message #169993] Sun, 27 January 2008 14:54 Go to previous messageGo to next message
Eclipse UserFriend
Originally posted by: raedler.inf.uni-konstanz.de

Where do I find this setting or how do I change this?
Re: How to extend the diagram xml/xmi file? [message #170109 is a reply to message #170100] Sun, 27 January 2008 15:49 Go to previous message
Eclipse UserFriend
Originally posted by: merks.ca.ibm.com

This is a multi-part message in MIME format.
--------------030606010909050201070203
Content-Type: text/plain; charset=ISO-8859-15; format=flowed
Content-Transfer-Encoding: 7bit

Roman,

Ctrl-Shift-T is a handy way to find files if someone hasn't told you the
fully qualified name. It is an option that can be passed while saving a
resource via the options map for the save method. Normally though,
you'd specified it in the resource factory when the resource is created
so so anywhere it's saved, it will use that option. You're getting this
form in the first place because that's how GMFResourceFactory specifies it.

|*public class *GMFResourceFactory
*extends *XMIResourceFactoryImpl {

*public *GMFResourceFactory() {
*super*();
}

// default load options.
*private static final *Map loadOptions = *new *HashMap();

// default save options.
*private static final *Map saveOptions = *new *HashMap();

*static *{

XMIResource resource = *new *XMIResourceImpl();

// default load options.
loadOptions.putAll(resource.getDefaultLoadOptions());
loadOptions.put(XMIResource.OPTION_LAX_FEATURE_PROCESSING, Boolean.TRUE);

// default save options.
saveOptions.putAll(resource.getDefaultSaveOptions());
saveOptions.put(XMIResource.OPTION_DECLARE_XML, Boolean.TRUE);
saveOptions.put(XMIResource.OPTION_PROCESS_DANGLING_HREF,
XMIResource.OPTION_PROCESS_DANGLING_HREF_DISCARD);
saveOptions.put(XMIResource.OPTION_SCHEMA_LOCATION, Boolean.TRUE);
* saveOptions.put(XMIResource.OPTION_USE_XMI_TYPE, Boolean.TRUE);*
saveOptions.put(XMIResource.OPTION_SAVE_TYPE_INFORMATION, Boolean.TRUE);
saveOptions.put(XMIResource.OPTION_SKIP_ESCAPE_URI, Boolean.FALSE);
saveOptions.put(XMIResource.OPTION_ENCODING, EMFCoreConstants.XMI_ENCODING);
}

/**
* Get default load options.
*/
*public static *Map getDefaultLoadOptions() {
*return *loadOptions;
}

/**
* Get default save options.
*/
*public static *Map getDefaultSaveOptions() {
*return *saveOptions;
}

*public *Resource createResource(URI uri) {

XMIResource resource = *new *GMFResource(uri);

resource.getDefaultLoadOptions().putAll(loadOptions);
resource.getDefaultSaveOptions().putAll(saveOptions);

*if *(!resource.getEncoding().equals(EMFCoreConstants.XMI_ENCODI NG))
resource.setEncoding(EMFCoreConstants.XMI_ENCODING);

*return *resource;
}
}|


Roman Raedle wrote:
> Where do I find this setting or how do I change this?
>


--------------030606010909050201070203
Content-Type: text/html; charset=ISO-8859-15
Content-Transfer-Encoding: 8bit

<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta content="text/html;charset=ISO-8859-15"
http-equiv="Content-Type">
</head>
<body bgcolor="#ffffff" text="#000000">
Roman,<br>
<br>
Ctrl-Shift-T is a handy way to find files if someone hasn't told you
the fully qualified name.
Previous Topic:Getting PropertySource for EMF within GMF editor
Next Topic:Listening on EditPart's label
Goto Forum:
  


Current Time: Wed May 28 18:10:23 EDT 2025

Powered by FUDForum. Page generated in 0.03296 seconds
.:: Contact :: Home ::.

Powered by: FUDforum 3.0.2.
Copyright ©2001-2010 FUDforum Bulletin Board Software

Back to the top