On Apr 20, 1:17 pm, Asko Soukka <asko.sou...@jyu.fi> wrote: > On 20.04.2010 12:33, sunew wrote: > > >>> In getpaid.core.options, the PersistentOptions class, used for > >>> handling the annotation storage on objects, for items as well as > >>> payment processors and so on, was setting the annotation_key on the > >>> PersistentOptions class itself instead of the generated storage > >>> classes (like BuyableContentStorage). > ... > > In my case everything ends up being stored under > > getpaid.content.variableamountdonate, which is the last content > > storage in Products.PloneGetPaid.content. My payment processor > > apparently gets imported earlier, also getting this key for storage. > > (a print statement in the PersistentOptions. wire class method reveal > > the order). > > Well, if it's always the case that everything gets stored under a single > specific key, isn't it then enough to find that key (possibly > installation dependent) and copy properties (for all known > keys/interfaces) under known correct keys.
The key migth change over time, in case of a new module being installed. This accounts for experiences of 'missing' data. A new key take over, so data can be stored under several annotation keys. Which is the most current? The last one to be imported - is it possible in some way to check for that? > > So, for every payable: > 1. iterate through all existing annotation keys > 2. pick the PersistentOptions key, which has the most stored options *) > 3. store those annotations (key, value -pairs) temporarily > 4. iterate through all known PersistentOptions key/interface-pairs > 5. if an interface can be imported, store its annotations with > respective annotation key (only if proper key, value -pairs were > retrieved earlier) > > *) I guess, it's possible that there still are annotations with more > than one PersistentOptions key. In those sitatiuations, the key with > most options is probably the used one. > > Well, to avoid side effects, for particular markers it could be checked > if the marker currently exist for the current payable before storing > options with the markers annotation key. agreed. > > > Most of the general setup is now based on a utility, see > > Products.PloneGetPaid.preferences. > > So, then only payment processor options are stored as annotations (and > affected by this bug; actually, as you already wrote earlier :) yes - possibly other modules as well, using the options class. (Maybe modules should really just use annotations directly - whats the gain of using the PersistentOptions class anyway). > > >> Would you still use Products.PloneGetPaid's custom upgrading framework > >> for a such migration or should it be done as GenericSetup upgradeStep? > > > I havent looked at the getpaid upgrading stuff, I guess GenericSetup > > would be my prefered choice. > > With GenericSetup upgradeStep it may be a problem that PloneGetPaid's > version has been reflected to GS profile-version (on metadata.xml). The > upgradeStep must be from a specific profile version to an another > specific profile version. Since the installed PloneGetPaid-profile > version is usually only updated when PloneGetPaid is either installed or > re-installed, there probably exists installations where installed > PloneGetPaid-profile version is lesser than version of the the used > PloneGetPaid-product. > > Technically, both migration options probably require as much work. > > Best Regards, > Asko > > -- > GetPaid for Plone:http://www.plonegetpaid.com(overview info) > |http://code.google.com/p/getpaid(code and issue tracker) > You received this message because you are subscribed to the Google Groups > "getpaid-dev" group. > To post to this group, send email to getpaid-dev@googlegroups.com > To unsubscribe from this group, send email to > getpaid-dev+unsubscr...@googlegroups.com > > For more options, visit this group > athttp://groups.google.com/group/getpaid-dev?hl=en?hl=en -- GetPaid for Plone: http://www.plonegetpaid.com (overview info) | http://code.google.com/p/getpaid (code and issue tracker) You received this message because you are subscribed to the Google Groups "getpaid-dev" group. To post to this group, send email to getpaid-dev@googlegroups.com To unsubscribe from this group, send email to getpaid-dev+unsubscr...@googlegroups.com For more options, visit this group at http://groups.google.com/group/getpaid-dev?hl=en?hl=en