Kevin Flynn wrote:
> 
> I would like to create a modified version of the "edit referenced 
> document" function that only conditionally opens the selected document. 
> In some cases an included document may have been auto-generated from 
> another source, and I therefore want to prevent the user from editing 
> it. In other cases the included document may be locked by a source 
> control system, and I would like to offer the user the option of 
> unlocking it before it is opened.
> 
> In both cases, I would need to be able to get hold of the path of the 
> included file before it is opened for editing, but I can't see how to do 
> this. Is it possible?
> 

--> It's possible to program quite easily the feature described above 
by implementing in Java an OpenedDocumentHook. See 
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/OpenedDocumentHook.html

The method of interest is openingDocument which may be used to veto a 
user action. See 
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmleditapp/kit/OpenedDocumentHook.html#openingDocument(com.xmlmind.xmleditapp.kit.OpenedDocument,%20java.net.URL,%20com.xmlmind.xmleditapp.kit.OpenedDocument)



--> I don't see how you could implement the feature described above 
using a macro.

Note that an included element has an ancestor having a "INCLUSION_MARK" 
property.

The value of an "INCLUSION_MARK" property is an InclusionMark object. 
See 
http://www.xmlmind.com/xmleditor/_distrib/doc/api/com/xmlmind/xmledit/doc/InclusionMark.html

The *string* *value* of an "INCLUSION_MARK" property can be obtained 
using the property() XPath extension function. See 
http://www.xmlmind.com/xmleditor/_distrib/doc/commands/xpathextfunc.html





Reply via email to