SequenceThe application uses the Here is the sequence for one-part checkin:
If any triggers in the above sequence are blocked, the file that has already been transferred to the store/location will be deleted by the MCS. Your Own One-Part CheckinTo write a client that performs a one-part checkin, use the Precheckin.doIt() and Checkin.doIt() methods. The classes that you use depend on the kind of client you are writing. The doIt() methods are available in these packages:
One-Part Checkins Using the com.matrixone.fcs.mcsFirst call the com.matrixone.fcs.mcs Precheckin.doIt() method which has two variants. Use the second variant when you want to perform a location override. Static TicketWrapper doIt(Context?ctx, String?store, String?connectString, int?cnt) static TicketWrapper doIt(Context ctx, String?store, String?locationOverride, String?connectString, int?cnt) The parameters for both variants are described in the following table:
Once you have the ticket, use the com.matrixone.fcs.mcs.checkin.doIt() to perform the actual checkin operation. It has this syntax: public static void doIt(Context?ctx, String?receiptValue, String?store, ArrayList?list) throws MatrixException The arguments are described in the following table:
The system will check for the following errors when listing proxies. These situations will lead to exceptions that will rollback the transaction.
First use the com.matrixone.fcs.http.HTTPPrecheckin.doIt() method. It looks like this: public static TicketWrapper doIt(Context?ctx, String?store, int?fileCount, String?processingPage, String?targetPage, String?errorPage, javax.servlet.http.HttpServletRequest?req, javax.servlet.http.HttpServletResponse?res) throws MatrixException The arguments are described in the following table:
This example shows how to use the Http.precheckin.doIt() method to obtain a ticket. . . . String processingPage = "/fcs/checkinMCS.jsp"; String targetPage = "/fcs/thankYou.jsp"; String errorPage = "/fcs/errorPage.jsp"; Context ctx = Framework.getFrameContext(session); int numFiles = new Integer(request.getParameter("numFiles")).intValue(); TicketWrapper ticket = HttpPreCheckin.doIt(ctx, store, numFiles, processingPage, targetPage, errorPage, locationOverride, 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> . . . Once you have the ticket, construct the business object and then perform the actual checkin using this doIt() method: public static void doIt(Context?ctx, String?store, java.util.ArrayList?list, javax.servlet.http.HttpServletRequest?req, javax.servlet.http.HttpServletResponse?resp) throws MatrixException The arguments are described in the following table:
The following code illustrates how to create a new business object proxy passing in the object id, file format. It appends the checkin file and leaves object in the unlocked state after the checkin completes. Context ctx = Framework.getFrameContext(session); String unlock = request.getParameter("unlock"); String append = request.getParameter("append"); String user = request.getParameter("user"); System.out.println("User supplied parameter: " + user); ArrayList list = new ArrayList(); for (int t = 0;t < 5;t++) { BusinessObjectProxy bop = new BusinessObjectProxy(obj.getObjectId(),format, append.equals("true"), unlock.equals("true")); list.add(bop); } String receiptValue = request.getParameter(McsBase.resolveFcsParam("jobReceipt")); HttpCheckin.doIt(context,store,list,request,response); |