SequenceWhen
the ticket (containing the OID and the format) is obtained, the check
trigger is fired. FCS processes the file and returns the receipt. The
application calls the Below is the sequence for two-part checkin:
The following diagram illustrates two-part checkin: Your Own Two-part CheckinTo write a client that performs a two-part checkin, use the doIt() method of the CheckinStart and CheckinEnd classes. The classes that you use depend on the kind of client you are writing. The doIt() methods are available in these packages:
Two-Part Checkins Using com.matrixone.fcs.mcsThe Checkin.start.doIt() method has four variants. Use this variant when the files are checked into the default store: public static TicketWrapper doIt(Context?ctx, String?connectString, java.util.ArrayList?list) throws MatrixException Use this variant to specify the checkin store: public static TicketWrapper doIt(Context?ctx, String?connectString, String?store, java.util.ArrayList?list) throws MatrixException Use this variant to allow the user to override the store location: public static TicketWrapper doIt(Context?ctx, String?connectString, String?store, String?locationOverride, java.util.ArrayList?list) throws MatrixException The arguments are:
The system will check for the following errors when listing proxies. These situations will lead to exceptions that will rollback the transaction.
To complete the checkin, call the CheckinEnd.doIt() method using one of these variants: public static void doIt(Context?ctx, String?receiptValue) throws java.lang.Exception public static void doIt(Context?ctx, String?store, String?receiptValue) throws MatrixException Two-part Checkins Using com.matrixone.http.HttpThe HttpCheckinStart.doIt() method has the two variants shown below. Use the second variant when you want to allow the user to override the checkin location. public static TicketWrapper doIt(Context?ctx, String?processingPage, String?targetPage, String?errorPage, String?store, String[]?boids, String[]?fileNames,String[]?formats,String[]?append,String[]?un lock, javax.servlet.http.HttpServletRequest?req, javax.servlet.http.HttpServletResponse?res) throws MatrixException public static TicketWrapper doIt(Context?ctx, String?processingPage, String?targetPage, String?errorPage, String?store, String?locationOverride, String[]?boids, String[]?fileNames, String[]?formats, String[]?append, String[]?unlock, javax.servlet.http.HttpServletRequest?req, javax.servlet.http.HttpServletResponse?res) throws MatrixException The arguments are described in the following table:
To complete the checkin, call the HttpCheckinEnd.doIt() method which has this syntax: public static void doIt(Context?ctx, String?store, javax.servlet.http.HttpServletRequest?req, javax.servlet.http.HttpServletResponse?resp) throws MatrixException The following example illustrates how to use the HttpCheckinStart.doIt() method: String targetPage = "/fcs/thankYou.jsp"; String errorPage = "/fcs/errorPage.jsp"; Context ctx = Framework.getFrameContext(session); int numFiles = new Integer(request.getParameter("numFiles")).intValue(); String[] fileNames = request.getParameterValues("fileName"); String[] formats = new String[numFiles]; String[] append = new String[numFiles]; String[] unlock = new String[numFiles]; String[] oids = new String[numFiles]; String[] files = new String[numFiles]; for (int t=0;t<numFiles;t++) { formats[t] = format; oids[t] = oid; append[t] = appendDefault + ""; unlock[t] = unlockDefault + ""; files[t] = fileNames[t]; } TicketWrapper ticket = HttpCheckinStart.doIt(ctx, processingPage, targetPage, errorPage, store, locationOverride, oids, files, 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> This example shows how to complete the checkin with the HttpCheckinEnd.doIt() method. . . . <% Context ctx = Framework.getFrameContext(session); HttpCheckinEnd.doIt(ctx, store, request, response); %> |