|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectorg.opencms.workplace.CmsWorkplace
org.opencms.workplace.tools.CmsToolDialog
org.opencms.workplace.CmsDialog
org.opencms.workplace.explorer.CmsNewResource
org.opencms.workplace.explorer.CmsNewResourceUpload
org.opencms.workplace.explorer.CmsNewCsvFile
The new resource upload dialog handles the upload of cvs files. They are converted in a first step to xml and in a second step transformed via a xsl stylesheet.
The following files use this class:
| Field Summary | |
static String |
BEST_DELIMITER
Constant for automatically selecting the best fitting delimiter. |
static String |
FRAMEHEIGHT
Constant for the height of the dialog frame. |
static String |
PARAM_CSVCONTENT
Request parameter name for the CSV content. |
static String |
PARAM_DELIMITER
Request parameter name for the delimiter. |
static String |
PARAM_XSLTFILE
Request parameter name for the XSLT file. |
static String |
TABLE_XSLT_SUFFIX
Constant for the xslt file suffix for table transformations. |
static String |
TABULATOR
Constant for the tab-value inside delimiter the select. |
static char |
TEXT_DELIMITER
The delimiter to separate the text. |
| Fields inherited from class org.opencms.workplace.explorer.CmsNewResourceUpload |
ACTION_APPLET, ACTION_NEWFORM2, ACTION_SHOWERROR, ACTION_SUBMITFORM2, DIALOG_SHOWERROR, DIALOG_SUBMITFORM2, PARAM_NEWRESOURCENAME, PARAM_REDIRECTURL, PARAM_TARGETFRAME, PARAM_UNZIPFILE, PARAM_UPLOADERROR, PARAM_UPLOADFILE, PARAM_UPLOADFOLDER |
| Fields inherited from class org.opencms.workplace.explorer.CmsNewResource |
ACTION_NEWFORM, ACTION_SUBMITFORM, BUTTON_NEXT, DIALOG_NEWFORM, DIALOG_SUBMITFORM, DIALOG_TYPE, PARAM_CURRENTFOLDER, PARAM_NEWRESOURCEEDITPROPS, PARAM_NEWRESOURCETYPE, PARAM_NEWRESOURCEURI |
| Fields inherited from class org.opencms.workplace.tools.CmsToolDialog |
PARAM_PATH, PARAM_ROOT, PARAM_STYLE |
| Constructor Summary | |
CmsNewCsvFile(CmsJspActionElement jsp)
Public constructor with JSP action element. |
|
CmsNewCsvFile(PageContext context,
HttpServletRequest req,
HttpServletResponse res)
Public constructor with JSP variables. |
|
| Method Summary | |
void |
actionUpload()
Uploads the specified file and transforms it to HTML. |
String |
applyXslTransformation(String xsltFile,
String xmlContent)
Applies a XSLT Transformation to the xmlContent. |
String |
buildDelimiterSelect()
Builds a html select for Delimiters. |
String |
buildXsltSelect()
Builds a html select for the XSLT files. |
static String |
convertCsvToXml(String csvData,
String delimiter)
Converts CSV data to xml. |
byte[] |
getFileContentFromUpload()
Returns the content of the file upload and sets the resource name. |
String |
getHeadFrameSetHeight()
Returns the height of the head frameset. |
String |
getParamCsvContent()
Returns the pasted csv content. |
String |
getParamDelimiter()
Returns the delimiter to separate the CSV values. |
String |
getParamXsltFile()
Returns the xslt file to transform the xml with. |
String |
getPreferredDelimiter(String csvData)
returns the Delimiter that most often occures in the CSV content. |
List |
getXsltFiles()
Returns a list of CmsResources with the xslt files in the modules folder. |
void |
setParamCsvContent(String csvContent)
Sets the pasted csv content. |
void |
setParamDelimiter(String delimiter)
Sets the delimiter to separate the CSV values. |
void |
setParamXsltFile(String xsltFile)
Sets the path to the xslt file. |
| Methods inherited from class org.opencms.workplace.explorer.CmsNewResourceUpload |
actionCloseDialog, actionUpdateFile, buildTypeList, createAppletCode, getParamNewResourceName, getParamRedirectUrl, getParamTargetFrame, getParamUnzipFile, getParamUploadError, getParamUploadFile, getParamUploadFolder, initWorkplaceRequestValues, setParamNewResourceName, setParamRedirectUrl, setParamTargetFrame, setParamUnzipFile, setParamUploadError, setParamUploadFile, setParamUploadFolder, unzipUpload |
| Methods inherited from class org.opencms.workplace.tools.CmsToolDialog |
dialogTitle, getAdminTool, getCurrentToolPath, getParamPath, getParamRoot, getParamStyle, getParentPath, getToolManager, iconsBlockArea, iconsBlockAreaEnd, iconsBlockAreaStart, initAdminTool, pageBody, pageHtmlStyle, setParamPath, setParamRoot, setParamStyle, useNewStyle |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static final String BEST_DELIMITER
public static final String FRAMEHEIGHT
public static final String PARAM_CSVCONTENT
public static final String PARAM_DELIMITER
public static final String PARAM_XSLTFILE
public static final String TABLE_XSLT_SUFFIX
public static final String TABULATOR
public static final char TEXT_DELIMITER
| Constructor Detail |
public CmsNewCsvFile(CmsJspActionElement jsp)
jsp - an initialized JSP action element
public CmsNewCsvFile(PageContext context,
HttpServletRequest req,
HttpServletResponse res)
context - the JSP page contextreq - the JSP requestres - the JSP response| Method Detail |
public static String convertCsvToXml(String csvData,
String delimiter)
throws IOException
csvData - the csv data to convertdelimiter - the delimiter to separate the values with
IOException - if there is an IO problem
public void actionUpload()
throws JspException
actionUpload in class CmsNewResourceUploadJspException - if inclusion of error dialog fails
public String applyXslTransformation(String xsltFile,
String xmlContent)
xsltFile - the XSLT transformation filexmlContent - the XML content to transform
public String buildDelimiterSelect()
public String buildXsltSelect()
public byte[] getFileContentFromUpload()
throws CmsWorkplaceException
CmsWorkplaceException - if the filesize if greater that maxFileSizeBytes or if the upload file cannot be foundpublic String getHeadFrameSetHeight()
public String getParamCsvContent()
public String getParamDelimiter()
public String getParamXsltFile()
public String getPreferredDelimiter(String csvData)
csvData - the comma separated values
public List getXsltFiles()
public void setParamCsvContent(String csvContent)
csvContent - the csv content to setpublic void setParamDelimiter(String delimiter)
delimiter - the delimiter to separate the CSV values.public void setParamXsltFile(String xsltFile)
xsltFile - the file to transform the xml with.
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||