The QuickCheckin Command enables the user to quickly checkin an item into an object store without using the FileNet Workplace Checkin Wizard. If you would prefer to display the FileNet Workplace Checkin Wizard to the user, use the Checkin command instead of QuickCheckin.
The client application must use the IQuickCheckinCmd interface to specify the item to checkin. Once the user has completed the QuickCheckin operation, a pointer to the checked-in item is returned to the client application. After the document is checked-in, the client is responsible for deleting the local file, unless otherwise directed by the Site Preference settings. If indicated by the Site Preferences, the application will delete the document.
After the QuickCheckin command has been executed by calling IAppIntCmd::Invoke, a Checkin response component is returned. Client applications may interact with the Response component via the standard IAppIntRsp and custom ICheckinRsp interfaces. For more information about working with command and response components and their COM interfaces, see Command and Response components.
DLL | FnAppIntCheckinCmd |
See Also | Checkin, CheckoutList and CancelCheckout commands |
The QuickCheckin command uses the following interfaces:
Interface | Description |
---|---|
IQuickCheckinCmd |
This is a custom interface used to initialize the data contained in the QuickCheckin command component. The client application can use the methods in this interface to identify the item to check-in by specifying the name and directory location of the file on the local machine, the version object for the item, the version type to apply, and the XML for the item properties, as well as to customize the dialog title. |
ICheckinRsp |
This is a custom interface for the Checkin response component that is returned when the QuickCheckin command is executed. This interface enables the client application to obtain information about the item that was checked into the object store. |
IAppIntCmd |
This is a standard interface which is automatically used by the QuickCheckin command to invoke the QuickCheckin command component. The client application executes the QuickCheckin command by calling this interface and passing the AppIntSession component on which the QuickCheckin command component is invoked. Each time the command is executed, a Checkin response component is returned. |
IAppIntRsp |
This is a standard interface that is automatically used by the QuickCheckin command to determine the success or failure of the command, as well as retrieve any error code or messages. |
In the application's StdAfx.h header file:
#import "C:\Program Files\FileNet\AppInt\FnAppIntCmd.tlb" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntHttpRequest.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntBrowserDlg.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntHttpConnection.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntResources.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntClientRecordBase.tlb" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntClientStore.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntSession.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntSessionLogin.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntCmdComponents.dll" named_guids no_namespace
#import "C:\Program Files\FileNet\AppInt\FnAppIntCheckinCmd.dll" named_guids no_namespace
In the application's primary .cpp source file:
// Instantiate the StdSessionLogin component
IStdSessionLoginPtr spIStdSessionLogin;
HRESULT hResult = spIStdSessionLogin.CreateInstance(__uuidof(StdSessionLogin));
if (FAILED(hResult)) { std::cout << "Could not create the StdSessionLogin component." << std::endl; _ASSERTE(0); } try {
// Initialize the StdSessionLogin component to create // a separate, non-unified login for the client application // by specifying the session / client application name. std::cout << "Initializing the StdSessionLogin component to use NON-unified login..." << std::endl; _bstr_t sessionName(_T("WordPerfect")); spIStdSessionLogin->InitializeViaSessionName(sessionName);
// Instantiate the AppIntSession component
IAppIntSessionPtr spIAppIntSession;
hResult = spIAppIntSession.CreateInstance(__uuidof(AppIntSession)); if (FAILED(hResult)) { std::cout << "Could not create the AppIntSession component." << std::endl; _ASSERTE(0); } // Initialize the AppIntSession component with the StdSessionLogin component
std::cout << "Initializing the AppIntSession component..." << std::endl;
spIAppIntSession->Initialize(spIStdSessionLogin); // * The Client Application may invoke a SessionLogin here; otherwise, // * it will automatically be invoked as needed when commands are executed. std::cout << "Checking Login Status..." << std::endl; VARIANT_BOOL bIsLoggedIn = spIAppIntSession->IsLoggedIn(); if (bIsLoggedIn == VARIANT_TRUE) { std::cout << "User is currently Logged In." << std::endl; } else {
std::cout << "User is NOT currently Logged In." << std::endl;
std::cout << "Attempting Login..." << std::endl;
hResult = spIAppIntSession->Login(); if (FAILED(hResult)) { std::cout << "Login failed." << std::endl; _ASSERTE(0); }
std::cout << "Login succeeded." << std::endl; } // Instantiate the custom QuickCheckin command component IQuickCheckinCmdPtr spIQuickCheckinCmd;
hResult = spIQuickCheckinCmd.CreateInstance(__uuidof(QuickCheckinCmd));
if (FAILED(hResult)) {
std::cout << "Could not create the QuickCheckin command component.\n"; _ASSERTE(0);
} // Instantiate the ObjectStoreItem component to hold // the version object for the checked-out item IObjectStoreItemPtr spIObjectStoreItem; hResult = spIObjectStoreItem.CreateInstance(__uuidof(ObjectStoreItem));
if (FAILED(hResult)) {
std::cout << "Could not create the ObjectStoreItem component.\n"; _ASSERTE(0);
} // Initialize the ObjectStoreItem component with // the items' type, name, version series ID and version ID. ItemType eItemType = eItemTypeDocument; _bstr_t bstrObjectStoreName = (_T("Alaska")); _bstr_t bstrVersionSeriesID = (_T("{6BC064A2-2D58-4B0A-AEF2-B2F8A1100000}")); _bstr_t bstrVersionID = (_T("{DDE54469-36D9-4fe9-8676-445E4994DE1F}")); std::cout << "Initializing the ObjectStoreItem component..." << std::endl;
spIObjectStoreItem->Initialize(eItemType, bstrObjectStoreName, bstrVersionSeriesID, bstrVersionID); // Define the XML properties for the item to Checkin std::cout << "Defining the XML item properties..." << std::endl; _bstr_t bstrPropertiesXml = _T( "" ); bstrPropertiesXml += _T("<properties>");
bstrPropertiesXml += _T("<property>");
bstrPropertiesXml += _T("<symname>DocumentTitle</symname>"); bstrPropertiesXml += _T("<values>");
bstrPropertiesXml += _T("<value>AddedDocument.doc</value></values>");
bstrPropertiesXml += _T("</property>");
bstrPropertiesXml += _T("<property>");
bstrPropertiesXml += _T("<symname>CommentReq</symname>"); bstrPropertiesXml += _T("<values>");
bstrPropertiesXml += _T("<value>This document contains new information to be checked-in.</value></values>");
bstrPropertiesXml += _T("</property>");
bstrPropertiesXml += _T("<property>");
bstrPropertiesXml += _T("<symname>SVCPStr</symname>"); bstrPropertiesXml += _T("<values>");
bstrPropertiesXml += _T("<value>This is the SVCPStr property</value></values>");
bstrPropertiesXml += _T("</property>");
bstrPropertiesXml += _T("</properties>");// Initialize the custom QuickCheckin command component with the dialog title, // name and directory location of the file on the local machine, // and the version type to apply, as well as the XML properties. _bstr_t bstrDialogTitle = (_T("Customized QuickCheckin Operation")); _bstr_t bstrPathName = (_T("C:\Temp\DocumentToBeCheckedIn.doc")); VersionType eVersionType = eMajorVersion; std::cout << "Initializing the QuickCheckin command component..." << std::endl; spIQuickCheckinCmd->Initialize(bstrDialogTitle, bstrPathName, spIObjectStoreItem, bstrPropertiesXml, eVersionType); // Execute the QuickCheckin command and capture the response component std::cout << "Executing the QuickCheckin command..." << std::endl; IAppIntCmdPtr spIAppIntCmd(spIQuickCheckinCmd);
IAppIntRspPtr spIAppIntRsp = spIAppIntCmd->Invoke(spIAppIntSession);// Determine if the command failed, before accessing response component data hResult = spIAppIntRsp->GetHResult(); if (FAILED(hResult)) { std::cout << "The QuickCheckin command failed to execute." << std::endl; // Examine the error information provided in the standard response component _bstr_t bstrErrorName = spIAppIntRsp->GetErrorName(); std::cout << "ErrorName=" << ( bstrErrorName.length() ? (LPCSTR) bstrErrorName : _T( "" ) ) << std::endl; _bstr_t bstrErrorMsg = spIAppIntRsp->GetErrorMsg(); std::cout << "ErrorMsg=" << ( bstrErrorMsg.length() ? (LPCSTR) bstrErrorMsg : _T( "" ) ) << std::endl; _bstr_t bstrErrorDetails = spIAppIntRsp->GetErrorDetails(); std::cout << "ErrorDetails=" << ( bstrErrorDetails.length() ? (LPCSTR) bstrErrorDetails : _T( "" ) ) << std::endl; _ASSERTE(0); } else { std::cout << "The QuickCheckin command succeeded." << std::endl; // Obtain the response name and description from the standard response component _bstr_t bstrResponseDescription = spIAppIntRsp->GetDescription(); std::cout << "ResponseDescription=" << ( bstrResponseDescription.length() ? (LPCSTR) bstrResponseDescription : _T( "" ) ) << std::endl; _bstr_t bstrResponseName = spIAppIntRsp->GetName(); std::cout << "ResponseName=" << ( bstrResponseName.length() ? (LPCSTR) bstrResponseName : _T( "" ) ) << std::endl; // Obtain the specific response information contained in the custom CheckinRsp component ICheckinRspPtr spICheckinRsp(spIAppIntRsp);
_ASSERTE(spICheckinRsp != 0);
IObjectStoreItemPtr spIObjectStoreItemCheckedIn = spIAddRsp->GetObjectStoreItem();
_ASSERTE(spIObjectStoreItemCheckedIn != 0);
std::cout << "ObjectStoreName=" << (LPCSTR) spIObjectStoreItemCheckedIn->GetObjectStoreName() << std::endl;
std::cout << "ItemType=" << (LPCSTR) CItemTypeConverter::EnumToBSTR(spIObjectStoreItemCheckedIn->GetItemType()) << std::endl;
std::cout << "VersionSeriesID=" << (LPCSTR) spIObjectStoreItemCheckedIn->GetVersionSeriesID() << std::endl;
std::cout << "VersionID=" << (LPCSTR) spIObjectStoreItemCheckedIn->GetVersionID() << std::endl; }} catch(...) { }