NOTE Customers should only use the ISelectObjectCmd2::Initialize2 method in new development, as well as replace existing implementations of ISelectObjectCmd::Initialize with ISelectObjectCmd2::Initialize2. The only difference between these methods is that a parameter has been added to support specification of the tabs for the Java™Server Pages (JSP) page.
The Initialize2 method customizes the Select Item JSP page in preparation for use by the SelectObject operation, by allowing the client application to filter the list of selectable items that are presented to the user (based on object type and MIME type), and to specify the tabs and title for the page
void spISelectObjectCmd2->Initialize2(_bstr_t bstrPageTitle, SelectItemMode enMode, showTabsMode enTabs, VARIANT vMimeTypes);
eFoldersAndDocumentsMode
, select either a document or a
folder. eDocumentsOnlyMode
, select only a document. eFoldersOnlyMode
, select only a folder. eAllObjectTypesMode
, select any type of object, including
documents and folders.eTabNone
, do not display any additional tabs on the JSP
page.eTabSearch
, display the additional "Search" tab in the
left bar of the JSP page. The Search tab enables users to view Search templates
and execute them to locate objects in an Object Store.VT_EMPTY
should
be specified....
// Instantiate the custom SelectObject command component ISelectObjectCmd2Ptr spISelectObjectCmd2;
hResult = spISelectObjectCmd2.CreateInstance(__uuidof(SelectObjectCmd));
if (FAILED(hResult)) {
std::cout << "Could not create the SelectObject 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 SelectObject command component with the // page title, supported object and MIME types, and display the Search Tab. _bstr_t bstrPageTitle = (_T("Customized SelectObject Operation")); SelectItemMode enMode = eFoldersAndDocumentsMode; ShowTabsMode enTabs = eTabSearch; std::cout << "Initializing the SelectObject command component..." << std::endl; spISelectObjectCmd2->Initialize2(bstrPageTitle, enMode, enTabs, vMIMETypes); // Execute the SelectObject2 command and capture the response component std::cout << "Executing the SelectObject2 command..." << std::endl; IAppIntCmdPtr spIAppIntCmd(spISelectObjectCmd2);
IAppIntRspPtr spIAppIntRsp = spIAppIntCmd->Invoke(spIAppIntSession);...