You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@hivemind.apache.org by Oscar Picasso <os...@yahoo.com> on 2005/11/21 21:55:28 UTC

Symbol sources

Hi,
 
 I want to use symbols that comes from:
 1- environement variables
 and/or 
 2- a properties file
 
 How to do that? I have read the docs, it should be simple but frankly I am lost.
 
 And that from someone that found Tapestry really easy to learn (despîte my background with other frameworks).
 
 Thanks.
 
 Oscar
 
 
		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

Re: Simple maps and lists in a configuration

Posted by Knut Wannheden <kn...@gmail.com>.
On 11/23/05, Oscar Picasso <os...@yahoo.com> wrote:
> Thanks. I needed to add the invoke-parent to your example to make it work:
>  ...
>  <push-attribute attribute="bar"/>
>  <!-- Added element -->
>  <invoke-parent method="addElement"/>
>  ...
>

Good catch! Sorry about that!

--knut

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Simple maps and lists in a configuration

Posted by Oscar Picasso <os...@yahoo.com>.
Thanks. I needed to add the invoke-parent to your example to make it work:
 ...
 <push-attribute attribute="bar"/>
 <!-- Added element -->
 <invoke-parent method="addElement"/>
 ...

Knut Wannheden <kn...@gmail.com> wrote: Oscar,

You don't have to do anything special at all. You just don't specify a
translator for the attribute or element content you'd like to have in
your List / Map. Then instead of a  element you use the
 element in conjunction with a 
 or

 rule.

So something like:


 
  
  
   

  

 


HTH,

--knut

On 11/22/05, Oscar Picasso  wrote:
> Hi,
>
>  The examples that I have read show how to contribute to a configuration
> with objects (like Datum) that can be retrieved from a List or a
> Map.
>
>  But what if I want to contribute something like List or
> Map? That is, I don't want to use a special object to hold
> the configuration values.
>
>  Thanks.
>
>  Oscar.
>
>  ________________________________
>  Yahoo! FareChase - Search multiple travel sites in one click.

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org






		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

Re: Simple maps and lists in a configuration

Posted by Knut Wannheden <kn...@gmail.com>.
Oscar,

You don't have to do anything special at all. You just don't specify a
translator for the attribute or element content you'd like to have in
your List / Map. Then instead of a <conversion> element you use the
<rules> element in conjunction with a <push-attribute> or
<push-content> rule.

So something like:

<schema>
 <element name="foo">
  <attribute name="bar"/>
  <rules>
   <push-attribute attribute="bar"/>
  </rules>
 </element>
</schema>

HTH,

--knut

On 11/22/05, Oscar Picasso <os...@yahoo.com> wrote:
> Hi,
>
>  The examples that I have read show how to contribute to a configuration
> with objects (like Datum) that can be retrieved from a List<Datum> or a
> Map<WhateverKeyClass, Datum>.
>
>  But what if I want to contribute something like List<String> or
> Map<String,String>? That is, I don't want to use a special object to hold
> the configuration values.
>
>  Thanks.
>
>  Oscar.
>
>  ________________________________
>  Yahoo! FareChase - Search multiple travel sites in one click.

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Simple maps and lists in a configuration

Posted by Oscar Picasso <os...@yahoo.com>.
Thanks.
 
 That was exactly what I was looking for.
 
 I think the documentation should have more examples like the ones in your site. Maybe they could be included in the official documentation.
 
 
Shing Hing Man <ma...@yahoo.com> wrote: I have an exmaple for a contribution of List of
string. 
The source code is at 

http://137.132.69.134/hiveMind/welcome

The above also have an exmaple on contribution of a
Map. But I do not
know whether it meets your needs. 
HTH
Shing

--- Oscar Picasso  wrote:

> Hi,
>  
>  The examples that I have read show how to
> contribute to a configuration with objects (like
> Datum) that can be retrieved from a List or a
> Map.
>  
>  But what if I want to contribute something like
> List or Map? That is, I don't
> want to use a special object to hold the
> configuration values.
>  
>  Thanks.
>  
>  Oscar.
>   
> ---------------------------------
>  Yahoo! FareChase - Search multiple travel sites in
> one click.  

Home page :
  http://uk.geocities.com/matmsh/index.html


 
 
  
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

Re: Simple maps and lists in a configuration

Posted by Shing Hing Man <ma...@yahoo.com>.
I have an exmaple for a contribution of List of
string. 
The source code is at 

http://137.132.69.134/hiveMind/welcome

The above also have an exmaple on contribution of a
Map. But I do not
know whether it meets your needs. 
HTH
Shing

--- Oscar Picasso <os...@yahoo.com> wrote:

> Hi,
>  
>  The examples that I have read show how to
> contribute to a configuration with objects (like
> Datum) that can be retrieved from a List<Datum> or a
> Map<WhateverKeyClass, Datum>.
>  
>  But what if I want to contribute something like
> List<String> or Map<String,String>? That is, I don't
> want to use a special object to hold the
> configuration values.
>  
>  Thanks.
>  
>  Oscar.
> 		
> ---------------------------------
>  Yahoo! FareChase - Search multiple travel sites in
> one click.  

Home page :
  http://uk.geocities.com/matmsh/index.html


	
	
		
___________________________________________________________ 
Yahoo! Messenger - NEW crystal clear PC to PC calling worldwide with voicemail http://uk.messenger.yahoo.com

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Simple maps and lists in a configuration

Posted by Oscar Picasso <os...@yahoo.com>.
Hi,
 
 The examples that I have read show how to contribute to a configuration with objects (like Datum) that can be retrieved from a List<Datum> or a Map<WhateverKeyClass, Datum>.
 
 But what if I want to contribute something like List<String> or Map<String,String>? That is, I don't want to use a special object to hold the configuration values.
 
 Thanks.
 
 Oscar.
		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.  

Re: Symbol sources

Posted by Knut Wannheden <kn...@gmail.com>.
Oscar,

Yes, it's the SymbolSources configuration point you were looking for.
If you need to load symbols from a properties file you'll have to roll
your own symbol source. But that's really very easy.

The 'name' attribute (in conjunction with the 'before' and 'after'
attributes) is used for ordering symbol sources. Thus if you have
multiple symbol sources defining the same symbols you can define the
order of precedence of the sources.

HTH,

--knut

On 11/21/05, Oscar Picasso <os...@yahoo.com> wrote:
> Ok. I found it. Quite simple finally.
>
>  Just added
>
>  <contribution configuration-id="hivemind.SymbolSources">
>  <source name="symbolSources"
> class="org.apache.hivemind.impl.SystemPropertiesSymbolSource"/>
>
>  </contribution>
>
>  Not sure what's the purpose of the name attribute though.
>
>
> Oscar Picasso <os...@yahoo.com> wrote:
>  Hi,
>
>  I want to use symbols that comes from:
>  1- environement variables
>  and/or
>  2- a properties file
>
>  How to do that? I have read the docs, it should be simple but frankly I am
> lost.
>
>  And that from someone that found Tapestry really easy to learn (despîte my
> background with other frameworks).
>
>  Thanks.
>
>  Oscar
>
>
>  ________________________________
>  Yahoo! FareChase - Search multiple travel sites in one click.
>
>
>  ________________________________
>  Yahoo! FareChase - Search multiple travel sites in one click.
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: hivemind-user-unsubscribe@jakarta.apache.org
For additional commands, e-mail: hivemind-user-help@jakarta.apache.org


Re: Symbol sources

Posted by Oscar Picasso <os...@yahoo.com>.
Ok. I found it. Quite simple finally.
 
 Just added 
 
 <contribution configuration-id="hivemind.SymbolSources">
 <source name="symbolSources"      class="org.apache.hivemind.impl.SystemPropertiesSymbolSource"/>     
 </contribution>
 
 Not sure what's the purpose of the name attribute though.

Oscar Picasso <os...@yahoo.com> wrote: Hi,
 
 I want to use symbols that comes from:
 1- environement variables
 and/or 
 2- a properties file
 
 How to do that? I have read the docs, it should be simple but frankly I am lost.
 
 And that from someone that found Tapestry really easy to learn (despîte my background with other frameworks).
 
 Thanks.
 
 Oscar
 
    

---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.      


		
---------------------------------
 Yahoo! FareChase - Search multiple travel sites in one click.