Jazz Forum Welcome to the Jazz Community Forum Connect and collaborate with IBM Engineering experts and users

[PUB] How do you dynamically load local javascipt files from file system to include as a javascript library

In a pub template you are able to add a javascript library

and use similar format

<Script src= "https://httpserver/JazzPublishingScripts/GlobalSecurityMarkingUtility.js"></Script>

or
<Script src= "library://api/scripts/7451"></Script>

This works well except when we are developing the libraries when we need to load them of a local file system.

Is there a format that allows you to dynamically load java script from the files system..

Looking for a format like..

<Script src= "scripts/myscript.js"></Script>
or
<Script src= "c:/scripts/myscript.js"></Script>

This would allow us to work as a team and maintain the scripts in EWM with some source control.

I have asked support already and got a very unsatisfactory answer and they just point me to the documentation which does not discuss this.

Thanks

0 votes



2 answers

Permanent link

Hi Peter,


In ELM Publishing PUB JavaScript can only be loaded from supported server accessible locations. The supported options are loading scripts from the JazzPublishingScripts directory on the server or from the Document Builder script library.


Using the Document Builder script library allows scripts to be shared across multiple templates and users. These scripts are centrally managed on the PUB server and work consistently in both Studio and during runtime publishing.


Loading JavaScript directly from a local file system is not supported. Examples include referencing scripts from a local folder or from a local drive on an individual machine. This limitation is by design.


Local file system references would only work for a single Studio installation and would not be available to other users or to the publishing server. Allowing local file access would also introduce security concerns in a shared server environment.


For team based development and source control the recommended approach is to maintain the JavaScript source in EWM or another version control system and then deploy the approved version into the PUB Document Builder script library. This ensures scripts are reusable secure and accessible to all users in shared publishing scenarios.

0 votes

Comments
Can you tell us more about how the Document Builder script library location is set up in each user's Studio installation?

The issue we are facing is that:
- users work on version controlled templates and scripts
- they make a change to the script that they need for their work
- they need to then test their templates and the modified script before they deliver their changes

At the moment, script changes cannot be tested unless they are deployed to a central location, and this is not desirable if the change affects other templates being worked on or used by others

The solution to use Pub server to host the javascript is a very limited option. You are unable to have version control and you can not access the javascript files from other Pub servers. We are forced to use a separate web server to host the files so that javascript files can be used across servers.  


You also can not dynamically reference libraries so if you change it for one then you change it for all.. not a lot of use for development.. with the suggestion above we would need to maintain a copy of the scripts for each user doing development (ewm can do that).. deploy each users workspace version onto the server with different names.. change the references manually in the dta file.. this is a complete waste of energy to work through limitations of the product.


1 vote


Permanent link

you can connect document builder to each studio as below 


0 votes

Your answer

Register or log in to post your answer.

Dashboards and work items are no longer publicly available, so some links may be invalid. We now provide similar information through other means. Learn more here.

Search context
Follow this question

By Email: 

Once you sign in you will be able to subscribe for any updates here.

By RSS:

Answers
Answers and Comments
Question details
× 12,129

Question asked: Dec 18 '25, 8:13 p.m.

Question was seen: 582 times

Last updated: Jan 07, 1:32 a.m.

Confirmation Cancel Confirm