In the Web UI Framework and the Rich Client Platform, you can plug in file
upload/download implementations without the Sterling Application Platform using the file attachment
base framework (platform_fa.jar).
About this task
To upload or download using the interface contracts without the Sterling application platform,
use the following procedure:
Procedure
- Code the file upload provider to implement IFileUploadProvider
or extend PLTFileUploadProvider, whichever is appropriate.
- Code the file download provider to implement IFileDownloadProvider.
- Add the context parameters
sc-file-upload-provider
and sc-file-download-provider
to
web.xml or set the file upload/download providers in the initialization
servlet of the application, with the qualified Java™ class path of the implementations.
- Add file upload/download servlet and servlet mapping entries
in the web.xml file.
Sample servlet and servlet mapping
entries for file upload and download servlet:
<servlet id="Servlet_55">
<description>File Upload Servlet</description>
<display-name>File Upload Servlet</display-name>
<servlet-name>FileUploadServlet</servlet-name>
<servlet-class>
com.sterlingcommerce.woodstock.util.frame.file.base.servlets.PLTFileUploadServlet
</servlet-class>
</servlet>
<servlet id="Servlet_56">
<description>File Download Servlet</description>
<display-name>File Download Servlet</display-name>
<servlet-name>FileDownloadServlet</servlet-name>
<servlet-class>
com.sterlingcommerce.woodstock.util.frame.file.base.servlets.PLTFileDownloadServlet
</servlet-class>
</servlet>
<servlet-mapping id="ServletMapping_30">
<servlet-name>FileUploadServlet</servlet-name>
<url-pattern>/FileUploadServlet/*</url-pattern>
</servlet-mapping>
<servlet-mapping id="ServletMapping_31">
<servlet-name>FileDownloadServlet</servlet-name>
<url-pattern>/FileDownloadServlet/*</url-pattern>
</servlet-mapping>