How to extend the diagram xml/xmi file? [message #169976] |
Fri, 25 January 2008 18:51  |
Eclipse User |
|
|
|
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 #170109 is a reply to message #170100] |
Sun, 27 January 2008 15:49  |
Eclipse User |
|
|
|
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.
|
|
|
Powered by
FUDForum. Page generated in 0.03296 seconds