Doc sourceId et proxy
---------------------
Key: NXP-2254
URL: http://jira.nuxeo.org/browse/NXP-2254
Project: Nuxeo Enterprise Platform 5
Issue Type: Question
Reporter: Nicolas Lecart
Assignee: Thierry Delprat
Voici un test qui ne fonctionne pas et sort de la boucle alors qu'il devrait
passer :)
Ce listener réponds à une notification de type création et test si la section
où le document est publié contient déja un proxy de ce document.
Or le test ne passe dans aucun cas alors qu'il devrait je pense.
Voici le code, y a t'il qqchose de non correct :
CoreSession documentManager = repo.open();
try {
DocumentModel parentDoc =
documentManager.getDocument(docMessage.getParentRef());
DocumentModel doc = documentManager.getDocument(docMessage.getRef());
String docSrcId = doc.getSourceId();
final DocumentModelList siblings =
documentManager.getChildren(parentDoc.getRef());
for (DocumentModel sibling : siblings) {
// check if sibling ref doc equals docMessage ref
if (sibling.getRef().equals(docMessage.getRef())) {
continue;
}
if (!docSrcId.equals(sibling.getSourceId())) {
continue;
}
// si des notifs existent, on les ajoutent au document
// publié
// ************** en fait je n'arrive jamais ici, je sors de la
boucle tjs avant**********
final String siblingId = sibling.getId();
for (Notification notification : notificationsForSubscriptions)
{
final List<String> subscribers =
NotificationService.getSubscribers(notification.getName(),siblingId);
for (String subscriber : subscribers) {
NotificationService.addSubscription(subscriber,
notification.getName(), doc, false, null, "");
}
}
}
} finally {
CoreInstance.getInstance().close(documentManager);
}
loginContext.logout();
} catch (Exception e) {
throw new EJBException(e);
}
merci
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://jira.nuxeo.org/secure/Administrators.jspa
-
For more information on JIRA, see: http://www.atlassian.com/software/jira
_______________________________________________
ECM-tickets mailing list
[email protected]
http://lists.nuxeo.com/mailman/listinfo/ecm-tickets