oXygene Editor Events
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygene Editor Events
Post by sorin_ristache »
Yes, we should dig this problem. It seems impossible for an insertMultipleElements() call on a selected word to take 15 seconds. Please send us a zip archive with your framework and the Java source code of the action that takes 15 seconds.
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygene Editor Events
Post by sorin_ristache »
Thank you for the files. Your action InsertImageOperation needs such a long time because AuthorDocumentController.insertXMLFragment() is called many times (about 200 times). This call parses your strings <MyTag_red>word1</MyTag_red>, <MyTag_green>word2</MyTag_green> and <MyTag_blue>word3</MyTag_blue> as XML fragments for all the 200 strings which needs more than 10 seconds. The call insertXMLFragment() should be used for inserting one more complex XML fragment. In your case with many simple XML elements (200 elements) inserted in the same Author action that surrounds every word of a paragraph with an XML tag I think you should use insertMultipleElements() and insertText().
Regards,
Sorin
-
- Posts: 55
- Joined: Tue Jun 09, 2009 4:47 pm
Re: oXygene Editor Events
Please, cite an example of using the function insertMultipleElements() for inserting tags <MyTag_red> , </MyTag_red>, <MyTag_green>,</MyTag_green> around the words word1, word2
Regards,
Max
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygene Editor Events
Post by sorin_ristache »
Regards,
Sorin
-
- Posts: 55
- Joined: Tue Jun 09, 2009 4:47 pm
Re: oXygene Editor Events
We are searching for the fastest way of surrounding words with <MyTag_color> tags.
Does insertMultipleElements() support inserting both opening and closing tags simultaneously to surround a word designated by the offset?
If not, can you please give us as sample of the fastest code which can do that?
Regards,
Max
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygene Editor Events
Post by sorin_ristache »
- the Author node for the parent element (one of the above elements)
- the list of all names of the new elements (MyTag_color) in the order from left to right
- the offsets where the new elements will be inserted
- the namespace of the new elements
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygene Editor Events
Post by sorin_ristache »
Yes it is possible. You can insert the processing instructions using AuthorDocumentController.createDocumentFragmentInContext() or AuthorDocumentController.insertXMLFragment() and you set the color in the CSS with:
Code: Select all
oxy|processing-instruction {
color: rgb(139, 38, 201) !important;
}
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygene Editor Events
Post by sorin_ristache »
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygene Editor Events
Post by sorin_ristache »
Do you mean catch save event when the user will save the edited document? You cannot catch this event in an Author extension. You can save the document with a call authorAccess.getEditorAccess().save() and you can catch events for document modification but you cannot catch the user save event. Can you specify more details about your usecase? Do you want to stop the save action?
Regards,
Sorin
-
- Posts: 55
- Joined: Tue Jun 09, 2009 4:47 pm
Re: oXygene Editor Events
Imagine that you add some modifications to an open document which are temporary.
So if a users decides to save the document the modifications must be cleared first.
This is why we need the event.. Every time the document is about to be saved, we need to make sure that our modifications to the document are cleared.
Regards,
Max
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygene Editor Events
Post by sorin_ristache »
I think we need to change the Author API for that. Maybe a save notification is not the best solution but we need more details about your application, what you did so far and what you plan to implement in your Author extension for integration with your application. If we know more about the context of your Author extension we can find together a solution. Can you send these details to our support email address or using our online form for texhnical support?
Regards,
Sorin
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygene Editor Events
Post by sorin_ristache »
That is not possible in an extension using the Author API. What do you want to do with the path of CSS file?
Regards,
Sorin
-
- Posts: 55
- Joined: Tue Jun 09, 2009 4:47 pm
Re: oXygene Editor Events
The third question is:
How to make plugin catch "on close oxygen" event?
This code is not working:
Code: Select all
((JFrame)authorAccess.getParentFrame()).addWindowListener(new WindowAdapter()
{
public void windowClosed(WindowEvent e) {
//Some code "on close"
}
}
);
Max
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygene Editor Events
Post by sorin_ristache »
We sent you details about a test build of Oxygen that includes new API for adding and removing highlights from an Author extension. Does that help you with the highlights that you want to remove on document save? What processing do you want to do in the event for close Oxygen window?
Regards,
Sorin
-
- Posts: 55
- Joined: Tue Jun 09, 2009 4:47 pm
Re: oXygene Editor Events
Thank you very-very much for your help.
Using highlights instead of inserting the colouring tags has solved almost all problems, well done!

But we still seem to have a couple of minor questions, both related to using our windows.
1. To be able to correctly display our information windows on top of the oXygene editor, we need to have the handle of the main oXygene window. So far we tried to use authorAccess.getParentFrame() but it doesnt seem to give us access to niether VLC nor MFC window handles. Please help.
2. Another related problem concerns window events. We create all windows in a java thread which is initiated by the menu click. The problem is that if later on we show one of those previously created windows, it appears but then ever responds to any events which, as we think, is eplained by the fact that the original java thread is inactive. Can you suggest a workaround for that?
Best Regards,
Max
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygene Editor Events
Post by sorin_ristache »
authorAccess.getWorkspaceAccess().getParentFrame() returns a javax.swing.JFrame object as you can read in the javadoc of getParentFrame(). You can use this JFrame object as a parent for your Java dialogs. If you just want to display information messages or error messages you can use authorAccess.getWorkspaceAccess().showInformationMessage() or authorAccess.getWorkspaceAccess().showErrorMessage().Max wrote:1. To be able to correctly display our information windows on top of the oXygene editor, we need to have the handle of the main oXygene window. So far we tried to use authorAccess.getParentFrame() but it doesnt seem to give us access to niether VLC nor MFC window handles. Please help.
What do you mean ever responds to any events? What is the thread that you call original Java thread? I think these are Java programming issues. Your extension classes are called on the Java AWT thread and you can do any processing that you want using Java code that calls the Author API.Max wrote:2. Another related problem concerns window events. We create all windows in a java thread which is initiated by the menu click. The problem is that if later on we show one of those previously created windows, it appears but then ever responds to any events which, as we think, is eplained by the fact that the original java thread is inactive. Can you suggest a workaround for that?
Regards,
Sorin
-
- Posts: 55
- Joined: Tue Jun 09, 2009 4:47 pm
Re: oXygene Editor Events
2. Sorry for the typo.. I mean NEVER responds. We show up the window from our DLL, it correctly displays, but clicking on the window controls has no effect. We suspect it happense because the java thread in which we created the window is inactive and does not process messages sent to the window
Regards,
Max
-
- Posts: 4141
- Joined: Fri Mar 28, 2003 2:12 pm
Re: oXygene Editor Events
Post by sorin_ristache »
Regards,
Sorin
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ SDK-API, Frameworks - Document Types
- ↳ DocBook
- ↳ TEI
- ↳ XHTML
- ↳ Other Issues
- Oxygen XML Web Author
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Content Fusion
- ↳ Feature Request
- ↳ Common Problems
- Oxygen JSON Editor
- ↳ Feature Request
- ↳ Common Problems
- Oxygen PDF Chemistry
- ↳ Feature Request
- ↳ Common Problems
- Oxygen Feedback
- ↳ Feature Request
- ↳ Common Problems
- Oxygen XML WebHelp
- ↳ Feature Request
- ↳ Common Problems
- XML
- ↳ General XML Questions
- ↳ XSLT and FOP
- ↳ XML Schemas
- ↳ XQuery
- NVDL
- ↳ General NVDL Issues
- ↳ oNVDL Related Issues
- XML Services Market
- ↳ Offer a Service