Focal Point Banner


As of December 1, 2020, Focal Point is retired and repurposed as a reference repository. We value the wealth of knowledge that's been shared here over the years. You'll continue to have access to this treasure trove of knowledge, for search purposes only.

Join the TIBCO Community
TIBCO Community is a collaborative space for users to share knowledge and support one another in making the best use of TIBCO products and services. There are several TIBCO WebFOCUS resources in the community.

  • From the Home page, select Predict: WebFOCUS to view articles, questions, and trending articles.
  • Select Products from the top navigation bar, scroll, and then select the TIBCO WebFOCUS product page to view product overview, articles, and discussions.
  • Request access to the private WebFOCUS User Group (login required) to network with fellow members.

Former myibi community members should have received an email on 8/3/22 to activate their user accounts to join the community. Check your Spam folder for the email. Please get in touch with us at community@tibco.com for further assistance. Reference the community FAQ to learn more about the community.


Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     DS HTML Composer: Insert JavaScript files

Read-Only Read-Only Topic
Go
Search
Notify
Tools
DS HTML Composer: Insert JavaScript files
 Login/Join
 
Expert
posted
I have an HTML Composer composed file in Managed Reporting. I want to insert two JavaScript files. They are located in the web applications area of Dev Studio Explorer and are named jquery-latest.js and jquery-selectboxes.js.

I select Insert > CSS/Scripts... I add the Javascript files by pointing to the application folder in the Web Applications area and selecting the two files.

I expect the script tags that are added to the HTML Composer composed file refer to the files that I pointed to, but, NO, they point to copied files in the Other folder of the MRE Domain the HTML Composer file is located in. Why on earth is this happening? The names of these files were changed to jquerylatest.js and jqueryselectboxes.js and all my jQuery-related code stopped working.

I KNOW I"M NOT SUPPOSED TO DO THIS, but I modified the code to refer to the files I want it to:

<script id=ITEM3 type=text/javascript src="/approot/app001/jquery-latest.js">

and things started working again.

I don't understand why we have to fight this thing.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
quote:
why we have to fight this thing

I am feeling very sorry for you, having read all the 'niceties' you found in this composter (I kinda like the typo Hakan made...).
My advice would be to try and convince your customer that going GUI with this product is not the way to go. It's far more cost expensive than typing it all in manually, and that includes documenting what you did for future maintenance.


GamP

- Using AS 8.2.01 on Windows 10 - IE11.
in Focus since 1988
 
Posts: 1961 | Location: Netherlands | Registered: September 25, 2007Report This Post
Guru
posted Hide Post
Perhaps you don't understand how Managed Reporting works. It can only see things in its space, meaning the domain and apps that domain is assigned to get master files. So JS files must be in the domain, hence the copy. Now, the removal of the hyphen is a different issue and I suggest you open a case for that.


David Glick
Director WebFOCUS App Studio
and WebFOCUS Developer Studio
WebFOCUS Division
Information Builders, Inc.
Direct (917) 339-5560
Voice Mail (212) 736-6250 x3560
Fax (212) 947-5168
Email david_glick@ibi.com
 
Posts: 315 | Registered: April 13, 2004Report This Post
Virtuoso
posted Hide Post
The same happens in self service reports, actually. Same for CSS.

I once opened a case on this and got told that Dev Studio has to behave this way because it can't know where the JS files reside on the web-server, hence it copies the files to a location where it knows how to handle the link.

That's a pretty stupid thing to do and the reason is almost as stupid, but that's what it does and why.

It would be far better to allow people to enter a URL for JS or CSS references. "Including" javascript using a file dialog is not just clumsy, it is the wrong thing to do: Often it is not a local file.

Edit: It would appear I got told the above on these forums, as I can't find a related case - or I'm not looking close enough, I have many many cases...


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
quote:
Perhaps you don't understand how Managed Reporting works

Actually I do.

If I didn't, why do my manually edited script to reference files in the web applications folder work?

Perhaps it is Managed Reporting that doesn't know how the web works. One has to assume MRE is on the same server as the web server, so it should be able to point to files in the web applications folder - isn't this where web server aliases help?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
Well, actually... files that are served statically can be on a different server. With self-service reports, for example, you can create a deploy "file" for your project. If you inspect what it creates by default, you will see that the fex and master files and such go to the EDA/EDASERVE/APPATH/projectname directory, while HTML, javascript and CSS files go to the WEB/projectname directory.
IBI makes a distinction between statically served files and dynamically served files.

I'm not saying I agree with how they handle inclusion of statically served files, I'm just saying the problem they are trying to solve is a little more complicated than it looks. IMHO, they should at least give us the option to use an URL instead of a file-name there.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
"while HTML, javascript and CSS files go to the WEB/projectname directory" - this is exactly the same server that MRE is hosted on.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Virtuoso
posted Hide Post
In your case, yes. As it is in ours. But it doesn't need to be, and that's what makes it a more difficult problem.

They're trying to solve the wrong problem, but that's the rationale for why they do what they do.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Expert
posted Hide Post
Wep, could you please explain when it is not.

Not including the database server:

In a single tier environment, the WebFOCUS Reporting server, MRE and the web server are on the same server.

In a multi-tier environment, the WebFOCUS Reporting server is on one server, MRE and the web server are on a second server.

When is it different than this?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Guru
posted Hide Post
Wep

second that. Typing the URL should be such an easy thing to add to the product. Just a simple prompt.
The way the've done it, I think the best way to get it to work is to put all your functions in the same file and then just add a <script line in the code. I know, you should not mess around with the HTML, but as far as I've seen, the head section does seem to be such a mine field as other parts of the code.

Håkan

This message has been edited. Last edited by: Håkan,


WebFOCUS DS 8.0.06/08 DS/AS
WebFOCUS RS 8.0.08 (Linux/IBM i)
WebFOCUS Client 8.0.06 (Linux)
 
Posts: 319 | Location: Stockholm, Sweden | Registered: February 04, 2004Report This Post
Virtuoso
posted Hide Post
Well, MRE and self-service reports are (mostly) dynamic content and for that reason require an application server of some sort to execute code in those reports. OTOH, images, javascript files, CSS and HTML files are all static content, which can be served as is without needing any interpretation on the server-side.

In our case for example, the dynamic content is served by tomcat while the static content is served by IIS. So for us they already are different servers (different programs), although they are on the same machine. They are connected to each other with the ISAPI redirector, but that does not limit you to single machine.

You could easily take it a step further and host the dynamic content from one (cluster of) machine(s), while hosting the static content on a separate machine. I don't think anything in WebFOCUS prevents you from doing that.
Whether that's practical is a different story, reports don't usually contain enough static content that it would be a noticeable load compared to the dynamic content.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Virtuoso
posted Hide Post
Hakan,

I've actually gone a step further with our Javascript includes and added dynamic loading and dependency checking to them :P
I add one SCRIPT-tag with the javascript URL that contains the dynamic loading code and one to the URL that contains the class I need, and the dynamic loader takes care of pulling in the dependencies. Effectively it just adds SCRIPT-tags into the HEAD, it's not very hard to implement.

Actually, I think IBI does something similar with their built-in javascript library.


WebFOCUS 8.1.03, Windows 7-64/2008-64, IBM DB2/400, Oracle 11g & RDB, MS SQL-Server 2005, SAP, PostgreSQL 11, Output: HTML, PDF, Excel 2010
: Member of User Group Benelux :
 
Posts: 1669 | Location: Enschede, Netherlands | Registered: August 12, 2010Report This Post
Guru
posted Hide Post
You can enter a fully qualified URL in the open dialog for CSS files, JS files, and Images as well.


David Glick
Director WebFOCUS App Studio
and WebFOCUS Developer Studio
WebFOCUS Division
Information Builders, Inc.
Direct (917) 339-5560
Voice Mail (212) 736-6250 x3560
Fax (212) 947-5168
Email david_glick@ibi.com
 
Posts: 315 | Registered: April 13, 2004Report This Post
Expert
posted Hide Post
But I do not want to enter a fully qualified URL - we have Dev, UAT, Prod and Demo environments - I would like to enter a partially qualified URL.


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
Francis
What we do here is we have a sysdef.fex where we set Enviroment level variables. this allows us to set things like Enviromnment, Server etc... We even get cute and change background colors so you can tell what environment you are in. This would mean you can set a fully qualified URL with the first part being Variables and eliminate your problem. Also allows you to run against PRODUCTION data from TEST by making a change in one place. Having two variables SERVER and SERVERA were one is the location of the data and the other the FEX files you need to execute.


Duane

WebFOCUS 8.0.7
DS 8.0.7 AS 8.0.7
Windows
Output: Excel, HTML, PDF, AHTML,Mobile
In Focus 1982
 
Posts: 83 | Location: Princeton NJ | Registered: October 26, 2007Report This Post
Expert
posted Hide Post
We also have a server setting fex.

Are you suggesting I can safely put an amper variable in the HTML Composer GUI "Add Script" box?


Francis


Give me code, or give me retirement. In FOCUS since 1991

Production: WF 7.7.05M, Dev Studio, BID, MRE, WebSphere, DB2 / Test: WF 8.1.05M, App Studio, BI Portal, Report Caster, jQuery, HighCharts, Apache Tomcat, MS SQL Server
 
Posts: 10577 | Location: Toronto, Ontario, Canada | Registered: April 27, 2005Report This Post
Gold member
posted Hide Post
Sorry I've Never tried that. our HTML pages are HTMLFORMS executed from a .FEX not a .HTM located in the HTML folder. If it is a .FEX the PArser will interprate the &value.


Duane

WebFOCUS 8.0.7
DS 8.0.7 AS 8.0.7
Windows
Output: Excel, HTML, PDF, AHTML,Mobile
In Focus 1982
 
Posts: 83 | Location: Princeton NJ | Registered: October 26, 2007Report This Post
  Powered by Social Strata  

Read-Only Read-Only Topic

Focal Point    Focal Point Forums  Hop To Forum Categories  WebFOCUS/FOCUS Forum on Focal Point     DS HTML Composer: Insert JavaScript files

Copyright © 1996-2020 Information Builders