
One-Part Checkins Using the com.matrixone.fcs.mcs
First 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:
Argument |
Description |
Context |
ENOVIA Live Collaboration context |
Store |
A valid location |
LocationOverride |
The URL to the location where the checkout should
be performed |
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:
Argument |
Description |
Context |
The ENOVIA Live Collaboration context |
receiptValue |
|
Store |
A valid location |
List |
The list of proxies given during the last step
is in the exact same order as the related files have been uploaded. If
they are not, the wrong files may be associated to the VPLM metadata,
leading to possible data issues that will be detected later on when trying
to read the data and will be very difficult to fix. |
The system will check for the following errors when listing proxies.
These situations will lead to exceptions that will rollback the transaction.
- The count of proxy list entries with file names does not match the size
of the proxy list.
- There are duplicate file names in the proxy list
- There are duplicate file names in the receipt.
- The file is mentioned in the receipt, but no corresponding proxy
found.
- The proxy is passed in, but no corresponding entry in the receipt.
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:
Argument |
Description |
Ctx |
The ENOVIA Live Collaboration context |
Store |
The store name |
fileCount |
The number of files to checkin |
ProcessingPage |
The page for the checkin end |
targetPage |
The final destination page |
errorPage |
The error page |
Req |
The servlet request. It must contain params
of boid, fileName, format, append, and unlock. The system throws an exception
if the count does not match. |
Res |
The servlet response |
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:
Argument |
Description |
Ctx |
The ENOVIA context |
Store |
The store name |
List |
The list of proxy files |
ProcessingPage |
The page for the checkin end |
targetPage |
The finel destination page |
errorPage |
The error page |
Req |
The servlet request. It must contain params
of boid, fileName, format, append, and unlock. The system throws an exception
if the count does not match. |
Resp |
The servlet response |
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);