Re: Logicsheet Woes with Esql and XSP Logic

2002-04-06 Thread Christian Haul

On 05.Apr.2002 -- 10:59 PM, Sharat Koya wrote:
 Hi help on this problem would be much appreciated since I have been stuck
 with it for a few days of coding.
 I have a logicsheet that runs mysql statments and returns values from the
 database.
 
 In my logic (in the file using the logic sheet) I have the statment that
 trys to assign a value from the database. I have tested my logicsheet on its
 own and it works fine, however Cocoon returns the error below when I try to
 assign the value to a java variable. can anyone help?
 
 thanks
 
 Sharat Koya
 
 Calling code
 mercurySun = eclipse-data:get-planet-data data=sundist name=Mercury/;
 --
 Error:
 org.apache.cocoon.ProcessingException: Language Exception:
 org.apache.cocoon.components.language.LanguageException: Error compiling
 register_xsp:
 Line 1652, column 4:  illegal start of expression
 Line 0, column 0:
 1 error
 --
 This is the segment of code where the error occurs:
 
 line 1652:
   mercurySun =
 if (_esql_connection != null)
  {_esql_connections.push(_esql_connection);
 
  }
 _esql_connection = new EsqlConnectionCocoon2();
try {
 try {
 _esql_connection.datasource = (DataSourceComponent)
 _esql_selector.select(String.valueOf(  + (database) ));
 _esql_connection.connection =
 _esql_connection.datasource.getConnection();
   } catch (Exception _esql_exception_N10170) {
 getLogger().error(Could not get the
 datasource,_esql_exception_N10170);
 throw new RuntimeException(Could not get the datasource
 +_esql_exception_N10170);
   }
 

Sharat,
your logicsheet seems to expand eclipse-data:get-planet-data/ to more that 
a simple esql:get-XXX/. You should create a tag that does all the connection
setup and nest the eclips-data:get-planet-data/ inside.

Chris.

-- 
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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

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




Re: Logicsheet Woes with Esql and XSP Logic

2002-04-06 Thread Sharat Koya


- Original Message -
From: Christian Haul [EMAIL PROTECTED]
To: [EMAIL PROTECTED]
Sent: Saturday, April 06, 2002 6:47 PM
Subject: Re: Logicsheet Woes with Esql and XSP Logic


 On 05.Apr.2002 -- 10:59 PM, Sharat Koya wrote:
  Hi help on this problem would be much appreciated since I have been
stuck
  with it for a few days of coding.
  I have a logicsheet that runs mysql statments and returns values from
the
  database.
 
  In my logic (in the file using the logic sheet) I have the statment that
  trys to assign a value from the database. I have tested my logicsheet on
its
  own and it works fine, however Cocoon returns the error below when I try
to
  assign the value to a java variable. can anyone help?
 
  thanks
 
  Sharat Koya
 
  Calling code
  mercurySun = eclipse-data:get-planet-data data=sundist
name=Mercury/;
  --
  Error:
  org.apache.cocoon.ProcessingException: Language Exception:
  org.apache.cocoon.components.language.LanguageException: Error compiling
  register_xsp:
  Line 1652, column 4:  illegal start of expression
  Line 0, column 0:
  1 error
  --
  This is the segment of code where the error occurs:
 
  line 1652:
mercurySun =
  if (_esql_connection != null)
   {_esql_connections.push(_esql_connection);
 
   }
  _esql_connection = new EsqlConnectionCocoon2();
 try {
  try {
  _esql_connection.datasource = (DataSourceComponent)
  _esql_selector.select(String.valueOf(  + (database) ));
  _esql_connection.connection =
  _esql_connection.datasource.getConnection();
} catch (Exception _esql_exception_N10170) {
  getLogger().error(Could not get the
  datasource,_esql_exception_N10170);
  throw new RuntimeException(Could not get the datasource
  +_esql_exception_N10170);
}
 

 Sharat,
 your logicsheet seems to expand eclipse-data:get-planet-data/ to more
that
 a simple esql:get-XXX/. You should create a tag that does all the
connection
 setup and nest the eclips-data:get-planet-data/ inside.

 Chris.

 --
 C h r i s t i a n   H a u l
 [EMAIL PROTECTED]
 fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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

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



The function eclipse-data:get-planet-data data=sundist name=Mercury/
expands as follows:
connect to the database using esql and return the value as a double.

All the function does is return the value from the database without any
surronding tags.

Since I first posted this message I changed the function so that instead of
assigning mercurySun (java double variable) as follows:
mercurySun = eclipse-data:get-planet-data data=sundist name=Mercury/;

I now have:
eclipse-data:get-planet-data data=sundist name=Mercury
variable=mercurySun/
where the function in the logicsheet assigns assigns the value. This works
fine, I'm still not that advanced in using Cocoon and so cannot workout why
I can't assign the value in the calling XSP file rather than the logicsheet.
If you can it would be aprreciated. It is a bit annoying to do the above but
it has shortend my code by quite a considerable amount compared to entering
a multitude of esql commands and logic.

Thanks
Sharat Koya



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

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




Re: Logicsheet Woes with Esql and XSP Logic

2002-04-06 Thread Christian Haul

On 06.Apr.2002 -- 07:04 PM, Sharat Koya wrote:
 - Original Message -
 From: Christian Haul [EMAIL PROTECTED]
 
  On 05.Apr.2002 -- 10:59 PM, Sharat Koya wrote:
   mercurySun = eclipse-data:get-planet-data data=sundist
 name=Mercury/;
   --
 mercurySun =
   if (_esql_connection != null)
{_esql_connections.push(_esql_connection);
  
}
   _esql_connection = new EsqlConnectionCocoon2();
  try {
   try {
   _esql_connection.datasource = (DataSourceComponent)
   _esql_selector.select(String.valueOf(  + (database) ));
   _esql_connection.connection =
   _esql_connection.datasource.getConnection();
 } catch (Exception _esql_exception_N10170) {
   getLogger().error(Could not get the
   datasource,_esql_exception_N10170);
   throw new RuntimeException(Could not get the datasource
   +_esql_exception_N10170);
 }
  
 
  Sharat,
  your logicsheet seems to expand eclipse-data:get-planet-data/ to more
 that
  a simple esql:get-XXX/. You should create a tag that does all the
 connection
  setup and nest the eclips-data:get-planet-data/ inside.
 
 The function eclipse-data:get-planet-data data=sundist name=Mercury/
 expands as follows:
 connect to the database using esql and return the value as a double.

Yep, this translates to the code above. Don't forget that in the end,
*all* logicsheets are translated to java. Somewhere the connection has
to be obtained. Obviously, you can't do that in the middle of an assignment.

 All the function does is return the value from the database without any
 surronding tags.
 
 Since I first posted this message I changed the function so that instead of
 assigning mercurySun (java double variable) as follows:
 mercurySun = eclipse-data:get-planet-data data=sundist name=Mercury/;
 
 I now have:
 eclipse-data:get-planet-data data=sundist name=Mercury
 variable=mercurySun/
 where the function in the logicsheet assigns assigns the value. This works
 fine, I'm still not that advanced in using Cocoon and so cannot workout why
 I can't assign the value in the calling XSP file rather than the logicsheet.

see above.

 If you can it would be aprreciated. It is a bit annoying to do the above but
 it has shortend my code by quite a considerable amount compared to entering
 a multitude of esql commands and logic.

you could

  eclipse-data:connect
 xsp:logic
 mercurySun = eclipse-data:get-planet-data ./;
 .
 /xsp:logic
  /eclipse-data:connect

with eclipse-date:connect/ translating to 
esql:connectesql:execute-queryesql:query...

HTH

Chris.

-- 
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

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

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




RE: Logicsheet Woes with Esql and XSP Logic

2002-04-06 Thread Sharatkoya

Ah cunning. 
Thanks
Sharat koya


-Original Message-
From: Christian Haul [mailto:[EMAIL PROTECTED]] 
Sent: Saturday, 06 April 2002 20:30
To: [EMAIL PROTECTED]
Subject: Re: Logicsheet Woes with Esql and XSP Logic

On 06.Apr.2002 -- 07:04 PM, Sharat Koya wrote:
 - Original Message -
 From: Christian Haul [EMAIL PROTECTED]
 
  On 05.Apr.2002 -- 10:59 PM, Sharat Koya wrote:
   mercurySun = eclipse-data:get-planet-data data=sundist
 name=Mercury/;
   --
 mercurySun =
   if (_esql_connection != null)
{_esql_connections.push(_esql_connection);
  
}
   _esql_connection = new EsqlConnectionCocoon2();
  try {
   try {
   _esql_connection.datasource = (DataSourceComponent)
   _esql_selector.select(String.valueOf(  + (database) ));
   _esql_connection.connection =
   _esql_connection.datasource.getConnection();
 } catch (Exception _esql_exception_N10170) {
   getLogger().error(Could not get the
   datasource,_esql_exception_N10170);
   throw new RuntimeException(Could not get the
datasource
   +_esql_exception_N10170);
 }
  
 
  Sharat,
  your logicsheet seems to expand eclipse-data:get-planet-data/ to
more
 that
  a simple esql:get-XXX/. You should create a tag that does all the
 connection
  setup and nest the eclips-data:get-planet-data/ inside.
 
 The function eclipse-data:get-planet-data data=sundist
name=Mercury/
 expands as follows:
 connect to the database using esql and return the value as a double.

Yep, this translates to the code above. Don't forget that in the end,
*all* logicsheets are translated to java. Somewhere the connection has
to be obtained. Obviously, you can't do that in the middle of an
assignment.

 All the function does is return the value from the database without
any
 surronding tags.
 
 Since I first posted this message I changed the function so that
instead of
 assigning mercurySun (java double variable) as follows:
 mercurySun = eclipse-data:get-planet-data data=sundist
name=Mercury/;
 
 I now have:
 eclipse-data:get-planet-data data=sundist name=Mercury
 variable=mercurySun/
 where the function in the logicsheet assigns assigns the value. This
works
 fine, I'm still not that advanced in using Cocoon and so cannot
workout why
 I can't assign the value in the calling XSP file rather than the
logicsheet.

see above.

 If you can it would be aprreciated. It is a bit annoying to do the
above but
 it has shortend my code by quite a considerable amount compared to
entering
 a multitude of esql commands and logic.

you could

  eclipse-data:connect
 xsp:logic
 mercurySun = eclipse-data:get-planet-data ./;
 .
 /xsp:logic
  /eclipse-data:connect

with eclipse-date:connect/ translating to
esql:connectesql:execute-queryesql:query...

HTH

Chris.

-- 
C h r i s t i a n   H a u l
[EMAIL PROTECTED]
fingerprint: 99B0 1D9D 7919 644A 4837  7D73 FEF9 6856 335A 9E08

-
Please check that your question has not already been answered in the
FAQ before posting. http://xml.apache.org/cocoon/faqs.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/faqs.html

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