Gary,
I tried the same thing on my machine (Editor 5.3 M020) with the same
results. However, I don't think there is a problem here. Since you
evidently have both the edit view and docmap view opened, there are
apparently 2 document "views" open as well. Your code only closes one
of the views. The following code seems to work for me, although I
haven't thoroughly tested it:
Acl.execute("set viewmode=edit;");
ADocument adoc = (ADocument)Application.getActiveDocument();
adoc.setModified(false); // or adoc.save();
adoc.close();
The first line has the effect of removing the docmap view, so there is
only one view of the document you want to close. There are probably
better ways of closing both views, but this seems to be the quickest. It
is possible (I haven't tested it) that both views of the document are
listed in the NodeList returned by Application.getDocuments(). If so you
could first get the ACL docid of the active document and then loop
through this NodeList, checking the docid of each against that of the
active document. Call ADocument's close method on all that match.
--
Brian Jensen
Kyoshinsha Co. Ltd.
brian@kik.co.jp
2-9-5 Morinomiya-chuo Chuo-ku
Osaka 540-0003 Japan
Tel: 81-6-6941-8881
Fax: 81-6-6941-1053
Gary Ouzts wrote:
> Does anyone know how to "close" the active document being edited in the
> Arbortext Editor using java code?
> Here's what I have tried:
>
> ADocument doc = (ADocument)Application.getActiveDocument();
> adoc.save();
> adoc.close();
>
> But this doesn't seem to actually close out the file. The Edit Window goes
> blank, but the Document Map window still shows the tag structure of the
> document. And the file being edited hasn't been fully released; for example, if
> I go outside the editor and try and delete the file from the local disk, the
> Windows OS says the file is still "in use".
> Any ideas/ suggestions?
> Thanks,
> Gary >> To unsubscribe from the list, send an email to
> listmanager@maillist.arbortext.com with the following in the body: unsubscribe
> adepters - For additional information on the adepters list (how to subscribe or
> unsubscribe etc), send an email to: listmanager@maillist.arbortext.com with the
> following in the body: info Adepters - You may also go to forums.arbortext.com,
> enter the Adepters folder and change your subscription options and preferences.>>