|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
com.ibm.commerce.command.AbstractECTargetableCommand | +--com.ibm.commerce.command.ControllerCommandImpl | +--com.ibm.commerce.tools.command.ToolsControllerCommandImpl | +--com.ibm.commerce.bi.commands.BIShowReportCmdImpl
Sends the requested file to the browser.
The file type can be html, htm, jpg and css. For any other types of files, an error page is forwarded.
The file name is passed in via a request parameter reportId
. The parameter name can be changed using setURLParamName
The path of the file is formed in buildReportPath
using the WebSphere Commerce instance directory and the WebSphere Commerce Analyzer report directory. If the file is in a sub directory of the default WebSphere Commerce Analyzer report directory, the sub directory can be added by setReportSubDirectory
.
Field Summary | |
protected static java.lang.String |
BASE_REPORT_DIR
|
protected static java.lang.String |
BI
|
protected static java.lang.String |
BI_REPORT_ERROR_VIEW
|
static java.lang.String |
COPYRIGHT
|
protected static java.lang.String |
CSA
|
protected static java.lang.String |
css_extension
|
protected static java.lang.String |
ERROR
|
protected static java.lang.String |
fileSeparator
|
protected static java.lang.String |
gif_extension
|
protected static java.lang.String |
htm_extension
|
protected static java.lang.String |
html_extension
|
protected static java.lang.String |
image_gif_content_type
|
protected static java.lang.String |
image_jpeg_content_type
|
protected static java.lang.String |
INSTANCE_DIR
|
protected static java.lang.String |
jpg_extension
|
protected static java.lang.String |
METHODbuildReportDirectoryPath
|
protected static java.lang.String |
METHODfileExtNotSupported
|
protected static java.lang.String |
METHODfileNotAvailable
|
protected static java.lang.String |
METHODisFileExtensionValid
|
protected static java.lang.String |
METHODlogAccess
|
protected static java.lang.String |
METHODperformExecute
|
protected static java.lang.String |
METHODsetReportSubDirectory
|
protected static java.lang.String |
METHODsetRequestProperties
|
protected static java.lang.String |
METHODsetViewName
|
protected static java.lang.String |
METHODssetURLParamName
|
protected static java.lang.String |
NOT_AVAILABLE
|
protected static java.lang.String |
NOT_SUPPORTED
|
protected static java.lang.String |
PAGE_NAME
|
protected java.lang.String |
reportId
|
protected java.lang.String |
reportSubDir
|
protected static java.lang.String |
storeIdPrefix
|
protected static java.lang.String |
text_css_content_type
|
protected static java.lang.String |
text_html_content_type
|
protected java.lang.String |
urlParamName
|
protected java.lang.String |
viewName
|
Fields inherited from class com.ibm.commerce.command.ControllerCommandImpl |
requestProperties, responseProperties, retriable, viewReqProperties |
Fields inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
commandContext |
Fields inherited from interface com.ibm.commerce.bi.commands.BIShowReportCmd |
defaultCommandClassName, NAME |
Constructor Summary | |
BIShowReportCmdImpl()
BIShowReportCmdImpl constructor. |
Method Summary | |
protected java.lang.String |
buildReportPath()
Build the report path based on the WebSphere Commerce instance directory and the WebSphere Commerce Analyzer report directory. |
protected void |
fileExtNotSupported(java.lang.String docName)
Forward to an error jsp when the file type is not supported. |
protected void |
fileNotAvailable(java.lang.String docName)
Forward to an error jsp when the file cannot be found or the file size cannot be read. |
java.lang.String |
getReportId()
Returns the report ID. |
AccessVector |
getResources()
Gets the access vector accessed by this command. |
protected boolean |
isFileExtensionValid(java.lang.String filename)
Test if the file is a supported file type. |
protected void |
logAccess()
Logs all accesses to this command. |
void |
performExecute()
This method calls the performExecute of the super class. |
protected void |
setReportId(java.lang.String id)
Set report ID. |
protected void |
setReportSubDirectory()
Sets the optional file sub directory. |
void |
setRequestProperties(TypedProperty reqProperties)
Sets request properties. |
protected void |
setURLParamName()
Sets the URL context parameter name. |
protected void |
setViewName()
Sets the view name. |
Methods inherited from class com.ibm.commerce.tools.command.ToolsControllerCommandImpl |
getViewInputProperties |
Methods inherited from class com.ibm.commerce.command.ControllerCommandImpl |
fulfills, getForUserId, getGeneric, getOwner, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, isGeneric, isRetriable, mergeProperties, setForUserId, setGeneric, setOwner, setResponseProperties, setRetriable, setViewInputProperties |
Methods inherited from class com.ibm.commerce.command.AbstractECTargetableCommand |
accessControlCheck, checkIsAllowed, checkResourcePermission, execute, finalize, getAccCheck, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, isReadyToCallExecute, reset, setAccCheck, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters |
Methods inherited from interface com.ibm.commerce.command.ControllerCommand |
execute, getGeneric, getRequestProperties, getResolvedRequestProperties, getResponseProperties, getRetriable, getViewInputProperties, isGeneric, isRetriable, mergeProperties, setGeneric, setRetriable, setViewInputProperties |
Methods inherited from interface com.ibm.commerce.command.AccCommand |
accessControlCheck, getAccCheck, getForUserId, setAccCheck, setForUserId, setOwner |
Methods inherited from interface com.ibm.commerce.command.ECCommand |
checkIsAllowed, checkResourcePermission, getCommandContext, getCommandIfName, getCommandName, getDefaultProperties, getStoreId, getUser, getUserId, setCommandContext, setCommandIfName, setDefaultProperties, validateParameters |
Methods inherited from interface com.ibm.commerce.security.Protectable |
fulfills, getOwner |
Field Detail |
protected static final java.lang.String BASE_REPORT_DIR
protected static final java.lang.String BI
protected static final java.lang.String BI_REPORT_ERROR_VIEW
public static final java.lang.String COPYRIGHT
protected static final java.lang.String CSA
protected static final java.lang.String css_extension
protected static final java.lang.String ERROR
protected static final java.lang.String fileSeparator
protected static final java.lang.String gif_extension
protected static final java.lang.String htm_extension
protected static final java.lang.String html_extension
protected static final java.lang.String image_gif_content_type
protected static final java.lang.String image_jpeg_content_type
protected static final java.lang.String INSTANCE_DIR
protected static final java.lang.String jpg_extension
protected static final java.lang.String METHODbuildReportDirectoryPath
protected static final java.lang.String METHODfileExtNotSupported
protected static final java.lang.String METHODfileNotAvailable
protected static final java.lang.String METHODisFileExtensionValid
protected static final java.lang.String METHODlogAccess
protected static final java.lang.String METHODperformExecute
protected static final java.lang.String METHODsetReportSubDirectory
protected static final java.lang.String METHODsetRequestProperties
protected static final java.lang.String METHODsetViewName
protected static final java.lang.String METHODssetURLParamName
protected static final java.lang.String NOT_AVAILABLE
protected static final java.lang.String NOT_SUPPORTED
protected static final java.lang.String PAGE_NAME
protected java.lang.String reportId
protected java.lang.String reportSubDir
protected static final java.lang.String storeIdPrefix
protected static final java.lang.String text_css_content_type
protected static final java.lang.String text_html_content_type
protected java.lang.String urlParamName
protected java.lang.String viewName
Constructor Detail |
public BIShowReportCmdImpl()
Method Detail |
protected java.lang.String buildReportPath()
Build the report path based on the WebSphere Commerce instance directory and the WebSphere Commerce Analyzer report directory. If the file is in a sub directory of the WCA directory, the sub directory can be added via setReportSubDirectory
.
It is called in performExecute
after the performExecute
of the super class is called. The sub directory must be set before this method is called.
protected void fileExtNotSupported(java.lang.String docName)
Forward to an error jsp when the file type is not supported.
docName
- The file name.protected void fileNotAvailable(java.lang.String docName)
Forward to an error jsp when the file cannot be found or the file size cannot be read.
docName
- The file name.public java.lang.String getReportId()
Returns the report ID.
public AccessVector getResources() throws ECException
getResources
in interface ECCommand
getResources
in class AbstractECTargetableCommand
protected boolean isFileExtensionValid(java.lang.String filename)
filename
- The file to be tested.protected void logAccess()
Logs all accesses to this command.
public void performExecute() throws ECException
This method calls the performExecute
of the super class. The performExecute
of the super class calls the checkParameter
and the file name is parsed in this method.
After the full path name of the file name is constructed. The file is opened as an input stream and passed to a direct view.
performExecute
in interface ECCommand
performExecute
in class AbstractECTargetableCommand
com.ibm.commerce.command.ECCommand
com.ibm.commerce.command.CommandException
- The superclass for all ECExceptions.protected void setReportId(java.lang.String id)
id
- The report ID.protected void setReportSubDirectory()
Sets the optional file sub directory.
public void setRequestProperties(TypedProperty reqProperties) throws ECApplicationException
Sets request properties.
If a sub class needs to have a different parameter name, override the setURLParamName
to set the urlParamName
to the required name.
If a sub class needs to have a different view name, override the setViewName
to set the viewName
to the required name.
If the report is in a sub directory, override setReportSubDirectory
to set reportSubDir
to the sub directory.
setRequestProperties
in interface ControllerCommand
setRequestProperties
in class ToolsControllerCommandImpl
reqProperties
- The request properties.ECApplicationException
- If the URL parameter is not passed in.protected void setURLParamName()
Sets the URL context parameter name.
If a sub class needs to have a different parameter name, override this method to set the urlParamName
to the required name.
protected void setViewName()
Sets the view name.
If a sub class needs to have a different view name, override this method to set the viewName
to the required name.
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |