Posted: 9 Oct 2017 11:12 EDT Last activity: 14 Oct 2017 15:58 EDT
Displaying a Document from Documentum within PRPC 7.2.2 application
I am calling a Documentum SOAP Service to get a document back (MTOM) and I want to display this document in the proper windows tools so for example if it is a text file then display in notepad from Pega.
I have tried used tools.sendfile() but it doesn't seem to do anything. No window pops up from my application. I have a button on the harness and it calls an activity that calls tools.sendfile()
I have also tried using Open URL in window as a click action on the button. A window pops up but it displays an error saying there is no content even though the property I specify on the action for window name does have the document contents.
Anyone know how I can achieve what I need to here?
***Updated by moderator: Lochan to add Categories***
Yes you are right . I received the wrong advice but I've also been trying to use send file and it does nothing. I run an activity in studio that does send file and it pops a window up displaying contents in ie. It doesn't ask if I want to open the doc or save it. In my application I trigger it from a button click and the send file does absolutely nothing as far as visible eye can see.
So on the clicking of a row in a grid I call an activity from the action of the click and the activity calls a webservice and gets a document which I place in a property. I then execute a java step as follows:
I've tried many different variations and never does a window pop nor a dialog at the bottom asking if I want to open or save it. I've also tried some simpler scenarios where I hard code the document and don't call a webservice and still nothing.
I believe one of the boolean arguments to sendFile signifies if the file is being sent for download. You currently have all arguments set to null/false, so you are telling Pega "this is not meant for downloading."
Therefore, if you're using Internet Explorer, Pega is sending the bytes, telling IE "this is a Word document that this application wants you to see." From the sounds of it, IE is being "smart" and displaying the document to you within itself.
If you correct your logic to send the bytes "for download," then pega will set the HTTP header that tells your browser "this is a file meant for download instead of display." Your browser may then offer the "open or download?" prompt.
I've tried many variations including setting that flag to true and still it makes absolutely no difference. Nothing comes up. My next step is to try to get fiddler I suppose and see if I can figure anything out.
I also check the return value from sendfile() and it is "null" so it looks like it thinks it worked.
I did submit an SR with Pega but the came back and said my SR is about "how to" so they will not look at it although I disagree. So that's why I'm on the forum looking for help.
So I have a grid and I click on a row in the grid so it is displaying a pagelist of pages. When I specify my acitivity in OpenURLInWindow and my activity is in the class that my page is of it won't call my activity. It always looks for my activity in @baseclass which of course its not there. When I copy my activity to @baseclass it then finds that activity but ignores my activity that is in my own class. Perhaps rule resolution is messed up. I'll clear cache and restart.
OK so I got it to work. I had to run activity before open url in window to call a webservice and then the activity on the open url in window called send file. I am quite confused why the primary page switches to the parent page seemingly when calling the activity on open url in window. I would have expected the primary page to be the page of the row on the grid I'm clicking on. Doesn't seem right. I do have a question though. It pops open a window temporarily and it disappears and then pops open the dialog at the bottom to open or save. Does it have to work that way where a window temporarily pops open?
I seemed to have this behavior when I forgot to check the "Use page" checkbox in the "Open URL in Window" configuration. Once I checked the checkbox, the Activity got properly picked up from the grid row page class. Can you check the configuration once?
So when performing open URL in Window it appears there is no way to call the activity on it relative to the page corresponding to the row I am on on the grid/pagelist which I find bizarre. So only way I can make this work I think is to first call an activity that populates some property on a global page and then have the activity on open url in window reference this global page property to sendfile() with. I will have to try this tomorrow. It really does not seem intuitive the way this works.