Closed salk31 closed 7 years ago
Is this a single resource or a resource part of a report unit?
I was just trying to do single resources but if I could update any part of a report unit I could switch to that.
FWIW I cobbled something together something using patch but it is quite verbose.
What do you mean with patch? The point is that you should not recreate the resource, but just modify the existing resource providing the new data.
PatchDescriptor patchDescriptor = new PatchDescriptor();
patchDescriptor.setVersion(version.intValue());
patchDescriptor.field("content", encodedString);
OperationResult<ClientFile> result = client
.authenticate("XXX", "XXX").resourcesService()
.resource(getFinalPath())
.patchResource(ClientFile.class, patchDescriptor);
So works but a bit of a pain as I also need to fetch the version?
Yes, this is the correct way of doing it.
Ah OK. Is the uploadFile just a convenience method? Cleaner to use the other repository methods?
I got confused because the API docs seem to suggest updateFile could/should exist http://community.jaspersoft.com/documentation/tibco-jasperreports-server-rest-api-reference/v621/working-file-resources#Updating_File_Resources
Anyway, thanks for your time.
It is not about uploading a generic file but a specific type of resource (FileResource)
OK. Many thanks.
Hello,
I'm probably missing something obvious but I can't see how to update an already uploaded file (using uploadFile method).
I tried delete/uploadFile but some of the jrxml is locked by being used for a report.
Many thanks
Sam