On 5/9/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
I think 1 is much more performant when it isn't a wicket component
because then the markup is stored under a locale and that markup is
preparsed for everything.
Can't be faster then that.

That is how WicketMessageTagHandler works today. It merely replaces
the attribute's value. But contrary to what I wrote we don't need to
create AMs for tags with wicket:id. It actually doesn't matter if
wicket:id exists or not. We simply change the attributes value.


3 is by far the worst when it comes done to performance. Because we have to
do it everytime for every request
even if there isn't a tag like that.. And if it is then we have to
manipulate (string concatting and copying) the buffer
And it can only be done when the person does buffer the response...


I don't think the performance is that much worse.
Yes we have to do it for all requests, but only than you can change
your properties on the fly. Else you'd have to remove the entry from
the markup cache to force markup reloading.
String manipulation I'd guess is about the same in all 3 scenarios.
Your last point is wrong. Transformers are independent from the
RESPONSE_BUFFER settings.

If we store the markup under the locale and the markup is parsed for that
locale and all resources are inserted into
the markup. Then it doesn't matter if it is a wicket component tag or not.
Just set the right attribute value into the
Component tag attribute. (if a developer alters that again it is his doing)
Then we only parse once and we have the right markup file per locale.


true, see above.
Hot deplyoment of properties files would require clearing the cache
(not true, but everything else seems far to complicated)

The problem with resources changes can be fixed if we monitor resource
changes and just delete the markup then
(as a whole or maybe a part if we can make the links)


you need to remove all markups which make use of the properties files
and that could potentially be every child component. Even worse, the
algorithm would be tied to the logic we use to find properties. That
logic however will become even more flexible in 1.2 meaning that you
can not rely on it all to remove the markup cache entries. IMO it'd be
sufficient to clear the whole cache and avoid these troubles all
together.

Juergen

johan



On 5/9/06, Juergen Donnerstag <[EMAIL PROTECTED]> wrote:
>
We do something similar for autolinks already. Actually I think there
at least 3 solutions:
1) If no wicket:id is present than replace the attribute on the fly
and add it to the markup stream as if it were RawMarkup. Con: changes
to the properties at runtime are not taken into account. Tags with
wicket:id are treated as below.
2) Automatically create a WebMarkupContainer for all tags without
wicket:id but with such attributes and auto-attach an
AttributeModifier. If wicket:id already exists, than auto-attach the
AttributeModifier to the already existing component. Con: you
auto-create plenty more Containers and the debug page is filled with
automatically created components.
3) A 3rd option could by an OutputTransformer kind of
Component/Behavior which simply ignores the html/xml structure and
search & replaces the attributes in the output string. Something like
s/"w18n:([w+\.])"/"${getString($1)"/g  (pseudo code only).
The
properties file of course could only be with the the transformer or
any container up the hierarchy. Currently I like this idea most. In
most scenarios (RESPONSE_BUFFER) we cache the output string already.
We'd simply kind of post process the output. Might as well be more
efficient (performance and memory) than any of the other solutions.

Juergen

On 5/9/06, Johan Compagner <[EMAIL PROTECTED]> wrote:
> the problem i see is are we going to check every tag's attribute (wicket
> component or not) for such a thing?
>
> And if it is not a wicket component we make it a special (none raw markup)
> tag?
> and if it is a wicket component already we just put a special object in
the
> tags attributes?
>
> johan
>
>
>
> On 5/9/06, Eelco Hillenius <[EMAIL PROTECTED]> wrote:
> > It'll give people choice though. Not everyone cares about
> > previewability in the same fashion.
> >
> > Eelco
> >
> >
> > On 5/9/06, Juergen Donnerstag <[EMAIL PROTECTED] > wrote:
> > > I guess it depends on what job you are in. It is nice for the person
> > > who has to maintain the properties. If I were a html designer I'd
> > > rather prefer a default text like "save" or whatever, which btw
> > > applies if no property is found.
> > >
> > > Juergen
> > >
> > > On 5/9/06, Igor Vaynberg <[EMAIL PROTECTED] > wrote:
> > > > why not? in a preview you would get a button with text
> > > > "wicket:i18n:buttons.save"
> > > >
> > > > thats good for preview since you can see the key!
> > > >
> > > > -Igor
> > > >
> > > >
> > > >
> > > > On 5/8/06, Juergen Donnerstag < [EMAIL PROTECTED]> wrote:
> > > > > It will not be previeable any more.
> > > > >
> > > > > Juergen
> > > > >
> > > > > On 5/9/06, Igor Vaynberg < [EMAIL PROTECTED]> wrote:
> > > > > > why not a format like this
> > > > > >
> > > > > > <input type="submit" value="wicket:i18n: buttons.save"/>
> > > > > >
> > > > > > or
> > > > > >
> > > > > > <input type="submit" value="wi18n:buttons.save "/>
> > > > > >
> > > > > > -Igor
> > > > > >
> > > > > >
> > > > > >
> > > > > > On 5/8/06, Andrew Berman < [EMAIL PROTECTED]> wrote:
> > > > > > >
> > > > > > > Hey Guys,
> > > > > > >
> > > > > > > I think adding something to support localized attributes would
> be a
> > > > big
> > > > > > plus.  I know that when Wicket added wicket:message it really
> saved a
> > > > lot of
> > > > > > extra Java code on my part.  I think the same thing would happen
> if we
> > > > came
> > > > > > up with something to do it in attributes.  AttributeModifiers
> obviously
> > > > > > work, but when you have a lot of things you want to localize on
> the same
> > > > > > page it's a lot of extra Java code that needs to be written to
> support
> > > > this
> > > > > > because you need to add the specific Component and add an
> > > > AttributeModifier.
> > > > > > >
> > > > > > > What about a compromise?  I think the experimental stuff in
> > > > > > WicketMessageTagHandler is cumbersome to add to the HTML, so
what
> if we
> > > > > > created a component whose sole purpose is to add attributes to
> some HTML
> > > > > > element.  Or can this already be done like this:
> > > > > > >
> > > > > > > Java:
> > > > > > > add(new WebComponent("imageAlt").add(new
> > > > > > AttributeModifier("alt", true, new ResourceModel(" my.key"))));
> > > > > > >
> > > > > > > HTML:
> > > > > > > <img wicket:id="imageAlt" src="mySrc" />
> > > > > > >
> > > > > > > I haven't tested if this works, but if not, maybe some kind of
> > > > Component
> > > > > > could be created which allows something like this.  It will
allow
> for
> > > > > > multiple attributes to be replaced as well.
> > > > > > >
> > > > > > > Thoughts?
> > > > > > >
> > > > > > >
> > > > > > > --Andrew
> > > > > > >
> > > > > > >
> > > > > > >
> > > > > > > On 5/4/06, Juergen Donnerstag < [EMAIL PROTECTED] >
> wrote:
> > > > > > > > On 5/4/06, Ralf Ebert <[EMAIL PROTECTED] > wrote:
> > > > > > > > > Hi Juergen,
> > > > > > > > >
> > > > > > > > > > please see WicketMessageTagHandler.java. It is
> experimental only
> > > > and
> > > > > > > > > > disabled by default. Reason: it is realy ugly to have
> something
> > > > like
> > > > > > > > > > wicket:example="tag=key". AttributeModifier are much
more
> > > > convinent
> > > > > > > > > > and far less ugly, IMO.
> > > > > > > > > if you have a page with like, say, 20 labels with static
> text
> > > > (like
> > > > > > > > > you have sometimes in complex forms for explaining things)
I
> don't
> > > > see
> > > > > > > > > something to win by adding AttributeModifiers to the
> component
> > > > tree. I
> > > > > > > > > see localization of static text as "markup issue" because
> there is
> > > > > > > > > almost no logic to define there. The format you described
is
> > > > rather
> > > > > > > > > ugly, that's right: What about:
> > > > > > > > > <div wicket:message="blaLabel">bla</div>
> (if you
> > > > want
> > > > > > to go the
> > > > > > > > > message as text between the tags)
> > > > > > > >
> > > > > > > > this is <wicket:message
> > > > > > value="xxx">default</wicket:message> and
> > > > > > > > already available.
> > > > > > > >
> > > > > > > > > <input type="submit" wicket:message:value="Do something"/>
> (for
> > > > > > > > > localizing the attribute value, probably the second : is
not
> valid
> > > > xml
> > > > > > > > > any more, but another separation char like _ or  maybe no
> > > > separation
> > > > > > > > > char at all could be used)
> > > > > > > > >
> > > > > > > >
> > > > > > > > It is all not realy nice, isn't it? That is what we
struggled
> with.
> > > > We
> > > > > > > > didn't find a syntax which we realy liked and which is
> standards
> > > > > > > > compliant ( e.g. XML namespace, schema).
> > > > > > > >
> > > > > > > > > This would be very helpful for quick & easy localization
of
> static
> > > > > > > > > content in pages, something that's missing at the moment
> from my
> > > > point
> > > > > > > > > of view. Tell me what you think, if I have time I would
like
> to
> > > > > > > > > implement this and contribute it...
> > > > > > > > >
> > > > > > > >
> > > > > > > > your help is very much appreciated but the syntax should be
> right.
> > > > > > > >
> > > > > > > > > > That is default. Localizer implements a search hierarchy
> up the
> > > > > > > > > > component tree. You only need one properties files per
> language
> > > > per
> > > > > > > > > > Panel which contains X number of component. Thinking ...
> That is
> > > > not
> > > > > > > > > > your question, isn't it? Like Application.properties is
> the last
> > > > > > > > > > resort for all messages, you ask for one per java
package,
> > > > right?
> > > > > > So,
> > > > > > > > > > in addition to the my.pkg.MyPanel.properties it should
> look in
> > > > > > > > > > my/pkg/Wicket.properties as well (may be
Wicket.properties
> is
> > > > not
> > > > > > the
> > > > > > > > > > best name).
> > > > > > > > > That's what I want to do and it would be a nice feature if
> such a
> > > > > > > > > lookup strategy could be added by just setting an option
and
> > > > defining
> > > > > > > > > a name for the property file. I tried to do it quick
myself
> but
> > > > > > > > > stopped after finding out that the property file name is
> quite
> > > > tightly
> > > > > > > > > coupled to some class name for the moment...
> > > > > > > > >
> > > > > > > >
> > > > > > > > It is fairly easy to add. Please see
> > > > > > Settings.addStringResourceLoader ,
> > > > > > > > Application.getResourceStreamLocator and
> > > > > > > > CompoundResourceStreamLocator.java
> > > > > > > >
> > > > > > > > Let me know if you need any more help
> > > > > > > >
> > > > > > > > Juergen
> > > > > > > >
> > > > > > > > > Regards,
> > > > > > > > > Ralf
> > > > > > > > >
> > > > > > > > >
> > > > > > > > >
> > > > > >
> -------------------------------------------------------
> > > > > > > > > Using Tomcat but need to do more? Need to support web
> services,
> > > > > > security?
> > > > > > > > > Get stuff done quickly with pre-integrated technology to
> make your
> > > > job
> > > > > > easier
> > > > > > > > > Download IBM WebSphere Application Server v.1.0.1 based on
> Apache
> > > > > > Geronimo
> > > > > > > > >
> > > > > >
> > > >
>
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
> > > > > > > > >
> _______________________________________________
> > > > > > > > > Wicket-user mailing list
> > > > > > > > > Wicket-user@lists.sourceforge.net
> > > > > > > > >
> > > > > >
> > > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > > > > > >
> > > > > > > >
> > > > > > > >
> > > > > > > >
> > > >
> -------------------------------------------------------
> > > > > > > > Using Tomcat but need to do more? Need to support web
> services,
> > > > > > security?
> > > > > > > > Get stuff done quickly with pre-integrated technology to
make
> your
> > > > job
> > > > > > easier
> > > > > > > > Download IBM WebSphere Application Server v.1.0.1 based on
> Apache
> > > > > > Geronimo
> > > > > > > >
> > > > > >
> > > >
>
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
> > > > > > > >
> _______________________________________________
> > > > > > > > Wicket-user mailing list
> > > > > > > > Wicket-user@lists.sourceforge.net
> > > > > > > >
> > > > > >
> > > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > > > > >
> > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > >
> > > > >
> > > > >
> -------------------------------------------------------
> > > > > Using Tomcat but need to do more? Need to support web services,
> security?
> > > > > Get stuff done quickly with pre-integrated technology to make your
> job
> > > > easier
> > > > > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> > > > >
> > > >
>
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
> > > > > _______________________________________________
> > > > > Wicket-user mailing list
> > > > > Wicket-user@lists.sourceforge.net
> > > > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > > > >
> > > >
> > > >
> > >
> > >
> > >
-------------------------------------------------------
> > > Using Tomcat but need to do more? Need to support web services,
> security?
> > > Get stuff done quickly with pre-integrated technology to make your job
> easier
> > > Download IBM WebSphere Application Server v.1.0.1 based on Apache
> Geronimo
> > >
>
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
> > > _______________________________________________
> > > Wicket-user mailing list
> > > Wicket-user@lists.sourceforge.net
> > >
> https://lists.sourceforge.net/lists/listinfo/wicket-user
> > >
> >
> >
> > -------------------------------------------------------
> > Using Tomcat but need to do more? Need to support web services,
security?
> > Get stuff done quickly with pre-integrated technology to make your job
> easier
> > Download IBM WebSphere Application Server v.1.0.1 based on Apache
Geronimo
> >
>
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
> > _______________________________________________
> > Wicket-user mailing list
> > Wicket-user@lists.sourceforge.net
> >
https://lists.sourceforge.net/lists/listinfo/wicket-user
> >
>
>


-------------------------------------------------------

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job
easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmdlnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user





-------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0709&bid&3057&dat1642
_______________________________________________
Wicket-user mailing list
Wicket-user@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/wicket-user

Reply via email to