diff --git a/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/CorbeillesService.java b/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/CorbeillesService.java index d37850cbc9c38e22f670e73065e31829df46fd20..18a42b4e8ecd704d57cfe970a6f4237462a07ad5 100644 --- a/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/CorbeillesService.java +++ b/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/CorbeillesService.java @@ -121,4 +121,12 @@ public interface CorbeillesService { * @param dossier */ public void updateLate(NodeRef dossier); + + void moveDossier(NodeRef node, NodeRef oldParent, NodeRef newParent); + + public void insertIntoCorbeillesVirtuelles(NodeRef dossier); + + public void deleteVirtuallyContainsAssociations(NodeRef dossier); + + public void removeDossierFromRecuperables(NodeRef dossier); } diff --git a/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/DossierService.java b/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/DossierService.java index fe84ee67ba5ecc5c5d2fe26b9d7b91040c664fe1..9893c7968b1d3f12960eedc0623c7f22a77ab905 100644 --- a/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/DossierService.java +++ b/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/DossierService.java @@ -93,7 +93,8 @@ public interface DossierService { TRANSFORM, GET_ATTEST, SIGN_INFO, - CACHET + CACHET, + CORBEILLE_EVENT } // <editor-fold desc="Actions"> diff --git a/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/impl/CorbeillesServiceImpl.java b/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/impl/CorbeillesServiceImpl.java index fe01bcf2f2c364785de05ed3f961c5c787b67160..b657cf17ee4dd959dd95dbb4b1e75a1a25ba0dff 100644 --- a/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/impl/CorbeillesServiceImpl.java +++ b/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/impl/CorbeillesServiceImpl.java @@ -45,9 +45,9 @@ import com.atolcd.parapheur.repo.CorbeillesService; import com.atolcd.parapheur.repo.DossierService; import com.atolcd.parapheur.repo.EtapeCircuit; import com.atolcd.parapheur.repo.ParapheurService; -import net.sf.acegisecurity.Authentication; import org.adullact.iparapheur.repo.amq.MessagesSender; import org.adullact.iparapheur.repo.notification.NotificationService; +import org.adullact.iparapheur.repo.worker.WorkerService; import org.alfresco.model.ContentModel; import org.alfresco.repo.node.NodeServicePolicies; import org.alfresco.repo.policy.Behaviour.NotificationFrequency; @@ -66,6 +66,7 @@ import org.alfresco.service.namespace.RegexQNamePattern; import org.alfresco.service.transaction.TransactionService; import org.apache.log4j.Level; import org.apache.log4j.Logger; +import org.json.JSONObject; import org.springframework.beans.factory.annotation.Autowired; import org.springframework.beans.factory.annotation.Qualifier; import org.springframework.context.ApplicationEvent; @@ -80,14 +81,11 @@ import java.util.*; * @author Vivien Barousse */ public class CorbeillesServiceImpl extends AbstractLifecycleBean implements CorbeillesService { - - private static final Object verrouUpdateCorbeille = new Object(); private static boolean ISINIT = false; private static Logger logger = Logger.getLogger(CorbeillesService.class); private NodeService nodeService; private PolicyComponent policyComponent; private ParapheurService parapheurService; - private DossierService dossierService; @Autowired private NotificationService notificationService; @Autowired @@ -108,27 +106,17 @@ public class CorbeillesServiceImpl extends AbstractLifecycleBean implements Corb policyComponent.bindClassBehaviour( NodeServicePolicies.OnCreateNodePolicy.QNAME, ParapheurModel.TYPE_DOSSIER, - new JavaBehaviour(this, "onDossierCreated", NotificationFrequency.TRANSACTION_COMMIT)); - - policyComponent.bindClassBehaviour( - NodeServicePolicies.OnMoveNodePolicy.QNAME, - ParapheurModel.TYPE_DOSSIER, - new JavaBehaviour(this, "onDossierMoved", NotificationFrequency.EVERY_EVENT)); + new JavaBehaviour(this, "onDossierCreated")); policyComponent.bindClassBehaviour( NodeServicePolicies.OnDeleteNodePolicy.QNAME, ParapheurModel.TYPE_DOSSIER, - new JavaBehaviour(this, "onDossierDeleted", NotificationFrequency.EVERY_EVENT)); - - policyComponent.bindClassBehaviour( - NodeServicePolicies.BeforeDeleteNodePolicy.QNAME, - ParapheurModel.TYPE_DOSSIER, - new JavaBehaviour(this, "beforeDossierDeleted", NotificationFrequency.EVERY_EVENT)); + new JavaBehaviour(this, "onDossierDeleted")); policyComponent.bindClassBehaviour( NodeServicePolicies.OnAddAspectPolicy.QNAME, ParapheurModel.ASPECT_LU, - new JavaBehaviour(this, "onDossierAddAspect", NotificationFrequency.EVERY_EVENT)); + new JavaBehaviour(this, "onDossierAddAspect", NotificationFrequency.FIRST_EVENT)); ISINIT = true; } } @@ -193,34 +181,59 @@ public class CorbeillesServiceImpl extends AbstractLifecycleBean implements Corb } public void onDossierCreated(ChildAssociationRef car) { - if (!nodeService.hasAspect(car.getChildRef(), ParapheurModel.ASPECT_DOSSIER_ORIGINE_WS)) { - raiseCorbeilleChildCount(car.getParentRef()); + try { + JSONObject onDossierCreatedObj = new JSONObject(); + onDossierCreatedObj.put(WorkerService.PARENT, car.getParentRef().getId()); + onDossierCreatedObj.put(WorkerService.TYPE, WorkerService.TYPE_EVENT); + onDossierCreatedObj.put(WorkerService.ACTION, DossierService.ACTION_DOSSIER.CORBEILLE_EVENT); + onDossierCreatedObj.put(WorkerService.ID, car.getChildRef().getId()); + onDossierCreatedObj.put(WorkerService.EVENT, "onDossierCreated"); + + messagesSender.sendWorker(onDossierCreatedObj.toString()); + } catch(Exception e) { + logger.error("Cannot update corbeille count :" + e.getMessage()); } } - public void onDossierMoved(ChildAssociationRef oldChildAssocRef, ChildAssociationRef newChildAssocRef) { - insertIntoCorbeillesVirtuelles(oldChildAssocRef.getChildRef()); + @Override + public void moveDossier(NodeRef node, NodeRef oldParent, NodeRef newParent) { + insertIntoCorbeillesVirtuelles(node); - // Update child count on updated corbeilles - reduceCorbeilleChildCount(oldChildAssocRef.getParentRef()); - raiseCorbeilleChildCount(newChildAssocRef.getParentRef()); - } + Integer currentCount = (Integer) nodeService.getProperty(oldParent, ParapheurModel.PROP_CHILD_COUNT); + nodeService.setProperty(oldParent, ParapheurModel.PROP_CHILD_COUNT, currentCount - 1); - public void onDossierDeleted(ChildAssociationRef car, boolean bln) { - reduceCorbeilleChildCount(parapheurService.getParentCorbeille(car.getParentRef())); + currentCount = (Integer) nodeService.getProperty(newParent, ParapheurModel.PROP_CHILD_COUNT); + nodeService.setProperty(newParent, ParapheurModel.PROP_CHILD_COUNT, currentCount + 1); } - public void beforeDossierDeleted(NodeRef nodeRef) { - // When a space is deleted in Alfresco, non child associations aren't - // deleted. This needs to be done manually. - deleteVirtuallyContainsAssociations(nodeRef); + public void onDossierDeleted(ChildAssociationRef car, boolean bln) { + try { + JSONObject onDossierDeletedObj = new JSONObject(); + onDossierDeletedObj.put(WorkerService.PARENT, car.getParentRef().getId()); + onDossierDeletedObj.put(WorkerService.TYPE, WorkerService.TYPE_EVENT); + onDossierDeletedObj.put(WorkerService.ACTION, DossierService.ACTION_DOSSIER.CORBEILLE_EVENT); + onDossierDeletedObj.put(WorkerService.ID, car.getChildRef().getId()); + onDossierDeletedObj.put(WorkerService.EVENT, "onDossierDeleted"); + + messagesSender.sendWorker(onDossierDeletedObj.toString()); + } catch(Exception e) { + logger.error("Cannot update corbeille count :" + e.getMessage()); + } } public void onDossierAddAspect(NodeRef nr, QName qname) { if (qname.equals(ParapheurModel.ASPECT_LU)) { - //if (dossierService.didSomeoneElseReadDocument(nr, AuthenticationUtil.getRunAsUser())) { - removeDossierFromRecuperables(nodeService.getPrimaryParent(nr).getParentRef()); - //} + try { + JSONObject onDossierAddAspectObj = new JSONObject(); + onDossierAddAspectObj.put(WorkerService.TYPE, WorkerService.TYPE_EVENT); + onDossierAddAspectObj.put(WorkerService.ACTION, DossierService.ACTION_DOSSIER.CORBEILLE_EVENT); + onDossierAddAspectObj.put(WorkerService.ID, nr.getId()); + onDossierAddAspectObj.put(WorkerService.EVENT, "onDossierAddAspect"); + + messagesSender.sendWorker(onDossierAddAspectObj.toString()); + } catch(Exception e) { + logger.error("Cannot update corbeille count :" + e.getMessage()); + } } } @@ -237,7 +250,7 @@ public class CorbeillesServiceImpl extends AbstractLifecycleBean implements Corb * * @param dossier Le dossier à insérer dans les corbeilles virtuelles. */ - private void insertIntoCorbeillesVirtuelles(NodeRef dossier) { + public void insertIntoCorbeillesVirtuelles(NodeRef dossier) { deleteVirtuallyContainsAssociations(dossier); List<EtapeCircuit> circuit = parapheurService.getCircuit(dossier); EtapeCircuit etapeCourante = parapheurService.getCurrentEtapeCircuit(circuit); @@ -396,7 +409,7 @@ public class CorbeillesServiceImpl extends AbstractLifecycleBean implements Corb } } - private void deleteVirtuallyContainsAssociations(NodeRef dossier) { + public void deleteVirtuallyContainsAssociations(NodeRef dossier) { List<AssociationRef> oldAssocs = nodeService.getSourceAssocs(dossier, ParapheurModel.ASSOC_VIRTUALLY_CONTAINS); for (AssociationRef oldAssoc : oldAssocs) { notificationService.notifierPourCorbeilleVirtuelle( @@ -409,22 +422,24 @@ public class CorbeillesServiceImpl extends AbstractLifecycleBean implements Corb oldAssoc.getTypeQName()); reduceCorbeilleChildCount(oldAssoc.getSourceRef()); } - if (nodeService.hasAspect(dossier, ParapheurModel.ASPECT_EN_RETARD)) { + if (nodeService.exists(dossier) && nodeService.hasAspect(dossier, ParapheurModel.ASPECT_EN_RETARD)) { nodeService.removeAspect(dossier, ParapheurModel.ASPECT_EN_RETARD); } } - private void removeDossierFromRecuperables(NodeRef dossier) { - List<AssociationRef> oldAssocs = nodeService.getSourceAssocs(dossier, ParapheurModel.ASSOC_VIRTUALLY_CONTAINS); - for (AssociationRef oldAssoc : oldAssocs) { - NodeRef corbeille = oldAssoc.getSourceRef(); - NodeRef parapheur = parapheurService.getParentParapheur(corbeille); - NodeRef corbeilleRecuperable = parapheurService.getCorbeille(parapheur, ParapheurModel.NAME_RECUPERABLES); - - if (corbeille.equals(corbeilleRecuperable)) { - nodeService.removeAssociation(oldAssoc.getSourceRef(), - oldAssoc.getTargetRef(), - oldAssoc.getTypeQName()); + public void removeDossierFromRecuperables(NodeRef dossier) { + if(nodeService.exists(dossier)) { + List<AssociationRef> oldAssocs = nodeService.getSourceAssocs(dossier, ParapheurModel.ASSOC_VIRTUALLY_CONTAINS); + for (AssociationRef oldAssoc : oldAssocs) { + NodeRef corbeille = oldAssoc.getSourceRef(); + NodeRef parapheur = parapheurService.getParentParapheur(corbeille); + NodeRef corbeilleRecuperable = parapheurService.getCorbeille(parapheur, ParapheurModel.NAME_RECUPERABLES); + + if (corbeille.equals(corbeilleRecuperable)) { + nodeService.removeAssociation(oldAssoc.getSourceRef(), + oldAssoc.getTargetRef(), + oldAssoc.getTypeQName()); + } } } } @@ -448,20 +463,9 @@ public class CorbeillesServiceImpl extends AbstractLifecycleBean implements Corb return false; } - private void modifyCorbeilleChildCount(final NodeRef corbeille, final int modifier) { - synchronized (verrouUpdateCorbeille) { - final RetryingTransactionHelper tx; - tx = transactionService.getRetryingTransactionHelper(); - tx.setMaxRetries(5); - tx.doInTransaction(new RetryingTransactionHelper.RetryingTransactionCallback<Object>() { - @Override - public Object execute() throws Throwable { - Integer currentCount = (Integer) nodeService.getProperty(corbeille, ParapheurModel.PROP_CHILD_COUNT); - nodeService.setProperty(corbeille, ParapheurModel.PROP_CHILD_COUNT, currentCount + modifier); - return null; - } - }); - } + private void modifyCorbeilleChildCount(NodeRef corbeille, int modifier) { + Integer currentCount = (Integer) nodeService.getProperty(corbeille, ParapheurModel.PROP_CHILD_COUNT); + nodeService.setProperty(corbeille, ParapheurModel.PROP_CHILD_COUNT, currentCount + modifier); } @Override @@ -528,15 +532,6 @@ public class CorbeillesServiceImpl extends AbstractLifecycleBean implements Corb } } - /* - for (NodeRef ref : children) { - Date limite = (Date) nodeService.getProperty(ref, ParapheurModel.PROP_DATE_LIMITE); - if (limite != null && new Date().after(limite)) { - late = true; - } - } - */ - nodeService.setProperty(corbeille, ParapheurModel.PROP_CHILD_COUNT, count); nodeService.setProperty(corbeille, ParapheurModel.PROP_CORBEILLE_LATE, late); } @@ -761,9 +756,5 @@ public class CorbeillesServiceImpl extends AbstractLifecycleBean implements Corb public void setParapheurService(ParapheurService parapheurService) { this.parapheurService = parapheurService; } - - public void setDossierService(DossierService dossierService) { - this.dossierService = dossierService; - } // </editor-fold> } diff --git a/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/impl/DossierServiceImpl.java b/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/impl/DossierServiceImpl.java index 4a9d4896f3ae45eab3f4b78a7c27634575cd8ff9..23e712f0661a30de90da649954155cbc903ed7f4 100644 --- a/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/impl/DossierServiceImpl.java +++ b/iparapheur-core/src/main/java/com/atolcd/parapheur/repo/impl/DossierServiceImpl.java @@ -1333,7 +1333,7 @@ public class DossierServiceImpl implements DossierService { signatureService.deleteAllDetachedSignature(doc.getId()); } String id = dossier.getId(); - + corbeillesService.deleteVirtuallyContainsAssociations(dossier); nodeService.deleteNode(dossier); /** @@ -1367,7 +1367,7 @@ public class DossierServiceImpl implements DossierService { list.add("SuppressionDossier"); list.add(nodeService.getProperty(dossier, ContentModel.PROP_TITLE)); auditWithNewBackend("ParapheurServiceCompat", "Suppression du dossier", dossier, list); - + corbeillesService.deleteVirtuallyContainsAssociations(dossier); nodeService.deleteNode(dossier); notificationService.sendPreparedNotificationsForDossier(dossier.getId()); diff --git a/iparapheur-core/src/main/java/org/adullact/iparapheur/repo/worker/impl/WorkerServiceImpl.java b/iparapheur-core/src/main/java/org/adullact/iparapheur/repo/worker/impl/WorkerServiceImpl.java index b14604093d3c9a69a950112adca7582a4b55f882..8556e1a4a474562835f081664b2f001517b92634 100644 --- a/iparapheur-core/src/main/java/org/adullact/iparapheur/repo/worker/impl/WorkerServiceImpl.java +++ b/iparapheur-core/src/main/java/org/adullact/iparapheur/repo/worker/impl/WorkerServiceImpl.java @@ -21,6 +21,7 @@ import org.alfresco.repo.security.authentication.AuthenticationUtil; import org.alfresco.repo.transaction.RetryingTransactionHelper; import org.alfresco.service.cmr.repository.*; import org.alfresco.service.transaction.TransactionService; +import org.apache.log4j.Logger; import org.json.JSONException; import org.json.JSONObject; import org.json.JSONStringer; @@ -37,6 +38,9 @@ import java.util.stream.Collectors; import static com.atolcd.parapheur.repo.DossierService.ACTION_DOSSIER; public class WorkerServiceImpl implements WorkerService { + + private static Logger logger = Logger.getLogger(WorkerService.class); + @Autowired @Qualifier("_dossierService") private DossierService dossierService; @@ -46,6 +50,8 @@ public class WorkerServiceImpl implements WorkerService { @Qualifier("_parapheurService") private ParapheurService parapheurService; @Autowired + private CorbeillesService corbeillesService; + @Autowired private S2lowService s2lowService; @Autowired private TransactionService transactionService; @@ -167,6 +173,9 @@ public class WorkerServiceImpl implements WorkerService { case CACHET: runnable = cachetHandler(request); break; + case CORBEILLE_EVENT: + runnable = eventHandler(request); + break; } return runnable; } @@ -477,6 +486,8 @@ public class WorkerServiceImpl implements WorkerService { parapheurService.setSignataire(node, signataire); parapheurService.approveV4(node, bureauCourant); + + corbeillesService.moveDossier(node, parentCourant, nodeService.getPrimaryParent(node).getParentRef()); } return true; @@ -533,6 +544,7 @@ public class WorkerServiceImpl implements WorkerService { parapheurService.setAnnotationPrivee(node, annotPriv); parapheurService.setAnnotationPublique(node, annotPub); parapheurService.reject(node); + corbeillesService.moveDossier(node, parentCourant, nodeService.getPrimaryParent(node).getParentRef()); return true; } @@ -608,7 +620,7 @@ public class WorkerServiceImpl implements WorkerService { @Override public boolean call() throws Exception { parapheurService.reprendreDossier(node); - + corbeillesService.moveDossier(node, parentCourant, nodeService.getPrimaryParent(node).getParentRef()); return true; } }); @@ -672,6 +684,7 @@ public class WorkerServiceImpl implements WorkerService { public boolean call() throws Exception { dossierService.doStamp(bureauCourant, node, annotPub, annotPriv, automatic); parapheurService.getMainDocuments(node).forEach(d -> dossierService.deleteCustomSignatureFromDocument(node, d)); + corbeillesService.moveDossier(node, parentCourant, nodeService.getPrimaryParent(node).getParentRef()); return false; } }); @@ -713,6 +726,7 @@ public class WorkerServiceImpl implements WorkerService { @Override public boolean call() throws Exception { parapheurService.recupererDossier(node); + corbeillesService.moveDossier(node, parentCourant, nodeService.getPrimaryParent(node).getParentRef()); return true; } @@ -742,6 +756,7 @@ public class WorkerServiceImpl implements WorkerService { parapheurService.setAnnotationPrivee(node, annotPriv); parapheurService.setAnnotationPublique(node, annotPub); parapheurService.secretariat(node); + corbeillesService.moveDossier(node, parentCourant, nodeService.getPrimaryParent(node).getParentRef()); return true; } @@ -775,6 +790,7 @@ public class WorkerServiceImpl implements WorkerService { parapheurService.setAnnotationPublique(node, annotPub); parapheurService.setAnnotationPrivee(node, annotPriv); parapheurService.approveV4(node, bureauCourant); + corbeillesService.moveDossier(node, parentCourant, nodeService.getPrimaryParent(node).getParentRef()); return true; } @@ -905,7 +921,9 @@ public class WorkerServiceImpl implements WorkerService { dossierService.setPermissionsDossier(node); parapheurService.approve(node); - // TODO and return true + + corbeillesService.moveDossier(node, parentCourant, nodeService.getPrimaryParent(node).getParentRef()); + return false; } }); @@ -971,6 +989,69 @@ public class WorkerServiceImpl implements WorkerService { }); } + private Runnable eventHandler(final Map request) { + return handleAction(ACTION_DOSSIER.CORBEILLE_EVENT, request, new DocumentAction() { + NodeRef parentRef = null; + NodeRef oldParentRef = null; + @Override + public boolean before() { + if(request.containsKey(WorkerService.PARENT)) { + parentRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, (String) request.get(WorkerService.PARENT)); + } + if(request.containsKey(WorkerService.OLD_PARENT)) { + oldParentRef = new NodeRef(StoreRef.STORE_REF_WORKSPACE_SPACESSTORE, (String) request.get(WorkerService.OLD_PARENT)); + } + return true; + } + + private void onDossierCreated() { + Integer currentCount = (Integer) nodeService.getProperty(parentRef, ParapheurModel.PROP_CHILD_COUNT); + nodeService.setProperty(parentRef, ParapheurModel.PROP_CHILD_COUNT, currentCount + 1); + } + + private void onDossierMoved() { +// corbeillesService.insertIntoCorbeillesVirtuelles(node); +// +// Integer currentCount = (Integer) nodeService.getProperty(oldParentRef, ParapheurModel.PROP_CHILD_COUNT); +// nodeService.setProperty(oldParentRef, ParapheurModel.PROP_CHILD_COUNT, currentCount - 1); +// +// currentCount = (Integer) nodeService.getProperty(parentRef, ParapheurModel.PROP_CHILD_COUNT); +// nodeService.setProperty(parentRef, ParapheurModel.PROP_CHILD_COUNT, currentCount + 1); + } + + private void onDossierDeleted() { + NodeRef corbeille = parapheurService.getParentCorbeille(parentRef); + Integer currentCount = (Integer) nodeService.getProperty(corbeille, ParapheurModel.PROP_CHILD_COUNT); + nodeService.setProperty(corbeille, ParapheurModel.PROP_CHILD_COUNT, currentCount - 1); + } + + private void onDossierAddAspect() { + corbeillesService.removeDossierFromRecuperables(node); + } + + @Override + public boolean call() throws Exception { + switch ((String)request.get(WorkerService.EVENT)) { + case "onDossierCreated": + onDossierCreated(); + break; + case "onDossierMoved": + onDossierMoved(); + break; + case "onDossierDeleted": + onDossierDeleted(); + break; + case "onDossierAddAspect": + onDossierAddAspect(); + break; + default: + logger.error("Action does not exists"); + } + return false; + } + }); + } + private Runnable avisHandler(final Map request) { return handleAction(ACTION_DOSSIER.AVIS_COMPLEMENTAIRE, request, new DossierAction() { @@ -1019,6 +1100,8 @@ public class WorkerServiceImpl implements WorkerService { dossierService.setPermissionsDossier(node); parapheurService.approve(node); + + corbeillesService.moveDossier(node, parentCourant, nodeService.getPrimaryParent(node).getParentRef()); return false; } }); @@ -1132,7 +1215,9 @@ public class WorkerServiceImpl implements WorkerService { public boolean execute() throws Exception { boolean ret = false; ret = this.call(); - nodeService.removeAspect(node, ParapheurModel.ASPECT_PENDING); + if(nodeService.exists(node)) { + nodeService.removeAspect(node, ParapheurModel.ASPECT_PENDING); + } return ret; } @@ -1145,6 +1230,8 @@ public class WorkerServiceImpl implements WorkerService { NodeRef bureauCourant = null; NodeRef bureauCible = null; String title; + NodeRef parentCourant; + NodeRef parentCible; List<String> banettesCourant; List<String> banettesCible; @@ -1179,6 +1266,7 @@ public class WorkerServiceImpl implements WorkerService { public void updateBanettesCourant(NodeRef bureau) { this.banettesCourant = dossierService.getCorbeillesParent(this.node, bureau); + this.parentCourant = nodeService.getPrimaryParent(this.node).getParentRef(); } public void updateBanettesCible(NodeRef bureau) { @@ -1234,7 +1322,7 @@ public class WorkerServiceImpl implements WorkerService { messagesSender.sendWorker(msg, node.getId()); } else { - System.out.println("Impossible d'envoyer sur Helios, aucun propriétaire trouvé"); + logger.error("Impossible d'envoyer sur Helios, aucun propriétaire trouvé"); } } @@ -1255,7 +1343,7 @@ public class WorkerServiceImpl implements WorkerService { messagesSender.sendWorker(msg, node.getId()); } else { - System.out.println("Impossible d'appliquer le cachet serveur, aucun propriétaire trouvé"); + logger.error("Impossible d'appliquer le cachet serveur, aucun propriétaire trouvé"); } } } @@ -1306,7 +1394,7 @@ public class WorkerServiceImpl implements WorkerService { if(!error) { // Execution de l'action - System.out.println("-----Execution de l'action : " + function.action.name()); + logger.info("ACTION : " + function.action.name() + "; ID : " + id + "; BEGIN"); transactionService.getRetryingTransactionHelper().doInTransaction( new RetryingTransactionHelper.RetryingTransactionCallback<Boolean>() { @Override @@ -1360,6 +1448,7 @@ public class WorkerServiceImpl implements WorkerService { schedulerService.stopExecution(id); if (!error) { function.after(); + logger.info("ACTION : " + function.action.name() + "; ID : " + id + "; OK"); } } } @@ -1383,7 +1472,7 @@ public class WorkerServiceImpl implements WorkerService { messagesSender.sendWorker(msg, node.getId()); } else { - System.out.println("Impossible de récupérer l'attestation de signature, aucun propriétaire trouvé"); + logger.error("Impossible de récupérer l'attestation de signature, aucun propriétaire trouvé"); } } diff --git a/iparapheur-core/src/main/resources/alfresco/module/parapheur/module-context.xml b/iparapheur-core/src/main/resources/alfresco/module/parapheur/module-context.xml index c8ed5c4ac234efb77f39fbb47ccd0f8046117476..d66d870db6da8b1d2cfabfc3be3311d103741a21 100755 --- a/iparapheur-core/src/main/resources/alfresco/module/parapheur/module-context.xml +++ b/iparapheur-core/src/main/resources/alfresco/module/parapheur/module-context.xml @@ -257,9 +257,6 @@ <property name="parapheurService"> <ref bean="parapheurService" /> </property> - <property name="dossierService"> - <ref bean="dossierService" /> - </property> </bean> <bean id="typesService" class="com.atolcd.parapheur.repo.impl.TypesServiceImpl">