Adrian, I understand how the getUserPreferenceGroup service works. I only see a problem when I will try to store two records that will have the same PK.
-Bruno 2009/12/8 Adrian Crum <adri...@hlmksw.com>: > Group the screen settings by screen name. Use the user preferences services > to get all settings for the current screen. The service returns a Map, where > the key is the setting's name, and the value is the setting's value. > > -Adrian > > > Bruno Busco wrote: >> >> Sorry, for sure I am missing something but... >> >> if the prim-key is >> <prim-key field="userLoginId"/> >> <prim-key field="userPrefTypeId"/> >> and we want to use: >> >> userLoginId -> to specify the user the setting belongs to (i.e. admin) >> userPrefTypeId -> to specify the screen setting name (i.e. >> ProductKeywordsPanel_collapsed) >> userPrefGroupTypeId -> to specify the screen where the settings >> belongs to, how can we have two settings (i.e. keywordsearchbox) >> >> how can I have two different settings with the same name but different >> screen, that is what the change is all about? >> >> -Bruno >> >> 2009/12/8 Adrian Crum <adri...@hlmksw.com>: >>> >>> No. The userPrefGroupTypeId field is optional, therefore it cannot be >>> part >>> of the primary key. Use the user preference services to get preference >>> groups. >>> >>> I believe most (if not all) widget model classes have a getName() method. >>> >>> -Adrian >>> >>> Bruno Busco wrote: >>>> >>>> Hi Adrian, >>>> I am trying to implement as you suggested but I found two difficulties: >>>> >>>> 1) the entity UserPreference has the following prim-key: >>>> <prim-key field="userLoginId"/> >>>> <prim-key field="userPrefTypeId"/> >>>> >>>> while it should be >>>> <prim-key field="userLoginId"/> >>>> <prim-key field="userPrefGroupTypeId"/> >>>> <prim-key field="userPrefTypeId"/> >>>> >>>> to do what you propose. Should we change it? >>>> >>>> 2) how to retrieve the screen name from a screenlet widget rendering >>>> code? >>>> I mean I need to pass the screen name to the ftl macro in the >>>> MacroScreenRendered.java like this: >>>> ... >>>> StringWriter sr = new StringWriter(); >>>> sr.append("<@renderScreenletBegin "); >>>> sr.append("screenName=\""); >>>> sr.append(screen.name); >>>> sr.append("\" id=\""); >>>> sr.append(screenlet.getId(context)); >>>> sr.append("\" title=\""); >>>> sr.append(title); >>>> sr.append("\" collapsible="); >>>> sr.append(Boolean.toString(collapsible)); >>>> ... >>>> but how to retrieve the screen.name ? >>>> >>>> Many thanks for any help. >>>> -Bruno >>>> >>>> 2009/12/7 Adrian Crum <adri...@hlmksw.com>: >>>>> >>>>> Then do the same thing in the model widget code. >>>>> >>>>> -Adrian >>>>> >>>>> Bruno Busco wrote: >>>>>> >>>>>> This would mean to change all the screens! :-( >>>>>> >>>>>> 2009/12/7 Adrian Crum <adri...@hlmksw.com>: >>>>>>> >>>>>>> <screen name="MyScreen"> >>>>>>> <section> >>>>>>> <actions> >>>>>>> <service service-name="getUserPreferenceGroup"> >>>>>>> <field-map field-name="userPrefGroupTypeId" >>>>>>> value="MyScreen"/> >>>>>>> </service> >>>>>>> <set field="screenSettings" from-field="userPrefMap"/> >>>>>>> </actions> >>>>>>> ... >>>>>>> </section> >>>>>>> </screen> >>>>>>> >>>>>>> >>>>>>> Bruno Busco wrote: >>>>>>>> >>>>>>>> Adrian, >>>>>>>> sorry for the bad sentence, I couldn't even read myself. >>>>>>>> I meant that GLOBAL_PREFERENCES gets already loaded in the >>>>>>>> ApplicationDecorator. >>>>>>>> >>>>>>>> So now we have two options to have screenlets with the same id saved >>>>>>>> indipendently: >>>>>>>> 1) Use a screen related userPrefGroupTypeId. >>>>>>>> 2) Combine the screen name for the preference key >>>>>>>> >>>>>>>> I will work on it... >>>>>>>> >>>>>>>> Thank you, >>>>>>>> -Bruno >>>>>>>> >>>>>>>> >>>>>>>> 2009/12/7 Bilgin Ibryam <bibr...@gmail.com>: >>>>>>>>> >>>>>>>>> Bruno Busco wrote: >>>>>>>>>> >>>>>>>>>> Thank you Adrian, >>>>>>>>>> but then how to the theme loaded easily? The global ones are >>>>>>>>>> already >>>>>>>>>> loaded along the selected theme etc. >>>>>>>>>> >>>>>>>>>> -Bruno >>>>>>>>>> >>>>>>>>> Or you can combine the screen name and sceenlet id for the >>>>>>>>> preference >>>>>>>>> key, >>>>>>>>> instead of (screenlet.id+"_collapsed" ) >>>>>>>>> >>>>>>>>> Bilgin >>>>>>>>> >>>>>>>>> >> >