📄 uploadeventstatus.jsp
字号:
<%--
* @author Shefali Bansal
* @version 1.0
*
* Name of the Application : UploadEventStatus.jsp
* Development Environment : Oracle JDeveloper 10g
* Creation/Modification History :
*
* Shefali Bansal 02-Jan-2004 Created
*
* Overview of Application :
* This JSP uploads the media content that is specified in 'UploadEvents.jsp'
* into the oracle interMedia database using the upload tags from Multimedia Tag Library.
* The upload tags that are used include:uploadFormData, uploadFile, and storeMedia. Here the
* media content that is uploaded include an image file, an audio and a video file.
*
* Here the SQL tag library is used to access the oracle database.
--%>
<%@ page language="java" %>
<%@ page errorPage="Exception.jsp" %>
<%-- Specify the location of the TLD file and the required
'ord' and 'sql' prefix attributes (Tag library directives).--%>
<%@ taglib prefix="ord" uri="intermedia-taglib.tld" %>
<%@ taglib prefix="sql" uri="sqltaglib.tld" %>
<%-- Upload the data into the database --%>
<%-- Create a script variable named fd, which is an instance of the oracle.ord.im.OrdHttpUploadFormData
object. This is done using the Multimedia JSP tag 'uploadFormData' --%>
<ord:uploadFormData formDataId = "fd">
<%-- Check for filesize etc. of the uploaded Image file. This is done using the
Multimedia JSP tag 'uploadFile' --%>
<ord:uploadFile
parameter = "ImageFile"
fullFileName = "ffName"
shortFileName = "sfName"
length = "fLength" >
<%
//check if an image file is specified.
if (ffName == null || ffName.length() == 0)
{
%>
<jsp:forward page="UploadEvents.jsp?error=Please+supply+a+valid+image+file+name."/>
<%
return;
}
if (fLength.intValue() == 0)
{
%>
<jsp:forward page="UploadEvents.jsp?error=Please+supply+a+valid+image+file."/>
<%
return;
}
%>
</ord:uploadFile>
<ord:uploadFile
parameter = "AudioFile"
fullFileName = "affName"
shortFileName = "asfName"
length = "afLength" >
<%
//check if an audio file is specified.
if (affName == null || affName.length() == 0)
{
%>
<jsp:forward page="UploadEvents.jsp?error=Please+supply+a+valid+audio+file+name."/>
<%
return;
}
if (afLength.intValue() == 0)
{
%>
<jsp:forward page="UploadEvents.jsp?error=Please+supply+a+valid+audio+file."/>
<%
return;
}
%>
</ord:uploadFile>
<ord:uploadFile
parameter = "VideoFile"
fullFileName = "vffName"
shortFileName = "vsfName"
length = "vfLength" >
<%
//check if a video file is specified.
if (vffName == null || vffName.length() == 0)
{
%>
<jsp:forward page="UploadEvents.jsp?error=Please+supply+a+valid+video+file+name."/>
<%
return;
}
if (vfLength.intValue() == 0)
{
%>
<jsp:forward page="UploadEvents.jsp?error=Please+supply+a+valid+video+file."/>
<%
return;
}
%>
</ord:uploadFile>
<%
String categoryType = fd.getParameter("CategoryType");
String description = fd.getParameter("Description");
java.util.Vector otherValuesVector = new java.util.Vector();
otherValuesVector.add(categoryType);
otherValuesVector.add(description);
%>
<%-- Open the database connection --%>
<sql:dbOpen connId = "myConn" dataSource="jdbc/OracleDS" commitOnClose="true"/>
<%String id = "original"; %>
<%-- Get the next unique event id for the OTN_WEBINAR_EVENTS table in the database.--%>
<sql:dbQuery connId = "myConn" queryId="myQuery" output="jdbc">
SELECT events_sequence.nextval from Dual
</sql:dbQuery>
<sql:dbNextRow queryId="myQuery">
<% id = myQuery.getString(1); %>
</sql:dbNextRow>
<%-- Upload the media data into the image, audio and video columns of the OTN_WEBINAR_EVENTS table,
and the category_id and description information into the category_id and description
columns of the OTN_WEBINAR_EVENTS table. This is done using the Multimedia JSP tag storeMedia. --%>
<ord:storeMedia
conn = "<%= myConn.getConnection() %>"
table = "OTN_WEBINAR_EVENTS"
key = "<%=id%>"
keyColumn = "Event_Id"
mediaColumns = "image, audio, video"
mediaParameters = "ImageFile, AudioFile, VideoFile"
otherColumns = "Category_id, Description"
otherValues = "<%=otherValuesVector%>"
/>
<%-- Close the database connection --%>
<sql:dbClose connId = "myConn" />
</ord:uploadFormData>
<HTML>
<HEAD>
<TITLE>JSP Multimedia Tag Application: Upload Status Page</TITLE>
<META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
<link rel="stylesheet" href="stylesheets/styles.css" type="text/css">
</HEAD>
<BODY text=#000000>
<!-- Main table -->
<TABLE border=0 cellPadding=0 cellSpacing=0 height=58 width=100%>
<TR>
<TD valign="top" width="100%">
<%@ include file="Header.jsp" %>
</TD>
</TR>
<TR>
<TD width="100%">
<table WIDTH ="100%" cellspacing=0 cellpadding=0 height="100%"
bgcolor="#FFFFFF">
<tr>
<TD height="100%">
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<!-- Heading of the page goes here -->
<TR >
<TD valign="middle" height="19" colspan="3" noWrap><b><font color="#990000"> Hi!
You logged in as <%=(String)session.getAttribute("UserType")%>.</font></b></TD>
</TR>
<TR>
<TD valign="middle" colspan="3" noWrap> </TD>
</TR>
<TR>
<TD valign="top" colspan="3" noWrap align="center" class=
"heading">Upload Status</TD>
</TR>
<TBODY>
<TR>
<TD valign="top" width="4%" noWrap> </TD>
<TD vAlign=top width="93%" align="center">
<form name="UploadTypeFrm" method="post">
<TABLE border=0 width="100%">
<TBODY>
<TR>
<TD> </TD>
</TR>
<TR>
<TD align="center"> <span class="formFieldName"> The Event data is successfully uploaded !!!</span></TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD> </TD>
</TR>
<TR>
<TD align="center"> <a href="javascript:history.go(-1)"><img
src="images/uploadmorebutton.gif" border=0 /></a>
<a href="Admin.jsp"><img src=
"images/AdminPageButt.gif" border=0 /></a> </TD>
</TR>
</TBODY>
</TABLE>
</form>
</TD>
<TD width="3%"> </TD>
</TR>
<TR>
<TD colspan=3> </TD>
</TR>
<TR>
<TD colspan=3> </TD>
</TR>
</TBODY>
</TABLE>
</TD>
</tr>
</table>
</td>
</TR>
<TR>
<%@ include file="Footer.jsp" %>
</TR>
</TABLE>
<!-- Main table ends here-->
</BODY>
</HTML>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -