How to trigger download of the contents of a custom workflow spaces UCM

I have a custom task flow in spaces WebCenter whereby I want to allow a user to download the content of the Complutense University of MADRID. When the user clicks on a button, I want to be prompted to download a file via their web browser.

I have the button call a method of a bean of support. Is passed to the method:

idcClient - an object of oracle.stellent.ridc.IdcClient
idcContext - an object of oracle.stellent.ridc.IdcContext
selectedDocID - a string containing has done to the document of the Complutense University of MADRID
selectedDocTitle - a string containing the dDocTitle for the document from the Complutense University of MADRID


The method call contains:

DataBinder binding = idcClient.createBinder ();
binder.putLocal ("IdcService", "GET_FILE");
binder.putLocal ("a", selectedDocID);

ServiceResponse response = idcClient.sendRequest (idcContext, binder);

String contentType = response.getHeader("Content-Type");
InputStream is = response.getResponseStream ();

HttpServletResponse hsr = (HttpServletResponse) FacesContext.getCurrentInstance () .getExternalContext () m:System.NET.FtpWebRequest.GetResponse ();
hsr.setHeader ("Content-Disposition", "attachment; filename = "" + selectedDocTitle); "
hsr.setContentType (contentType);
hsr.setStatus (200);

try {}
OutputStream os = hsr.getOutputStream ();
StreamUtil.copyStream (is, os, true, true);
} catch (IOException e) {}
e.printStackTrace ();
}


When this method is called, nothing happening... no output, no error message. If I change the OutputStream to write to a local file on the server, the document is written in the file correctly:

FileOutputStream fos = new FileOutputStream (new file ("/tmp/" + selectedDocTitle));
StreamUtil.copyStream (is, fos, true, true);

... which leads me to believe that I use the HttpServletResponse object incorrectly (since it's stolen code). Can you see a problem with my code? Or did someone knows a better way to trigger the download via the web browser?

Thank you!

Therefore, you have the downloadListener:


    

Code download method:

    public void download(javax.faces.context.FacesContext facesContext,
                         OutputStream os) {

    }

Follow code to write the inputStream in the following outputstream: http://www.roseindia.net/java/java-conversion/InputstreamToOutputstream.shtml

Tags: Fusion Middleware

Similar Questions

  • I bought a new iMac, and now I don't know how to re-download/switch the photoshop Lightroom (1 year contract) - MONTHLY PAY - I bought this machine. Help, please?

    I bought a new iMac, and now I don't know how to re-download/switch the photoshop Lightroom (1 year contract) - MONTHLY PAY - I bought this machine. Help, please?

    Download & install instructions https://forums.adobe.com/thread/2003339 can help

    -includes a link to access a page to download the Adobe programs if you do not have a disk or drive

    Also go to https://forums.adobe.com/community/creative_cloud/creative_cloud_faq

  • Download all the contents of a collection

    Hello

    Is there a way to download all the contents of a collection at a time? Instead of browse an article for download start.

    Thank you

    New option added two weeks ago allows it.

    Is a collection level option, it defined in the collection properties: 'Allow the user to save the collection of their device' - characteristic expression is "explicit downloads".

    Read more here: Digital Publishing Solution help | What's new in this version of DPS 2015

  • I, s/n, for, acrobat 9, standard, how, may, I, download, from, the, web?

    I, s/n, for, acrobat 9, standard, how, may, I, download, from, the, web?

    If you have a CD? Plugin's DVD/CD drives are cheap, easy to use and essential.

    Or you can read the CD on another computer and copy it using a memory stick.

  • How to insert images in the content pane HTMLEditor?

    How to insert images in the content pane HTMLEditor? or a hyperlink?

    > know the position of the caret

    Well, there is no public API on the HtmlEditor to know that.

    You could create an tweak asks to add such an api.

    In the meantime, I believe that the HtmlEditor is implemented as a contentEditable has WebView below, so I think it's possible to hack together a solution if you want to.

    To do this:

    1. create a program that uses the HtmlEditor.

    2. run the program and use ScenicView to work on the css to display embedded Web search path.

    3. Once your HtmlEditor appears on a scene, use a node search to dig up a reference to the Web view.

    4. Once you have a reference to the Web mode, use executeScript to get the position of the caret by using JavaScript.

    5. Once you know where the caret, use a mechanism similar to my example program above to allow you to insert an image to the location of the caret (get the html text, put the position appropriate, up-to-date then set it again).

    Of course, you don't need to use a HtmlEditor control to do this, you can also just use a plain WebView with contentEditable flag put on it or any number of 3rd party JavaScript html editors have image insert functions.

  • How can I get back the content removed by the numbers

    Hello

    I accidentally delete some content in my spreadsheet in numbers. How can I get back the deleted content?

    Thank you

    Vincent

    If you did not leave, then you can use the menu item "Edition > Cancel" (or + z key combination) until you have recovered your work.  This will cancel each step at a time

  • How can I recover all the contents of my windows photo gallery that I lost?

    I lost everything on my windows photo gallery. I simply opened the program yesterday and without deleting what whatsoever. He went.

    How can I retrieve the content.

    Hello

    1. did you delete any file/photo from any folder using windows Explorer?
    2. you made any hardware or software changes your system before the show?

    If the photos or videos still exist in your system, you can import those in Windows Photo Gallery. If the files have been deleted permanently, you can't bring them back into the gallery. Follow the steps listed in the article mentioned below.

    Select the pictures and videos are displayed in Windows Photo Gallery:
    http://Windows.Microsoft.com/en-us/Windows-Vista/choose-which-pictures-and-videos-are-displayed-in-Windows-Photo-Gallery

    You can see the article mentioned below.

    Windows Photo Gallery: frequently asked questions:
    http://Windows.Microsoft.com/en-us/Windows-Vista/Windows-Photo-Gallery-frequently-asked-questions

  • How can I copy all the content from my old hard drive on my hard drive again?

    My old PC is on its last breath and I decided to replace it. I bought a new more powerful PC and thought that by installing my old hard drive (Windows 7 on a Sata Drive) be simple and give me all my current programs without the need to install again. Unfortunately, my new PC refuses to recognize the old drive and I need these programs. How to copy all the contents of a new (bigger hard disk) without loss of functionality.

    Any help greatly appreciated

    Original title: old to new hard drive

    Remove the old drive, (just unplug its cables) reboot the PC, it does not start?

    If the method of connection of the old drive was at fault

    (Or bother readers origonal connections when you installed the old disk)

    BTW, you can not use the old drive as primary boot on your new PC drive, or you can access all the programs that have been installed on this subject.

  • New on this... How to move text with the contents of overflow to the new page?

    When the content in a text box is too big and must go beyond the next page, how can I do this? I can't so...

    Click on the small red + sign below to the right. Then click on the next page.

    If you hold the SHIFT key when you place the text it will sink to fill all the pages.

  • How is it possible for the content of all annotations to the output file or text box?

    Hello

    I try to get the content of all annotations (except accessories) within a PDF file. Creation of the Javascript code to enumerate all annotations in the document is not a problem. I am puzzled as to how I can save the output in a text file unicode (preferable to a file selected by the user name) or place it in a form textbox in a dialog so that the user can copy to the Clipboard. As far as I understand, it is possible to generate a new PDF with the release, but I would like that the code also works in Adobe Reader.

    Thank you very much!

    Best regards

    Stanislav

    You cannot write to a file with the player. You can with Acrobat with certain restrictions, using data, which are attached objects. What is possible is documented in the Acrobat JavaScript reference.

  • How can I download on the external hard drive?

    I'm out of memory on my computer if I want to download photoshop elements 11 on an external hard drive (160 GB hope enough), but the application loader does not have the possibility of storage LOCATION of the program and it stops just as he tries to download on my complete computer that is full and gives not enough memory error.

    also, this computer doesn't have a dvd player, so I need to download the program on the internet not the cd tht I bought in case it makes a difference.

    any ideas? Thank you!

    You can use the direct download from the link below link and download it to the external hard drive.

    l http://prodesigntools.com/Photoshop-Elements-11-Direct-Download-Links-PSE-Premiere-pre.htm

    Read the '' very significant intended '' to avoid any error

  • How can I remove all the unused files to clear a space

    How can I remove all the unused files from my computer

    You can remove applications on the control panels.  XP seems to me (im not on a XP ATM machine) programs cpanel

    Files?  you do not (or should not) delete separately

  • How can I view or load a flash drive without having to download all the content.

    Previously, with assistant, there was an option to do NOTHING to DO when you plug in a device (USB, CD key or camera), but I don't see this option now?  The program automatically downloads all of the volume that makes multiple copies if you keep a few pictures on your device.  Often, I want only the low load one or two images to work with photoshop.

    It won't automatically download/run except in the AutoPlay window origonal you had selected an option and then clicked allways this.

    Reset the auto run settings

    http://www.globinch.com/Windows-7-How-to-enable-or-disable-AutoPlay-Autorun/

  • How can I download all the songs of icloud in one click?

    How would I go about downloading all my music on the cloud on one new PC other than by clicking on each individual album or artist? I have about 15,000 songs, so I would like to know if there is an option to 'click' for downloading this content?

    Hello

    According to the song, you can select all the Flickr photos - a. control then right click and choose make available offline. Moreover, it is better to download in small batches.

    However, it would be better to copy your iTunes folder full of the old pc to the new pc. Also look at this How to move your iTunes library to a new computer - Apple Support

    Jim

  • After creative cloud downloading all the contents of my office disappear

    I need HELP!

    It is a disaster that I wasn't ready for.  I downloaded this application Cloud Creative freaking on my window 8 and all my office content with everything (programs, photos, docs, etc) everything has disappeared!

    I'll try to find it anywhere on my computer but I can't!

    I tried to go to my creative cloud online account, but could not find something or the other...

    Please, I beg you! Anyone having had a similar situation, or know what to let me know!

    I just lost half of my life :(((

    Hi KapustNik,

    In the case that your desktop screen is empty (no), please try the following steps.

    • Run the Task Manager by pressing Ctrl + Shift + Esc keys together.
    • Go to file > new task
    • Run: explorer.exe

    Please share the results after you perform these steps, I hope that this would take over your desktop icons.

    Thank you.

Maybe you are looking for

  • How to adjust the video memory on Satellite A100-811

    Hi all There, an agency know how to adjust the memory of the video card in the laptop Toshiba Satellite A100-811?The physical memory of my laptop is 512 MB, I want to share my 128 MB videocard, nomatter if 384 will remain in my physical memory. Your

  • Update 10.2.1 logic problem: controller keyboard Roland - 49 stop working

    My judgment of keyboard/controller of Roland A-49 working after install Logic Pro X update 10.2.1 I get a message "Please select MIDI CH.1...» "but even if I chose ch.1, this does not (no action from noon at all). Already uninstall and install Roland

  • How to clean an iphone 4

    How do I "clean up" an iphone 4, I want to give the child to may. Do not remember the code with restricted access. I want it to be like a new phone, so she doesn't have my contact, notes, bookmarks, calendar, etc. Help, please Thank you

  • Need graphics drivers HP 15-r022TX

    Hello I recently bought r022TX. I downloaded the graphics driver on the HP support site, but both the graphics installed (intel and Nvidia G force)... Please help me

  • I reinstalled Windows Vista and can not reactivate with my key now... What do I do?

    Hello. I own a copy of Windows Vista Ultimate x 64.  It's the Builder pack and I used this license for 2 other computers I built bringing the total number of machines to 3 that it runs currently on. My question is this... I did a clean install on my