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     [SOLVED] Reference JS file located in content from HTML created in Focexec

Read-Only Read-Only Topic
Go
Search
Notify
Tools
[SOLVED] Reference JS file located in content from HTML created in Focexec
 Login/Join
 
Platinum Member
posted
I am creating HTML in a fex using HTMLFORM BEGIN. In the HTML I am trying to reference JS file located inside a content folder. I have tried several ways. The file is not reading during the execution. Any ideas? Thanks in advance.

This message has been edited. Last edited by: Kathleen Butler,


WebFOCUS 8207.11
App Studio 8207
 
Posts: 146 | Registered: January 06, 2009Report This Post
Master
posted Hide Post
quote:
Originally posted by WFConsultant:
I am creating HTML in a fex using HTMLFORM BEGIN. In the HTML I am trying to reference JS file located inside a content folder. I have tried several ways. The file is not reading during the execution. Any ideas? Thanks in advance.

I've never been able to get that to work from a content folder. I put my JavaScript files on the reporting server (EDASERVE for me) and access like this:

    <script type="text/javascript" src="/ibi_apps/approot/balanced_scorecard/common/js/scorecard.js"></script>

My content folder in this example is "balanced_scorecard", so there is a corresponding folder of the same name on the reporting server (With subfolders "common" and "js" in this example).


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Platinum Member
posted Hide Post
Thank you Squatch. The JS file in the content is widely used by many reports. I cannot move it to the reporting server. It will be lot of work.


WebFOCUS 8207.11
App Studio 8207
 
Posts: 146 | Registered: January 06, 2009Report This Post
Master
posted Hide Post
quote:
Originally posted by WFConsultant:
Thank you Squatch. The JS file in the content is widely used by many reports. I cannot move it to the reporting server. It will be lot of work.

It looks like if you are using App Studio to develop an HTML application, you can specify that you want to use a JavaScript file in the Content area. But if you are using "-HTMLFORM" in a procedure it doesn't seem to work.

I think the reason for this is because files in the Content area are actually stored in a database, and App Studio creates the necessary mechanism to access these files when creating an HTML application. Outside of App Studio, it appears we are out of luck and have to use the Reporting Server to house JavaScript/CSS files.

If anyone has information to the contrary, I'd love to hear about it!


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Master
posted Hide Post
quote:
Originally posted by WFConsultant:
Thank you Squatch. The JS file in the content is widely used by many reports. I cannot move it to the reporting server. It will be lot of work.

But you could make a copy of the file and put it on the Reporting Server, couldn't you?


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Virtuoso
posted Hide Post
Time for me to drop in and come to the rescue! haha

It is totally doable. Use this syntax/URL build:

<link type="text/css" rel="stylesheet" href="/ibi_apps/WFServlet.ibfs?IBFS1_action=RUNFEX&|IBFS_path=/WFC/Repository/appDirectory/Hidden_Content/styles/tablesaw.css">
<script src="/ibi_apps/WFServlet.ibfs?IBFS1_action=RUNFEX&|IBFS_path=/WFC/Repository/appDirectory/Hidden_Content/scripts/tablesaw.js" type="text/javascript"></script>


You can also call libraries from a CDN. :-)

Hope this helps!


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Master
posted Hide Post
quote:
Originally posted by CoolGuy:
Time for me to drop in and come to the rescue! haha

It is totally doable. Use this syntax/URL build:

<link type="text/css" rel="stylesheet" href="/ibi_apps/WFServlet.ibfs?IBFS1_action=RUNFEX&|IBFS_path=/WFC/Repository/appDirectory/Hidden_Content/styles/tablesaw.css">
<script src="/ibi_apps/WFServlet.ibfs?IBFS1_action=RUNFEX&|IBFS_path=/WFC/Repository/appDirectory/Hidden_Content/scripts/tablesaw.js" type="text/javascript"></script>


You can also call libraries from a CDN. :-)

Hope this helps!

It definitely helps, CoolGuy! This is something that has been driving me nuts for some time now. Thank you very much.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Expert
posted Hide Post
This is why coders will still be required for a while yet!

Understanding the construct of the output and how you can effect a change, is one measure of a developers worth!

Another is being able to apply that change using the architecture available to you.

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Master
posted Hide Post
quote:
Originally posted by Tony A:
This is why coders will still be required for a while yet!

Understanding the construct of the output and how you can effect a change, is one measure of a developers worth!

Another is being able to apply that change using the architecture available to you.

T

Agreed.

Although I must admit that I haven't been able to get CoolGuy's example to work yet.

I'm assuming I'm doing something wrong at this point, however.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Virtuoso
posted Hide Post
Squatch,

Can you post your code so we can take a look at it? Wondering if you've got it in the right spot or not. This works for us without a problem.

Thanks.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Master
posted Hide Post
quote:
Originally posted by CoolGuy:
Squatch,

Can you post your code so we can take a look at it? Wondering if you've got it in the right spot or not. This works for us without a problem.

Thanks.

-HTMLFORM BEGIN
<!DOCTYPE html>
<head>
<script src="/ibi_apps/WFServlet.ibfs?IBFS1_action=RUNFEX&|IBFS:/WFC/Repository/balanced_scorecard/Common/js/scorecard.js" type="text/javascript"></script>
</head>
<body>
Test
</body>
</html>
-HTMLFORM END

I've confirmed the path by going into the WebFOCUS web interface, right-clicking on the JavaScript file and selecting properties.

The error I get is "Method Not Implemented". This is different from the error I get if I make the path wrong. In that case, it's just a "File Not Found" error.

Thanks for the help, it's appreciated.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Master
posted Hide Post
If I use the debugging ability in the Chrome browser, the error I see is "Uncaught SyntaxError: Unexpected token <" at "WFServlet.ibfs:1".


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Virtuoso
posted Hide Post
Change &|IBFS:/ to &IBFS_path=/.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Guru
posted Hide Post
Squatch,

try this:
 
-HTMLFORM BEGIN
<!DOCTYPE html>
<head>
<script src="/ibi_apps/run.bip?BIP_REQUEST_TYPE=BIP_RUN&|BIP_folder=IBFS:/WFC/Repository/vesir218/others&|BIP_item=alert.js" type="text/javascript"></script>
</head>
<body>
Test
</body>
</html>
-HTMLFORM END

 


PS.: change path to fit yours!


WebFOCUS 8.1.05 / APP Studio
 
Posts: 272 | Location: Brazil | Registered: October 31, 2006Report This Post
Master
posted Hide Post
quote:
Originally posted by CoolGuy:
Change &|IBFS:/ to &IBFS_path=/.

Sorry, CoolGuy, the code I posted above had a copy and paste mistake in it. It is now:

-HTMLFORM BEGIN
<!DOCTYPE html>
<head>
<script src="/ibi_apps/WFServlet.ibfs?IBFS1_action=RUNFEX&|IBFS_path=/WFC/Repository/balanced_scorecard/Common/js/scorecard.js" type="text/javascript"></script>
</head>
<body>
Test
</body>
</html>
-HTMLFORM END

And it works! But when I use the browser's debugging facilities, there is this error: "Uncaught ReferenceError: $ is not defined". However, the JavaScript file starts with a JQuery command, which I think causes the confusion because it does begin with a dollar sign.

(I must have the "&|" in there or App Studio interprets it as an ampersand variable and throws a screen full of errors.)

Thank you so much!


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Master
posted Hide Post
WFConsultant, CoolGuy has answered your original question.

You do something like this:

<script src="/ibi_apps/WFServlet.ibfs?IBFS1_action=RUNFEX&|IBFS_path=/WFC/Repository/balanced_scorecard/Common/js/scorecard.js" type="text/javascript"></script>

I have confirmed that this works.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Expert
posted Hide Post
If your referenced JS file uses jQuery, you need to reference the jQuery library as well.


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
Master
posted Hide Post
Yes. I just happened to test on a JavaScript file that had JQuery in it.

It did load, though, and that was all I was trying to accomplish.


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Expert
posted Hide Post
... and so the coders conquer again.

Gives you a nice warm fuzzy feeling, doesn't it Wink

T



In FOCUS
since 1986
WebFOCUS Server 8.2.01M, thru 8.2.07 on Windows Svr 2008 R2  
WebFOCUS App Studio 8.2.06 standalone on Windows 10 
 
Posts: 5694 | Location: United Kingdom | Registered: April 08, 2004Report This Post
Platinum Member
posted Hide Post
Thank you all for contributing with great ideas. Going by same notation, can we include a CSS file in the content?


WebFOCUS 8207.11
App Studio 8207
 
Posts: 146 | Registered: January 06, 2009Report This Post
Virtuoso
posted Hide Post
You can.

Example:

<link type="text/css" rel="stylesheet" href="/ibi_apps/WFServlet.ibfs?IBFS1_action=RUNFEX&|IBFS_path=/WFC/Repository/appDirectory/.../styles.css">


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Master
posted Hide Post
quote:
Originally posted by CoolGuy:
You can.

Example:

<link type="text/css" rel="stylesheet" href="/ibi_apps/WFServlet.ibfs?IBFS1_action=RUNFEX&|IBFS_path=/WFC/Repository/appDirectory/.../styles.css">

Is there an online place where all these "WFServlet.ibfs" parameters are documented? Or do you just have to be part of the "in crowd" to gain this knowledge? Wink


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report This Post
Virtuoso
posted Hide Post
Here's the not-too-helpful docs article for it (at least what I could find):

WFServlet doc

I came across the repository syntax string/build from some IBI developed code in the Responsive Demo CM package we acquired last year. Lots of good undocumented ways to work with WF content in there.


8.2.02M (production), 8.2.02M (test), Windows 10, all outputs.
 
Posts: 1113 | Location: USA | Registered: January 27, 2015Report This Post
Master
posted Hide Post
quote:
Originally posted by CoolGuy:
Here's the not-too-helpful docs article for it (at least what I could find):

WFServlet doc

I came across the repository syntax string/build from some IBI developed code in the Responsive Demo CM package we acquired last year. Lots of good undocumented ways to work with WF content in there.

Thanks for the info!


App Studio
WebFOCUS 8.1.05M
Windows, All Outputs
 
Posts: 594 | Location: Michigan | Registered: September 04, 2015Report 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     [SOLVED] Reference JS file located in content from HTML created in Focexec

Copyright © 1996-2020 Information Builders