Focal Point
How do I deliver xml output from a run to the client's platform?

This topic can be found at:
https://forums.informationbuilders.com/eve/forums/a/tpc/f/7971057331/m/6071063592

August 13, 2008, 10:06 AM
John_Edwards
How do I deliver xml output from a run to the client's platform?
I have a Data Migrator process that creates an xml file as its output. I currently have a FILEDEF command that places the results in a file on the server. But at the end of that run, I'd like to offer up that output to the enduser through their browser; that is, a window pops up prompting them to save the file. In this way I don't have to manage securing the file on the server from prying eyes.

Does anyone know of a way to filedef or otherwise direct an output to the user's client platform instead of landing it on the server somewhere? This is pretty much just a fancy MODIFY command, but I don't know how to deliver the result to the client platform.

Any help you can provide . . .

John



August 13, 2008, 01:25 PM
<JG>
John you are using the wrong tool for that.
DM does not have the sort of interface that allows for 'client output', that's the job of WebFocus.

A possible solution would be to mail the file as part of your flow, but you to do that you need to
insert a system call. If your system is configured to handle mails which it almost certainly is
then there should be no problem.
August 13, 2008, 02:32 PM
John_Edwards
Any web application can return a file to the enduser's browser window. Has anyone done it with WF/DM?

John



August 13, 2008, 02:38 PM
Tom Flynn
Hi John,

You come across as such a nice person, AND, from the tone of your previous posts, I'll bet you are a joy to work with! Big Grin

The file is probably sitting on the WF Reporting server, so, it needs to be FTP'd...

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 13, 2008, 03:59 PM
John_Edwards
I had hoped to drop it into an MRE directory and allow them to fetch them via a folder tab in Dashboard. Unfortunately MRE will not recognized the file when it arrives and does not present it to the user.

I fear I may need to settle for an FTP or a shared folder. Thanks for the input!

J.



August 13, 2008, 04:05 PM
Francis Mariani
John,

MRE should be able to access the WF Reporting Server, if that's where the file is. How do you propose to display the XML file in a Dashboard tab? Do you have a HMTL file that somehow links to the XML file?


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
August 13, 2008, 04:19 PM
Tom Flynn
OK, I'll be nice...

Create an HTML file, copy and paste:


 
<!-- Generated by Report Layout Painter -->
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<HTML>
<HEAD>
<SCRIPT id=IBI_OptionsScript type=text/javascript>
var rltVersion = "76";
var cgipath = "cgipath";
var ibirls = "ibirls2";
var multidrill = "multidrill";
var mntFormValidate = "mntFormValidate";
var dyncalendar = "dyncalendar";
var olap="olap";
var olappanebase="olappanebase";
var olapdrill="olapdrill";
var multidrill = "multidrill";

var ibixmltree="ibixmltree";
var ibilangtrans="ibilangtrans";

var ibiOptions = new Array(cgipath,ibirls,mntFormValidate,ibilangtrans,dyncalendar,multidrill);
</SCRIPT>

<SCRIPT id=IBI_nls src="/ibi_html/javaassist/nls.js" type=text/javascript></SCRIPT>

<SCRIPT id=IBI_ibigbl src="/ibi_html/javaassist/ibi/html/js/ibigbl.js" type=text/javascript></SCRIPT>

<SCRIPT id=IBI_ibigblloadCss type=text/javascript>
ibigblloadCss(null);</SCRIPT>

<SCRIPT id=IBI_RelCallBack type=text/javascript>function AdjustChildrenPosition(){
}
</SCRIPT>

<SCRIPT id=clientEventHandlersJS type=text/javascript>
function window_onload() {
UpdateData();
// TODO: Add your event handler code here
}

<script type="text/javascript">
if(navigator.userAgent.indexOf('Opera') > 0) // Opera
{ document.write('Select "Save target as..."'); }
else if(navigator.userAgent.indexOf('Safari') > 0) // Safari
{ document.write('Select "Download Linked File As..."'); }
else if(navigator.userAgent.indexOf('Firefox') > 0) // Firefox
{ document.write('Select "Save Link As..."'); }
else if(navigator.userAgent.indexOf('Netscape') > 0) // Netscape
{ document.write('Select "Save Target As..."'); }
else if(navigator.userAgent.indexOf('Win') > 0) // IE
{ document.write('Select "Save Target As..."'); }
else
{ document.write('Save the file'); } // Default message
</script>

<div style="border-style:solid; border-width:1px; padding:20px;">
<p style="margin-top:0">
To download "John Edwards XML file from DataMigrator" right-click <a href="/approot/downloads/john_edwards.xml">on this link.</a>
</p>
<p>
<script type="text/javascript">
if(navigator.userAgent.indexOf('Opera') > 0) // Opera
{ document.write('Select "Save target as..."'); }
else if(navigator.userAgent.indexOf('Safari') > 0) // Safari
{ document.write('Select "Download Linked File As..."'); }
else if(navigator.userAgent.indexOf('Firefox') > 0) // Firefox
{ document.write('Select "Save Link As..."'); }
else if(navigator.userAgent.indexOf('Netscape') > 0) // Netscape
{ document.write('Select "Save Target As..."'); }
else if(navigator.userAgent.indexOf('Win') > 0) // IE
{ document.write('Select "Save Target As..."'); }
else
{ document.write('Save the file'); } // Default message
</script>
</p>
<p style="margin-bottom:0">
Make a note where you saved it on your computer, especially if you are a blonde!!!
</p>
</div>

</SCRIPT>

</HEAD>
</HTML>
 



Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 14, 2008, 12:02 PM
John_Edwards
Thank you very much!

This requires web services on the application directory, or is it processing through the servlet?

J.



August 14, 2008, 12:30 PM
Tom Flynn
John,

INTRAnet will be the servlet, INTERnet will be web.

Your WF server has no idea the identity of the other server processing the request.

I still think FTP at the end of the DM process, or, a ReportCaster batch job to FTP the file is the most efficient.

Also, you'll need to name the file with a .txt, then, have the client SAVE AS a .xml

Also, remove the last paragraph,
  
<p style="margin-bottom:0">
Make a note where you saved it on your computer, especially if you are a blonde!!!
</p>


Having a little fun, there!

I pride myself as a non-PC type person!!! Smiler

Tom


Tom Flynn
WebFOCUS 8.1.05 - PROD/QA
DB2 - AS400 - Mainframe
August 14, 2008, 12:40 PM
<JG>
John,

I misunderstood what you meant by
“But at the end of that run, I'd like to offer up that output to the enduser through their browser; that is, a window pops up prompting them to save the file.”

That DM can not do. But if you mean you’d like the users to access the file via MRE or another WebFocus app that’s quite straight forward.

Create a focexec in the correct environment as follows

FILEDEF XMLFILE dir:\directories\XMLFILE.XML
-* what ever your mapping is
-RUN
-HTMLFORM BEGIN
!IBI.FIL.XMLFILE;
-HTMLFORM END

This will normally display the xml in the browser as certainly IE knows what it is, so
to save it the user must use file/save as from the title bar.

to overcome this you must disable the browser recognition of xml
(giving it an extension that it does not know about will not work because it reads the file and knows)