What is the best way to manage assets for forms and custom widgets ?

1
0
-1

Hi,

I'm writing this post to discuss asset management on forms, pages, and custom widgets. We are developing an application with a lot of complex custom widgets. These widgets rely on several angular modules and can have up to 15 javascript and css assets (some are developed by our team and some are third party libraries). Bonita offers two options : local files or external url.

Local is not a good solution, because each time we'll make changes on one of the files we will have to reupload it to UIDesigner. The best solution we've found so far is to make the tomcat server serve those assets as static files and reference them in custom widgets and pages with external urls. It works fine but we have to update the url of each assets when we deploy the application to another server so it matches the domain of the new server. For example : http://localhost:8080/assets/myfile.js becomes http://testserver:8080/assets/myfile.js.

How do you manage your assets ? What is the best way to do it ? I want to spend the minimal amount of time managing them during development and migration.

Thank you

Regards

Comments

Submitted by Sean McP on Mon, 10/05/2015 - 12:21

Does the widget need the whole address for the included Asset?

Does it not work using relative addresses to the Tomcat home directory?

For example instead of
http://localhost:8080/assets/myfile.js

is it possible to put

.../assets/myfile.js

In theory this should work like scripts in the HTML Head, not tried it but just an idea.

regards

Submitted by Quentin Choulet on Mon, 10/05/2015 - 12:25

Thanks for your reply, unfortunately it doesn't work. The UI-Designer considers the url invalid if it doesn't start with "http://"

Submitted by Sean McP on Mon, 10/05/2015 - 12:50

thinking out the box have you tried creating properties and giving a URL like this:
http://{server}{port}/assets/my.js

yes it accepts it ;)

I haven't tried it...

Otherwise we need to ask for it as a feature

regards

Submitted by Quentin Choulet on Mon, 10/05/2015 - 17:54

It doesn't work either. It looks like the brackets are not parsed : Chrome tries to fetch http://%7Bmyproperty%7D/assets/my.js, which fails with err::NAME_NOT_RESOLVED. I tried single brackets and double brackets. I also tried to access the property directly {myproperty} and from the properties object {properties.myproperty}.

Another workaround would be to concat all assets into one file. This way, only one url needs to be changed. However, we still have to makes changes on every widgets when deploying on the test server.

Using relative url to the Tomcat home directory would be perfect. Do you know where I can request a feature ?

Submitted by Sean McP on Tue, 10/06/2015 - 17:35

Add the Requirement to http://community.bonitasoft.com/ideas

and I'll support you, I'm sure several others will too.

regards

1 answer

1
0
-1

Anyone who likes this question please support the idea on the Ideas portal, the more supporters the more likely it will be built in to the product

Thanks

http://community.bonitasoft.com/ideas/bonita-7-support-relative-url-tomcat-home-directory-assets-pages-forms-and-custom-widgets

Notifications