ICheckinCmd2::Initialize2

NOTE Customers should only use the ICheckinCmd2::Initialize2 method in new development, as well as replace existing implementations of ICheckinCmd::Initialize with ICheckinCmd2::Initialize2.

The Initialize2 method is used to configure the Checkin operation, including providing the client with the ability to customize the dialog title. This method also enables the client to specify information about the item to be checked-in, such as the name and directory location of the file on the local machine, the version object for the item, and the XML for the item properties.

void spICheckinCmd2->Initialize2(_bstr_t bstrDialogTitle,
                                 _bstr_t bstrPathName,
                                 IObjectStoreItemPtr pIObjectStoreItem,
                                 _bstr_t bstrRootDocClass,
                                 VARIANT_BOOL bRestrictClass,
                                 _bstr_t bstrPropertiesXml);
Parameters
bstrDialogTitle - [in] Required _bstr_t, which specifies the label to display in the title bar of the Checkin Wizard dialog when the Checkin command is invoked. By using this parameter, client applications can customize the title that appears at the top of the Wizard dialog to correspond with their application requirements.
bstrPathName - [in] Required _bstr_t, which specifies the name and directory location of the file on the local machine that is to be checked-in.
pIObjectStoreItem - [in] Required pointer to an IObjectStoreItem interface, in which the version series ID (GUID) for the reservation object for the object to be checked-in is specified in the bstrVersionID parameter.
bstrRootDocClass - [in] Required _bstr_t, that specifies the root document class ID (GUID) to display and select for use by the Checkin operation, which can be set as follows:
- a GUID identifying the specific root document class.
- an empty string "" signifying that any class may be selected by the user.
bRestrictClass - [in] Required VARIANT_BOOL, which represents the class ID(s) that should be made available for selection and use by the Checkin operation. This parameter can be set to the following:
- VARIANT_TRUE, only allow the root document class ID specified in bstrRootDocClass to be selected.
- VARIANT_FALSE, allow the root document class ID specified in bstrRootDocClass or any of its' children to be selected.
NOTE When bstrRootDocClass is empty, only the base Document class may be selected, regardless of whether bRestrictClass has been set to true or false.
bstrPropertiesXml - [in] Required _bstr_t, the XML which specifies the properties to apply to the item during the Checkin2 operation, where the XML must be of the form:
<properties>
   <property>
      <symname>SymbolicName</symname>
      <values>
         <value>PropertyValue</value>
         <value>...</value></values>
   </property>
   <property>
      ...
   </property>
</properties>

Results
This method always returns an HRESULT value of S_OK if successful.
Sample
The following is a fragment from the complete example for the Checkin command.
   ...
   // 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 Add 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 Checkin command component with the dialog title, // name and directory location of the file on the local machine, // as well as the XML properties. _bstr_t bstrDialogTitle = (_T("Customized Checkin Operation")); _bstr_t bstrPathName = (_T("C:\Temp\DocumentToBeCheckedIn.doc")); _bstr_t bstrRootDocClass = (_T("{379B665E-1BBA-4BEA-AA4A-BE678369F2CC}")); VARIANT_BOOL bRestrictClass = VARIANT_TRUE; std::cout << "Initializing the Checkin command component..." << std::endl; spICheckinCmd2->Initialize2(bstrDialogTitle, bstrPathName, spIObjectStoreItem, bstrRootDocClass, bRestrictClass, bstrPropertiesXml); ...