How to automate attachments deletion from Commerce EAR using ibm-partialapp-delete.props

Using attachments features on Commerce is very useful to manage a lot of files in a organized way.

But the downside is the need to progressively delete the unused files from the Commerce EAR file because his size can grow very quickly.

Infocenter reports the manual way to do this but it’s not viable to generate manually a ibm-partialapp-delete.props file containing the images you need to delete and deploy it every time.

You can automate this task using an ant script (with his properties file) with a very easy logic.

You generate an images file list with a fileset task

<fileset id=”filesListToDelete” dir=”${attachmentsFolderEAR}”>
<include name=”**/*.jpg” />
<date datetime=”${days.before.clean}” when=”before” pattern=”MM/dd/yyyy hh:mm” />

This list will contain all the images older than ${daysBeforeClean} days and will be transformed in a ibm-partialapp-delete.props file with an echo tag

<echo file=”${filePathIBMDeleteProps}/ibm-partialapp-delete.props”>${lastFiles}</echo>

The result file will be put in a zip file and deployed as partial update with a wsadmin task using a basic python script.

Scheduling the execution of this simple ant script will keep your Commerce EAR quite small. Quite because it’s very common to have a 300 MB EAR file on production systems.


Websphere Commerce and Portal Architect ✔ Motivated IT professional with more than ten years of experience, combining Java and JEE developer skills with systems and IBM products installation knowledge. ✔ Strong experience and skills on planning, architecting and implementing complex commerce and portal solutions based on IBM middleware products. ✔ Reliable with a strong network attitude, experience on leading developer's teams and manage international relationships. Specialties ✔ Pleasant manner, reliable. ✔ Ability to consider issues from different point of views. ✔ End-oriented work capacity and problem-solving attitude. ✔ Ability to work with deadlines and under pressure. ✔ Ability to prioritise tasks and manage people. ✔ Ability to increase the whole team skills. ✔ Ability to generate commercial leads

Tagged with: , ,
Posted in was, websphere commerce

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: