Re: XMLForm: dynamic content listbox

2002-11-23 Thread Ivelin Ivanov

Yes. JXPath is used.
The names are matched by JavaBean introspection.


- Original Message -
From: "Josema Alonso" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Friday, November 22, 2002 3:47 AM
Subject: RE: XMLForm: dynamic content listbox


> When you say 'So, but how is the xmlform framework determining the name?'
I
> do not know exactly what you mean.
>
> Maybe you need the help of someone more expert than me in the framework.
As
> I told you in my previous message I think is JXPath making the mappings,
but
> haven't investigate this point too much...maybe we should take a closer
look
> at http://jakarta.apache.org/commons/jxpath/...
>
>
> -Mensaje original-
> De: Kirchhoff, Lars [mailto:[EMAIL PROTECTED]]
> Enviado el: viernes, 22 de noviembre de 2002 9:59
> Para: '[EMAIL PROTECTED]'
> Asunto: AW: XMLForm: dynamic content listbox
>
>
> thanks Josema,
>
> after playing a while I found it as well, but still find it a bit
> confusing, because there is now direct reference. What I did was
> the following:
>
> 
>  public UserBean () {
> initCustomers();
>  }
>
>  public String[] getName() {
> return names;
>  }
>
>  public void setName( String[] newNames ) {
> names = newNames;
>  }
>
>  public Set getCustomerNames() {
> return customerNames.entrySet();
>  }
>
>  public void initCustomers() {
> names  = new String[] {};
> customerNames  = new HashMap();
>
> ...
>   fill with database entries
> ...
>  }
> 
>
> after this was done in the java bean, I could acces the elements
> by using /name as ref value in the xml file.
>
> 
>  
>   Customer
>   
>
>
>   
>  
> 
>
> So, but how is the xmlform framework determining the name?
>
> best regards
> Lars Kirchhoff
>
>
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: XMLForm: dynamic content listbox

2002-11-23 Thread Ivelin Ivanov

yes.

http://jakarta.apache.org/commons/jxpath/users-guide.html#Containers


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Thursday, November 21, 2002 2:54 AM
Subject: RE: XMLForm: dynamic content listbox


Thanks Alonso.

I have read userIdentity.xml and UserBean.java files from Cocoon Wizard
sample.
In UserBean.java, I have found a method called "initHobbies()". This method
simply init all hobbies.

If I have well understood, I could replace the hard-coded values of
allHobbies by a query to a database. isn't it?

What would be the solution if I want to retrieve the allHobbies values from
an external xml file?
Is there an example?

Thank you
Sylvain


-Message d'origine-
De: Josema Alonso [mailto:[EMAIL PROTECTED]]
Date: mercredi, 20. novembre 2002 19:50
À: Cocoon-Users
Objet: Re: XMLForm: dynamic content listbox


Hello.

I had a very similar problem a few days ago. The way to go is the itemset
tag as used in the wizard demo. Take a look at the 'userIdentity.xml' file
where the Hobbies get listed:

Hobbies






All you have to do is to change the UIType to the one desired and fill the
items with values taken from the DB, for example from the action.

Hope it helps,
Josema.


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 20, 2002 3:56 PM
Subject: XMLForm: dynamic content listbox


> Hello,
>
> I'm using listbox in XMLForm (with tag ). The content of the listbox (the items listed) is
hard-coded in the xml document (view) like that:
>
> 
>  
>   Unix
>   Unix>
>  
>  
>   Windows
>   Windows
>  
> 
>
> Is there a possibility to retrieve dynamically these items from a database
instead of using the hard-coded items in xml document??
>
> Thank you
> Sylvain
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>



-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>



-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: XMLForm: dynamic content listbox

2002-11-22 Thread Josema Alonso
When you say 'So, but how is the xmlform framework determining the name?' I
do not know exactly what you mean.

Maybe you need the help of someone more expert than me in the framework. As
I told you in my previous message I think is JXPath making the mappings, but
haven't investigate this point too much...maybe we should take a closer look
at http://jakarta.apache.org/commons/jxpath/...


-Mensaje original-
De: Kirchhoff, Lars [mailto:[EMAIL PROTECTED]]
Enviado el: viernes, 22 de noviembre de 2002 9:59
Para: '[EMAIL PROTECTED]'
Asunto: AW: XMLForm: dynamic content listbox


thanks Josema,

after playing a while I found it as well, but still find it a bit
confusing, because there is now direct reference. What I did was
the following:


 public UserBean () {
initCustomers();
 }

 public String[] getName() {
return names;
 }

 public void setName( String[] newNames ) {
names = newNames;
 }

 public Set getCustomerNames() {
return customerNames.entrySet();
 }

 public void initCustomers() {
names  = new String[] {};
customerNames  = new HashMap();

...
  fill with database entries
...
 }


after this was done in the java bean, I could acces the elements
by using /name as ref value in the xml file.


 
  Customer
  
   
   
  
 


So, but how is the xmlform framework determining the name?

best regards
Lars Kirchhoff



-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: XMLForm: dynamic content listbox

2002-11-22 Thread Josema Alonso
Hi,

For what I know, the access to the properties by JXPath relies on the getter
and setter methods. So if you read the code in UserBean.java you'll see:
  public String[] getHobby()
  {
return hobbies;
  }

  public void setHobby( String[] newHobbies )
  {
hobbies = newHobbies;
  }

And that's why is accesssed via /hobby.

Please, Ivelin or anyone else, correct me if I'm wrong.

Hope it helps.


-Mensaje original-
De: Kirchhoff, Lars [mailto:[EMAIL PROTECTED]]
Enviado el: viernes, 22 de noviembre de 2002 7:20
Para: '[EMAIL PROTECTED]'
Asunto: AW: XMLForm: dynamic content listbox


Hello,

I'm trying the same and did manage to create a dynamic list
of checkboxes from a database. But I still don't get it completely.
Where is the ref="/hobby" defined? I looked in the UserBean and the
userIdentity.xml, but found nothing. Can somebody give me a hint.
I would like to change this to one of my own variable names.

regards Lars



-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: XMLForm: dynamic content listbox

2002-11-21 Thread Josema Alonso
>Yes I'm interested for your complete example!
Ok, I'll send the example later this evening.

>I think that the access to Xindice or to a XML file are nearly the same?!?
Well, mostly...let's say you can get XML documents from Xindice. Think about
it as a XML documents repository that are stored in collections.

>Thank you very much
You're welcome.


-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: XMLForm: dynamic content listbox

2002-11-21 Thread Sylvain.Thevoz
Yes I'm interested for your complete example!

I think that the access to Xindice or to a XML file are nearly the same?!?

Thank you very much
Sylvain

-Message d'origine-
De: Josema Alonso [mailto:[EMAIL PROTECTED]]
Date: jeudi, 21. novembre 2002 10:34
À: [EMAIL PROTECTED]
Objet: RE: XMLForm: dynamic content listbox


>If I have well understood, I could replace the hard-coded values of
allHobbies by a query to a database. >isn't it?
Yes. Just fill the appropriate Java structure of your choice with the
database values after querying it.

>What would be the solution if I want to retrieve the allHobbies values from
an external xml file?
>Is there an example?
Well, I'm using Xindice as the backend DB. I'm using DOM nodes to load the
content from the DB and then map those nodes to the form (there's an example
in the wizard with DOM nodes, too). It took me some time to make it work but
I know I get it. I do not have the code right here, but could send you a
complete example later today if you're interested.

Best.


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: XMLForm: dynamic content listbox

2002-11-21 Thread Josema Alonso
>If I have well understood, I could replace the hard-coded values of
allHobbies by a query to a database. >isn't it?
Yes. Just fill the appropriate Java structure of your choice with the
database values after querying it.

>What would be the solution if I want to retrieve the allHobbies values from
an external xml file?
>Is there an example?
Well, I'm using Xindice as the backend DB. I'm using DOM nodes to load the
content from the DB and then map those nodes to the form (there's an example
in the wizard with DOM nodes, too). It took me some time to make it work but
I know I get it. I do not have the code right here, but could send you a
complete example later today if you're interested.

Best.


-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




RE: XMLForm: dynamic content listbox

2002-11-21 Thread Sylvain.Thevoz
Thanks Alonso.

I have read userIdentity.xml and UserBean.java files from Cocoon Wizard sample.
In UserBean.java, I have found a method called "initHobbies()". This method simply 
init all hobbies.

If I have well understood, I could replace the hard-coded values of allHobbies by a 
query to a database. isn't it?

What would be the solution if I want to retrieve the allHobbies values from an 
external xml file?
Is there an example?

Thank you
Sylvain


-Message d'origine-
De: Josema Alonso [mailto:[EMAIL PROTECTED]]
Date: mercredi, 20. novembre 2002 19:50
À: Cocoon-Users
Objet: Re: XMLForm: dynamic content listbox


Hello.

I had a very similar problem a few days ago. The way to go is the itemset
tag as used in the wizard demo. Take a look at the 'userIdentity.xml' file
where the Hobbies get listed:

Hobbies






All you have to do is to change the UIType to the one desired and fill the
items with values taken from the DB, for example from the action.

Hope it helps,
Josema.


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 20, 2002 3:56 PM
Subject: XMLForm: dynamic content listbox


> Hello,
>
> I'm using listbox in XMLForm (with tag ). The content of the listbox (the items listed) is
hard-coded in the xml document (view) like that:
>
> 
>  
>   Unix
>   Unix>
>  
>  
>   Windows
>   Windows
>  
> 
>
> Is there a possibility to retrieve dynamically these items from a database
instead of using the hard-coded items in xml document??
>
> Thank you
> Sylvain
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>



-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>


-
Please check that your question  has not already been answered in the
FAQ before posting. <http://xml.apache.org/cocoon/faq/index.html>

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>




Re: XMLForm: dynamic content listbox

2002-11-20 Thread Josema Alonso
Hello.

I had a very similar problem a few days ago. The way to go is the itemset
tag as used in the wizard demo. Take a look at the 'userIdentity.xml' file
where the Hobbies get listed:

Hobbies






All you have to do is to change the UIType to the one desired and fill the
items with values taken from the DB, for example from the action.

Hope it helps,
Josema.


- Original Message -
From: <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Wednesday, November 20, 2002 3:56 PM
Subject: XMLForm: dynamic content listbox


> Hello,
>
> I'm using listbox in XMLForm (with tag ). The content of the listbox (the items listed) is
hard-coded in the xml document (view) like that:
>
> 
>  
>   Unix
>   Unix>
>  
>  
>   Windows
>   Windows
>  
> 
>
> Is there a possibility to retrieve dynamically these items from a database
instead of using the hard-coded items in xml document??
>
> Thank you
> Sylvain
>
> -
> Please check that your question  has not already been answered in the
> FAQ before posting. 
>
> To unsubscribe, e-mail: <[EMAIL PROTECTED]>
> For additional commands, e-mail:   <[EMAIL PROTECTED]>
>



-
Please check that your question  has not already been answered in the
FAQ before posting. 

To unsubscribe, e-mail: <[EMAIL PROTECTED]>
For additional commands, e-mail:   <[EMAIL PROTECTED]>