public Collection<QName> getServices()
{
// TODO: Implement
throw new UnsupportedOperationException();
}
Secondo me dipende dal fatto che in effetti non esiste una interfaccia a fattor comune dei vari servizi, in quanto ciascuno ha delle peculiarità che rende difficile scrivere del codice generico sui servizi. Non resta che fare la "get" del singolo servizio che si intende utilizzare.[…]
public class Purge extends DeclarativeWebScript {
final Logger logger = LoggerFactory.getLogger(Purge.class);
private NodeArchiveService nodeArchiveService;
public void setNodeArchiveService(NodeArchiveService nodeArchiveService) {
this.nodeArchiveService = nodeArchiveService;
}
@Override
protected Map<String, Object> executeImpl(WebScriptRequest req, Status status, Cache cache) {
logger.info("@@@ Purging all archived nodes… ");
final long start = System.currentTimeMillis();
try {
this.nodeArchiveService.purgeAllArchivedNodes(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE);
} catch (Throwable t) {
logger.error("@@@ Error executing purge ", t);
errorMessage(status, Status.STATUS_INTERNAL_SERVER_ERROR,
"Runtime error: " + t.getMessage() + ". Cause: " + t.getCause());
return null;
}
final long elapsed = System.currentTimeMillis() - start;
Map<String, Object> model = new HashMap<String, Object>();
model.put("elapsed", elapsed);
logger.info("@@@ Elapsed time (ms): " + elapsed);
return model;
}
private void errorMessage(Status status, int code, final String message) {
status.setCode(code);
status.setMessage(message);
status.setRedirect(true);
}
}
E' inizializzato dal seguente context:<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE beans PUBLIC "-//SPRING//DTD BEAN 2.0//EN" "http://www.springframework.org/dtd/spring-beans-2.0.dtd">
<beans>
<bean id="webscript.it.alfresco.util.purge.get"
class="it.alfresco.util.Purge" parent="webscript">
<property name="nodeArchiveService" ref="nodeArchiveService"/>
</bean>
</beans>
(Riferimento: http://camelcase.blogspot.com/2011/03/purge-alfresco-archived-nodes.html)Archive content from product discussions in Italian.
This group is now closed and content is read-only.
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.