I want to copy a repotUnit then need to change its content in java.
In SOAP API we have direct copy method, it was quite easy for us to copy any resource.
Since we are migrating to REST API, i am unable to copy a reportUnit. Also when i read the guide, haven't found anything.
I have gone through the code of Jasperserver source code which i downloaded from Source forge, Also , there are some test cases given but those are not working.
Lateron i tried to create a new ReportUnit. But it too got failed.
Any help is appreciated.
May The Creator bless all of us.
Hello S Atah Ahmed Khan
Sorry for a belated response. Actually there is a possibility to copy a resource, particularly a Report Unit, to any folder using REST. Given that you are logged in as some administrator, perform the following POST request:
Like this one:
Please note that slashes '/' in copyTo parameter are URL-encoded as %2F. If you're going to copy a resource, you have to specify the full path to the new resource along with its new ID, not just the folder where to copy the resource to. If you are copying an entire folder, you also specify the new path of the clone of this folder, not the parent folder under which your copied folder would be placed.
Also please don't forget to check whether your desired permissions for the copied resource/folder are preserved. This functionality is not documented for a while already (however we use it for internal purposes), so there may be reasons for this like some flaws in the service or some uncertainty. Please make sure everything works okay for you and no security breaches (e.g. unpreserved permissions) appear.
Let me know if it works for you.
Thanks for using our Community Portal.
With best regards,