On 10/16/2009 04:46 PM, Sergiu Dumitriu wrote:
On 10/16/2009 11:12 AM, Guillaume Lerouge wrote:
> Hi Anca,
>
> On Fri, Oct 16, 2009 at 10:54 AM, Anca Luca<ancapaula.luca(a)xwiki.com>wrote;wrote:
>
>> On 10/16/2009 10:44 AM, Guillaume Lerouge wrote:
>>> Hi Anca,
>>>
>>> On Thu, Oct 15, 2009 at 9:07 PM, Anca Luca<ancapaula.luca(a)xwiki.com>
>> wrote:
>>>
>>>> Hi Guillaume,
>>>>
>>>> Guillaume Lerouge wrote:
>>>>> Hi Anca,
>>>>> Do you plan on using GWT to achieve this? If not, what's the best
way
>> to
>>>>> code it in a cross-browser, maintainable way? Using one of the JS
>> library
>>>>> already embedded in XWiki such as Prototype I guess?
>>>>
>>>> I don't have a plan.
>>>>
>>>
>>> Good luck.
>>
>> The only problem with GWT is that the javascript is not editable right
>> away: it
>> goes through compilation (so the source itself is not the "executable"
>> anymore,
>> as in standard interpreted languages which js is) whereas a jsx, for
>> example, is
>> editable from the wiki. Again, an admin / programmer in a wiki could go in
>> and
>> tweak some js without access to the server fs, or a GWT compiler, or
>> downloading
>> sources, or etc.
>>
>> However, the main advantage of GWT is its cross-browser-ness, the precious
>> selection API we have and easy development in the more "stable" Java.
>>
>
> Is there a way to have GWT retrieve values for some CSS properties from
> XObjects?
>
> For instance, is the GWT-based UI could retrieve its CSS color codes from a
> ColorTheme object it would allow you to code in GWT while still giving the
> wiki admin some control over the annotations' look.
>
> Is that doable?
the problem is not with looks but with slight adjust of functionality, like,
say, extra validation before you click a button, or an extra help message or
baloon. If in GWT you need to recompile and redeploy while in jsx you just edit
in the browser. Now, this is a frequent use-case only for developers, and edit
in browser is a very "nice to have", we need to find out if we're willing to
trade.
Styling was never an issue with GWT code. Editing the source javascript
is, and it's not possible to do it.
What's doable is to have a mix of GWT and plain javascript, like a core
functionality and API in GWT, which is used by a JSX to provide the UI.
I don't think you'd be able to cover all cases where users might want to hack.
Since hacking is not supposed to happen (we'd only give one the chance to easily
do it if she wants), I think it's very hard to define an API for it.
But this only increases the complexity, and
doesn't add the advantages
of both frameworks, on the contrary, it only sums their disadvantages.
Still, why do you think that GWT is more cross-browser than Prototype?
IIRC, there were lots of problems with GWT code, too, and the main
problem with both JS and GWT code is not the code itself, but the very
general rules in the core skin, which have many side effects hard to
overcome. Am I right?
More or less about the skin rules.
GWT might be more cross-browser at least because Marius has been working a lot
on making it very cross browser (we have our xwiki-gwt-dom module which
encapsulates selection API and the fixes for the DOM api). We can reuse some of
this work.
So, personally I prefer the Prototype way, but Anca's vote counts more,
since she'll have to write the code.
The whole issue is if it's worth to employ a whole GWT app for such a thing
(which might be too light for it). Otherwise GWT has pretty good parts: easier
to write code with, automated testing, hosted mode debugging (well, that's
achievable with firebug), and all the others that coding in Java brings.
Thanks,
Anca
By the way, +1 for the general goals, Anca.