One-Part Checkin

In one-part checkin, the business object that the file will be checked into typically does not exist yet. This type of checkin is supported.

This page discusses:

Sequence

The application uses the preCheckin() method to obtain a ticket with no OID and format. The FCS then processes the file(s). Upon ticket receipt, the application calls the 3DSpace Service checkin methods and any triggers are fired.

Here is the sequence for one-part checkin:

  1. Get the ticket using preCheckin()
  2. Transfer the file.
  3. Call checkin()
    1. Check trigger is fired.
    2. Meta data is written.
    3. Action trigger is fired.

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 Checkin

To 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:

  • com.matrixone.fcs.mcs--Use this when the client performing the checkin is located on the MQL/FCS server.
  • com.matrixone.fcs.http.Http--Use this when the client performing the checkin is a browser client.

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

3DSpace 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 3DSpace 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 3DSpace 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 3DEXPERIENCE platform context

Store

The store name

List

The list of proxy files

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.

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);