Hi Roberto,
the Workspace Portlet does not interact with Storage directly but through the HL component.
On dev and prod the snippet of (identical) code implemented by Worspace Portlet to empty the Trash is the following one:
WorkspaceTrashFolder trash = workspace.getTrash(); //The object 'WorkspaceTrashFolder' is from HL
GWTWorkspaceBuilder builder = getGWTWorkspaceBuilder();
TrashContent result = new TrashContent();
switch (operation) {
case EMPTY_TRASH:
listErrors = trash.emptyTrash(); //[1]
break;
case RESTORE_ALL:
listErrors = trash.restoreAll();
break;
case REFRESH:
default:
result.setTrashContent(builder.buildGXTListTrashContent(trash));
return result;
}
The method at point [1] is implemented by HL as following:
@Override
public List<String> emptyTrash() throws InternalErrorException {
logger.trace("Calling Empty Trash Servlet");
GetMethod getMethod = null;
try {
HttpClient httpClient = new HttpClient();
//System.out.println(servlets.get(ServletName.SAVE_CURRENT_VERSION).uri().toString() + "?" + ServletParameter.ID + "=" + id + "&" + ServletParameter.REMOTE_PATH + "=" + URLEncoder.encode(remotePath, "UTF-8") + "&" + ServletParameter.PORTAL_LOGIN + "=" + portalLogin);
getMethod = new GetMethod(JCRRepository.servlets.get(ServletName.EMPTY_TRASH).uri().toString() + "?" + ServletParameter.PORTAL_LOGIN + "=" + workspace.getOwner().getPortalLogin());
TokenUtility.setHeader(getMethod);
int response = httpClient.executeMethod(getMethod);
// Check response code
if (response != HttpStatus.SC_OK)
throw new HttpException("Received error status " + response);
} catch (Exception e) {
logger.error("Error deleting item from trash ID " + getId(), e);
throw new InternalErrorException(e);
} finally {
if(getMethod != null)
getMethod.releaseConnection();
}
return null;
}
and HL seems to perform a HTT GET call to the servlet "EmptyTrash" and so on..
However, I tried to perform some tests:
First access to my WS performing the action "EMPTY" Trash (a lot of items were in the Trash), no changes appears (starting with 417 items, remaining 417 items). KO
Removed 3 files:
Removing just one item by the action "Delete Permanently". Starting with 417 items, remaining 416 items. OK
Emptying the whole Trash. Starting with 416 items, remaining 416 items. K0
Removed 5 files:
Removing just two items by the action "Delete Permanently". Starting with 416 items, remaining 414 items. OK
Emptying the whole Trash. Starting with 414 items, remaining 411 items. OK
After the above tests, now performing the action "EMPTY" Trash the number of items decreases correctly.
Could the issue related to old items either existing in the Trash or saved in the Storage? It seems that removing new items the Storage statistics become right. If it is not the case, you and @lucio.lelii@isti.cnr.it should investigate starting from above HL method.