onePartCheckin.jspThis file holds the frameset used to set up the one-part checkin. <%@include file="common.inc"%> <frameset rows="30%,*" framespacing="0" frameborder="no" border="1"> <frame name="mcsForm" noresize marginheight="10" marginwidth="10" border="1" scrolling="yes" src="<%=response.encodeURL("onePartCheckinMCSForm.jsp?boid=" + request.getParameter("boid"))%>" frameborder="0"> <frame name="fcsForm" noresize marginheight="10" marginwidth="10" border="1" scrolling="yes" src="onePartCheckinFCSForm.jsp" frameborder="0"> </frameset> onePartCheckinFCSFormThis file is the user visible form. The user uses this form to select one or more files for upload. One-part checkin needs only the file count to issue the ticket. <%@include file="common.inc"%> <%@ page import="com.matrixone.servlet.Framework,com.matrixone.fcs.mcs.M csBase" %> <% String errorPage = Framework.getFullClientSideURL(request,response,"/fcs/ errorPage.jsp"); // number of potential files to upload int numPotentialFiles = 5; %> <html> <body> <script> function doFileUpload() { var mcsForm = parent.frames["mcsForm"].document.forms[0]; var actualFileCount = 0; <% for (int i = 0; i < numPotentialFiles;i++) { %> if (document.forms["FCSForm"].file_<%=i%>.value != "") { actualFileCount++; } <% } %> mcsForm.numFiles.value = actualFileCount; mcsForm.submit(); } </script> <form enctype="multipart/form-data" method="post" name="FCSForm" action=""> <br> Error Page: <input name="<%=McsBase.resolveFcsParam("failurePage")%>" value="<%=errorPage%>" size="90"><br> JobTicket: <input name="<%=McsBase.resolveFcsParam("jobTicket")%>" value="" size="90"><br> <br> <% for (int t = 0 ; t < numPotentialFiles; t++) { %> File: <input type="file" name="file_<%=t%>"> <br> <% } %> <br> <hr> User Paramaters - passed through by the FTA to the 'targetPage'<br> <hr> Text Field:<input name="user_1" value="1"> <br> Select Box: <select name="user_2" size="3" multiple> <option value="one">One</option> <option value="two">Two</option> <option value="three">Three</option> </select> <input type="text" name="boris"> </form> <hr> <a href="#" onClick="javascript:doFileUpload();return false;">Go</a> </body> </html> onePartCheckinMCSForm.jspThis form is typically in a hidden frame. (In the example, it is visible for demonstration purposes.) This form is used to send information to the 3DSpace Service to get the job ticket. <html> <body> <b>MCS Form - do not modify - this form is hidden in real system</b> <br> <br> <form name="MCSForm" action="preCheckinMCS.jsp"> NumFiles: <input name="numFiles"><br> </form> </body> </html> preCheckinMCS.jspThis page calls the <%@ page import="com.matrixone.servlet.*,matrix.db.*,com.matrixone.fcs.h ttp.*,com.matrixone.fcs.common.*,com.matrixone.fcs.mcs.*"%> <% String processingPage = "/fcs/checkinMCS.jsp"; String targetPage = "/fcs/thankYou.jsp"; String errorPage = "/fcs/errorPage.jsp"; Context ctx = Framework.getFrameContext(session); String store = "STORE"; int numFiles = new Integer(request.getParameter("numFiles")).intValue(); System.out.println("Num files: " + numFiles); TicketWrapper ticket = HttpPreCheckin.doIt(ctx, store, numFiles, processingPage, targetPage, errorPage, request, response); String ticketStr = ticket.getExportString(); String actionURL = ticket.getActionURL(); %> <html> <body> <script> var fcsForm = parent.frames["fcsForm"].document.forms[0]; fcsForm.<%=McsBase.resolveFcsParam("jobTicket")%>.value='<%=tic ketStr%>'; fcsForm.action='<%=actionURL%>'; fcsForm.submit(); </script> </body> </html> checkinMCS.jsp
<%@ page import="matrix.db.*,com.matrixone.fcs.http.*,com.matrixone.fcs. mcs.*,com.matrixone.servlet.*,java.util.*" errorPage="errorPage.jsp"%> <%@ include file="objSetup.inc"%> <% Context ctx = Framework.getFrameContext(session); String store="STORE"; String format="generic"; String unlock = request.getParameter("unlock"); String append = request.getParameter("append"); String user = request.getParameter("boris"); ArrayList list = new ArrayList(); BusinessObjectProxy bop = new BusinessObjectProxy(obj.getObjectId(), format, append.equals("true"), unlock.equals("true")); list.add(bop); HttpCheckin.doIt(ctx, store, list, request, response); %> twoPartCheckin.jspThis file holds the frameset used to set up the two-part checkin. <%@include file="common.inc"%> <frameset rows="40%,*" framespacing="0" frameborder="no" border="1"> <frame name="mcsForm" noresize marginheight="10" marginwidth="10" border="1" scrolling="yes" src="<%=response.encodeURL("twoPartCheckinMCSForm.jsp?boid=" + request.getParameter("boid"))%>" frameborder="0"> <frame name="fcsForm" noresize marginheight="10" marginwidth="10" border="1" scrolling="yes" src="twoPartCheckinFCSForm.jsp" frameborder="0"> </frameset> twoPartCheckinFCSFormThis file is the user visible form. The user uses this form to select one or more files for upload. <%@include file="common.inc"%> <%@ page import="com.matrixone.servlet.Framework,com.matrixone.fcs.mcs.M csBase" %> <% String errorPage = Framework.getFullClientSideURL(request,response,"/fcs/ errorPage.jsp"); int numPotentialFiles = 5; %> <html> <body> <script> function doFileUpload() { var mcsForm = parent.frames["mcsForm"].document.forms[0]; var t = 0; <% for (int i = 0; i < numPotentialFiles;i++) { %> if (document.forms["FCSForm"].file_<%=i%>.value != "") { mcsForm.fileName[<%=i%>].value = document.forms["FCSForm"].file_<%=i%>.value; mcsForm.format[<%=i%>].value = document.forms["FCSForm"].format_<%=i%>.value; mcsForm.append[<%=i%>].value = document.forms["FCSForm"].append_<%=i%>[0].checked; mcsForm.unlock[<%=i%>].value = document.forms["FCSForm"].unlock_<%=i%>[0].checked; } <% } %> mcsForm.submit(); } </script> <form enctype="multipart/form-data" method="post" name="FCSForm" action=""> <br> Error Page: <input name="<%=McsBase.resolveFcsParam("failurePage")%>" value="<%=errorPage%>" size="90"><br> JobTicket: <input name="<%=McsBase.resolveFcsParam("jobTicket")%>" value="" size="90"><br> <br> <% for (int i = 0 ; i < numPotentialFiles; i++) { %> File: <input type="file" name="file_<%=i%>"> <br> Format: <input name="format_<%=i%>" value="test"><br> Append: True: <input type="radio" name="append_<%=i%>" value="true" checked> False: <input type="radio" name="append_<%=i%>" value="false" ><br> Unlock: True: <input type="radio" name="unlock_<%=i%>" value="true" checked> False: <input type="radio" name="unlock_<%=i%>" value="false" ><br> <% } %> <br> <hr> User Paramaters - passed through by the FCS to the 'targetPage'<br> <hr> Text Field:<input name="user_1" value="1"> <br> Select Box: <select name="user_2" size="3" multiple> <option value="one">One</option> <option value="two">Two</option> <option value="three">Three</option> </select> </form> <hr> <a href="#" onClick="javascript:doFileUpload();return false;">Go</a> </body> </html> twoPartCheckinMCSForm.jspThis form is typically in a hidden frame. (In the example, it is visible for demonstration purposes.) This form is used to send information to the 3DSpace Service to get the job ticket. <html> <body> <b>MCS Form - do not modify - this form is hidden in real system</b> <br> <br> <form name="MCSForm" action="checkinMCSStart.jsp"> <% int numPotentialFiles = 5; for (int i = 0; i < numPotentialFiles;i++) { %> FileName: <input name="fileName" value="" size="50"><br> Boid: <input name="boid" value="<%=request.getParameter("boid")%>"><br> Format: <input name="format" size="50"><br> Append: <input name="append" size="50"><br> Unlock: <input name="unlock" size="50"><br> <% } %> </form> </body> </html> checkinMCSStart.jspThis page calls the <%@ page import="com.matrixone.servlet.*,matrix.db.*,com.matrixone.fcs.h ttp.*,com.matrixone.fcs.common.*,com.matrixone.fcs.mcs.*"%> <%! void dumpList(String[] args) { for (int t =0; t< args.length;t++) { System.out.println("t: " + t + " " + args[t]); } } %> <% String processingPage = "/fcs/checkinMCSEnd.jsp"; String targetPage = "/fcs/thankYou.jsp"; String errorPage = "/fcs/errorPage.jsp"; Context ctx = Framework.getFrameContext(session); String[] boids = request.getParameterValues("boid"); String[] fileNames = request.getParameterValues("fileName"); String[] formats =request.getParameterValues("format"); String[] append = request.getParameterValues("append"); String[] unlock = request.getParameterValues("unlock"); dumpList(boids); dumpList(fileNames); dumpList(formats); dumpList(append); dumpList(unlock); String store="STORE"; TicketWrapper ticket = HttpCheckinStart.doIt(ctx, processingPage, targetPage, errorPage, store, boids, fileNames, formats, append, unlock, request, response); String ticketStr = ticket.getExportString(); String actionURL = ticket.getActionURL(); %> <html> <body> <script> var fcsForm = parent.frames["fcsForm"].document.forms[0]; fcsForm.<%=McsBase.resolveFcsParam("jobTicket")%>.value='<%=tic ketStr%>'; fcsForm.action='<%=actionURL%>'; fcsForm.submit(); </script> </body> </html> checkinMCSEnd.jspThis page is called by the FCS when the checkin operation is completed. This page is called with a Job Receipt. This page performs the actual meta-data checkin. <%@ page import="matrix.db.*,com.matrixone.fcs.http.*,com.matrixone.serv let.*" errorPage="errorPage.jsp"%> <% Context ctx = Framework.getFrameContext(session); String store = "STORE"; HttpCheckinEnd.doIt(ctx, store, request, response); %> thankYou.jspThis page is called by the 3DSpace Service when the checkin is completed. <html> <body> <script> parent.document.location="thankYouText.jsp"; </script> </body> </html> thankYouText.jspThis page is called from <html> <body> Thanks for uploading with the FTA. <br> <a href="index.jsp">Back to main page</a> </body> </html> |