Re: [Spacewalk-devel] Added a new Session Set

2008-09-16 Thread Partha Aji
Thanks to jsherrill's insight,  I realized that one can now do 
customized "RhnSets" based on parameters.. With respect to this I added 
a new method to RhnSetDecl .. Here is an example use


 RhnSetDecl.ERRATA.createCustom(sid, archId, packageName);


Basically the createCustom method takes the sid,archId and packageName 
generates a hashCode out of it and appends to the label to make the 
RhnSet Declaration unique  to the input. In the above case the label 
will be "errata_list" + hash codes of sid archId and packagename (in 
what ever order the HashCodeBuilder combines it)..  In our code every 
list using a set has set label, but   this fix will help us making that 
set more unique across different keys. In the past we've been bitten by 
bugs where a set selections was getting duplicated across 2 or 3 
individual systems that were going thru the same page flow at the same 
time.. This fix will make that issue go away in the future sets..



Partha


Partha Aji wrote:
I added  to Spacewalk 0.3 a "sessionset". Basically these are an 
alternative to RhnSets and must replace them for 90% of the cases...

For more info...
https://fedorahosted.org/spacewalk/wiki/ListTag#SessionSet

Basic advantages over our traditional Rhnsets
1) Uses a session lifecyle.. So when the session dies the checkbox 
selections the user makes dies with it..


2) Flexible keying.. Certain lists need more than 2 keys to uniquely 
identify each row.. With the previous db set you were stuck with max 2 
keys problem... With the new Session sets we use a simple string  that 
can be as big as we want as the key.  Given this nature one can conceive 
of using keys like "id1|id2|id3" or even some sort of json like 
notation, and embed multiple keys (even though that may look 
overengineered). What the key means to the world is upto the DTO and 
ActionManager itself.. The tag does not assume any particualr format...


3) Its more minimalist than the rhnSet, in the sense it uses 
java.util.Set no fancy RhnSetManager, RhnSet, RhnSetElement, RhnSetDecl, 
SetCleanup,  keys are just simple strings ... You write code as if you 
are dealing with a regular set..


Disadvantages:
1) Needs the new list tag.. Basically the older list tag made the 
taglibs responsible for set handling making it really hard to work it 
out there..
2) If the set you populate this page is needed by a Perl page you have 
no option but to go with RhnSet...


Other Observations:
 If your set is needed by another action that is expecting the RhnSet, 
then you 'd either need to change that also to use the session set.. For 
example we have these confirm pages.. The confirm pages share a set with 
the list pages.. So we must just make sure confirm page points to the 
same declaration label 


Look at the wiki page.. Feel free to ask questions on this...
https://fedorahosted.org/spacewalk/wiki/ListTag#SessionSet

Partha

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel



___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel


[Spacewalk-devel] Added a new Session Set

2008-09-16 Thread Partha Aji
I added  to Spacewalk 0.3 a "sessionset". Basically these are an 
alternative to RhnSets and must replace them for 90% of the cases...

For more info...
https://fedorahosted.org/spacewalk/wiki/ListTag#SessionSet

Basic advantages over our traditional Rhnsets
1) Uses a session lifecyle.. So when the session dies the checkbox 
selections the user makes dies with it..


2) Flexible keying.. Certain lists need more than 2 keys to uniquely 
identify each row.. With the previous db set you were stuck with max 2 
keys problem... With the new Session sets we use a simple string  that 
can be as big as we want as the key.  Given this nature one can conceive 
of using keys like "id1|id2|id3" or even some sort of json like 
notation, and embed multiple keys (even though that may look 
overengineered). What the key means to the world is upto the DTO and 
ActionManager itself.. The tag does not assume any particualr format...


3) Its more minimalist than the rhnSet, in the sense it uses 
java.util.Set no fancy RhnSetManager, RhnSet, RhnSetElement, RhnSetDecl, 
SetCleanup,  keys are just simple strings ... You write code as if you 
are dealing with a regular set..


Disadvantages:
1) Needs the new list tag.. Basically the older list tag made the 
taglibs responsible for set handling making it really hard to work it 
out there..
2) If the set you populate this page is needed by a Perl page you have 
no option but to go with RhnSet...


Other Observations:
 If your set is needed by another action that is expecting the RhnSet, 
then you 'd either need to change that also to use the session set.. For 
example we have these confirm pages.. The confirm pages share a set with 
the list pages.. So we must just make sure confirm page points to the 
same declaration label 


Look at the wiki page.. Feel free to ask questions on this...
https://fedorahosted.org/spacewalk/wiki/ListTag#SessionSet

Partha

___
Spacewalk-devel mailing list
Spacewalk-devel@redhat.com
https://www.redhat.com/mailman/listinfo/spacewalk-devel