Get current document schema url

Post here questions and problems related to oXygen frameworks/document types.
cditcher
Posts: 29
Location: Victoria BC, Canada

Get current document schema url

Sat Jan 09, 2016 12:38 am

We are developing DTAs which have actions (implementations of ro.sync.ecss.extensions.api.AuthorOperation) that extend the functionality of Author. I have a situation where i need to get the url of the schema of the current document. I know this should be simple, but a search of the forums and api turned up no explicit example.

My first attempt was similar to this (where the variable 'aa' is an AuthorAccess implementation):

Code: Select all

aa.getUtilAccess().expandEditorVariables(EditorVariables.DETECTED_SCHEMA_URL, null);

Unfortunately, the String this returns was only ${dsu} instead of a valid path to a schema location.

Another attempt was:

Code: Select all

EditorVariables.expandEditorVariables(EditorVariables.DETECTED_SCHEMA_URL, aa.getDocumentController().getAuthorDocumentNode().getSystemID());

But still nothing.

The schema is valid, declared in the dta framework and validates the open document so Author is aware of the associated schema. Is there a better way?

Thanks,
Chris
alex_jitianu
Posts: 632

Re: Get current document schema url

Mon Jan 11, 2016 1:36 pm

Hello Chris,

It looks like EditorVariables.DETECTED_SCHEMA_URL variable only gets expanded inside a few, specific contexts. Please try:

Code: Select all

aa.getDocumentController().getAuthorSchemaManager().getGrammarURLs();


Best regards,
Alex
cditcher
Posts: 29
Location: Victoria BC, Canada

Re: Get current document schema url

Tue Jan 12, 2016 8:13 pm

Correct! Thanks Alex. I overlooked that.

Return to “SDK-API, Frameworks - Document Types”

Who is online

Users browsing this forum: No registered users and 0 guests