Hello Igor, Thanks very much for your help! Actually, you have helped me in two ways. After confirmation, I wanted to assign visitors to Newsletter mail group. So, your code was totally useful.
Thanks again, Biba -----Original Message----- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Igor Salma Sent: Friday, September 26, 2008 9:41 AM To: Hippo CMS development public mailinglist Subject: Re: [HippoCMS-dev] HCA confirmation mechanism Hello Biba, I think this code will help (it worked for me): Confirmation confirmation = newsletterService.getConfirmation(idHash); Subscriber subscriber = confirmation.getSubscriber(); MailGroup mailGroup = newsletterService.getMailGroup(confirmation.getAction()); Subscription subscription = new SubscriptionImpl(subscriber, mailGroup); subscriber = newsletterService.getSubscriber(subscriber.getId()); subscriber.addSubscription(subscription); if (!subscriber.getConfirmed()) subscriber.setConfirmed(true); newsletterService.saveSubscriber(subscriber); newsletterService.deleteConfirmation(confirmation); All the best, Igor Kind regards, HintTech Igor Salma T: +381 [0] 21-301 205 F: +381 [0] 21-639 26 96 M: +381 [0] 64-4010415 E: [EMAIL PROTECTED] Jermenska 9 | 21000 Novi Sad | Serbia HEADQUARTERS: Rotterdamseweg 183c | 2629 HD Delft | The Netherlands | www.hinttech.com Chamber of Commerce The Hague nr. 27242282 | Sales Tax nr. NL8062.16.396.B01 HintTech HintTech specialises in supplying contract specialist staff in the field of software development (.NET and Java), Project Management and Information Security. Tridion | IBM WebSphere | .Net | Unix | Hippo CMS | GrIB | ISMF | Prince2 | IPMA | ITIL ----- Original Message ----- From: "Biba" <[EMAIL PROTECTED]> To: "'Hippo CMS development public mailinglist'" <[email protected]> Cc: "'Hippo Helpdesk'" <[EMAIL PROTECTED]>; "Nicu Lazar" <[EMAIL PROTECTED]> Sent: Thursday, September 25, 2008 4:29 PM Subject: [HippoCMS-dev] HCA confirmation mechanism > Hello all, > > I have a problem while trying to confirm subscribed site visitor. > When I insert visitor, I insert confirmation hashId in hca_confirmations > table. > Visitor receives confirmation mail with confirmation link in it. When > clicking that link I call this code from my flow.js file: > > var hashId = cocoon.parameters["hashId"]; > var email = cocoon.parameters["email"]; > cocoon.log.debug("Subscription - confirm hashId " + hashId); > var newsletterService = getFacade("newsletterService"); > var confirmation = newsletterService.getConfirmation(hashId); > var subscriber = confirmation.getSubscriber(); > > newsletterService.deleteConfirmation(confirmation); > > subscriber.setConfirmed(true); > saveSubscriber(subscriber); > > ... > > I get an error: > cause: javax.jdo.JDODetachedFieldAccessException: You have just attempted > to > access field "user" yet this field was not detached when you detached the > object. Either dont access this field, or detach the field when detaching > the object. > ... > > I have also noticed that there is a method > public void confirmSubscriber(Subscriber subscriber) > in class NewsletterJdoDao.java, but no such method in > NewsletterServiceImpl.java, so it can't be invited anywhere. > > Could somebody explain if there is any confirmation mechanism in hca and > how > it suppose to work? > > Thanks, > Biba > > Met vriendelijke groet / Kind regards, > Biljana Boskovic > Software Developer/Service Support Manager > Levi9 Global Sourcing > =============================================================== > Adress: Jan van Goyenkade 8, 1075 HP Amsterdam > Tel.: (+31) (0) 20 6701 947 > Mobile: (+381) (0) 64 8509 308 > Email: [EMAIL PROTECTED] > SkypeID: b.jovanovic.b > Internet: www.levi9.com > > Chamber of commerce Levi9 Global Sourcing BV: 34221951 > Chamber of commerce Levi9 Global Sourcing Benelux BV: 34224746 > =============================================================== > This e-mail may contain confidential or privileged information. If you are > not (one of) the intended > recipient(s), please notify the sender immediately by reply e-mail and > delete this message and any > attachments permanently without retaining a copy. Any review, disclosure, > copying, distribution or > taking any action in reliance on the contents of this e-mail by persons or > entities other than the > intended recipient(s) is strictly prohibited and may be unlawful. > > The services of Levi9 are exclusively subject to its general terms and > conditions. These general > terms and conditions can be found on www.levi9.com and a copy will be > promptly submitted to you on > your request and free of charge. > > > > ******************************************** > Hippocms-dev: Hippo CMS development public mailinglist > > Searchable archives can be found at: > MarkMail: http://hippocms-dev.markmail.org > Nabble: http://www.nabble.com/Hippo-CMS-f26633.html > ******************************************** Hippocms-dev: Hippo CMS development public mailinglist Searchable archives can be found at: MarkMail: http://hippocms-dev.markmail.org Nabble: http://www.nabble.com/Hippo-CMS-f26633.html ******************************************** Hippocms-dev: Hippo CMS development public mailinglist Searchable archives can be found at: MarkMail: http://hippocms-dev.markmail.org Nabble: http://www.nabble.com/Hippo-CMS-f26633.html
