Class UploadServlet
- java.lang.Object
-
- javax.servlet.GenericServlet
-
- javax.servlet.http.HttpServlet
-
- de.businesscode.bcdui.upload.data.UploadServlet
-
- All Implemented Interfaces:
java.io.Serializable
,javax.servlet.Servlet
,javax.servlet.ServletConfig
public class UploadServlet extends javax.servlet.http.HttpServlet
Entry point for all data data upload related steps, supports POST and PUT Add custom steps in web.xml in the following format:Steps MY_STEP_NAME: de.my.package.ClassName; MY_STEP_NAME2: de.my.package.ClassName2; - See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static java.lang.String
ANONYMOUS_ID
static java.lang.String
INIT_PARAM_STEPS
static java.lang.String
PARAM_NAME_DELETE
static java.lang.String
PARAM_NAME_FILENAME
static java.lang.String
PARAM_NAME_STEPS
static java.lang.String
PARAM_NAME_TARGETBS
static java.lang.String
PARAM_NAME_UPLOADID
static java.lang.String
PARAM_STEPS_SEPARATOR
static java.lang.String
PART_FILENAME
protected java.util.Map<java.lang.String,java.lang.Class<? extends IUploadStep>>
stepImpls
-
Constructor Summary
Constructors Constructor Description UploadServlet()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static java.sql.Connection
getControlConnection()
protected java.lang.String
getMultipartParam(javax.servlet.http.Part part, java.lang.String paramName)
Retrieve the filename of the data upload file from http headerstatic java.lang.String
getTransformSQL(java.lang.String sql)
protected java.lang.String
getUserId()
void
init()
protected void
service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
Receives an data upload file and creates an entry in bcd_dataupload_control-
Methods inherited from class javax.servlet.http.HttpServlet
doDelete, doGet, doHead, doOptions, doPost, doPut, doTrace, getLastModified, service
-
-
-
-
Field Detail
-
PARAM_NAME_UPLOADID
public static final java.lang.String PARAM_NAME_UPLOADID
- See Also:
- Constant Field Values
-
PARAM_NAME_STEPS
public static final java.lang.String PARAM_NAME_STEPS
- See Also:
- Constant Field Values
-
PARAM_NAME_TARGETBS
public static final java.lang.String PARAM_NAME_TARGETBS
- See Also:
- Constant Field Values
-
PARAM_NAME_DELETE
public static final java.lang.String PARAM_NAME_DELETE
- See Also:
- Constant Field Values
-
PARAM_STEPS_SEPARATOR
public static final java.lang.String PARAM_STEPS_SEPARATOR
- See Also:
- Constant Field Values
-
INIT_PARAM_STEPS
public static final java.lang.String INIT_PARAM_STEPS
- See Also:
- Constant Field Values
-
PART_FILENAME
public static final java.lang.String PART_FILENAME
- See Also:
- Constant Field Values
-
PARAM_NAME_FILENAME
public static final java.lang.String PARAM_NAME_FILENAME
- See Also:
- Constant Field Values
-
ANONYMOUS_ID
protected static final java.lang.String ANONYMOUS_ID
- See Also:
- Constant Field Values
-
stepImpls
protected java.util.Map<java.lang.String,java.lang.Class<? extends IUploadStep>> stepImpls
-
-
Method Detail
-
service
protected void service(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) throws javax.servlet.ServletException
Receives an data upload file and creates an entry in bcd_dataupload_control- Overrides:
service
in classjavax.servlet.http.HttpServlet
- Parameters:
request
-response
-- Throws:
javax.servlet.ServletException
-
getUserId
protected java.lang.String getUserId()
- Returns:
- userId (or a predefined string
ANONYMOUS_ID
) if no user is known
-
getMultipartParam
protected java.lang.String getMultipartParam(javax.servlet.http.Part part, java.lang.String paramName)
Retrieve the filename of the data upload file from http header- Parameters:
part
-paramName
-- Returns:
-
init
public void init() throws javax.servlet.ServletException
- Overrides:
init
in classjavax.servlet.GenericServlet
- Throws:
javax.servlet.ServletException
-
getTransformSQL
public static java.lang.String getTransformSQL(java.lang.String sql)
-
getControlConnection
public static java.sql.Connection getControlConnection() throws java.lang.Exception
- Throws:
java.lang.Exception
-
-