Extend the Author web applet code
Having trouble installing Oxygen? Got a bug to report? Post it all here.
-
- Posts: 4
- Joined: Mon Jun 24, 2013 5:26 pm
Extend the Author web applet code
Hi there,
I'm using the Author component applet in the browser to edit XML documents. I can check the status by calling:
And I can also get the content:
However when I send the document back and save the isModified() call will show me true - so for it it's still changed. How can I tell the applet that I managed to save the code and only tell me that it's changed when there is a new change in it?
Regarding this - is there a documentation what applet functions are available? (Such as isModified() or getSerializedDocument())? I've checked the ro.sync.ecss.samples classes at the src folder, there I can see it defined. I tried to edit it and rebuild with ant but my new functions weren't available. Is there a way to add new functions that I can call from JS?
Thanks so much.
Peter
I'm using the Author component applet in the browser to edit XML documents. I can check the status by calling:
Code: Select all
var applet = document.getElementById(id).getAuthorComponentSample();
applet.isModified();
Code: Select all
var applet = document.getElementById(id).getAuthorComponentSample();
applet.getSerializedDocument();
Regarding this - is there a documentation what applet functions are available? (Such as isModified() or getSerializedDocument())? I've checked the ro.sync.ecss.samples classes at the src folder, there I can see it defined. I tried to edit it and rebuild with ant but my new functions weren't available. Is there a way to add new functions that I can call from JS?
Thanks so much.
Peter
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Extend the Author web applet code
Hi Peter,
So you are calling the Java code from the ro.sync.ecss.samples.AuthorComponentSample class from the Javascript code, right?
You could add in the AuthorComponentSample sample Java class another method like:
Basically all public methods you add to the AuthorComponentSample class will be accessible via the Javascript.
And these public methods can call our API, the Javadoc for our API is present in the : javadoc/doc.zip ZIP file.
If adding a new method to the AuthorComponentSample class does not work, it's possible that the class is not re-compiled by the ANT build process. The original "build.xml" we bundle with the component has a target called "compile" which is called before the applet's libraries are constructed.
Regards,
Radu
So you are calling the Java code from the ro.sync.ecss.samples.AuthorComponentSample class from the Javascript code, right?
You could add in the AuthorComponentSample sample Java class another method like:
Code: Select all
/**
* Set the document's modified flag to a certain state.
*
* @param modified <code>true</code> to mark the document as modified, <code>false</code> to mark it as not dirty.
*/
public void setModified(boolean modified) {
editorComponent.getWSEditorAccess().setModified(modified);
}
And these public methods can call our API, the Javadoc for our API is present in the : javadoc/doc.zip ZIP file.
If adding a new method to the AuthorComponentSample class does not work, it's possible that the class is not re-compiled by the ANT build process. The original "build.xml" we bundle with the component has a target called "compile" which is called before the applet's libraries are constructed.
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
-
- Posts: 4
- Joined: Mon Jun 24, 2013 5:26 pm
Re: Extend the Author web applet code
Hi Radu,
Thanks so much for your quick reply. I tried to add the functions - and I called 'ant' (not 'ant compile') and didn't see any change. I'll check which java file is used and do an 'ant compile' again.
One question - just out of curiosity. When I recompile it again, which jar file the updated java file goes into?
Thanks,
Peter
Thanks so much for your quick reply. I tried to add the functions - and I called 'ant' (not 'ant compile') and didn't see any change. I'll check which java file is used and do an 'ant compile' again.
One question - just out of curiosity. When I recompile it again, which jar file the updated java file goes into?
Thanks,
Peter
-
- Posts: 9449
- Joined: Fri Jul 09, 2004 5:18 pm
Re: Extend the Author web applet code
Hi Peter,
You can also look in the ANT build file for this information.
A folder called dist is created having the newly updated library lib\oxygen-author-component-sample.jar
Regards,
Radu
You can also look in the ANT build file for this information.
A folder called dist is created having the newly updated library lib\oxygen-author-component-sample.jar
Regards,
Radu
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
<oXygen/> XML Editor
http://www.oxygenxml.com
Jump to
- Oxygen XML Editor/Author/Developer
- ↳ Feature Request
- ↳ Common Problems
- ↳ DITA (Editing and Publishing DITA Content)
- ↳ Artificial Intelligence (AI Positron Assistant add-on)
- ↳ 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