You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@wicket.apache.org by Jens Alenius <je...@megasol.se> on 2009/06/03 10:12:31 UTC

Different xml property filename for the markup and java

I would like to have two different webpages sharing the same xml 
property file. That could be solved be letting one of the markups
point to the others property file. Does anyone know if it is possible?

History
We got a core project and then we have different projects for different 
customers. We cant place all the propertys in the core's
Application.xml because it would add customers propertys in the core. 
And the Application.xml would become to large.
Im trying to solve the problem by letting the customers have there own 
base webpage where the xml properties could be located. The problem is 
just that I have to type of base
webpages and I dont want to extend two differnt webpages for each 
customer. If these two webpages could sher the same xml property file it 
would be nicer.
Mayby some one else have a better Idea for this problem?
Jens Alenius


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Different xml property filename for the markup and java

Posted by jensiator <je...@megasol.se>.
Thanks for the suggestions everone!
Jens

-- 
View this message in context: http://www.nabble.com/Different-xml-property-filename-for-the-markup-and-java-tp23847329p23864326.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Different xml property filename for the markup and java

Posted by jensiator <je...@megasol.se>.
That is what I missed! That must be the solution. Thanks Igor
Jens
-- 
View this message in context: http://www.nabble.com/Different-xml-property-filename-for-the-markup-and-java-tp23847329p23885796.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Different xml property filename for the markup and java

Posted by Igor Vaynberg <ig...@gmail.com>.
you can create a file called package.properties which will also be
checked as the hierarchy is being iterated by all classes in that
package.

-igor

On Thu, Jun 4, 2009 at 1:15 AM, jensiator <je...@megasol.se> wrote:
>
> But still...
> Everything I read says that wicket searches for property files on class
> hierarchy and nesting.
> And that a good thing of cource.
> But...
> Lets say that I would like to have one big xml property file for every
> functionality package (that our customers might want to buy). Most of the
> pages in that package is built up of different panels but they share a lot
> of properties.
> I cant use the MyApplication.xml because its in the core package. But I got
> two base webpages in the core webapplication package(that contains the
> Application class). One webpage for basic layout where I'm using
> wicket:child. And one webpage that I using in modalwindows. Im willing to
> extend them for the func. package but I dont want to duplicate all the
> properties in these to pages propertyfiles. In my case I cant see how the
> wicket class hierarchy and nesting could help me.
>
> But I dont understand what you meen with package-wide property files. I know
> two ways of hooking up on property files in wicket.
> 1. Nesting and hierarchy
> 2. getResourceSettings().addStringResourceLoader in the Application.init
>
> I cant use number 2 because Its in the core package
>
> Jens
>
>
> there are always package-wide property files support in wicket...
>
> -igor
>
> --
> View this message in context: http://www.nabble.com/Different-xml-property-filename-for-the-markup-and-java-tp23847329p23865653.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Different xml property filename for the markup and java

Posted by jensiator <je...@megasol.se>.
But still...
Everything I read says that wicket searches for property files on class
hierarchy and nesting.
And that a good thing of cource. 
But...
Lets say that I would like to have one big xml property file for every
functionality package (that our customers might want to buy). Most of the
pages in that package is built up of different panels but they share a lot
of properties. 
I cant use the MyApplication.xml because its in the core package. But I got
two base webpages in the core webapplication package(that contains the
Application class). One webpage for basic layout where I'm using
wicket:child. And one webpage that I using in modalwindows. Im willing to
extend them for the func. package but I dont want to duplicate all the
properties in these to pages propertyfiles. In my case I cant see how the
wicket class hierarchy and nesting could help me. 

But I dont understand what you meen with package-wide property files. I know
two ways of hooking up on property files in wicket. 
1. Nesting and hierarchy 
2. getResourceSettings().addStringResourceLoader in the Application.init

I cant use number 2 because Its in the core package

Jens


there are always package-wide property files support in wicket...

-igor

-- 
View this message in context: http://www.nabble.com/Different-xml-property-filename-for-the-markup-and-java-tp23847329p23865653.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Different xml property filename for the markup and java

Posted by Igor Vaynberg <ig...@gmail.com>.
there are always package-wide property files support in wicket...

-igor

On Wed, Jun 3, 2009 at 6:57 AM, Marcin Palka <ma...@gmail.com> wrote:
>
> Hi Jens,
>
> I would suggest to create a base page class that contains common elements
> and then for each customer extend your base page class. This makes it
> possible to keep common message keys in a base class property file(s). As
> far as I know in case wicket is not able to find a message key in a property
> file(s) with the same name as a class file it will look into its base class
> property files as well.
>
> You may want to read this article (especially the "Finding the message"
> section):
> http://day-to-day-stuff.blogspot.com/2008/05/wicket-internationalization.html
>
> cheers
> Marcin
> --
> View this message in context: http://www.nabble.com/Different-xml-property-filename-for-the-markup-and-java-tp23847329p23851943.html
> Sent from the Wicket - User mailing list archive at Nabble.com.
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
> For additional commands, e-mail: users-help@wicket.apache.org
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org


Re: Different xml property filename for the markup and java

Posted by Marcin Palka <ma...@gmail.com>.
Hi Jens,

I would suggest to create a base page class that contains common elements
and then for each customer extend your base page class. This makes it
possible to keep common message keys in a base class property file(s). As
far as I know in case wicket is not able to find a message key in a property
file(s) with the same name as a class file it will look into its base class
property files as well. 

You may want to read this article (especially the "Finding the message"
section):
http://day-to-day-stuff.blogspot.com/2008/05/wicket-internationalization.html

cheers
Marcin
-- 
View this message in context: http://www.nabble.com/Different-xml-property-filename-for-the-markup-and-java-tp23847329p23851943.html
Sent from the Wicket - User mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: users-unsubscribe@wicket.apache.org
For additional commands, e-mail: users-help@wicket.apache.org