[[https://www.revelation.com/|Sign up on the Revelation Software website to have access to the most current content, and to be able to ask questions and get answers from the Revelation community]] ==== Return PDF from OECGI (OpenInsight 32-bit Specific) ==== === At 26 MAY 2006 07:00:47PM JIM MABEY wrote: === {{tag>"OpenInsight 32-bit Specific"}} I have confidential PDF files that only certain people should be able to view based on their security level. I would like to return a PDF file from OECGI.EXE to the client browser. This way the client won't have access to the folder where the files are located, only the server application will. I figured out how to set the header "content-type: application/pdf" and how to return the PDF file. The PDF viewer opens automatically on the client PC. The only problem is that the PDF file returned from my OI application has all the "$FE" CHAR(255) replaced with "$0A" CHAR(10). This is the only problem I'm having. I tried moving my routine that sets the header and returns the PDF to INET_FINALIZE and am having the same problem. I'm using OSBREAD to read the PDF file. Can I prevent OI or OECGI from replacing all of the $FE with $0A in the returned packet? Thanks, Jim ---- === At 26 MAY 2006 07:13PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: === Jim, There's a fix for this in due in the next OI release (You set a flag in the HTTPRequest variable to stop RUN_OECGI_REQUEST performing the swap). I don't know if Revelation will issue a patch for this before then however. [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] [i]World leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 01 JUN 2006 03:41AM JIM MABEY wrote: === Ok... That's what I was afraid of... I read in the documentation that you can write your own RUN_OECGI_REQUEST... Has anyone done this? Is someone willing to give me the source for this? Or, perhaps I should bite the bullet and convert my app to ASP.NET... I hate to have to convert my entire app to ASP.NET right now though... though I do need a workable solution to my problem and will do what I must... Thanks, Jim ---- === At 01 JUN 2006 06:15AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: === We've done it - it isn't a huge job. Regretfully we're not about to make it Open Source as we've done it for paying clients and they don't like seeing us give away what they have to pay for :). [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] [i]World leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 01 JUN 2006 11:12AM Gerald Lovel wrote: === Hopefully they do not resent others having to pay as well? Or would they expect a post-resale rebate? This can be a touchy subject. I did a great sales presentation for a client one time, up to the point where I explained that any code customization they paid for would be considered available to upgrade the associated application. After all, if I did not incorporate the changes into the application, how would I be able to support them through future upgrades? I think they are using Excel spreadsheets for these features now. Since you raised the subject, how do other developers explain the issue of reselling or releasing code from paid consultancy? Any comments? ---- === At 01 JUN 2006 02:10PM JIM MABEY wrote: === How did you figure out what you needed to do in your RUN_OECGI_REQUEST routine? Someone must have at least given you a skeleton of what your routine needs to do. I don't understand why Revelation Software doesn't just include the source code for this... It seems like anytime I want to do something like this I end up having to come up with some contrived way to make it work often after spending hours of poking around and trial and error - hours I don't feel I should bill the client for. I don't feel the client should have to pay for us to come up with a workaround to a limitation with the toolset we chose to use. I can Google my question about how to return a PDF file and get free code for how to do this with other tools like ASP.NET and PHP... Thank you, Jim ---- === At 01 JUN 2006 04:42PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: === We have an established history of working out the undocumented. In the 80s/90s we published a journal called REVMEDIA which specialised in documenting the undocumented for AREV developers. With SENL we applied the same investigative skills to OpenInsight. Both journals are available Free of Charge from our website. So the simple answer is that no, it was not necessary for someone to give us a skeleton, there are ways of investigating this. Revelation Software stopped giving away source code to the product when the product ceased being at end of life. The point you make about the client not having to pay for workarounds is an interesting one but we would argue that the benefit they get from your increased productivity more than outweighs the cost of the odd workaround. On a training course last week the java developer present could not believe that he had achieved more in a morning as a trainee than he had achieved as a programmer in a week. In this instance is there no way you can 7 bit encode the return value so that the information is not interfered with? [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] [i]World leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 02 JUN 2006 04:29PM JIM MABEY wrote: === I just spent a couple of hours of time that I'm not going to bill the client for trying to figure out if a PDF file could be stored in 7 bit encoded format and I don't believe it can. Here is an excerpt from one web site: PDF is not an ASCII text file. You may be able to look inside a PDF file with a text editor, but PDF is a binary file format that cannot be edited using a text editor. Are you aware of some way that I can encode the file down to ASCII format where the Adobe compatible reader will accept this? How about some tips on how to try to figure out how to reinvent the wheel (write my own RUN_OECGI_REQUEST routine)? I'm thinking one way I could try to figure out what RUN_OECGI_REQUEST does is to write a routine in INET_FINALIZE that writes out the input and output records and then try to review both to figure out what the RUN_OECGI_REQUEST needs to do. Or I suppose I could write an ASP.NET routine that calls OENGINE to bypass the need to reinvent the RUN_OECGI_REQUEST routine. Has anyone done this? Wrote a routine to allow for web access via ASP.NET to OI subroutines? Thanks, Jim ---- === At 02 JUN 2006 04:55PM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: === [url=http://www.javaworld.com/javaworld/javatips/jw-javatip117.html?tip]Some encoding tips here[/url]. [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] [i]World leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 03 JUN 2006 12:09AM Warren Auyong wrote: === ASP.net support is a planned feature for OI v8 if I'm not mistaken. ---- === At 06 JUN 2006 10:48PM JIM MABEY wrote: === Thank you for your help. The route of encoding the PDF to base 64 seems less desirable as it appears I would need to write a helper app and install on the client pc's to decode, write a binary file and then launch Adobe reader. I am still looking into this approach though. I have many users of this app spread out over hundreds of computers in remote locations both at the client and the app is accessed by employees at home as well. I interested in trying another approach which is to call OI routines to bypass the OECGI so that the $FF to $0A translation does not occur. One way I could do this is to call my OI subroutine from VB or VB running under ASP.NET. This approach might also allow me to try to set up persistant engines and to do load balancing to overcome the issue of single threaded without having the performance hit of having to fire up a new OENGINE for each web request. I saw some sample code you have on your web site that demostrates how to call OI routines from VB. I tried to create a VB project using your sample code but couldn't get it to work. Do I need to register an OI dll perhaps? I'm receiving messages that VB doesn't know what RevSoftLib is and such. Here is the code from your site: Eric the Emu does VB1 (and Visual Basic) - Some code to connect a VB6 front end to an OI32 database. First, create a new project inside VB6 and paint a Command button on a blank form. Then in the private Declarations for the project add the text: Option Explicit Public Revelation As Revelation Then in the VB project you'll need to add the following components if they are not already present (to support the Msgbox and Button functionality on your VB form) Microsoft Windows Common Controls 5.0 SP2 (c:\windows\system32\comctl32.ocx) Then, add some code to the Command button click routine in the VB form designer Private Sub Command1_Click() ' This project starts Open Engine from VB, ' triggers an OI32 Basic+ process from VB ' displays an OI message, ' returns a value from OI32 to VB ' displays in VB the data from OI On Error Resume Next Dim Engine As RevSoftLib.IEngine ' Declare local variables in VB Dim Result As Long Dim Queue As Object Dim strCmd As String Dim ReturnValue As String ' Create an OpenEngine ' this tells VB where to find Open Engine (OENGINE.EXE) on the hard disk ChDir "c:\Revsoft\OI412\" Set Revelation=New Revelation DoEvents ' We'll call our instance of Open Engine "VB" Result=Revelation.CreateEngine(Engine, "\\.\VB", "SYSPROG", 1, 1) DoEvents If Result=0 Then ' Create an active Queue. Result=Engine.CreateQueue(Queue, "", "\\.\VB", "SYSPROG", "SYSPROG") DoEvents If Result=0 Then ' Call a Basic+ function, passing a string of data to it from VB. strCmd=This is data sent from VB to OI32" + Chr(0) Result=Queue.CallFunction(ReturnValue, "MYBASICPLUSROUTINE", strCmd) DoEvents If Result=0 Then 1 Note for non-antipodeans – VB – Victoria Bitter – a nice Australian lager. But I prefer Crown. - Ed ' Display the data sent back from Open Insight MsgBox ReturnValue End If End If End If DoEvents Queue.CloseQueue DoEvents ' shut down Open Engine Engine.CloseEngine DoEvents ' pack away the instances of the objects we created inside VB to avoid death by Task Manager Set Queue=Nothing Set Engine=Nothing Set Revelation=Nothing End Sub ---- === At 07 JUN 2006 03:49AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: === Jim, You'll need to register Xrev.DLL [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] [i]World leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 07 JUN 2006 05:15AM [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] wrote: === Word of warning - the use of XREV or a non OECGI technology to access Linear Hash data requires the use of a Web Deployment Pack to comply with the current licensing model. As this is expensive ($5,000) you'd still be better off looking at a customised RUN_OECGI_REQUEST. [url=http://www.sprezzatura.com]The Sprezzatura Group[/url] [i]World leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 07 JUN 2006 10:24AM Mike Ruane wrote: === Jim- At one point (I think) we had the $FF to $0A translation set as an option in the environment and the respective programs honored it, but it looks like it is not in the product now. I know that it has been reported in the bug tracker and it will be in the 8.0 release. Thanks ---- === At 08 JUN 2006 05:01PM JIM MABEY wrote: === Kevin and Mike told my client that they had to buy two copies of the Web Deployment pack (one for our production server and one for our development/test server) (plus other stuff) as a part of our last upgrade to 4x (version we are on now). Immediately after they sold us this (before we even installed it) they changed their licensing policy obviating the need for what we just bought. Coincidentally they lowered their Works renewal price almost the day after I paid the full price. From what you say, it sounds like we are licensed to call OI routines from VB running under ".NET" for the version we have. My question is this- if I can pursuade the client to allow us to keep using Open Insight (a major challenge especially after a report that Gartner Group prepared for my client - as a result my client is trying to see if there is an "off the shelf" solution/product that they can purchase to replace what I've done for them even though the users of my app are very happy with it) and if we do choose to go the route of calling OI from VB running under ".NET" as a work around to this problem (+ hopefully to help address the issue of threads), would my client need to repurchase the web deployment pack or packs to be able to upgrade to the newer version of OI? I would like to find out when version 8 will be out and what my client would need to purchase to be able to upgrade to it. Would we need to repurchase the "bumps", / user count, network driver upgrade or would I just need to renew my Works subscription? Meanwhile, I would like to be able to offer my client a solution for their request to return a PDF file... Thank you, Jim ---- === At 08 JUN 2006 05:23PM Warren Auyong wrote: === v8.0 isn't due out until the end of the year. You should be able to update through the Works subscription. User counts should remain the same. You may or may not have to upgrade the network services/driver depending on what version of OI you are currently using. ---- === At 08 JUN 2006 06:15PM support@sprezzatura.com wrote: === The WDP makes no mention of "version" - it is a license to publish LH data to the Web so you sound to be licensed for the .NET approach. 8.0 will be (as Warren intimates) a "Works" upgrade so no fees required for bumped clients of current Works subscribers. support@sprezzatura.com The Sprezzatura Group Web Site [i]World Leaders in all things RevSoft[/i] [img]http://www.sprezzatura.com/zz.gif[/img] ---- === At 09 JUN 2006 07:09AM Mike Ruane wrote: === Jim- As mentioned, we have the fix for OI 8.0 If you'd be willing, I can send you the pieces for this and you can test at your own risk. If you'd like, contact me at mike@revelation.com Thanks ---- === At 17 JUL 2006 10:22AM Simon Dobson wrote: === Here's a basic starting point for your very own RUN_OECGI_REQUEST: function Run_OECGI_Request_New(Request) RequestedFunction=Request RequestedFunction=RequestedFunction2,Len(RequestedFunction) - 1 Convert @Lower_Case to @Upper_Case in RequestedFunction If RequestedFunction1,5 "INET_" Then RequestedFunction=INET_":RequestedFunction End ReturnValue=Function(@RequestedFunction(Request)) return ReturnValue ---- === At 12 AUG 2007 12:48AM Patrick McCann wrote: === Hi Jim, I know this post is over a year old but you have done exactly what I am trying to accomplish. I am hoping you still monitor these messages and/or perhaps this may better explain what I am trying to accomplish to others who post here. If you or others have examples or can point me to some documentaion on how to accomplish returning the PDF to OI and displaying the PDF in a browser window it would be greatly appreciated. Thank you, Patrick [[https://www.revelation.com/revweb/oecgi4p.php/O4W_HANDOFF?DESTN=O4W_RUN_FORM&INQID=NONWORKS_READ&SUMMARY=1&KEY=5A551D6DF7D732978525717A007E6A34|View this thread on the forum...]]