What I've done is to deploy the xmlmind backend in a separate container from our application backend. In fact, it's probably difficult to run the xmlmind server embedded in our backend due to dependency conflicts and such, even as it happens that our backend is also running in Java. I communicate with our backend to do the load/save to our database and access to a graphics and other media resources database, just as the example in the documentation.
However, in order to support some interactive features I need to update the XML tree or add properties from the client side. But I don't seem to have access in the client to that. So one way to do it, or so I thought, without adding more JavaScript APIs is to communicate directly with the custom Java extension in the xmlmind backend, which has the access to the XML tree. Well, I guess I can just add another endpoint to the xmlmind server inside my Java extension! Anyway, at this point I don't have the specific use case where I would need this. It looks like the current Java extension mechanism even with the web edition restrictions is sufficient for my application. I'll see if it works. Thanks, Carlos On Wed, Nov 27, 2024 at 7:33 PM Hussein Shafie <huss...@xmlmind.com> wrote: > On 11/27/24 05:03, Carlos Villegas wrote: > > > > But in the general case, I would need some interactive functionality on > > the client side. > > Sure. Quite understandable. > > > > > Is there a way to provide access to the document element tree and > > receive document element events on the Javascript side? > > No. The "Javascript side" is just the View/Controller[*] and has no > direct access to the document/element/node tree, the Model[*], which is > found in xxeserver, the back-end. > > Available document events, see > https://www.xmlmind.com/xmleditor/_web/doc/apidoc/XMLEditorEvent.html , > > XMLEditorEvent > DocumentOpenedEvent > DocumentSavedEvent > DocumentViewChangedEvent > EditingContextChangedEvent > etc > > may be received by a client of yours integrating <xxe-client> by the > means of standard JavaScript API addEventListener. Excerpts from our > XMLEditorApp.js, the sample XML editor application included in the > XMLmind XML Editor Web Edition distributions: > > --- > this._xmlEditor = xxe; > xxe.resourceStorage = new LocalFiles(xxe); > xxe.addEventListener("connected", > this.onConnected.bind(this)); > xxe.addEventListener("disconnected", > this.onDisconnected.bind(this)); > const docOpenedHandler = this.onDocumentOpened.bind(this); > xxe.addEventListener("documentCreated", docOpenedHandler); > xxe.addEventListener("documentOpened", docOpenedHandler); > xxe.addEventListener("documentRecovered", docOpenedHandler); > xxe.addEventListener("documentSavedAs", > this.onDocumentSavedAs.bind(this)); > xxe.addEventListener("documentClosed", > this.onDocumentClosed.bind(this)); > xxe.addEventListener("saveStateChanged", > this.onSaveStateChanged.bind(this)); > xxe.addEventListener("readOnlyStateChanged", > this.onReadOnlyStateChanged.bind(this)); > --- > > > > Or some way for the client to communicate with a custom Java extension > > in the backend? > > May be there is a misunderstanding here. > > In our mind, it's up to you > 1) to develop *your* client, > 2) to make *your* client communicate with *your* backend. > > - xxeserver, our XML editor backend, is meant to run side by side with > your backend (or even your multiple backends). See > > https://www.xmlmind.com/xmleditor/_web/doc/manual/xxeserver_reference.html#xxeserver_reference > > - <xxe-app>, the sample XML editor application included in the XMLmind > XML Editor Web Edition distributions is just that, a *sample* XML editor > application, and as such, cannot be used as the client in any advanced > use case. See > > https://www.xmlmind.com/xmleditor/_web/doc/manual/xxe-app_reference.html#xxe-app_reference > > - <xxe-client> is a "WYSIWYG" XML editor *component* just like TinyMCE > (https://www.tiny.cloud/) or CKEditor (https://ckeditor.com/) are > WYSIWYG HTML editor components. > > The main difference with TinyMCE or CKEditor is that <xxe-client> is not > self-contained and needs xxeserver, the backend, to perform its tasks. > Hence <xxe-client> communicates exclusively with xxeserver through a > WebSocket. Making <xxe-client> communicate with the backends of our > customers would simply not make sense. > > <xxe-client> is meant to be integrated in a larger Web application > developed by our customers. See > > https://www.xmlmind.com/xmleditor/_web/doc/manual/xxe-client_reference.html#xxe-client_reference > > Here is an example of a Web application using <xxe-client> and which is > totally different from <xxe-app>: > > https://www.xmlmind.com/xmleditor/_web/demo/newsapp.html > > More information: > > https://www.xmlmind.com/xmleditor/_web/doc/manual/integration_demo.html#integration_demo > > > > > If not now, is this or something similar planned for the future? > > > > No, not at all, mainly because we don't understand your needs. It would > help if you could give us examples of what you would like to implement. > > > > > --- > [*] MVC, Model View Controller, > https://en.wikipedia.org/wiki/Model%E2%80%93view%E2%80%93controller >
-- XMLmind XML Editor Support List xmleditor-support@xmlmind.com http://www.xmlmind.com/mailman/listinfo/xmleditor-support