Timeline for How do I get my Storage Extension to call the 'update' method when republishing a Dynamic Component Presentation?
Current License: CC BY-SA 3.0
13 events
when toggle format | what | by | license | comment | |
---|---|---|---|---|---|
Oct 10, 2013 at 17:52 | comment | added | Mihai Cădariu |
I don't think the Stored Procedure will work either. In case of an update , the create is always preceded by a delete . So checking for the existence of the DCP while creating it will always return nothing. At the same time, when handling a delete you never know if it will be followed by a create . So you're in a Catch-22 situation. I'm afraid you have to use the delete-then-create sequence.
|
|
Oct 10, 2013 at 9:50 | vote | accept | Arai Yuhei | ||
Oct 10, 2013 at 9:49 | vote | accept | Arai Yuhei | ||
Oct 10, 2013 at 9:49 | |||||
Oct 10, 2013 at 9:49 | vote | accept | Arai Yuhei | ||
Oct 10, 2013 at 9:49 | |||||
Oct 10, 2013 at 9:49 | vote | accept | Arai Yuhei | ||
Oct 10, 2013 at 9:49 | |||||
Oct 10, 2013 at 9:09 | comment | added | Arai Yuhei | Thank you to answer my comment and I'm sorry I don't to confirm your answer of 'Update based on comment below'. I understand. Thank you to advice. | |
Oct 10, 2013 at 8:59 | history | edited | Pankaj Gaur | CC BY-SA 3.0 |
added 544 characters in body
|
Oct 10, 2013 at 8:57 | comment | added | Pankaj Gaur | And that's exactly what I am suggesting, that modify your custom java code which will be interacting with your custom DB and I hope it will be consuming some Stored Procedure in the Custom DB to Insert or Update (If it is not and instead firing direct Insert and Update sql queries, then I am afraid that you are already on a wrong path). Now in the Stored Procedure itself, you can write this conditional logic if the composite key (componentID and PublicationID) exists then update else insert. | |
Oct 10, 2013 at 8:40 | comment | added | Arai Yuhei | I want to do following operation: When DCP is published, DCP is stored to Broker DB, and also stored to my custom DB by Storage Extension. I found it's possible by extending JPAComponentPresentationDAO class and implementing ComponentPresentationDAO interface, and call super.create() in its create() method, and write some custom program in Java code. So I want to update data to Custom DB when a DCP is re-Published, and insert data to Custom DB when a DCP is published, and delete data to Custom DB when a DCP is un-Published. when DCP is Published, Create method is called. | |
Oct 10, 2013 at 8:28 | comment | added | Pankaj Gaur | Can you explain in a bit more detail, currently what you are doing? and why can't you have that logic implemented in the Stored Procedure of your custom DB and why do you want to put a load on the Publishing Process by writing a logic in storage layer? | |
Oct 10, 2013 at 7:41 | comment | added | Quirijn | I can confirm this, on 2011sp1 update is never called for DCPs. | |
Oct 10, 2013 at 7:33 | comment | added | Arai Yuhei | thank you to answer my question. I understand update method isn't called. Because update method isn't called, when create method is called and search primary key(for example, componentID and PublicationID) from Custom DB and the primary key is correspond to a DCP(componentID and PublicationID), insert data to Custom DB. Otherwise when create method is called and search primary key(for example, componentID and PublicationID) from Custom DB and the primary key is not correspond to a DCP, update data to Custom DB. If there is a better way, please teach me. | |
Oct 10, 2013 at 6:56 | history | answered | Pankaj Gaur | CC BY-SA 3.0 |