You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@commons.apache.org by David Wynter <da...@stpenable.com> on 2004/11/06 16:33:35 UTC

[Jelly] More accessible general examples?

Hi,

I have used Jelly exclusivelywith blissed until now. When I needed to use it
for a broader purpose I found it really difficult to find decent examples. I
have Jelly embedded and find the exceptions return are fairly useless. While
the tag libs are pretty well catered for in the test script more general
things like how to concatenate a string I have found nowhere. So here is my
script

<j:jelly xmlns:j="http://www.blah.com/ns/jelly"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://www.blah.com/ns/jelly jelly.xsd"
xmlns:sql="jelly:sql">
  <j:set var="datepattern" value="MMdd"/>
  <j:set var="databaseUrl"
value="jdbc:jtds:sqlserver://localhost:1433/RWTransformer"/>
  <j:set var="databaseDriver" value="net.sourceforge.jtds.jdbc.Driver"/>
  <j:set var="databaseUser" value="Loader"/>
  <j:set var="databasePassword" value="********"/>
  <j:new className="java.util.Date" var="today"/>
  <j:new className="java.text.SimpleDateFormat" var="sdf"/>
  <j:invoke method="applyPattern" on="${sdf}">
      <j:arg value="${datepattern}"/>
  </j:invoke>
  <j:invoke method="format" on="${sdf}" var="partdatestr">
      <j:arg value="${today}"/>
  </j:invoke>
  <j:set var="pattern" value="????"+"${partdatestr}"+".I"/>
  <sql:setDataSource url="${databaseUrl}" driver="${databaseDriver}"
user="${databaseUser}"
    password="${databasePassword}"/>
  <sql:update>
      update rw_file set filename_pattern=?
      <sql:param value="${pattern}"/>
  </sql:update>
</j:jelly>

The best the excpetion can give me is "Process script could not be compiled
and therefore run." which doesn't really help me. Trying to trace into Jelly
to find out the problem is a nightmare, so quickly gave up on that. Is there
some sort of console application in which you can test Jelly scripts that
gives decent exception, like where the syntax error is?

Thx.

David Wynter


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


Re: [Jelly] More accessible general examples?

Posted by Dion Gillard <di...@gmail.com>.
Or you could use the dist:install goal.


On Sun, 7 Nov 2004 09:01:29 +0100, Paul Libbrecht <pa...@activemath.org> wrote:
> org.apache.commons.jelly.Jelly is runnable on the command-line.
> However, you need a huge classpath!
> 
> There's two ways for you in the maven.xml
> 
> • maven pack-fat-jar
> will (by default) pack you a large jar merging all classes needed to
> run most of the taglibs, at least those without
> non-downloadable-dependencies. Has the option of building them all or
> fetching them from the maven remote repo.
> 
> • using the same goal... you'll find a ": or ;"-separated list of jars
> jelly depends-on, mostly inside the repository.
> This ca be used with good command-line on unices:
>    java -classpath `cat target/classpath-with-deps.txt` \
>       org.apache.commons.jelly.Jelly theFile.jelly
> (or your own main-class and params)
> (target/classpath-with-deps.txt is the default value of classpathFile)
> 
> Hope that helps.
> 
> paul
> 
> Le 7 nov. 04, à 06:56, A Leg a écrit :
> 
> 
> > Can you explain and give details, please.
> > org.apache.commons.jelly.Jelly is not runnable on the command line.
> > Do you mean to write a very basic java code using
> > org.apache.commons.jelly.Jelly ?
> >
> > I am begenner with jelly.
> >
> > Thank's
> >
> > Andre
> >
> > Paul Libbrecht wrote:
> >
> >> At least his sounds to be non-well-formed XML.
> >>
> >> Le 6 nov. 04, à 16:33, David Wynter a écrit :
> >>
> >>>   <j:set var="pattern" value="????"+"${partdatestr}"+".I"/>
> >>
> >>
> >> Generally, using org.apache.commons.jelly.Jelly can run the script
> >> as-is on the command-line.
> >> Errors will be reported as exception with their stacktrace. But
> >> generally the exception message (a large amount of lines above) gives
> >> you a line-number (try find "fileName.jelly:####" where #### is a
> >> number).
> >>
> >> paul
> >>
> >>
> >> ---------------------------------------------------------------------
> >> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> >> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >>
> >>
> >
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> > For additional commands, e-mail: commons-user-help@jakarta.apache.org
> >
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
> 
> 


-- 
http://www.multitask.com.au/people/dion/

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


Re: [Jelly] More accessible general examples?

Posted by Paul Libbrecht <pa...@activemath.org>.
org.apache.commons.jelly.Jelly is runnable on the command-line.
However, you need a huge classpath!

There's two ways for you in the maven.xml

• maven pack-fat-jar
will (by default) pack you a large jar merging all classes needed to 
run most of the taglibs, at least those without 
non-downloadable-dependencies. Has the option of building them all or 
fetching them from the maven remote repo.

• using the same goal... you'll find a ": or ;"-separated list of jars 
jelly depends-on, mostly inside the repository.
This ca be used with good command-line on unices:
   java -classpath `cat target/classpath-with-deps.txt` \
      org.apache.commons.jelly.Jelly theFile.jelly
(or your own main-class and params)
(target/classpath-with-deps.txt is the default value of classpathFile)

Hope that helps.

paul


Le 7 nov. 04, à 06:56, A Leg a écrit :
> Can you explain and give details, please.
> org.apache.commons.jelly.Jelly is not runnable on the command line.
> Do you mean to write a very basic java code using 
> org.apache.commons.jelly.Jelly ?
>
> I am begenner with jelly.
>
> Thank's
>
> Andre
>
> Paul Libbrecht wrote:
>
>> At least his sounds to be non-well-formed XML.
>>
>> Le 6 nov. 04, à 16:33, David Wynter a écrit :
>>
>>>   <j:set var="pattern" value="????"+"${partdatestr}"+".I"/>
>>
>>
>> Generally, using org.apache.commons.jelly.Jelly can run the script 
>> as-is on the command-line.
>> Errors will be reported as exception with their stacktrace. But 
>> generally the exception message (a large amount of lines above) gives 
>> you a line-number (try find "fileName.jelly:####" where #### is a 
>> number).
>>
>> paul
>>
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
>> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>>
>>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>


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


Re: [Jelly] More accessible general examples?

Posted by A Leg <ha...@yahoo.com>.
Hi Paull

Can you explain and give details, please.
org.apache.commons.jelly.Jelly is not runnable on the command line.
Do you mean to write a very basic java code using 
org.apache.commons.jelly.Jelly ?

I am begenner with jelly.

Thank's

Andre

Paul Libbrecht wrote:

> At least his sounds to be non-well-formed XML.
>
> Le 6 nov. 04, à 16:33, David Wynter a écrit :
>
>>   <j:set var="pattern" value="????"+"${partdatestr}"+".I"/>
>
>
> Generally, using org.apache.commons.jelly.Jelly can run the script 
> as-is on the command-line.
> Errors will be reported as exception with their stacktrace. But 
> generally the exception message (a large amount of lines above) gives 
> you a line-number (try find "fileName.jelly:####" where #### is a 
> number).
>
> paul
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: commons-user-unsubscribe@jakarta.apache.org
> For additional commands, e-mail: commons-user-help@jakarta.apache.org
>
>


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


Re: [Jelly] More accessible general examples?

Posted by Paul Libbrecht <pa...@activemath.org>.
At least his sounds to be non-well-formed XML.

Le 6 nov. 04, à 16:33, David Wynter a écrit :
>   <j:set var="pattern" value="????"+"${partdatestr}"+".I"/>

Generally, using org.apache.commons.jelly.Jelly can run the script 
as-is on the command-line.
Errors will be reported as exception with their stacktrace. But 
generally the exception message (a large amount of lines above) gives 
you a line-number (try find "fileName.jelly:####" where #### is a 
number).

paul


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