Free Support Forum - groupdocs.com

Groupdocs-annotation-1.9.0 custom InputDataHandler Issue


#1

Setting a custom InputDataHandler with groupdocs-annotation-1.9.0 seems to be broken in this version.


#2
Hello Tim,

Thank you for interest in the GroupDocs. What do you mean under broken? Can you give more details, please?

Just in case checked sample with the custom InputDataHandler – seems to work ok.


#3

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


This message was posted using Notification2Forum from Downloads module by GroupDocs Notifier.

#4
So basically if I set a custom input data handler it is never called. I’m using the IntelliJ IDE and If I follow the constructor for the AnnotationHandler that takes an InputDataHandler, the constructor makes several calls through super class constructors and ultimately get to the code snippet below. You’ll see in the highlighted yellow lines that the input data handler passed in is never used. Instead, a different input data handler is constructed and used.

package com.groupdocs.annotation.api.a;

...

public class b extends a {
private ILocalization localization;

public b(ServiceConfiguration serviceConfiguration, InputDataHandler inputDataHandler, com.groupdocs.viewer.handlers.a.a cacheDataHandler) {
Utils.setTempPath(serviceConfiguration.getTempDir());

try {
com.groupdocs.viewer.f.a.a(serviceConfiguration.getConfig().getLicensePath(), new com.groupdocs.annotation.e.a());
if(inputDataHandler == null) {
;
}

com.groupdocs.annotation.handler.a inputDataHandler1 = new com.groupdocs.annotation.handler.a(serviceConfiguration, serviceConfiguration.getUploadPath());
this.setViewerHandler(new ViewerHandler(serviceConfiguration, inputDataHandler1, cacheDataHandler));
} catch (Exception var5) {
Logger.getLogger(b.class.getName()).log(Level.SEVERE, var5.getMessage(), var5.getStackTrace());
}

}

I am using the GroupDocsAnnotation Java API, version 1.9.0, in a Scala/Play application by the way. So as a work around in my Scala trait that I use for working with the GroupDocs API, I can work around this issue using the following code..

val annotationHandler: AnnotationHandler = new AnnotationHandler(serviceConfig, connector, assetStore) {

/*
* Version 1.9.0 of GroupDocs.Annotation setting a custom InputDataHandler is not working
* TODO remove this later when fixed
*/
this.setViewerHandler(new ViewerHandler(serviceConfig, assetStore, null))

override def getInputDataHandler() = {
assetStore
}
}

#5
Hello Tim,

We examined the issue you described. Indeed there is such problem. It was reported to our product team and registered in our system as ANNOTATIONJAVA-815 – “Custom InputDataHandler is never called”. When the fix is released you’ll get a notification. Sorry for the inconvenience.