/ Development  

Make a web library definition work for you

Hi there AppWorks fans,

Welcome to a new installment of AppWorks tips.

And in this post we’ll talk and make use of a new type of document called ‘Web Library Definition’. Not hard to work with but required if you want to expose ‘assets’ like images or icons to your runtime environment for our beloved users.


Let get right into it…

We have 2 situations we’ll try out…

Publish the solution without WLD

Let’s say we have this start situation with some assets and some basic entities.

wld_001

On the ‘Category’ entity we have a Boolean property that looks like this (with those 2 flag icons select from the above assets folder!):

wld_002

And on that same entity we have a ‘Create’ form that uses that property like this (and it shows the icons!)

wld_003

Let’s publish this entity and jump to the runtime of our environment (/app/start)

Now create a new instance of the entity and see what happens:

wld_004

Yes…No icons!

Check the developer tools with <F12> for more details!

And there you have your 404 error for not finding the ‘asset’

wld_005

When we also look in the webroot folder on the file storage you will also find nothing that indeed points to this location: /opt/opentext/AppWorksPlatform/defaultInst/webroot/organization/appworks_tips/

Let’s fix this with a Web Library Definition!


Publish with WLD

Go back to the design-time where (hopefully) your project is still open and right click on the assets folder for the creation of a new time of document.

wld_006

Create the new WLD like this with the name ‘Assets Web Library Definition’

wld_007

Save it and publish it directly (no need to publish on project level).

Now go to the storage location and see some magic happening!

ls /opt/opentext/AppWorksPlatform/defaultInst/webroot/organization/appworks_tips/assets/icons/

wld_008

The assets are published now in the ‘webroot’ folder…great!

Let’s jump back to the front-end for a refresh…

And there we are! 🤟

wld_009


That was a simple “DONE”. Nothing more to say and nothing more to show. Simple stuff, but now you know how it works in the back end also and why you need this type of document! Have a great day with lots of information to experience.

Don’t forget to subscribe to get updates on the activities happening on this site. Have you noticed the quiz where you find out if you are also “The AppWorks guy”?