Re: Getting started with flowscript

2004-05-13 Thread Antonio Gallardo
David Leangen dijo:

 I again turn to you for salvation.

 I'm finally ready to jump into flowscript... but I need a push in the
 right
 direction.

 Based on previous threads, it appears that a good approach (just to avoid
 saying best practice ;-) is to invoke the business logic from
 flowscript,
 set any values necessary, and call the values as needed within
 JXTemplates.

 Ok, fine.

 I made a trivial test class as follows:

First, see change made to the bean:

 package test.model;

 public class Test
 {
   private String m_val;
private String val;

   public Test()
   {
   }

   public void setVal(String val)
public void setVal(String newVal)
   {
   val = newVal;
   }

   public String getVal()
   {
return val;
   }
 }

 In my flowscript, I make this call:

   var test = new test.model.Test();
   test.setVal(hello);

 I pass this along to the pipeline.

 So far, so good...


 Now, in my JXTemplate, I'd like to call the getVal() getter but how do
 I
 do this??

Hi:

I guess you sent the test to JXTemplate using sendpage:

cocoon.sendPage(myJXTemplatePage, {bean : test});

Then inside JXTemplate, try to use: ${bean.val} Example:

val${bean.val}/val

Hope this help,

Best Regards,

Antonio Gallardo




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



Re: Getting started with flowscript

2004-05-13 Thread Christian Rosenberger
David Leangen  wrote:

-Original Message-
From: David Leangen [mailto:[EMAIL PROTECTED]
Sent: Thursday, May 13, 2004 10:37 AM
To: [EMAIL PROTECTED]
Subject: Getting started with flowscript


I again turn to you for salvation.

I'm finally ready to jump into flowscript... but I need a push in the
right direction.
Based on previous threads, it appears that a good approach (just to
avoid saying best practice ;-) is to invoke the business logic from
flowscript, set any values necessary, and call the values as needed
within JXTemplates.
Ok, fine.

I made a trivial test class as follows:

package test.model;

public class Test
{
private String m_val;
public Test()
{
}
public void setVal(String val)
{
m_val = val;
}
public String getVal()
{
return m_val;
}
}
In my flowscript, I make this call:

 var test = new test.model.Test();
As far as I can see you have to use
var test = Packages.test.model.Test();
because your package is not in java.* .

 test.setVal(hello);

I pass this along to the pipeline.
You pass this with sendPage(YOURPIPE, {test:test}); ?

So far, so good...

Now, in my JXTemplate, I'd like to call the getVal() getter but
how do I do this??
You can access the values you passed with flowscript by using XPath ( 
#{test/val} ) or Jexl Syntax ( ${test.val} ):
http://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.html

Regards,
Christian
-
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]


RE: Getting started with flowscript

2004-05-13 Thread David Leangen

Holy service!!

Thanks Antonio and Christian for the ultra-quick 911!!



 -Original Message-
 From: Christian Rosenberger [mailto:[EMAIL PROTECTED]
 Sent: May 13, 2004 17:57
 To: [EMAIL PROTECTED]
 Subject: Re: Getting started with flowscript
 
 
 David Leangen  wrote:
 
  -Original Message-
  From: David Leangen [mailto:[EMAIL PROTECTED]
  Sent: Thursday, May 13, 2004 10:37 AM
  To: [EMAIL PROTECTED]
  Subject: Getting started with flowscript
 
 
 
  I again turn to you for salvation.
 
  I'm finally ready to jump into flowscript... but I need a push in the
  right direction.
 
  Based on previous threads, it appears that a good approach (just to
  avoid saying best practice ;-) is to invoke the business logic from
  flowscript, set any values necessary, and call the values as needed
  within JXTemplates.
 
  Ok, fine.
 
  I made a trivial test class as follows:
 
  package test.model;
 
  public class Test
  {
  private String m_val;
 
  public Test()
  {
  }
 
  public void setVal(String val)
  {
  m_val = val;
  }
 
  public String getVal()
  {
  return m_val;
  }
  }
 
  In my flowscript, I make this call:
 
   var test = new test.model.Test();
 
 As far as I can see you have to use
 var test = Packages.test.model.Test();
 
 because your package is not in java.* .
 
   test.setVal(hello);
 
  I pass this along to the pipeline.
 
 You pass this with sendPage(YOURPIPE, {test:test}); ?
 
 
  So far, so good...
 
 
  Now, in my JXTemplate, I'd like to call the getVal() getter but
  how do I do this??
 
 You can access the values you passed with flowscript by using XPath ( 
 #{test/val} ) or Jexl Syntax ( ${test.val} ):
 http://cocoon.apache.org/2.1/userdocs/flow/jxtemplate.html
 
 Regards,
 Christian
 
 
 -
 To unsubscribe, e-mail: [EMAIL PROTECTED]
 For additional commands, e-mail: [EMAIL PROTECTED]

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



RE: Getting started with flowscript

2004-05-13 Thread Antonio Gallardo
David Leangen dijo:

 Holy service!!

 Thanks Antonio and Christian for the ultra-quick 911!!

:-)

For more info, you can see:
http://wiki.cocoondev.org/Wiki.jsp?page=GettingStartedWithFlow

Best Regards,

Antonio Gallardo


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