cancel
Showing results for 
Search instead for 
Did you mean: 

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

milonette_
Star Collaborator
Star Collaborator

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

1 ACCEPTED ANSWER

Vladimir_Pasqui
Star Collaborator
Star Collaborator

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);
}

View answer in original post

2 REPLIES 2

Vladimir_Pasqui
Star Collaborator
Star Collaborator

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);
}

Ok thank you very much.

Getting started

Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.