[opencms-dev] Suggestion: make CmsUser available in I_CmsWidget / A_Widget

Mathias Lin | SYSVISION mail at mathiaslin.com
Fri May 1 09:43:11 CEST 2009


Hi Michael,
thanks for the hint, I was sure I checked the CmsObject for the appropriate
method but must have overseen that one.
Mathias


Michael Moossen wrote:
> 
> Hi Mathias!
> 
> This should be possible out of the box since the method that generates 
> the widget code:
> String I_CmsWidget#getDialogWidget(CmsObject, I_CmsWidgetDialog, 
> I_CmsWidgetParameter);
> as well as many other methods of I_CmsWidget get the cms context as 
> parameter.
> having the cms context you also have the user with 
> cms.getRequesdtContext.currentUser()
> 
> Kind Regards,
> Michael.
> 
> -------------------
> Michael Moossen
> 
> Alkacon Software GmbH  - The OpenCms Experts
> http://www.alkacon.com - http://www.opencms.org
> 
> Visit OpenCms Days 2009 Conference and Expo
> June 15 to June 16 2009 in Cologne, Germany
> http://www.opencms-days.org
> 
> Mathias Lin | SYSVISION wrote:
>> Hi Alkacon,
>> 
>> I needed a custom widget (derived from simple text input widget
>> CmsInputWidget), that is either read-only or read-write depending on the
>> current user/current user's groups.
>> Therefore I added setter and getter for CmsUser in I_CmsWidget and
>> A_CmsWidget and pass the user from the editor to the widget (in my case I
>> do
>> it in the constructor public CmsXmlContentEditor(CmsJspActionElement jsp)
>> of
>> CmsXmlContentEditor.
>> 
>> I find it helpful and can imagine it's very useful in many cases
>> (especially
>> for custom widgets) to have the current user available in the widget
>> class
>> to implement custom behaviours of the widgets.
>> Therefore my question if it wouldn't be good to add/modify this in the
>> OpenCms core?
>> 
>> Mathias
>> 
>> 
>> 
>> -----
>> Mathias Lin
>> SYSVISION Ltd., China
>> http://www.sysvision.com
> 
> _______________________________________________
> This mail is sent to you from the opencms-dev mailing list
> To change your list options, or to unsubscribe from the list, please visit
> http://lists.opencms.org/mailman/listinfo/opencms-dev
> 
> 


-----
Mathias Lin
SYSVISION Ltd., China
http://www.sysvision.com
-- 
View this message in context: http://www.nabble.com/Suggestion%3A-make-CmsUser-available-in-I_CmsWidget---A_Widget-tp23328962p23329478.html
Sent from the OpenCMS - Dev mailing list archive at Nabble.com.




More information about the opencms-dev mailing list