on 09-20-2004 10:01 AM
Hi,
I want to place a link to a particular PDF file in the same manner in which links are present in the example matrix section of SDN. Following are my queries:-
1. Where in the directory structure should the file be present.
2. For using the file download UI element how should I set the DATA property of the UI element. How should I point the UI element to the PDF file.
Regards
Sidharth Deshpande
Hi valery,
Thanks for the response. Regarding the first part again what will happen is that all the PDF files will be dumped in a particular location by an external tool and at runtime i need to search the directory and then if the file is present i need to provoide the link to that file.
Hence i need to know where should all the files be dumped so that i can have access to those files.
Do let me know incase you have not understood the query.
Regards
Sidharth
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
<i>1. Where in the directory structure should the file be present.</i>
It depends, since you have to populate in-memory context yourself. If you plan to deploy PDF files with your application -- then better place is <b>mimes</b> folder of your sources (or <b>mimes/<i><component-name></i></b>). Then you can get full path to file at run-time via
WDURLGenerator.getResourcePath(...)
<i>2. For using the file download UI element how should I set the DATA property of the UI element.</i>
Data property should be bound to WD Context attribute of type <b>binary</b>, java type used underneath is byte[].
Next you have to apply run-time modification to data type of binary attribute:
public void wdDoInit()
{
/* @@begin wdDoInit() */
/* The FileDownload UI element requires: */
final IWDAttributeInfo fileAttrInfo = wdContext
.nodeRoot()
.getNodeInfo()
.getAttribute("MyPdfFileContent");
final IWDModifiableBinaryType pdfType =
(IWDModifiableBinaryType)
fileAttrInfo
.getModifiableSimpleType();
/* In addition the FileDownload
* UI element needs for defined resource types
*/
pdfType.setFileName( "MyPdfFile.pdf" );
pdfType.setMimeType( WDWebResourceType.PDF );
/* @@end */
}
<i>How should I point the UI element to the PDF file.</i>
You have to read content of file as byte array (byte[]) and assign this "value" to attribute mentioned.
More info can be found in NetWeaver help:
SAP Web AS for Java Applications -> Reference Manual -> Standard Library of the UI Elements -> Web Dynpro FileDownload API IWDFileDownload
Valery
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
88 | |
10 | |
10 | |
9 | |
7 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.