IQuickCheckinCmd::Initialize

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);
Parameters
bstrDialogTitle - [in] Required _bstr_t, which specifies the label to display in the title bar of the Checkin Wizard dialog when the QuickCheckin 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.
bstrPropertiesXml - [in] Required _bstr_t, the XML which specifies the properties to apply to the item during the QuickCheckin 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>
enVersionType - [in] Required VersionType enumeration, that specifies whether or not the document is to be checked-in as a major version, and which can be set to the following:
- 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.
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 QuickCheckin 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 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); ...