The CheckoutList command displays the FileNet Workplace Checkout List Java™Server Pages (JSP) page, which enables a user to choose from a list of their currently checked-out items. The client application must use the ICheckoutListCmd interface to filter the list of checked-out items that are presented to the user based on MIME type, as well as to customize the page title.
After the CheckoutList command has been executed by calling IAppIntCmd::Invoke, a CheckoutList response component is returned. Client applications may interact with the Response component via the standard IAppIntRsp and custom ICheckoutListRsp interfaces. For more information about working with command and response components and their COM interfaces, see Command and Response components.
DLL | FnAppIntCheckoutListCmd.dll |
See Also | IsCheckedOut, CancelCheckout, Checkin, and QuickCheckin commands |
The CheckoutList command uses the following interfaces:
Interface | Description |
---|---|
ICheckoutListCmd |
This is a custom interface used to initialize the data contained in the CheckoutList command component. The client application can use the method in this interface to customize the dialog title and filter the list of checked-out items that are presented to the user based on MIME type. |
ICheckoutListRsp |
This is a custom interface for the CheckoutList response component that is returned when the CheckoutList command is executed. This interface enables the client application to obtain information about the item that was selected from the checkout list. |
IAppIntCmd |
This is a standard interface which is automatically used by the CheckoutList command to invoke the CheckoutList command component. The client application executes the CheckoutList command by calling this interface and passing the AppIntSession component on which the CheckoutList command component is invoked. Each time the command is executed, an CheckoutList response component is returned. |
IAppIntRsp |
This is a standard interface that is automatically used by the CheckoutList 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\FnAppIntCheckoutListCmd.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 CheckoutList command component ICheckoutListCmdPtr spICheckoutListCmd;
hResult = spICheckoutListCmd.CreateInstance(__uuidof(CheckoutListCmd));
if (FAILED(hResult)) {
std::cout << "Could not create the CheckoutList command component.\n"; _ASSERTE(0);
} // Create the list of allowable MIME types const DWORD cNumElements = 4; long lCount = 0; COleSafeArray saMIMETypes(VT_BSTR, cNumElements); {
long lIndex = 0;
_bstr_t bstrWordMimeType(_T("application/msword"));
saMIMETypes.PutElement(&lCount, bstrWordMimeType.copy()); lIndex++;
_bstr_t bstrExcelMimeType(_T("application/vnd.ms-excel"));
saMIMETypes.PutElement(&lCount, bstrExcelMimeType.copy()); lIndex++;
_bstr_t bstrPPTMimeType(_T("application/vnd.ms-powerpoint"));
saMIMETypes.PutElement(&lCount, bstrPPTMimeType.copy()); lIndex++;
_bstr_t bstrTextMimeType(_T("text/plain"));
saMIMETypes.PutElement(&lCount, bstrTextMimeType.copy());
} _variant_t vMIMETypes((LPCVARIANT) saMIMETypes); // Initialize the custom CheckoutList command component _bstr_t bstrPageTitle = (_T("Customized Checkout List Operation")); std::cout << "Initializing the CheckoutList command component..." << std::endl; spICheckoutListCmd->Initialize(bstrPageTitle, vMIMETypes); // Execute the CheckoutList command and capture the response component std::cout << "Executing the CheckoutList command..." << std::endl; IAppIntCmdPtr spIAppIntCmd(spICheckoutListCmd);
IAppIntRspPtr spIAppIntRsp = spIAppIntCmd->Invoke(spIAppIntSession);// Determine if the command failed, before accessing response component data hResult = spIAppIntRsp->GetHResult(); if (FAILED(hResult)) { std::cout << "The CheckoutList 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 CheckoutList 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 CheckoutListRsp component ICheckoutListRspPtr spICheckoutListRsp(spIAppIntRsp);
_ASSERTE(spICheckoutListRsp != 0);
IObjectStoreItemPtr spIObjectStoreItemSelected = spICheckoutListRsp->GetObjectStoreItem();
_ASSERTE(spIObjectStoreItemSelected != 0);
std::cout << "ObjectStoreName=" << (LPCSTR) spIObjectStoreItemSelected->GetObjectStoreName() << std::endl;
std::cout << "ItemType=" << (LPCSTR) CItemTypeConverter::EnumToBSTR(spIObjectStoreItemSelected->GetItemType()) << std::endl;
std::cout << "VersionSeriesID=" << (LPCSTR) spIObjectStoreItemSelected->GetVersionSeriesID() << std::endl;
std::cout << "VersionID=" << (LPCSTR) spIObjectStoreItemSelected->GetVersionID() << std::endl; }} catch(...) { }