David Gawron commented on May 31, 2013

Re: Handling file attachments using IBM WebSphere Portlet Factory

There are a number of techniques in the article that are not WEF best practices. The most critical one to be aware of is the code sample in listing 6. The way Content Launch Action is used in listing 6 (called with an empty byte array and the subsequent direct writing to the response output stream) is an unsupported use of the builder. It just happens to work right now, but there is no guarantee it will continue to work in future releases of WEF. The code sample should be something like this:

{

webAppAccess.getVariables().setString("documentName", DocName);

try

{

final byte[] bits = new javax.xml.bind.annotation.adapters.HexBinaryAdapter().unmarshal(DocData);

webAppAccess.callMethod("ContentLaunch.launchContent", bits );

}

catch( Exception t )

{

System.out.println("Exception writing file to output"+t.getMessage());

}

}

This is simpler and a correct usage of the CLA builder.

Michael Burati commented on May 31, 2013

Re: Handling file attachments using IBM WebSphere Portlet Factory

Please note that unless your application needs to work on the bytes of the document across requests, that storing the files as hex encoded bytes in a text node of a session based XML variable is not the most efficient means of accomplishing content launch. If you don't need to operate on the bytes across requests in the app, then a more efficient implementation would be to only read the bytes in the action that is sending them back to the content launch request.

Amr Darwish commented on Apr 16, 2013

Re: Handling file attachments using IBM WebSphere Portlet Factory

How can I change the "Browse" button of "File Upload" builder or even apply image button instead or apply resourse bundling on it .. PLS hlep

Joerg Herbst commented on Jan 7, 2013

Re: Handling file attachments using IBM WebSphere Portlet Factory

Is a downloadable version of this model available and will it also run with IBM Web Experience Factory? I got an error "No PageLocation for RepeatedRegion on Element Document".

Animesh K Sharma commented on May 24, 2012

Re: Handling file attachments using IBM WebSphere Portlet Factory

Please add the WebSphere Portal V7.0 server library to the java build path of your project and rebuild, this should get rid of compile issues you are facing .

Shu Sia Lukito commented on May 14, 2012

Re: Handling file attachments using IBM WebSphere Portlet Factory

I have added rt.jar and jaxb-api.jar to the Java Build Path from the Portal Server and WebSphere install directories, but still getting the error

Shu Sia Lukito commented on May 14, 2012

Re: Handling file attachments using IBM WebSphere Portlet Factory

I have the same generation error on bytesString = new javax.xml.bind.annotation.adapters.HexBinaryAdapter().marshal(bytes);

Sankar Krishnan Shanmugam commented on Apr 27, 2012

Re: Handling file attachments using IBM WebSphere Portlet Factory

I am getting a generation error

bytesString = new javax.xml.bind.annotation.adapters.HexBinaryAdapter().marshal(bytes);

^^^^^^^^^^^^^^

javax.xml.bind cannot be resolved to a type

when I try to create the method uploadHandler. Please help.