ISelectPropertiesCmd::Initialize

The Initialize method customizes the Select Properties Java™Server Pages (JSP) page in preparation for use by the SelectProperties operation, including filtering the list of selectable properties by document item or class, the number of properties that can be selected and whether system properties should be included, as well as the columns and the page title to display.

void spISelectPropertiesCmd->Initialize(_bstr_t bstrPageTitle,
                                        IObjectStoreItemPtr pIObjectStoreItem,
                                        _bstr_t bstrPropertiesXml,
                                        ColumnMode enColMode,
                                        Boolean bMultiSelect,
                                        Boolean bShowSystemProperties);
Parameters
bstrPageTitle - [in] Required _bstr_t, which specifies the label to display in the title bar of the Select Properties JSP page when the SelectProperties command is invoked. By using this parameter, client applications can customize the title that appears at the top of the JSP page to correspond with their application requirements.
pIObjectStoreItem - [in] Required pointer to an IObjectStoreItem interface, in which the version series ID (GUID) for the reservation object for the object for which to select the property, is specified in the bstrVersionID parameter.
bstrPropertiesXml - [in] Required _bstr_t, the XML which specifies the properties to apply to the item during the SelectProperties 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>
enColMode - [in] Required ColumnMode enumeration, which specifies the number of columns to display for the SelectProperties operation and can be set to the following:
- eColumnModeTwo, display two columns (0).
- eColumnModeFour, display four columns (1).
bMultiSelect - [in] Required Boolean, which indicates the number of properties that may be selected. This parameter can be set to the following:
- VARIANT_TRUE, multiple properties may be selected.
- VARIANT_FALSE, only a single property may be selected.
bShowSystemProperties - [in] Required Boolean, which indicates whether system properties should be available for selection. This parameter can be set to the following:
- VARIANT_TRUE, display system properties and make them available for selection.
- VARIANT_FALSE, do not make system properties available for selection.
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 SelectProperties command.
   ...
   // Instantiate the ObjectStoreItem component
   IObjectStoreItemPtr pIObjectStoreItem;
   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, object store name, version series ID and item ID ItemType enItemType = eItemTypeDocument; _bstr_t bstrObjectStoreName = (_T("Alaska")); _bstr_t bstrVersionSeriesID = (_T("{6BC064A2-2D58-4B0A-AEF2-B2F8A1100000}")); _bstr_t bstrItemID = (_T("{DDE54469-36D9-4fe9-8676-445E4994DE1F}")); std::cout << "Initializing the ObjectStoreItem component..." << std::endl;
spIObjectStoreItem->Initialize(enItemType, bstrObjectStoreName, bstrVersionSeriesID, bstrItemID); // Define the XML properties for the item 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>SelectedDocument.doc</value></values>"); bstrPropertiesXml += _T("<selected>false</selected>");
bstrPropertiesXml += _T("</property>");
bstrPropertiesXml += _T("<property>");
bstrPropertiesXml += _T("<symname>CommentReq</symname>"); bstrPropertiesXml += _T("<values>");
bstrPropertiesXml += _T("<value>This document contains the information to be selected.</value></values>"); bstrPropertiesXml += _T("<selected>false</selected>");
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("<selected>true</selected>");
bstrPropertiesXml += _T("</property>");
bstrPropertiesXml += _T("</properties>");
// Instantiate the custom SelectProperties command component ISelectPropertiesCmdPtr spISelectPropertiesCmd;
hResult = spISelectPropertiesCmd.CreateInstance(__uuidof(SelectPropertiesCmd));
if (FAILED(hResult)) {
std::cout << "Could not create the SelectProperties command component.\n"; _ASSERTE(0);
} // Initialize the custom SelectProperties command component with the // page title, two columns, single property selection, and no system properties. _bstr_t bstrPageTitle = (_T("Customized SelectProperties Operation")); ColumnMode enColMode = eColumnsTwo; bool bMultiSelect = false; bool bShowSystemProperties = false; std::cout << "Initializing the SelectProperties command component..." << std::endl; spISelectPropertiesCmd->Initialize(bstrPageTitle, pIObjectStoreItem, bstrPropertiesXml, enColMode, bMultiSelect, bShowSystemProperties);
...