<html>
<head>
<meta content="text/html; charset=ISO-8859-1"
http-equiv="Content-Type">
</head>
<body bgcolor="#FFFFFF" text="#000000">
<div class="moz-cite-prefix">Hi Nathan,<br>
<br>
I'm sorry I didn't give more details. I kind of expected our
documentation to also mention more on how to install the filter,
but at a closer look I see that it doesn't... I'll add an issue to
add more details. <br>
<br>
There are two places where you can add the filter:<br>
1. AuthorExtensionStateListener.activated(), if you are working
with framework level API. Like you've said, you can create a class
which extends the DITAExtensionBundle and override
createAuthorExtensionStateListener(). I recommend also delegating
to the super listener (the default bundle needs this listener
too), like so:<br>
<br>
public class CustomDITAExtensionBundle extends
DITAExtensionsBundle {<br>
/**<br>
* @see
ro.sync.ecss.extensions.dita.DITAExtensionsBundle#createAuthorExtensionStateListener()<br>
*/<br>
@Override<br>
public AuthorExtensionStateListener
createAuthorExtensionStateListener() {<br>
final AuthorExtensionStateListener superListener =
super.createAuthorExtensionStateListener();<br>
<br>
return new AuthorExtensionStateListenerDelegator() {<br>
@Override<br>
public String getDescription() {<br>
return "";<br>
}<br>
@Override<br>
public void deactivated(AuthorAccess authorAccess) {<br>
superListener.deactivated(authorAccess);<br>
}<br>
<br>
@Override<br>
public void activated(AuthorAccess authorAccess) {<br>
// TODO INSTALL FILTER<br>
authorAccess.getDocumentController().setDocumentFilter(authorDocumentFilter);<br>
superListener.activated(authorAccess);<br>
}<br>
};<br>
}<br>
}<br>
<br>
2. An Workspace Access plugin [2], if you are working with plugin
API. Like so:<br>
<br>
public void applicationStarted(final StandalonePluginWorkspace
pluginWorkspaceAccess) {<br>
<br>
pluginWorkspaceAccess.addEditorChangeListener(<br>
new WSEditorChangeListener() {<br>
@Override<br>
public void editorOpened(URL editorLocation) {<br>
WSEditor editorAccess =
pluginWorkspaceAccess.getEditorAccess(editorLocation,
PluginWorkspace.MAIN_EDITING_AREA);<br>
WSEditorPage currentPage =
editorAccess.getCurrentPage();<br>
if (currentPage instanceof WSAuthorEditorPage) {<br>
WSAuthorEditorPage authorEditorPage =
(WSAuthorEditorPage) currentPage;<br>
authorEditorPage.getAuthorAccess().getDocumentController().setDocumentFilter(authorDocumentFilter);<br>
}<br>
// TODO It's also a good idea to listener for page
changes on the editor.<br>
// Perhaps the editor opens in the text page and the
user switches later on to author.<br>
editorAccess.addPageChangedListener(new
WSEditorPageChangedListener() {<br>
@Override<br>
public void editorPageChanged() {<br>
// TODO Same code here to add the filter. <br>
}<br>
});<br>
}<br>
}, <br>
PluginWorkspace.MAIN_EDITING_AREA);<br>
<br>
<br>
[1]
<a class="moz-txt-link-freetext" href="http://www.oxygenxml.com/InstData/Editor/SDK/javadoc/ro/sync/ecss/extensions/api/AuthorExtensionStateListener.html">http://www.oxygenxml.com/InstData/Editor/SDK/javadoc/ro/sync/ecss/extensions/api/AuthorExtensionStateListener.html</a><br>
[2]
<a class="moz-txt-link-freetext" href="http://www.oxygenxml.com/doc/ug-editor/#concepts/workspace-access-plugin.html">http://www.oxygenxml.com/doc/ug-editor/#concepts/workspace-access-plugin.html</a><br>
<pre class="moz-signature" cols="72">Best regards,
Alex
--
Alex Jitianu
<oXygen/> XML Editor, Schema Editor and XSLT Editor/Debugger
<a class="moz-txt-link-freetext" href="http://www.oxygenxml.com">http://www.oxygenxml.com</a> </pre>
On 06-May-14 8:50 AM, Nathan wrote:<br>
</div>
<blockquote
cite="mid:CAAA7NDiBGawPPhrz87ycTsqTXj6EzR1DgRJT=oRQXpMexC4cow@mail.gmail.com"
type="cite">
<div dir="ltr">Thanks a bunch Alex. With regards to the scenario,
in our case, our writers are used to see these attributes
pre-populated since it is valid for 90% of all our content. Only
for the smaller percentage of the content do our writers
actually go ahead and change these values, which saves them
quite a few clicks.
<div>
With regards to your suggestion of using the "<span
style="font-family:arial,sans-serif;font-size:13px">AuthorDocumentFilter"
as shown in "</span><font face="arial, sans-serif"><a
moz-do-not-send="true"
href="http://www.oxygenxml.com/doc/ug-editor/#topics/api_faq_use_typograhic_quotation_marks.html">http://www.oxygenxml.com/doc/ug-editor/#topics/api_faq_use_typograhic_quotation_marks.html</a>",
do let me know if the following steps are what I should
undertake based on the fact that I am using the DITA
extension:</font></div>
<div><font face="arial, sans-serif">1) Create a class which
extends the dita extension bundle.</font></div>
<div><font face="arial, sans-serif">2) Create a new document
filter to filter out xrefs and set the attributes.</font></div>
<div><font face="arial, sans-serif">3) Set the document filter
created in (2) within the class created in (1).</font></div>
<div><br>
</div>
<div><font face="arial, sans-serif">Do let me know if there is
any alternative to the above steps.</font></div>
<div><font face="arial, sans-serif"><br>
</font></div>
<div><font face="arial, sans-serif">Thanks,</font></div>
<div><font face="arial, sans-serif">Nathan</font></div>
</div>
<div class="gmail_extra"><br>
<br>
<div class="gmail_quote">
On Thu, May 1, 2014 at 7:56 AM, Nathan <span dir="ltr"><<a
moz-do-not-send="true" href="mailto:vrveerar@gmail.com"
target="_blank">vrveerar@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0
.8ex;border-left:1px #ccc solid;padding-left:1ex">
<div dir="ltr">Thanks Alex, I think we are good with the
format attribute.
<div> With respect to my second part of the mail, is
there any way to add defaulted "scope" and "type"
attribute values to the xref when they are
dragged-and-dropped from the project/ditamaps manager
pane? Can this be done using the Author SDK?</div>
<div><br>
</div>
<div>Regards,</div>
<div>Nathan</div>
</div>
</blockquote>
</div>
<br>
</div>
<br>
<fieldset class="mimeAttachmentHeader"></fieldset>
<br>
<pre wrap="">_______________________________________________
oXygen-sdk mailing list
<a class="moz-txt-link-abbreviated" href="mailto:oXygen-sdk@oxygenxml.com">oXygen-sdk@oxygenxml.com</a>
<a class="moz-txt-link-freetext" href="http://www.oxygenxml.com/mailman/listinfo/oxygen-sdk">http://www.oxygenxml.com/mailman/listinfo/oxygen-sdk</a>
</pre>
</blockquote>
<br>
</body>
</html>