S Atah Ahmed Khan Posted April 4, 2013 Share Posted April 4, 2013 Hi Everyone,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.Thanks.May The Creator bless all of us. Link to comment Share on other sites More sharing options...
pdanyliuk Posted April 8, 2013 Share Posted April 8, 2013 Hello S Atah Ahmed KhanSorry 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:http://host:port/jasperserver/rest/resource/uri/to/resource?copyTo=%2Furi%2Fto%2FdestinationLike this one:http://localhost:8080/jasperserver/rest/resource/reports/samples/AllAccounts?copyTo=%2Fpublic%2FAllAccountsPlease 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, Paul Danyliuk Link to comment Share on other sites More sharing options...
S Atah Ahmed Khan Posted April 9, 2013 Author Share Posted April 9, 2013 Hi PDANYLIUK,Thanks, i am looking for the same.Tested the code in JUNIT, It's working.Now implementing the same in the application.I will let you know if something goes wrong.Thanks once again.S Atah Ahmed Khan..... Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now