?? uploadcategorystatus.jsp
字號:
<%--
* @author Shefali Bansal
* @version 1.0
*
* Name of the Application : UploadCategoryStatus.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 'UploadCategories.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.
*
* 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">
<%-- Create the script variables: ffName, sfName, and fLength, which contain the full file name,
short file name, and file length 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="UploadCategories.jsp?error=Please+supply+a+file+name!!!"/>
<%
return;
}
if (fLength.intValue() == 0)
{
%>
<jsp:forward page="UploadCategories.jsp?error=Please+supply+a+valid+image+file!!!"/>
<%
return;
}
String categoryType = fd.getParameter("CategoryType");
String description = fd.getParameter("Description");
String short_desc = "OTN WEBINAR " ;
// Based on the CategoryType selected, get the short description for the same
if ((categoryType.equals("GRID"))){
short_desc = "Get on the Grid - Online Event";
} else if ((categoryType.equals("BI"))){
short_desc = "Oracle Business Intelligence - Online Event";
} else if ((categoryType.equals("COLLAB"))){
short_desc = "Oracle Collaboration Suite - Online Event";
} else if ((categoryType.equals("LINUX"))){
short_desc = "Oracle Makes Linux Unbreakable - Online Event";
}
// Insert the description and the short description information
// into the vector
java.util.Vector otherValuesVector = new java.util.Vector();
otherValuesVector.add(description);
otherValuesVector.add(short_desc);
%>
<%-- Open the database connection --%>
<sql:dbOpen connId = "myConn" dataSource="jdbc/OracleDS" commitOnClose="true"/>
<%-- Upload the media data into the image column of the OTN_WEBINAR_CATEGORIES table,
and the description and short description information into the description and short_desc columns of
the OTN_WEBINAR_CATEGORIES table. This is done using the Multimedia JSP tag storeMedia. --%>
<ord:storeMedia
conn = "<%= myConn.getConnection() %>"
table = "OTN_WEBINAR_CATEGORIES"
key = "<%=categoryType%>"
keyColumn = "Category_Id"
mediaColumns = "image"
mediaParameters = "ImageFile"
otherColumns = "Description, Short_Desc"
otherValues = "<%=otherValuesVector%>"
/>
<%-- Close the database connection --%>
<sql:dbClose connId = "myConn" />
</ord:uploadFile>
</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 the static 'Header.jsp' file -->
<%@ 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">
<!-- 6th table starts here for working area-->
<TABLE border=0 width="100%">
<TBODY>
<TR>
<TD> </TD>
</TR>
<TR>
<TD align="center"> <span class="formFieldName"> The Category 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 + -