How to disable reference resolver
Posted: Tue Feb 13, 2024 3:22 pm
There are times a user may want to open a document (topic, concept, or map etc.,) in editor without resolving any references (xrefs, conrefs, mapref etc.,) The document could have 100s or references and it could take forever to resolve all the references, by disabling reference resolvers user can load the document almost instantly.
I added a pseudo class to the root element from WebappEditingSessionLifecycleListener.editingSessionStarted(String sessionId, AuthorDocumentModel documentModel), which will help in identifying that the document would not have to resolve any references.
Xrefs are resolved from Author CSS using oxy_getSomeText (frameworks\dita\css\core\-topic-related-links-xref.css). It was easy override this behavior using the pseudo class.
But maprefs / conrefs seem to be resolved by DITAMapRefResolver/ DITAConRefResolver.
I tried to override DITAMapRefResolver.hasReferences(AuthorNode node), return false if the pseudo class is present in root element.
But it appears this method is called upon initial load even before WebappEditingSessionLifecycleListener.editingSessionStarted(String sessionId, AuthorDocumentModel documentModel) where the pseudo class is added. Also do not seem to have access to URL Query Parameters from this method.
Any suggestions?
Sample map
I added a pseudo class to the root element from WebappEditingSessionLifecycleListener.editingSessionStarted(String sessionId, AuthorDocumentModel documentModel), which will help in identifying that the document would not have to resolve any references.
Xrefs are resolved from Author CSS using oxy_getSomeText (frameworks\dita\css\core\-topic-related-links-xref.css). It was easy override this behavior using the pseudo class.
But maprefs / conrefs seem to be resolved by DITAMapRefResolver/ DITAConRefResolver.
I tried to override DITAMapRefResolver.hasReferences(AuthorNode node), return false if the pseudo class is present in root element.
But it appears this method is called upon initial load even before WebappEditingSessionLifecycleListener.editingSessionStarted(String sessionId, AuthorDocumentModel documentModel) where the pseudo class is added. Also do not seem to have access to URL Query Parameters from this method.
Any suggestions?
Sample map
Code: Select all
<map>
<mapref href="one.ditamap"/>
......
<mapref href="key.ditamap"/>
</map>