| com.sun.portal.admin.console.common.PortalBaseBean com.sun.portal.admin.console.desktop.UploadDownloadDPBean
DISPLAY_PROFILE_XML | final public static String DISPLAY_PROFILE_XML(Code) | | |
UploadDownloadDPBean | public UploadDownloadDPBean()(Code) | | |
getBean | public static Object getBean(String ref)(Code) | | doDownload action.
Since this action take over the response object and use the writer,
the browser does not give control back to the container, so somehow
the request parameter will not be flushed. Two minor problems
with this: 1. the page alert is not shown after
content-type and header is set (for the complete
message). 2. the input value downloadedFileName will be there
until the session is over. There maybe ways to make these fixed
but right now it is stay as is.
public String doDownload() {
String dpXML = getDP();
if (dpXML == null || dpXML.length() == 0) {
dpXML = "";
}
try {
String downloadedFile = getDownloadedFileName();
if (!FacesContext.getCurrentInstance().getResponseComplete()) {
HttpServletResponse response = (HttpServletResponse)
FacesContext.getCurrentInstance().getExternalContext().getResponse();
response.setContentType("application/x-xxxxx; charset=UTF-8");
response.setHeader("Content-Disposition",
"filename=\"" +
downloadedFile + "\"");
PrintWriter out = response.getWriter();
out.write(dpXML);
out.close();
}
FacesContext.getCurrentInstance().responseComplete();
} catch (IOException ex) {
log(Level.SEVERE, "Exception in UploadDownloadDPBean.doDownload()", ex);
setupAlert("error.downloadDP.summary",
"error.downloadDP.ioerror","error",
"error.downloadDP.failed");
}
return "done";
}
|
getCancelText | public String getCancelText()(Code) | | cancel methods
|
getDisplayError | public Boolean getDisplayError()(Code) | | Alert methods
|
getDownloadedFileName | public String getDownloadedFileName()(Code) | | Getter for property downloadedFileName.
Value of property uploadedFile. |
getRemoveDPFlag | public String getRemoveDPFlag()(Code) | | RemoveDPFlag
|
getUploadedFile | public UploadedFile getUploadedFile()(Code) | | Getter for property uploadedFile.
Value of property uploadedFile. |
setAlertDetail | public void setAlertDetail(String detail)(Code) | | |
setAlertSummary | public void setAlertSummary(String summary)(Code) | | |
setDownloadedFileName | public void setDownloadedFileName(String val)(Code) | | |
setRemoveDPFlag | public void setRemoveDPFlag(String val)(Code) | | |
setUploadedFile | public void setUploadedFile(UploadedFile uploadedFile)(Code) | | Setter for property uploadedFile.
Parameters: uploadedFile - New value of property uploadedFile. |
|
|