This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal



Dec 19, 2011, 4:05 PM
38 Posts

Creating script libraries with / without .js extension

  • Category: Other
  • Platform: Windows
  • Release: 8.5.3
  • Role: Developer
  • Tags: xpages,Domino Designer
  • Replies: 3
 Let's say, I create a two JavaScript libraries (client side) in my database. I name them "Test1.js" and "Test2" (omit the .js extension from second one while entering name in "New Script Library" dialog box). 
 
If I add "Test1.js" to my XPage, it generate source as 
 
<script type="text/javascript" src="/mbl.nsf/Test1.js"></script>
 
If I add "Test2" to my XPage, it generates source as
 
<script type="text/javascript" src="/mbl.nsf/Test2"></script> (Notice the .js extension is not there)
 
If I import both the script libraries then I get source as
 
<script type="text/javascript" src="/mbl.nsf/xsp/.ibmmodres/.js/Test1.js&amp;Test2.js"></script> 
 
This brings to my first question. What special purpose does ".ibmmodres" serve? I wasn't able to find it in the XPages cheatsheet.
 
In the design properties of the script libraries the "$TITLE" field shows "Test1.js" and "Test2" respectively. But in the package explorer it shows "Test1.js" & "Test2.js" (the .js extension is shown in package explorer). Why?
 
Sometimes, I need to compute the name of script library so I use the <xp:headTag>. 
 
<xp:headTag tagName="script" rendered="true" loaded="true">
<xp:this.attributes>
<xp:parameter name="script" value="text/javascript" />
<xp:parameter name="src" value="Test2" />
</xp:this.attributes>
</xp:headTag>
 
This time I need to specify the exact name script library, "Test1.js" (with extension) and "Test2" (without extension). Also I noticed that while opening the script library using URLs I have to write like
 
http://<SERVER NAME>/<DATABSE PATH>/Test1.js
http://<SERVER NAME>/<DATABSE PATH>/Test2
 
This leads to my third question. Why does Lotus Notes not put .js extension in the script library if it is not present? Because some developers write with .js and others without .js, it often leads to errors. Is it a bug?
Dec 22, 2011, 11:30 AM
272 Posts
Re: Creating script libraries with / without .js extension
Hi,
 
to answer your first question:
 
<script type="text/javascript" src="/mbl.nsf/xsp/.ibmmodres/.js/Test1.js&amp;Test2.js"></script>
/.ibmmodres/ is internally used by the domino server. It is an identifier how to handle the current request (with a module, not as an on disc-resource).
 
<script type="text/javascript" src="/mbl.nsf/xsp/.ibmmodres/.js/Test1.js&amp;Test2.js"></script>
The /.js/ behind this is the identifier how to handle the following ressources (as a javascript ressource).
 
<script type="text/javascript" src="/mbl.nsf/xsp/.ibmmodres/.js/Test1.js&amp;Test2.js"></script>
The names of the script libraries for internal identification (this is a "tribute" to the mime handling which uses the file name of the requested resource for type identification).
 
The idea behind is to minimize the requests to the domino server for a better performance of web pages.
 
To answer the second and third question:
No, it is not a bug. The name you give to the resources is your free choice. You can name them whatever you want to (with/without extensions) etc. This is the name inside the "$Title" Field, and is the Notes name. In the package explorer you see the files "raw", that means that eclipse stores javascript files with .js extension.
 
Hope this helps
Sven
 
Dec 23, 2011, 5:16 AM
38 Posts
Re: Creating script libraries with / without .js extension
Thanks for the reply Sven.
 
So I guess when using <xp:headTag> I need to use the exact name of the script library that I gave them while creating them. Right?
 
Also, by any chance your blog "http://hasselba.ch/blog/" is available in English? :)
 
 
Dec 28, 2011, 7:45 AM
170 Posts
Re: use Chrome it will translate for you <eom>

This forum is closed to new posts and responses. Individual names altered for privacy purposes. The information contained in this website is provided for informational purposes only and should not be construed as a forum for customer support requests. Any customer support requests should be directed to the official HCL customer support channels below:

HCL Software Customer Support Portal for U.S. Federal Government clients
HCL Software Customer Support Portal