<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
</head>
<body bgcolor="#ffffff" text="#000000">
I have now made use of four of the experimental oXygen plugin workspace
API options (on a Mac running OS X - Snow Leopard) :<br>
<br>
(1) getOptionsStorage - This has a straightforaward interface, which
worked as expected.<br>
(2) createNewEditor - This was slightly more awkward to use in our
plugin's context (more details below).<br>
(3) getEntityResolver - Works as expected (thanks).<br>
(4) getURIResolver - Appears to works as expected (but currently, not
tested).<br>
<br>
I have managed to get the 'createNewEditor' API call to create a fresh
document that is considered to be modified, using the following code:<br>
<br>
<blockquote><tt>Writer writer = new StringWriter();<br>
...<br>
// Write to the string.<br>
...<br>
URL url= workspace.createNewEditor("xml", "text/xml",
writer.toString());<br>
WSEditor ed=workspace.getEditorAccess(url,
StandalonePluginWorkspace.MAIN_EDITING_AREA);<br>
ed.setModified(true);<br>
</tt></blockquote>
<br>
Observations:<br>
<br>
(1) This approach may be problematic for big documents, as the whole
document is stored in a string.<br>
(2) The created document is not marked as modified.<br>
<br>
There are at least two ways of addressing the first of these points.
One approach is to create a small blank document that is then
overridden using the WSEditod's realoadContent(Reader). Here, the
question I had was: what is the minimal XML document that can be
overridden (and get the right document type association - e.g. DITA)?
It might be that oXygen could automatically create such a document from
the first two arguments of the <tt>createNewEditor</tt> method.<br>
<br>
A second approach could be to replace the third argument of the <tt>createNewEditor</tt>
method with a java.io.Reader argument, such as is used when reloading a
document into an existing WSEditor (editor.reloadContent(reader)).<br>
<br>
Overall, I am pleased with these experimental enhancements.<br>
<br>
Regards,<br>
Anthony.<br>
<br>
-- <br>
<pre class="moz-signature" cols="9999">-- -------------------------------------------------------------------------
Michael Anthony Smith, DeltaXML Ltd "Change control for XML"
T: +44 1684 578751 E: <a class="moz-txt-link-abbreviated" href="mailto:anthony.smith@deltaxml.com">anthony.smith@deltaxml.com</a> <a class="moz-txt-link-freetext" href="http://www.deltaxml.com">http://www.deltaxml.com</a>
Registered in England 02528681 Reg. Office: Monsell House, WR8 0QN, UK
</pre>
</body>
</html>