Deleting Old Scheduled Report Ouptuts Using the Jaspersoft REST API

I get this request quite a bit - how do I clean up old artifacts from the Jaspersoft repository? Old artifacts are typically reports that are scheduled and then saved into the repository. I explain this in a short video:



Here are some specifics about the Talend/Jaspersoft ETL job used:
  • tHttpRequest - Does a GET to the URI "http://localhost:8080/jasperserver-pro/rest_v2/resources?recursive=true&type=file&folderUri=/public/ScheduledReports" and writes it to an XML file. API reference- see "Searching the Repository"
  • tFileInputXML - Reads the XML response from file (written by tHttpRequest)
  • tFilterRow - Filters the XML file on the field "creationDate" with the value: TalendDate.parseDate("yyyy-MM-dd", "2014-03-04")
  • tFlowToIterate - takes each request and iterates through them
  • tREST - For each file (URI) we run the DELETE command: "http://localhost:8080/jasperserver-pro/rest_v2/resources" + ((String)globalMap.get("row2.uri")) API reference- see "Deleting Resources"
You can find my example job here - it is for Talend 5.4.1 

Comments

21cssIndia said…
talend online training| talend training| call us+ ...
www.21cssindia.com/courses/talend-online-training-160.html
online training, courses, talend online training, carbone, olivier, cv, talend, Engineer, Research, Developement, Training, elearning, soft, training , open source, ...

Popular posts from this blog

Dealing with Nested Documents in MongoDB and Talend (aka Baking a Cake)

Add sbin to user PATH in Debian

Batch convert Asterisk GSM WAV files to mp3