Conversation with AntranigBasman
(11:24:08) Antranig: Hello there
(11:24:08) Kapil Ahuja <AUTO-REPLY> : NA
(11:24:14) Antranig: Sorry, I didn't see this message until now..
(13:17:19) Kapil Ahuja: No problem....
(13:17:31) Kapil Ahuja: I need some help on how to use BeanLocator
(13:18:07) Antranig: Ah yes, good
(13:18:20) Antranig: Yes, I have just helped Will a bit with this as well
(13:18:29) Antranig: Soon we will infect the entire team with OTPism :P
(13:18:40) Kapil Ahuja: :-)
(13:18:47) Antranig: So, in your case you will need a WriteableBeanLocator, since you also want to be able to write back the submitted values directly as leaves
(13:19:00) Kapil Ahuja: okay
(13:19:03) Antranig: Essentially your WBL will become an "adaptation" to the settings API
(13:19:23) Kapil Ahuja: okay
(13:19:23) Antranig: You will see it has 3 methods, one of which is inapplicable (the remove() method cannot be implemented)
(13:19:37) Antranig: So you need to provide suitable implementations of set, and locateBean
(13:20:16) Kapil Ahuja: one sec...let me look at the code
(13:21:01) Antranig: So, here is what I pasted to Aaron yesterday
(13:21:06) Antranig: https://saffron.caret.cam.ac.uk/svn/projects/PonderUtilCore/trunk/src/uk/org/ponder/beanutil/WriteableBeanLocator.java
(13:21:15) Antranig: (20:00:28) Antranig: You can make "remove" throw, or no-op if you want
(20:00:36) Antranig: You just need to implement "set" and "locateBean"
(20:01:23) Aaron: so, how does this help Kapil then?
(20:01:28) Antranig: ...
(20:01:38) Antranig: He then dumps this bean into his request model
(13:21:22) Antranig: (20:01:46) Antranig: So he doesn't have to write a bean with a million properties
(20:01:54) Antranig: He just targets the EL for the fields at this bean
(20:02:59) Antranig: OK, so you just need an extra method which calls getType in EvaluationSettingsParse when it receives a "set"
(20:03:06) Antranig: Since it will receive things which are of type String
(13:21:36) Antranig: (20:07:29) Antranig: As your "API" currently stands he would also need to do some reflection
(20:07:43) Aaron: how so?
(20:07:43) Antranig: Since the only way to get to the type string for a setting is to reflect for the member of EvalSettings which has the same name
(20:07:54) Antranig: I.e. say you are given the String "USE_EXPERT_ITEMS"
(20:08:03) Antranig: And you need to know... "what is the type of this setting"
(13:21:46) Antranig: (20:09:05) Antranig: The only route you have is USE_EXPERT_ITEMS -> member of EvalSettings.USE_EXPERT_ITEMS -> String "USE_EXPERT_ITEMS:java.lang.Boolean" -> EvaluationSettingsParse method getType() -> boolean
(20:09:13) Antranig: So all this can happen automatically
(20:09:24) Antranig: Even if you haven't gone out of your way to make it particularly easy :P
(13:24:12) Kapil Ahuja: give me a minute or two...to understand all this
(13:24:18) Antranig: no worries :)
(13:25:45) Antranig: Also take a look here
(13:25:46) Antranig: http://www2.caret.cam.ac.uk/rsfwiki/Wiki.jsp?page=BeanLocator
(13:26:08) Antranig: As well as http://www2.caret.cam.ac.uk/rsfwiki/Wiki.jsp?page=EL
(13:46:54) Kapil Ahuja: Hey I am leaving for a class.....I would ping back after about 1.5 hours (if you are there)
(13:47:09) Kapil Ahuja: otherwise I would chat would you more tomorrow
(13:47:11) Antranig: OK
(13:47:16) Antranig: I will probably be off at choir then
(13:47:22) Kapil Ahuja: okay
(13:47:25) Kapil Ahuja: I am getting a hang of things
(13:47:39) Kapil Ahuja: but need some more info
(13:47:49) Kapil Ahuja: see u then