The Initialize method 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, the version type to apply, and the XML for the item properties.
void spIQuickCheckinCmd->Initialize(_bstr_t bstrDialogTitle, _bstr_t bstrPathName, IObjectStoreItemPtr pIObjectStoreItem, _bstr_t bstrPropertiesXml, VersionType enVersionType);
<properties>
<property>
<symname>SymbolicName</symname>
<values>
<value>PropertyValue</value>
<value>...</value></values>
</property>
<property>
...
</property>
</properties>
eMajorVersion
, (1) the checkin is a major version.
eMinorVersion
, (2) the checkin is not a major version.
eDefaultVersion
, (3) the checkin version is determined
according to the Site Preference settings.... // 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 QuickCheckin 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 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);
...