Question

Media file upload in an assistant

  • 24 October 2022
  • 4 replies
  • 193 views

Badge +1

I'm doing a customization for an assistant, and I need to upload some media files there.

I have checked the existing assistant similar to this and did the exact development. But I'm getting the error "Unable to fulfill the request due to unexpected server state" and 500 status code for MediaObject in Dev tool.

 

And I noticed that there's a Java class attached to the Projection also. Is it mandatory to create a java class for these kind of media file uploads?

 

 


4 replies

Userlevel 7
Badge +30

And I noticed that there's a Java class attached to the Projection also. Is it mandatory to create a java class for these kind of media file uploads?

Yes, it is. There are a number of existing assistants already doing this, and there is a fragment that can be included to make it easier. Still, a little Java needs to be written. Not sure if this would work in LAA.

@deshan.ekanayake, any pointers? @Andreas Dahllöf , any comments on LAA and pulling this off in a customization?

 

Badge +1

And I noticed that there's a Java class attached to the Projection also. Is it mandatory to create a java class for these kind of media file uploads?

Yes, it is. There are a number of existing assistants already doing this, and there is a fragment that can be included to make it easier. Still, a little Java needs to be written. Not sure if this would work in LAA.

@deshan.ekanayake, any pointers? @Andreas Dahllöf , any comments on LAA and pulling this off in a customization?

 

 

Hi. Thank you for the valuable input.
I have created a Java file and is it enough? I mean does the server find that java class by itself and compile it or do we need to do something?

Userlevel 2
Badge +4

Hi,

LAA is not supported in java files, but if this is a new projection no custom/additional layer is needed. 
I think this also applies if this is an existing projection with added fragments in customization, and no previous java impl file exists. A java impl file can just be added.

The java impl file has to be there when the codegenerator runs, because it triggers the creation of the interface and abstract class needed to forward the java calls to the included fragment java implementation. 
A java impl file without any implementation should do, but it has to be committed. The server should find the class by itself.

Best Regards Andreas

Badge +1

Hi,

LAA is not supported in java files, but if this is a new projection no custom/additional layer is needed. 
I think this also applies if this is an existing projection with added fragments in customization, and no previous java impl file exists. A java impl file can just be added.

The java impl file has to be there when the codegenerator runs, because it triggers the creation of the interface and abstract class needed to forward the java calls to the included fragment java implementation. 
A java impl file without any implementation should do, but it has to be committed. The server should find the class by itself.

Best Regards Andreas

Hi,

Thanks for the information. I found that the Java file is generated automatically once we generate code for the projection. Currently, I’m looking on creating a local server and check this media file item upload in Cust layer as we were unable to test this kind of customization in our existing server.

Reply