Automation chain : blob binaries metadata : How to remove binarie file physicaly when reset metadata value ?

Hello,

I would like to know how to delete physically a binarie file when in an automation chain we “remove content” of a metadata field ? Is it done with an automation operation ?

thank you

0 votes

1 answers

1192 views

ANSWER



alt textHi,

In the admin center, you can remove all orphans binaries via an action (cf. screencap)

When you remove a blob from a document, only the link is destroyed between the Nx document and the binary. (e.g. http://localhost:8080/nuxeo/site/automation/doc?id=Blob.Remove on your local Nuxeo server)

Here is the code doing the job:

import org.nuxeo.ecm.core.storage.sql.management.RepositoryStatus;

RepositoryStatus status = new RepositoryStatus();
if (!status.isBinariesGCInProgress()) {
    status.gcBinaries(true);
}
0 votes



Ok thank you very much. I called this method in an automation operation of my own and called it in an automation chain. So I was wondering if it takes time to launch this operation everytime in my automation chain, because if I'm right this call should just make a test and then launch a thread? So few seconds isn't it ? thanks
05/15/2014