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.
How were you going to get output produced from a fex? Whenever I create custom XML with WebFOCUS I have to use WRITE commands to create a file and then read it in via javascript.
Lately, I've been using JQuery to read WebFOCUS formatted XML output that is returned using the command: ON TABLE PCHOLD FORMAT XML
I think it can be done using ON TABLE HOLD FORMAT WP
-Fred-
DEFINE FILE CAR
LINE1/A50 = '<navItem title="' || COUNTRY || '"> ';
LINE2/A80 = '<subNavItem url="' || CAR || '.HTML" title="' || CAR || '" />';
LINE3/A20 = '</navItem>';
END
TABLE FILE CAR
BY COUNTRY NOPRINT
BY LINE2 AS ''
ON COUNTRY SUBHEAD
"<LINE1"
ON COUNTRY SUBFOOT
"<LINE3"
ON TABLE HOLD AS RPRT FORMAT WP
ON TABLE SET PAGE NOPAGE
END
-RUN
SET HTMLFORMTYPE=TXT
-HTMLFORM BEGIN
<?xml version="1.0" encoding="utf-8" ?>
<navigation>
!IBI.FIL.RPRT;
</navigation>
-HTMLFORM END
-EXIT
-*new file
TABLE FILE ibisamp/CAR
PRINT
COMPUTE TITLE/A70= COUNTRY;
COMPUTE SUBURL/A70= CAR || '.htm';
COMPUTE SUBTITLE/A70= CAR;
BY COUNTRY NOPRINT
ON TABLE HOLD AS TEST FORMAT ALPHA
ON TABLE SET HOLDLIST PRINTONLY
END
-RUN
CREATE FILE XMLTEST DROP
MODIFY FILE XMLTEST
MATCH TITLE
ON MATCH CONTINUE
ON NOMATCH INCLUDE
MATCH SUBURL
ON MATCH INCLUDE
ON NOMATCH INCLUDE
FIXFORM FROM TEST
DATA ON TEST
END
-RUN
EX EDAGET XML,wsdemo/xmltest,T
-RUN
"There is no limit to what you can achieve ... if you don’t care who gets the credit." Roger Abbott
Support for XML output is built in to DataMigrator and requires no coding. From the DMC create a synonym, say NAVIGATION, for the xml checking "Make Unique" so that the second TITLE element gets named TITLE1. In the synonym editor change the length of the fields from the default A10 to A16 for TITLE1 and A21 for URL.
Then create a data flow with CAR as source and NAVIGATION as target. In SQL select CAR and COUNTRY. In the target transformations map TITLE = COUNTRY URL = CAR||'.html' TITLE1 = CAR Submit and you are done.
N/A
Posts: 397 | Location: New York City | Registered: May 03, 2007
Below an example how to do it. I saved the fex (see my post above) as cardata_as_xml.fex in my baseapp folder and the code below was also saved in baseapp as xml_jquery.htm
And url is: http://localhost:8080/approot/baseapp/xml_jquery.htm
Cheers,
-Fred-
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>Demo jQuery / WebFOCUS</title>
<script src="https://ajax.googleapis.com/ajax/libs/jquery/1.5.2/jquery.min.js"></script>
<style>
body {
font-family:verdana;
font-size:14px;
}
.data {
padding:20px;
}
.navItem {
color : navy;
font-size:18px;
}
.subNavItem {
padding-left:20px;
}
</style>
<script>
var glbWebFocusUrl = "http://localhost:8080/ibi_apps/WFServlet?IBIF_ex=cardata_as_xml";
function getXmlData() {
$.ajax({
type : "GET",
url : glbWebFocusUrl,
dataType: "xml",
success : function(_data) {
$("#content").empty();
$(_data).find("navItem").each(function() {
var html = "";
var $navItem = $(this);
html += "<div class='data'>";
html += "<div class='navItem'>" + $navItem.attr("title") + "</div>";
var $subNavItem = $navItem.find('subNavItem');
$subNavItem.each(function() {
html += "<div class='subNavItem'>" + $(this).attr("url") + " (---" + $(this).attr("title").toLowerCase() + "---)</div>";
})
html += "</div>";
$("#content").append(html);
});
}
});
}
</script>
</head>
<body id="body">
<button onclick=getXmlData()>getXMLData</button>
<div id="content">
</div>
</body>
</html>
This message has been edited. Last edited by: <FreSte>,