Deploy reports in .war - Question

Forum to discuss the new web client version of Servoy.

Deploy reports in .war - Question

Postby vik.lamp.vl » Thu Nov 09, 2023 11:52 am

Hey guys,

i have a question, maybe you guys can help me with that.

How it is: for our customers we deploy updates via the .war, which we just copy into the tomcat. (We created a little c# service which does that automaticly when we release a update)
If we have new reports or report-updates (jasper & velocity) we replace them in c:\servoy-programm\reports\ for example.

Now my idea, cant we deliver the reports IN/THROUGH the .war? Because in the servoy-admin under plugin-setting we can set the jasper-path like /lib/reports...

If yes, how do we put the reports in the .war? Just open the .war with winRar and place them there?
There must be a better/right way to do this.

Maybe place the reports in some specific .metadata folder of the workspace, or create the .war over the commandline but with a extra parameter "take these files XXX in the .war too".


I hope my question is understandable and u guys have ideas for it :)

Greetings
-Vik
vik.lamp.vl
 
Posts: 23
Joined: Wed May 26, 2021 3:37 pm
Location: Germany

Re: Deploy reports in .war - Question

Postby mboegem » Thu Nov 09, 2023 1:54 pm

Hi Vik,

Yes you can do this, but this won't really work in a cluster of application servers.
In that case you will probably also need some shared storage.

A solution that is more solid is this:
1) store reports in a reports folder in the media library.
2) use a post-import solution to trigger a function that will write out the reports folder to the default servoy upload location (which can be set to any shared storage location)
3) point the jasper/velocity folder to the correct location (being reports folder inside the default servoy upload location
4) problem solved.

BTW, for smaller projects I take the approach of customising the WAR file through a shell script, this has been working fine for a long time but has its limitations on larger deployments.

Hope this helps
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1725
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Deploy reports in .war - Question

Postby vik.lamp.vl » Fri Nov 10, 2023 1:47 pm

Hi Marc,

thanks for the info!
I didnt even think about the media -> post import hook methode. I´ll look into it.

For the part with smaller projects and customizing the war through shell. That sounds exactly what i am looking for.
Can you share your shell-script with me? So i have a approach on how to do it?

Thanks and Greetings
-Vik
vik.lamp.vl
 
Posts: 23
Joined: Wed May 26, 2021 3:37 pm
Location: Germany

Re: Deploy reports in .war - Question

Postby mboegem » Mon Nov 13, 2023 2:02 pm

Hi Vik,

This is the shell script:
Code: Select all
#!/bin/sh
filename=$(basename "$0")
filename="${filename%.*}"
appname="$(cut -d'_' -f2 <<<$filename)"
environment="$(cut -d'_' -f3 <<<$filename)"
warname_source="$appname.war"
warname_target="ROOT_$environment.war"

cd "$(dirname "$0")"
cd "$environment/custom"

zip -r ../../$warname_source * -O ../../$warname_target -x "*.DS_Store" -x "__MACOSX"
#zip -d ../../$warname_target "WEB-INF/lib/org.apache.commons.commons-text_1.9.0.jar"


Input/output is based on the name, so 'build_vik_test.sh' will result in customizing the exported vik.war file with the content of the 'test' folder and an output file named ROOT_vik_test.war

The folder structure looks like this (where 'custom' is basically pointing to the ROOT of the war file):
build.png
You do not have the required permissions to view the files attached to this post.
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1725
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: Deploy reports in .war - Question

Postby vik.lamp.vl » Mon Nov 13, 2023 2:14 pm

Hi Marc,

thanks alot! Im gonna try it this way.
We just want to optimize our deployment until we go full-cloud, so that report in war idea is one step :)

Thanks and have a nice day!

-Vik
vik.lamp.vl
 
Posts: 23
Joined: Wed May 26, 2021 3:37 pm
Location: Germany


Return to Servoy NGClient

Who is online

Users browsing this forum: No registered users and 1 guest