I am having an issue writing code that keeps the cross reference text updated between files.
For example, I have two xml documents: docOne.xml and docTwo.xml. If docTwo.xml has a reference to a title in docOne.xml - and the title in docOne.xml is updated, I would like that change to be reflected in docTwo.xml (when it refreshes - does not have to be in real time).
Specifically, I'd like to retrieve the TextContent() value from <title> nodes found across several .xml files (which are stored in the same directory). I would like to use the retrieved value to update the Link Text Value in several anchor tags with a currently viewed document.
I am extending the LinkTextResolver class in which I am overriding the resolveReference method. Within the resolveReference method I am using :
Code: Select all
Object nodes = authorAccess.getDocumentController().evaluateXPath("collection('"+searchDirectory+"?select=*.xml')//title[@id='" + idValue + "']", authorNode,false,false,false,false);
To scan all .xml files within the defined directory, ‘searchDirectory’ in search of the <title> element with the matching ‘idValue’ . This works fine in the Oxygen XML Editor v19.0 desktop application when ‘searchDirectory’ points to a location on a local drive.
However when I deploy to the Oxygen WebAuthor v19.0 environment where the source .xml files are accessed via WebDav the function fails. Here in lies the issue and my question. I have modified ‘searchDirectory’ to point to the correct http:// location however I receive a “500 Internal Server Error” due to the permissions on WebDav.
Is the a way for me to obtain a WebDavUrlConnection using the current user's credentials from within LinkTextResolver ? I can’t seem to find any method or approach for doing so.
Is this approach completely insane? Is there an easier way to achieve what I am attempting? I just need to keep the reference text content current in any document while it is being viewed.
Any thoughts or suggestions would be greatly appreciated!