On Thu, Mar 15, 2012 at 2:27 AM, Eduard Moraru <[email protected]> wrote:

> While I would be tempted to say +1 for easier access to components, I tend
> to also notice that this would invite people (including us) in avoiding to
> write the heavy code in Java and use Velocity instead. There would be
> almost no motivation to write a script service and the core/component code
> that we`ll end up executing from velocity will no longer have the checks
> that the *.api/script service methods had, knowing that they were called
> from userspace. So this would respect the strategy of offering a script
> service for the component module, but since the component module is the
> gateway to all the others, there will no longer be an incentive to respect
> this strategy for all other (future) modules.
>
> While I know that anyone can write a script service that just exposes the
> component manager, I think my questions is whether or not it is ethical for
> us to do so by default. Also, if it *is* ethical, then why haven't we done
> this before?
>
> Regarding the old com.xpn.xwiki.web.Utils.getComponentManager() method [1]
> (which targets non-componentized Java code), I don`t understand what is its
> relation with the issue at hand, namely Velocity a the proposed new
> component script service. As far as I know, you can not currently access
> components from Velocity and the current $util [2] velocity tool points to
> com.xpn.xwiki.api.Util (not com.xpn.xwiki.web.Utils) which has no such
> method.
>

Since I am not very familiar with Groovy, I assume you are referring to
using "services.component.getComponent(x)" instead of
"Utils.getComponent(x)" or "Utils.getComponentManager()" in Groovy. That
would probably be better, but again, the service will be available to all
scripting languages and my initial question remains.

Thanks,
Eduard


> Am I missing something?
>
> Thanks,
> Eduard
>
> ----------
> [1]
> https://github.com/xwiki/xwiki-platform/blob/master/xwiki-platform-core/xwiki-platform-oldcore/src/main/java/com/xpn/xwiki/web/Utils.java#L626
> [2]
> http://maven.xwiki.org/site/xwiki-core-parent/xwiki-core/apidocs/com/xpn/xwiki/api/Util.html
>
>
> On Wed, Mar 14, 2012 at 1:36 PM, Denis Gervalle <[email protected]> wrote:
>
>> +1
>>
>> On Wed, Mar 14, 2012 at 08:16, Marius Dumitru Florea <
>> [email protected]> wrote:
>>
>> > +1
>> >
>> > Thanks,
>> > Marius
>> >
>> > On Tue, Mar 13, 2012 at 6:35 PM, Vincent Massol <[email protected]>
>> > wrote:
>> > > Hi,
>> > >
>> > > I'd like to propose adding a module named
>> > xwiki-platform-component-script in xwiki-platform.
>> > > It would allow a script to get access to the Component Manager (for
>> now,
>> > we can imagine other apis later on).
>> > >
>> > > The idea is to replace the ugly static and "deprecated":
>> > > com.xpn….Util.getComponentManager()
>> > >
>> > > Of course the script Service will check for Programming Rights before
>> > giving back a CM instance.
>> > >
>> > > This follows the strategy of offering script services for each module.
>> > >
>> > > Here's my +1
>> > >
>> > > Thanks
>> > > -Vincent
>> > > _______________________________________________
>> > > devs mailing list
>> > > [email protected]
>> > > http://lists.xwiki.org/mailman/listinfo/devs
>> > _______________________________________________
>> > devs mailing list
>> > [email protected]
>> > http://lists.xwiki.org/mailman/listinfo/devs
>> >
>>
>>
>>
>> --
>> Denis Gervalle
>> SOFTEC sa - CEO
>> eGuilde sarl - CTO
>> _______________________________________________
>> devs mailing list
>> [email protected]
>> http://lists.xwiki.org/mailman/listinfo/devs
>>
>
>
_______________________________________________
devs mailing list
[email protected]
http://lists.xwiki.org/mailman/listinfo/devs

Reply via email to