Paulo Roberto Massa Cereda | 9 Jun 2012 03:43
Picon
Gravatar

Cayenne with the last Velocity release

Dear friends,

First of all, kudos to all developers for this great project. :) I have 
to say I'm really impressed and satisfied with Cayenne. It really makes 
things easier to model and implement.

First of all, apologies if this subject is recurring in the mailing 
list. I tried to follow some past messages hoping to find a workaround, 
but I had no luck so far.

One specific application of mine makes heavy use of Velocity for 
generating reports and other kinds of documents. Most of my templates 
are really complex, they make use of several features included in the 
most recent Velocity release (1.7). Long story short: these templates 
are not properly generated from Velocity shipped with Cayenne. :)

I would like to hear from you experienced Cayenne users if anyone has a 
successful story of Cayenne working with Velocity 1.7. The project I 
have is not Maven-based, but I don't see any restrictions in a possible 
migration if a possible solution requires it.

Thanks a lot for your time, and again thanks for making Cayenne a jewel 
in software development.

Best wishes,

Paulo

Aristedes Maniatis | 9 Jun 2012 11:21

Re: Cayenne with the last Velocity release

Depending on your build system, could you invoke different versions of velocity for the build environment
(Cayenne) and the runtime environment (your app)?

Alternatively, the velocity templates in Cayenne are quite simple. Perhaps you'd be able to review what
would be needed in upgrading them to velocity 1.7. I don't think it should be too hard... we'd be happy to see
your patches for inclusion in Cayenne. Personally I don't use Velocity outside of Cayenne, so I don't know
what is involved in the upgrade.

Ari

On 9/06/12 11:43am, Paulo Roberto Massa Cereda wrote:
> Dear friends,
>
> First of all, kudos to all developers for this great project. :) I have to say I'm really impressed and
satisfied with Cayenne. It really makes things easier to model and implement.
>
> First of all, apologies if this subject is recurring in the mailing list. I tried to follow some past
messages hoping to find a workaround, but I had no luck so far.
>
> One specific application of mine makes heavy use of Velocity for generating reports and other kinds of
documents. Most of my templates are really complex, they make use of several features included in the most
recent Velocity release (1.7). Long story short: these templates are not properly generated from
Velocity shipped with Cayenne. :)
>
> I would like to hear from you experienced Cayenne users if anyone has a successful story of Cayenne working
with Velocity 1.7. The project I have is not Maven-based, but I don't see any restrictions in a possible
migration if a possible solution requires it.
>
> Thanks a lot for your time, and again thanks for making Cayenne a jewel in software development.
>
(Continue reading)

Michael Gentry | 9 Jun 2012 14:19
Favicon

Re: Cayenne with the last Velocity release

Hi Paulo,

If you are using Maven to build your project, exclude Velocity from
the Cayenne dependency:

<dependency>
  <groupId>org.apache.cayenne</groupId>
  <artifactId>cayenne-server</artifactId>
  <version>3.0.2</version>
  <type>jar</type>
  <scope>compile</scope>
  <exclusions>
    <exclusion>
      <groupId>velocity</groupId>
      <artifactId>velocity</artifactId>
    </exclusion>
  </exclusions>
</dependency>

Then include your 1.7 dependency and Maven should package the correct
Velocity jar for you.  Cayenne's usage of Velocity is trivial and it
shouldn't be impacted by the version switch.

If you are using a different tool to build, I'm sure there is an
exclusion option for it as well.

mrg

On Fri, Jun 8, 2012 at 9:43 PM, Paulo Roberto Massa Cereda
<cereda.paulo <at> gmail.com> wrote:
(Continue reading)

Michael Gentry | 9 Jun 2012 14:34
Favicon

Re: Cayenne with the last Velocity release

"The project I have is not Maven-based..."

Sorry, I missed that.  What are you using to build?  If you are
manually managing JARs, you could always unpack the Cayenne JAR, rip
the old Velocity JAR out of it, and re-package it.

mrg

On Sat, Jun 9, 2012 at 8:19 AM, Michael Gentry <mgentry <at> masslight.net> wrote:
> Hi Paulo,
>
> If you are using Maven to build your project, exclude Velocity from
> the Cayenne dependency:
>
> <dependency>
>  <groupId>org.apache.cayenne</groupId>
>  <artifactId>cayenne-server</artifactId>
>  <version>3.0.2</version>
>  <type>jar</type>
>  <scope>compile</scope>
>  <exclusions>
>    <exclusion>
>      <groupId>velocity</groupId>
>      <artifactId>velocity</artifactId>
>    </exclusion>
>  </exclusions>
> </dependency>
>
> Then include your 1.7 dependency and Maven should package the correct
> Velocity jar for you.  Cayenne's usage of Velocity is trivial and it
(Continue reading)

Paulo Roberto Massa Cereda | 9 Jun 2012 16:58
Picon
Gravatar

Re: Cayenne with the last Velocity release

Hi Ari and Michael,

Thanks a lot for your feedback. I made some adjustments and I could 
deploy Velocity 1.7 with Cayenne. :)

Em 09/06/2012 06:21, Aristedes Maniatis escreveu:
 > Alternatively, the velocity templates in Cayenne are quite simple.
 > Perhaps you'd be able to review what would be needed in upgrading
 > them to velocity 1.7. I don't think it should be too hard... we'd
 > be happy to see your patches for inclusion in Cayenne. Personally I
 > don't use Velocity outside of Cayenne, so I don't know what is
 > involved in the upgrade.

Bear with me, I'm a humble Cayenne newcomer. :) I'll take a look in how 
Cayenne deals with Velocity, check the possible conflicts and report 
back to you (maybe in the dev list?). As Michael mentioned in his reply, 
the use is probably trivial enough to not break Cayenne in a possible 
Velocity upgrade. :)

One "recent" feature from Velocity that I use *a lot* is the static 
classes support -- probably from 1.6 on, IIRC. I usually have to export 
data to several formats, including ReST and LaTeX, and some helper 
static classes might help in the process. For example, I use LambdaJ to 
write more fluent template code, or use some utilitary classes instead 
of a hardcoded data preprocessing (e.g, remove accents from a string). 
That way, my templates are more flexible, at the cost of complexity. But 
we do love write code, don't we? :P

Em 09/06/2012 09:19, Michael Gentry escreveu:
 > If you are using Maven to build your project, exclude Velocity from
(Continue reading)


Gmane