[daisy] problem adding a document subscription for a newly created
user
Andreas Deininger
adeininger at googlemail.com
Fri Nov 10 05:16:51 CST 2006
Hi,
I wrote a custom Cocoon apple which at its end creates a new daisy
user. Everything works fine so far. Now I would like to add a document
subscription for that newly created user, and I ran into trouble doing
so. My code looks like:
EmailSubscriptionManager subscriptionManager =
(EmailSubscriptionManager)adminrepository.getExtension("EmailSubscriptionManager");
subscriptionManager.addDocumentSubscription(user.getId(), new
VariantKey("3910-MBA",3,2));
Subscription newusersubscription =
subscriptionManager.getSubscription(user.getId());
newusersubscription.setReceiveDocumentEvents(true);
newusersubscription.save();
This code actually sets the "receive documents" flag for the newly
created user, however, it does not add the document subscription, and
I couldn't figure out the reason for the latter.
Strangely enough, if I give an id of an existing user, the document
subscription is added:
subscriptionManager.addDocumentSubscription(116, new
VariantKey("3910-MBA",3,2));
Subscription existingusersubscription =
subscriptionManager.getSubscription(116);
existingusersubscription.setReceiveDocumentEvents(true);
existingusersubscription.save();
This does exactly what I want for the existing user with id 116.
Any advice, how to achieve that for the newly created user, too?
Thanks in advance
--
Andreas
More information about the daisy
mailing list