Atmosphere callbacks implementation

Hi,


I was trying an integration with GroupDocs.Annotation based on spring application example. One place is unclear in HomeController.java :
/**
* On ready handler
*
* @param resource resource data received from socket
*/
@Override
@ResponseBody
@RequestMapping(value = ATMOSPHERE_ANNOTATION, method = RequestMethod.GET)
public void onAtmosphereReady(AtmosphereResource resource) {
try {
annotationHandler().onAtmosphereReady(resource);
} catch (AnnotationException e) {
Utils.log(HomeController.class, e);
}
}

This request comes from socket compare to other requests in controller which comes through common http. It means actually that I could not share my annotationHandler within a session scope, because sessions for socket and for http are different.
I was trying to skip those atmosphere messages and seems application could live without it, except annotation toolbox became hidden.

So actually I’m interesting in:
1. What is the purpose of using Atmosphere framework?
2. Is it possible to skip/avoid these handlers in my controller? What is the proper way to do it?
3. How would you recommend to put AnnotationHandler to the session scope?

Best regards,
Maxim

Hello Maxim,

Thank you for interest in GroupDocs.
  1. The Atmosphere framework is used to provide a live collaboration between users. It means when someone adds new annotation or edits existing one these changes are reflected to other users viewing the document without reloading the page.
  2. Unfortunately at the moment you can’t turn off the Atmosphere handlers, in this case the toolbar will not appear on the UI. But it may be improved in the next release. Features priority in our roadmap depends on the customer license type and demand.
  3. Do you want to create multiple instances of the AnnotationHandler and store them per user session? Can you describe your case in more details?

The issues you have found earlier (filed as ANNOTATIONJAVA-614) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by groupdocs.notifier.

Hi Ihor,


Thanks for your reply. We are working with multiple document management systems like Alfresco, EMC or even Oracle’s WebCenter. To extract data from there developer usually have to create user’s session and then call specific API to get document itself, his permissions and annotations. I saw it is possible to initialize AnnotationHandler with custom IDataConnector and custom IDataHandler where I was going to put my external system session and use within. To make it shorter - I was expecting for every user to have own AnnotationHandler with session instance for retrieving/storing data from/in the external system. It can’t be just one connection like in case with SQL database since everything is mostly depends on user’s rights and settings in such kind of systems.

How would you do that with GroupDocs? Any suggestions are really appreciated.

Regards,
Maxim

Hi Maxim,

You are correct. The best way will be to have a specific AnnotationHandler, InputDataHandler and IConnector per each user. Technically almost all these features will be available in the 1.8.0 version of the GroupDocs.Annotation, but we have a beta version that you can use already. We mailed a download link to you. One thing that we do not tested is multiplicity of AnnotationHandlers in the environment. Theoretically it should work.

You can also review this thread: <a href="http://groupdocs.comhttps://forum.aspose.com/t/1619</a> there user has similar to yours case.</font></div><div><br></div>

Hi Ihor,


Thanks for your help. I had a quick look on new release, noticed that you have added Environment handler. What was the case for that, how we could use it? In general do you have any kind of release notes or docs about which changes gonna be applied in version 1.8.0

Regards,
Maxim
Hello Maxim,

The Environment variable was introduced to provide information about the context in the time of the request call. The DAO principles do not allow pass “external” parameters to the selectBy or selectAllBy methods. One such case is when annotations are stored per document. In the selectBy call of the IAnnotationDao there is no any info pointing to the document of the annotation. Now using the Environment variable there is no need to create additional cache structures, you can immediately get document, user or session identifier (depending on a context).

Release notes will be available after the full release of the 1.8.0 version.