<?xml version="1.0" encoding="utf-8"?>
<rss xmlns:atom="https://www.w3.org/2005/Atom" xmlns:sy="https://purl.org/rss/1.0/modules/syndication/" xmlns:dc="https://purl.org/dc/elements/1.1/" xmlns:content="https://purl.org/rss/1.0/modules/content/" xmlns:wfw="https://wellformedweb.org/CommentAPI/" xmlns:slash="https://purl.org/rss/1.0/modules/slash/"
  version="2.0">
  <channel>
    <title>Vinayak's WebLog</title>
    <atom:link
      href="https://docs.microsoft.com/archive/blogs/vinayakt/feed.xml"
      rel="self"
      type="application/rss+xml" />
    <link>https://docs.microsoft.com/archive/blogs/vinayakt/feed.xml</link>
    <description>Things you wanted to know about Microsoft Commerce Server</description>
    <lastBuildDate>Tue, 16 Apr 2019 05:35:47 GMT</lastBuildDate>
    <language>en-US</language>
    <sy:updatePeriod>hourly</sy:updatePeriod>
    <sy:updateFrequency>1</sy:updateFrequency>
    <item>
      <title>Adding multilingual display names to property definitions</title>
      <link>https://docs.microsoft.com/archive/blogs/vinayakt/adding-multilingual-display-names-to-property-definitions</link>
      <pubDate>Sat, 07 Oct 2006 02:22:00 GMT</pubDate>
      <dc:creator><![CDATA[vinayakt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vinayakt/2006/10/07/adding-multilingual-display-names-to-property-definitions/</guid>
      <description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The Commerce Server 2007 catalog system supports...]]></description>
      <content:encoded><![CDATA[<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The Commerce Server 2007 catalog system supports multilingual display names for Property definitions, catalog definitions, products, categories and variants. This post discusses multilingual display name support for property definitions. </P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The following are the steps to add multilingual display names for property definitions</P>
<OL>
<LI>Add the desired langauges to the property definitions</LI>
<LI>Set the display names for the desired property.</LI></OL>
<P>While the above steps can be performed from the Catalog and Inventory Schema Manager, you can programatically achieve this as follows:</P>
<P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 border=1 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 6.15in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width=590>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">///</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&lt;summary&gt;<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">///</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> Language support for property definitions<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">///</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&lt;/summary&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">///</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&lt;param name="catalogContext"&gt;&lt;/param&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">internal</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">void</SPAN> AddLanguagesToPropertyDefinitions(<SPAN style="COLOR: teal">CatalogContext</SPAN> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catalogContext)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Add the languages to the Property definitions<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catalogContext.AddLanguageToPropertyDefinitions(<SPAN style="COLOR: maroon">"en-US"</SPAN>);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catalogContext.AddLanguageToPropertyDefinitions(<SPAN style="COLOR: maroon">"fr-FR"</SPAN>);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Get the langauges added to the Property definitions<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">foreach</SPAN>(<SPAN style="COLOR: blue">string</SPAN> language <SPAN style="COLOR: blue">in</SPAN> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catalogContext.GetPropertyDefinitionLanguages())<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">Console</SPAN>.WriteLine(language);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// To set the displaynames for properties<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Get the CatalogProperty object<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">CatalogProperty</SPAN> property = catalogContext.GetProperty(<SPAN style="COLOR: maroon">"Name"</SPAN>);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// For a language X, you can get/set the display name in the <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>// DisplayName_X property<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>property[<SPAN style="COLOR: maroon">"DisplayName_en-US"</SPAN>] = <SPAN style="COLOR: maroon">"Name"</SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>property[<SPAN style="COLOR: maroon">"DisplayName_fr-FR"</SPAN>] = <SPAN style="COLOR: maroon">"Nom"</SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1"></SPAN><SPAN style="COLOR: green">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Save the displaynames<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>property.Save();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Get the English display names<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue"><FONT color=#0000ff size=2><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">string</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000> displayNameEn = </FONT><SPAN style="COLOR: blue">null</SPAN><FONT color=#000000>;</FONT></SPAN></FONT></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="COLOR: blue"><FONT color=#0000ff size=2><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000><o:p></o:p></FONT></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Ensure that the property exists and it has a value<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000> ( property.HasProperty(</FONT><SPAN style="COLOR: maroon">"DisplayName_en-US"</SPAN><FONT color=#000000>) &amp;&amp; </FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; !property.IsPropertyNull(</FONT><SPAN style="COLOR: maroon">"DisplayName_en-US"</SPAN><FONT color=#000000>))</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; {<o:p></o:p></FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>displayNameEn = (</FONT><SPAN style="COLOR: blue">string</SPAN><FONT color=#000000>)property[</FONT><SPAN style="COLOR: maroon">"DisplayName_en-US"</SPAN><FONT color=#000000>];</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; }</FONT></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><FONT color=#000000></FONT></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"></FONT></SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="COLOR: green">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; // Remove the language <o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catalogContext.RemoveLanguageFromPropertyDefinitions(<SPAN style="COLOR: maroon">"fr-FR"</SPAN>);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}</SPAN></P></TD></TR></TBODY></TABLE></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P>]]></content:encoded>
    </item>
    <item>
      <title>Extending the entites in the Catalog and Inventory Systems</title>
      <link>https://docs.microsoft.com/archive/blogs/vinayakt/extending-the-entites-in-the-catalog-and-inventory-systems</link>
      <pubDate>Fri, 06 Oct 2006 04:14:00 GMT</pubDate>
      <dc:creator><![CDATA[vinayakt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vinayakt/2006/10/06/extending-the-entites-in-the-catalog-and-inventory-systems/</guid>
      <description><![CDATA[Commerce Server 2007 allows you to extend the different entities in the Catalog and Inventory...]]></description>
      <content:encoded><![CDATA[<P>Commerce Server 2007 allows you to extend the different entities in the Catalog and Inventory systems in a straightforward manner. These are the various entities that can be extended</P>
<OL>
<LI>Property Definitions </LI>
<LI>Catalog&nbsp; Definitions</LI>
<LI>Inventory Catalog</LI>
<LI>Inventory Skus</LI>
<LI>Product and Categories </LI></OL>
<P>All the above entities except 5 can be extended as follows</P>
<OL>
<LI>Create a property. For eg if you want to associate a VendorId with a catalog, create a property named VendorId of datatype string.</LI>
<LI>Add the property to the appropriate entity</LI>
<LI>Once the entity has been added to the entity you can access its value using the indexer or the corresponding dataset. For eg. string vendorId&nbsp; = (string)productCatalog["VendorId"];</LI>
<LI>You can also enumerate the list of properties added to a particular entity</LI>
<LI>Note that multilingual properties cannot be added to the first four entities</LI>
<LI>If your site contains an inventory resource then the properties defined in the catalog system can be used to extend the Inventory Catalog and Inventry Skus entities</LI></OL>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; The above operations can be performed from the Catalog and Inventory Schema manager. This is how you can perform the above tasks programatically.</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; Assume that you want to add a VendorId property to track vendors for your product catalogs</P>
<P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; WIDTH: 7.95in; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 width=763 border=1 class="MsoTableGrid">
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD class="" style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 7.95in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width=763>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">///</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&lt;summary&gt;<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">///</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> Extends the ProductCatalog Entity<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">///</SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> </SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&lt;/summary&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN lang=FR style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR">///</SPAN><SPAN lang=FR style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR"> </SPAN><SPAN lang=FR style="FONT-SIZE: 10pt; COLOR: gray; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR">&lt;param name="catalogContext"&gt;&lt;/param&gt;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN lang=FR style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR">internal</SPAN><SPAN lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR"> <SPAN style="COLOR: blue">void</SPAN> ExtendCatalogEntity(<SPAN style="COLOR: teal">CatalogContext</SPAN> catalogContext)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Create the property <o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">CatalogProperty</SPAN> property = catalogContext.CreateProperty(<SPAN style="COLOR: maroon">"VendorId"</SPAN>, <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>CatalogDataType</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">.String, 25);</SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p></o:p></SPAN>&nbsp;</P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Add the property<SPAN style="mso-spacerun: yes">&nbsp; </SPAN>to the ExtensibleEntityType.ProductCatalog entity<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catalogContext.AddPropertyToEntity(<SPAN style="COLOR: teal">ExtensibleEntityType</SPAN>.ProductCatalog, </SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<SPAN style="COLOR: maroon">"VendorId"</SPAN>);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Get the properties added to the ExtensibleEntityType.ProductCatalog entity<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=FR style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR">CatalogPropertiesDataSet</SPAN><SPAN lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR"> extendedProperties = <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>catalogContext.GetEntityProperties(<SPAN style="COLOR: teal">ExtensibleEntityType</SPAN>.ProductCatalog);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">// Iterate through all the extended properties <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">foreach</SPAN>(<SPAN style="COLOR: teal">CatalogPropertiesDataSet</SPAN>.<SPAN style="COLOR: teal">CatalogProperty</SPAN> extendedProperty <SPAN style="COLOR: blue">in</SPAN> <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>extendedProperties.CatalogProperties)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">string</SPAN> propertyName = extendedProperty.PropertyName;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Now assign a value to the VendorId<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=FR style="FONT-SIZE: 10pt; COLOR: teal; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR">ProductCatalog</SPAN><SPAN lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR"> productCatalog = catalogContext.GetCatalog(<SPAN style="COLOR: maroon">"My Catalog"</SPAN>);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">productCatalog[<SPAN style="COLOR: maroon">"VendorId"</SPAN>] = <SPAN style="COLOR: maroon">"My Vendor"</SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// You can also use the Information property to do the same thing<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=FR style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR">// productCatalog.Information.Catalogs[0]["VendorId"] = "My Vendor";<SPAN style="mso-spacerun: yes">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">// save the changes <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>productCatalog.Save();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><o:p>&nbsp;</o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">string</SPAN> vendorId = <SPAN style="COLOR: blue">null</SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Access the value of the "VendorId" property<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Validate that "VendorId" property has been added to the ProductCatalog </SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="COLOR: green">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// entity </SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">and its value is not null<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN> ( productCatalog.HasProperty(<SPAN style="COLOR: maroon">"VendorId"</SPAN>) <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>&amp;&amp; !productCatalog.IsPropertyNull(<SPAN style="COLOR: maroon">"VendorId"</SPAN>))<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>vendorId = (<SPAN style="COLOR: blue">string</SPAN>)productCatalog[<SPAN style="COLOR: maroon">"VendorId"</SPAN>];<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN></SPAN><SPAN lang=FR style="FONT-SIZE: 10pt; COLOR: green; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR">//</SPAN><SPAN lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR"> vendorId = (<SPAN style="COLOR: blue">string</SPAN>)productCatalog.Information.Catalogs[0][<SPAN style="COLOR: maroon">"VendorId"</SPAN>];<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Remove the property from the ProductCatalog entity <o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN></SPAN><SPAN lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR">catalogContext.RemovePropertyFromEntity(<SPAN style="COLOR: teal">ExtensibleEntityType</SPAN>.ProductCatalog, </SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: maroon">"VendorId"</SPAN>);<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN lang=FR style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes; mso-ansi-language: FR"><SPAN style="mso-tab-count: 4">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}</SPAN></P></TD></TR></TBODY></TABLE></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p><FONT face="Times New Roman" size=3>&nbsp;</FONT></o:p></P>
<P mce_keep="true">In a similar manner you can extend the other entities. Use </P>
<OL>
<LI>
<DIV mce_keep="true"><FONT face="Courier New"><SPAN style="COLOR: teal">ExtensibleEntityType</SPAN>.PropertyDefinition&nbsp;for </FONT>Property Definitions </DIV></LI>
<LI>
<DIV mce_keep="true"><FONT face="Courier New"><SPAN style="COLOR: teal">ExtensibleEntityType</SPAN>.ProductCatalog for </FONT>Catalog&nbsp; Definitions</DIV></LI>
<LI>
<DIV mce_keep="true"><FONT face="Courier New"><SPAN style="COLOR: teal">ExtensibleEntityType</SPAN>.InventoryCatalog for </FONT>Inventory Catalog</DIV></LI>
<LI>
<DIV mce_keep="true"><FONT face="Courier New"><SPAN style="COLOR: teal">ExtensibleEntityType</SPAN>.InventorySku for </FONT>Inventory Skus</DIV></LI></OL>
<P mce_keep="true">&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Implementing the credential prompter</title>
      <link>https://docs.microsoft.com/archive/blogs/vinayakt/implementing-the-credential-prompter</link>
      <pubDate>Wed, 06 Sep 2006 01:14:00 GMT</pubDate>
      <dc:creator><![CDATA[vinayakt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vinayakt/2006/09/06/implementing-the-credential-prompter/</guid>
      <description><![CDATA[I received a question on&nbsp;my earlier post on implementing the credential prompter. When...]]></description>
      <content:encoded><![CDATA[<P>I received a question on&nbsp;my<A href="https://blogs.msdn.com/vinayakt/archive/2006/08/30/731135.aspx"> earlier post </A>on implementing the credential prompter. When connecting to the web service you have to specify a CatalogServiceAgent object. When authenticating against a Web service, the default behavior is to first try to make Web service method calls without any authentication credentials.&nbsp; If an Authentication related exception results (e.g. HTTP 401 response from the Web server), then the next step is to try using the user's default credentials, if available. If those credentials are not available or also fail, and the CatalogServiceAgent has been provided with an IPromptForCredentials&nbsp; implementation, then the IPromptForCredentials.PromptForCredentials method is invoked to retrieve alternate credentials for the user.&nbsp; This typically involves displaying a dialog box to a user in order to prompt them to input new credentials. These credentials are then cached in a System.Net.CredentialCache object and re-used when issuing further method calls against the service.</P>
<P>A sample implementation of the credential prompter whcih prompts the user for the login name and password can be&nbsp;done as follows:</P>
<P>&nbsp;</P>
<TABLE class=MsoTableGrid style="BORDER-RIGHT: medium none; BORDER-TOP: medium none; BORDER-LEFT: medium none; BORDER-BOTTOM: medium none; BORDER-COLLAPSE: collapse; mso-border-alt: solid windowtext .5pt; mso-yfti-tbllook: 480; mso-padding-alt: 0in 5.4pt 0in 5.4pt; mso-border-insideh: .5pt solid windowtext; mso-border-insidev: .5pt solid windowtext" cellSpacing=0 cellPadding=0 border=1>
<TBODY>
<TR style="mso-yfti-irow: 0; mso-yfti-firstrow: yes; mso-yfti-lastrow: yes">
<TD style="BORDER-RIGHT: windowtext 1pt solid; PADDING-RIGHT: 5.4pt; BORDER-TOP: windowtext 1pt solid; PADDING-LEFT: 5.4pt; PADDING-BOTTOM: 0in; BORDER-LEFT: windowtext 1pt solid; WIDTH: 6.15in; PADDING-TOP: 0in; BORDER-BOTTOM: windowtext 1pt solid; BACKGROUND-COLOR: transparent; mso-border-alt: solid windowtext .5pt" vAlign=top width=590>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">internal</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> <SPAN style="COLOR: blue">class</SPAN> <SPAN style="COLOR: teal">UserCredentialPrompter</SPAN> : <SPAN style="COLOR: teal">IPromptForCredentials<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">public</SPAN> <SPAN style="COLOR: teal">NetworkCredential</SPAN> PromptForCredentials(<SPAN style="COLOR: blue">string</SPAN> url, <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; COLOR: blue; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>string</SPAN><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"> authType)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Set the network credentials<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">NetworkCredential</SPAN> myCredentials = <SPAN style="COLOR: blue">null</SPAN>;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Launch dialog to capture the user name and password<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">Login</SPAN> form = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: teal">Login</SPAN>();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Show the Login dialog<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: teal">DialogResult</SPAN> result = form.ShowDialog();<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">if</SPAN> (result == <SPAN style="COLOR: teal">DialogResult</SPAN>.OK)<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>{<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN><SPAN style="COLOR: green">// Create the </SPAN><SPAN style="COLOR: teal">NetworkCredential based on user input</SPAN><SPAN style="COLOR: green"><o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 3">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</SPAN>myCredentials = <SPAN style="COLOR: blue">new</SPAN> <SPAN style="COLOR: teal">NetworkCredential</SPAN>(form.UserName, <o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-spacerun: yes">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>form.Password, form.Domain);<SPAN style="mso-tab-count: 1">&nbsp; </SPAN><o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: green">// Return the obtained credentials<o:p></o:p></SPAN></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-layout-grid-align: none"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 2">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN><SPAN style="COLOR: blue">return</SPAN> myCredentials;<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes"><SPAN style="mso-tab-count: 1">&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; </SPAN>}<o:p></o:p></SPAN></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><SPAN style="FONT-SIZE: 10pt; FONT-FAMILY: 'Courier New'; mso-no-proof: yes">}</SPAN><o:p></o:p></P></TD></TR></TBODY></TABLE>
<P>&nbsp;</P>
<P>You can then instantiate the CatalogServiceAgent as</P>
<DIV><FONT color=#008080>
<DIV><FONT face="Times New Roman"><FONT size=3>CatalogServiceAgent<FONT color=#000000> catalogServiceAgent = </FONT><FONT color=#0000ff>new</FONT><FONT color=#000000> </FONT><FONT color=#008080>CatalogServiceAgent</FONT><FONT color=#000000>(</FONT><FONT color=#800000>@"<A href="https://servername/CatalogWebservice/CatalogWebservice.asmx">https://Servername/CatalogWebservice/CatalogWebservice.asmx</A>", <FONT color=#0000ff>ServiceAgent.DefaultAuthMethods</FONT>, <FONT color=#0000ff>new</FONT><FONT color=#000000> </FONT><FONT size=2><FONT face="Courier New"><SPAN style="COLOR: teal">UserCredentialPrompter</SPAN>()</FONT></FONT></FONT></FONT></FONT><FONT face="Times New Roman"><FONT size=3><FONT color=#000000>);</FONT></FONT></FONT></DIV>
<DIV><FONT face="Times New Roman"><FONT size=3><FONT color=#008080>CatalogContext</FONT> context = <FONT color=#008080>CatalogContext</FONT>.Create(catalogServiceAgent);</FONT></FONT></DIV>
<DIV>&nbsp;</DIV>
<DIV>&nbsp;</DIV></FONT></DIV>]]></content:encoded>
    </item>
    <item>
      <title>Programming the Commerce Server 2007 catalog system: Creating the CatalogContext</title>
      <link>https://docs.microsoft.com/archive/blogs/vinayakt/programming-the-commerce-server-2007-catalog-system-creating-the-catalogcontext</link>
      <pubDate>Wed, 30 Aug 2006 00:15:00 GMT</pubDate>
      <dc:creator><![CDATA[vinayakt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vinayakt/2006/08/30/programming-the-commerce-server-2007-catalog-system-creating-the-catalogcontext/</guid>
      <description><![CDATA[&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The objects in the catalog system can now be programmed in two...]]></description>
      <content:encoded><![CDATA[<DIV><FONT face="Times New Roman" size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The objects in the catalog system can now be programmed in two modes. In the first mode the catalog server assembly&nbsp;is loaded in the callers appdomain (aka inproc mode). In the second mode the functionality of the catalog system is available&nbsp;remotely via the catalog web service. The programming model and the methods available in both the modes are the same. The only difference is in the way the CatalogContext object is created. The CatalogContext object is the root object in the catalog system. All other objects are obtained from the CatalogContext object. </FONT></DIV>
<DIV><FONT face="Times New Roman" size=3></FONT>&nbsp;</DIV>
<DIV><FONT face="Times New Roman" size=3>1. <U><STRONG>The Inproc mode </STRONG>:</U>&nbsp;You&nbsp;use this mode when you are running your code on the web server. The CatalogContext code is initialized by specifying the sitename. The following code sample shows how to create a CatalogContext in this mode. You need to add references to the Microsoft.Commerceserver.catalog, Microsoft.CommerceServer.CrossTierTypes and Microsoft.CommerceServer.Shared assemblies. The objects in the catalog system reside in the Microsoft.CommerceServer.Catalog and Microsoft.CommerceServer namespaces.</FONT></DIV>
<DIV><FONT face="Times New Roman" size=3></FONT>&nbsp;</DIV>
<DIV><FONT color=#008080><FONT face="Times New Roman" size=3></FONT><FONT color=#008080>
<DIV><FONT face="Times New Roman"><FONT size=3>&nbsp;&nbsp;&nbsp; CatalogSiteAgent<FONT color=#000000> siteInfo = </FONT><FONT color=#0000ff>new</FONT><FONT color=#000000> </FONT><FONT color=#008080>CatalogSiteAgent</FONT><FONT color=#000000>();&nbsp;&nbsp;&nbsp; </FONT></FONT></FONT></DIV>
<DIV><FONT face="Times New Roman" size=3>&nbsp;&nbsp;&nbsp; siteInfo.SiteName = <FONT color=#800000>"StarterSite"</FONT>; </FONT></DIV>
<DIV><FONT face="Times New Roman" size=3>&nbsp;&nbsp;&nbsp; siteInfo.AuthorizationMode = <FONT color=#008080>AuthorizationMode</FONT>.ThreadContext;</FONT></DIV>
<DIV><FONT face="Times New Roman" size=3>&nbsp;&nbsp;&nbsp; siteInfo.AuthorizationPolicyPath = <FONT color=#800000>@"E:\Inetpub\wwwroot\CatalogWebService\CatalogAuthorizationStore.xml"</FONT>;</FONT></DIV>
<DIV><FONT face="Times New Roman" size=3>&nbsp;&nbsp;&nbsp; siteInfo.IgnoreInventorySystem = <FONT color=#0000ff>false</FONT>;</FONT></DIV>
<DIV><FONT color=#008080>
<DIV><FONT color=#008080><FONT face="Times New Roman"><FONT size=3><FONT color=#008080>&nbsp;&nbsp;&nbsp; CacheConfiguration</FONT> <FONT color=#000000>cacheConfiguration</FONT> = <FONT color=#0000ff>new</FONT> <FONT color=#008080>CacheConfiguration</FONT>();</FONT></FONT></FONT></DIV>
<DIV>
<DIV>
<DIV>
<DIV><FONT face="Times New Roman"><FONT size=3><FONT color=#000000>&nbsp;&nbsp;&nbsp; cacheConfiguration.CacheEnabled</FONT> =<FONT color=#0000ff>true</FONT>;</FONT></FONT></DIV>
<DIV><FONT face="Times New Roman"><FONT size=3><FONT color=#000000>&nbsp;&nbsp;&nbsp; cacheConfiguration.SchemaCacheTimeout</FONT> = <FONT color=#0000ff>new</FONT> <FONT color=#008080>TimeSpan</FONT>(0, 10, 0);</FONT></FONT></DIV>
<DIV><FONT face="Times New Roman"><FONT size=3><FONT color=#008080>&nbsp;&nbsp;&nbsp; CatalogContext</FONT> <FONT color=#000000>context</FONT> = <FONT color=#008080>CatalogContext</FONT>.<FONT color=#000000>Create(siteInfo, cacheConfiguration);</FONT></FONT></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3></FONT>&nbsp;</DIV></DIV></DIV></DIV></FONT></DIV>
<DIV><FONT color=#000000><FONT face="Times New Roman"><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use the <FONT color=#008080>CatalogSiteAgent</FONT><FONT color=#000000> class to specify the site name, the authorization information and the inventory usage option. </FONT></FONT></FONT></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000><FONT face="Times New Roman" color=#000000 size=3>The <FONT color=#008080>AuthorizationMode&nbsp;</FONT>enumeration has the following values</FONT></FONT><FONT face="Times New Roman" color=#008080 size=3></FONT></DIV>
<UL style="MARGIN-TOP: 0px; MARGIN-BOTTOM: 0px">
<LI><FONT face="Times New Roman"><FONT size=3><FONT color=#008080>AuthorizationMode</FONT><FONT color=#000000>.NoAuthorization : Do not perform any authorization checks.&nbsp;This mode should be used on the runtime sites.</FONT></FONT></FONT></LI>
<LI><FONT color=#000000><FONT face="Times New Roman"><FONT size=3><FONT color=#008080>AuthorizationMode</FONT><FONT color=#000000>.ThreadContext : Before performing any operation ensure that the user is authorized to perform it. The identity of the user is obtained from the user's thread context. This mode should be used in Console applications.</FONT></FONT></FONT></FONT></LI>
<LI><FONT face="Times New Roman"><FONT size=3>AuthorizationMode.<FONT color=#000000>HttpContext : Before performing any operation ensure that the user is authorized to perform it. The identity of the user is obtained from the current Http context. This mode should be used in&nbsp;web applications where users update the catalog system.</FONT></FONT></FONT></LI></UL>
<DIV><FONT color=#000000><FONT face="Times New Roman"><FONT size=3></FONT></FONT></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000><FONT face="Times New Roman"><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;The <FONT color=#008080>AuthorizationPolicyPath </FONT><FONT color=#000000>specifies the location of the <A href="https://blogs.msdn.com/vinayakt/archive/2006/06/28/649364.aspx">authorization store</A>. The authorization store is an Xml file which contains which information about the authorized users and the operations they can perform. </FONT></FONT></FONT></FONT></DIV>
<DIV><FONT color=#000000></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000><FONT face="Times New Roman"><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Commerce Server 2007 now adds an inventory integration with the catalog system.The inventory system&nbsp;now allows you to store the inventory information like (onhandquantities, status etc) for products and variants in the catalog system.&nbsp;You can use the <FONT color=#008080>IgnoreInventorySystem&nbsp;<FONT color=#000000>parameter to turn off inventory integration.If the inventory resource exists and <FONT color=#008080>IgnoreInventorySystem&nbsp;</FONT><FONT color=#000000>parameter is set to false no inventory operations or lookups will be performed by the catalog methods.</FONT></FONT></FONT></FONT></FONT></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3></FONT>&nbsp;</DIV>
<DIV><FONT color=#000000><FONT face="Times New Roman"><FONT size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use the <FONT color=#008080>CacheConfiguration&nbsp;</FONT><FONT color=#000000>object to specify the&nbsp;<A href="https://blogs.msdn.com/vinayakt/archive/2006/06/02/613939.aspx">caching configuration</A>. Note that caching is turned off by default and is enabled by setting the cacheConfiguration.CacheEnabled<FONT color=#008080>&nbsp;</FONT>&nbsp;property.</FONT></FONT></FONT></FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you are using the Microsoft.CommerceServer.Runtime BCL then you can specify the cache configuration and the inventory integration option in the web.config of your runtime site.</FONT></DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3></FONT>&nbsp;</DIV>
<DIV><FONT face="Times New Roman" color=#000000 size=3>2. <STRONG><U>The WebService mode:</U> </STRONG>The CatalogContext object can also be initialized in the webservice mode by passing in the url of the catalog webservice. </FONT></DIV><FONT color=#008080>
<DIV><FONT color=#008080>
<DIV>
<DIV><FONT color=#008080>
<DIV><FONT face="Times New Roman"><FONT size=3>CatalogServiceAgent<FONT color=#000000> catalogServiceAgent = </FONT><FONT color=#0000ff>new</FONT><FONT color=#000000> </FONT><FONT color=#008080>CatalogServiceAgent</FONT><FONT color=#000000>(</FONT><FONT color=#800000>@"https://Servername/CatalogWebservice/CatalogWebservice.asmx"</FONT><FONT color=#000000>);</FONT></FONT></FONT></DIV>
<DIV><FONT face="Times New Roman"><FONT size=3><FONT color=#008080>CatalogContext</FONT> context = <FONT color=#008080>CatalogContext</FONT>.Create(catalogServiceAgent);</FONT></FONT></DIV></FONT></DIV><FONT face="Times New Roman" size=3>&nbsp;</FONT></DIV>
<DIV><FONT face="Times New Roman" color=#333333 size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Use the&nbsp;CatalogServiceAgent class to specify the url of the catalog web service. The other overloads on this method allow you to specify the&nbsp;authentication methods and a credential prompter. &nbsp;</FONT></DIV>
<DIV><FONT face="Times New Roman" color=#333333 size=3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;If you are wondering&nbsp;how to specify the authorization, caching and inventory option this &nbsp;is specified&nbsp;through the <STRONG>catalogWebService</STRONG> element in web.config. All&nbsp;the&nbsp;attributes and child elements are documented in the&nbsp;&nbsp;web.config itself. </FONT></DIV></FONT></DIV></FONT></FONT></FONT></DIV>
<DIV><STRONG><FONT face="Times New Roman" size=3></FONT></STRONG>&nbsp;</DIV>
<DIV><FONT face="Times New Roman"><FONT size=3><STRONG>Note: </STRONG>Even though the CatalogContext class has&nbsp;the CreateFromConnectionString&nbsp;method, it exists only for backward compatibility and is now deprecated.</FONT></FONT></DIV>]]></content:encoded>
    </item>
    <item>
      <title>Unable to import a commerce server catalog on Windows XP</title>
      <link>https://docs.microsoft.com/archive/blogs/vinayakt/unable-to-import-a-commerce-server-catalog-on-windows-xp</link>
      <pubDate>Tue, 29 Aug 2006 12:40:00 GMT</pubDate>
      <dc:creator><![CDATA[vinayakt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vinayakt/2006/08/29/unable-to-import-a-commerce-server-catalog-on-windows-xp/</guid>
      <description><![CDATA[I have seen a few customers hit this issue in the newsgroups. If you are using Windows XP as your...]]></description>
      <content:encoded><![CDATA[<P>I have seen a few customers hit this issue in the newsgroups. If you are using Windows XP as your development environment for Commerce Server 2007 Developer Edition and importing a catalog gives you an error "Value does not fall within the expected range" please contact Microsoft Technical support for the associated hotfix and mention the KB Number 920867 and that the hotfix is private.<FONT size=2></P>
<P></FONT>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Securing the catalog system</title>
      <link>https://docs.microsoft.com/archive/blogs/vinayakt/securing-the-catalog-system</link>
      <pubDate>Wed, 28 Jun 2006 00:20:00 GMT</pubDate>
      <dc:creator><![CDATA[vinayakt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vinayakt/2006/06/28/securing-the-catalog-system/</guid>
      <description><![CDATA[The authorization model is another new feature in the Commerce Server 2007&nbsp;catalog system which...]]></description>
      <content:encoded><![CDATA[<P>The authorization model is another new feature in the Commerce Server 2007&nbsp;catalog system which allows you to protect your catalog data from being accessed by unauthorized users. Since we decided to expose the functionality of the catalog system over the web service it became imperative to ensure that only authorized users can access the catalog data. The catalog system in Commerce Server 2007 has two main components: the catalog web service and the catalog database. Both these components can be appropriately secured.<?xml:namespace prefix = o ns = "urn:schemas-microsoft-com:office:office" /><o:p></o:p></P>
<P><STRONG><U>Securing the Catalog web service</U></STRONG><o:p></o:p></P>
<P>First let's talk about securing the catalog web service. Securing the catalog web service involves securing the web methods&nbsp;to ensure that unauthorized users cannot successfully invoke these methods. Instead of reinventing the wheel and introduce another authorization model for users to learn we decided to use the <A href="https://msdn.microsoft.com/msdnmag/issues/03/11/AuthorizationManager/">Windows Authorization Manager</A>. There are several articles on Authorization manager on msdn. You can also check out the <A id=bp___v____ctl0__ctl0_bcr_bth___BlogTitle href="https://blogs.msdn.com/azman/archive/2006/02/22/536513.aspx"><SPAN style="COLOR: #0033cc">Authorization Manager Team Blog</SPAN></A>&nbsp;for overviews, case studies etc.<o:p></o:p></P>
<P>The catalog system provides various levels of authorization which can be defined by assigning the users&nbsp;to&nbsp;the different roles. Users can be Administrators, catalog editors, language translators etc. You can also create your own user model and still enforce the catalog authorization in the web service. The authorization model also allows you to control which users can view which catalogs and edit which properties. For eg you can disable certain&nbsp;users from editing specific product properties like list price, description etc. <o:p></o:p></P>
<P>The catalog system&nbsp;supports only&nbsp;the XML store which means that the authorization information is defined in an xml file.&nbsp;The name of the&nbsp;xml file is specified in the catalogWebService element in the web.config via the <STRONG>authorizationPolicyPath</STRONG>&nbsp;attribute. When you unpup the catalog webservice a default xml file named CatalogAuthorizationStore.xml is installed in the web service directory (typically &lt;Drive&gt;:\Inetpub\wwwroot\CatalogWebService). You can use the <STRONG>authorizationPolicyPath </STRONG>attribute<STRONG> </STRONG>to specify a different authorization store. If the specified path is not an absolute path then the path is relative to the catalog web service's directory.<o:p></o:p></P>
<P>After you install the catalog web service you need to perform the following steps to get the catalog webservice up and running.<o:p></o:p></P>
<P>1. Application pool: Verify that the catalog web service has been assigned to the desired Application pool. Verify the properties of the application pool especially the Identity. The identity of&nbsp;the application pool is the name of the account under which an application pool's worker process runs.<o:p></o:p></P>
<P>2. Once the identity of the catalog web service's application pool has ben configured ensure that this account has write access on the catalog authorization store. You can do this by right clicking the CatalogAuthorizationStore.xml, click properties, select the Security tab, add the&nbsp;catalog web service’s account and check the Allow Write checkbox. The catalog system offers catalog level security which means that you can control which users can access which catalogs. This has been implemented by means of scopes in the authorization store. Since the catalogs are dynamically created in the catalog system it becomes necessary to create a new scope in the authorization store every time a catalog is created. Creating the catalog scope needs write permissions on the xml file. This is why you need to ensure that the account running the catalog web service has Write permissions on the catalog authorization store. If this is not done then the&nbsp;catalog web service will throw a configuration exception at startup and none of the methods can be invoked.<o:p></o:p></P>
<P>3. The final step is to add the user accounts to the appropriate roles. This can be done by the Authorization Manager MMC.&nbsp;To do this <o:p></o:p></P>
<OL type=1>
<LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto">Start-&gt;Run-&gt;Azman.msc<o:p></o:p></LI>
<LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto">Right click Authorization Manager<o:p></o:p></LI>
<LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto">Click Open Authorization Store<o:p></o:p></LI>
<LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto">Select the CatalogAuthorizationStore.xml<o:p></o:p></LI>
<LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto">Expand CatalogAuthorizationStore-&gt;CatalogAndInventorySystem-&gt;Role Assignments<o:p></o:p></LI>
<LI class=MsoNormal style="MARGIN: 0in 0in 0pt; mso-list: l0 level1 lfo1; tab-stops: list .5in; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto">To add a user to a role, right click the role and select "Assign&nbsp;Windows Users&nbsp;or groups" and add the users to the appropriate roles.<o:p></o:p></LI></OL>
<P>Note that adding the user the Administrator role will allow the user to perform any operation in the catalog system.<o:p></o:p></P>
<P>4. As I mentioned previously we dynamically create scopes for each catalog, language and property in the catalog system to provide a finely grained authorization mode. This means that every time you create a new catalog you need to follow the above steps to ensure that appropriate users have access to this catalog. The only difference is that you need to expand the node named "CatalogScope_&lt;Catalog Name&gt;"-&gt;Role Assignments and add the users to the CatalogEditor role. <o:p></o:p></P>
<P>5. If you are unable to access the catalog web service due to the following exception: System.IO.FileNotFoundException: File or assembly name 0x1gew0n.dll, or one of its dependencies, was not&nbsp;found. File name: "0x1gew0n.dll" at System.Reflection.Assembly.nLoad(AssemblyName fileName, String codeBase, Boolean isStringized, Evidence assemblySecurity, Boolean throwOnFileNotFound, Assembly locationHint, StackCrawlMark&amp; stackMark) --- LOG: Attempting download of new URL file:///C:/WINDOWS/TEMP/6hg1.dll. The resolution for this issue is to grant write permissions on the temp directory mentioned in the above URL (C:/WINDOWS/TEMP) to the catalog web service account. <o:p></o:p></P>
<P>The next post will be about the various operations, tasks and roles and how you can create your own tasks and roles to enforce an authorization model which is driven by your business needs. It will also discuss how to define&nbsp;permissions for the various user scenarios.<o:p></o:p></P>
<P>&nbsp;<o:p></o:p></P>
<P class=MsoNormal style="MARGIN: 0in 0in 0pt"><o:p>&nbsp;</o:p></P>]]></content:encoded>
    </item>
    <item>
      <title>Want to try Microsoft Commerce Server 2007 for free?</title>
      <link>https://docs.microsoft.com/archive/blogs/vinayakt/want-to-try-microsoft-commerce-server-2007-for-free</link>
      <pubDate>Mon, 19 Jun 2006 22:31:00 GMT</pubDate>
      <dc:creator><![CDATA[vinayakt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vinayakt/2006/06/19/want-to-try-microsoft-commerce-server-2007-for-free/</guid>
      <description><![CDATA[You can now download the evaluation version of Commerce Server 2007 from here. 
Other useful...]]></description>
      <content:encoded><![CDATA[<P>You can now download the evaluation version of Commerce Server 2007 from <A href="https://www.microsoft.com/commerceserver/default.mspx">here</A>. </P>
<P>Other useful links:</P>
<UL>
<LI><A href="https://msdn.microsoft.com/library/default.asp?url=/library/en-us/CS07Default/html/02afcee1-5546-4acc-b053-2aa6d7762bd3.asp">Product Documentation</A></LI>
<LI><A href="https://www.microsoft.com/commerceserver/evaluation/overview.mspx">Product Review</A></LI>
<LI><A href="https://go.microsoft.com/fwlink/?LinkID=57013 ">Readme</A></LI>
<LI><A href="https://download.microsoft.com/download/3/a/4/3a46267f-9640-4623-86a1-c63bbfea9e1d/Installation%20and%20Configuration%20Guide%20for%20Microsoft%20Commerce%20Server%202007.html">Installation Guide</A></LI></UL>
<P>Additional information on general availability and pricing can be found <A href="https://blogs.msdn.com/rdonovan/archive/2006/06/16/634876.aspx">here</A>.</P>]]></content:encoded>
    </item>
    <item>
      <title>Improving the catalog search experience in Commerce Server 2007</title>
      <link>https://docs.microsoft.com/archive/blogs/vinayakt/improving-the-catalog-search-experience-in-commerce-server-2007</link>
      <pubDate>Sun, 18 Jun 2006 01:53:00 GMT</pubDate>
      <dc:creator><![CDATA[vinayakt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vinayakt/2006/06/18/improving-the-catalog-search-experience-in-commerce-server-2007/</guid>
      <description><![CDATA[Two years back in this post on fulltext search in the catalog system, I had explained how fulltext...]]></description>
      <content:encoded><![CDATA[<P>Two years back in this post on <A href="https://blogs.msdn.com/vinayakt/archive/2004/05/05/126329.aspx">fulltext search in the catalog system</A>, I had explained how fulltext searches are performed in the catalog system and added the following comment</P>
<P>"Providing an increased number of search features/conditions is something we are looking forward to, in the&nbsp;upcoming releases. This should allow you to specify more complex search phrases."</P>
<P>Commerce Server 2007 now allows you to specify complex search phrases which&nbsp;allow you to customize your searches to the finest level of granularity.&nbsp;If the default&nbsp;freetext search behavior as described in the above link does not work for you, you can now &nbsp;use the new AdvancedFreeTextSearchPhrase property on the CatalogSearch object. An example of using this property&nbsp;to implement Thesaurus support&nbsp;is provided in this <A href="https://blogs.msdn.com/vinayakt/archive/2006/06/12/627861.aspx">link</A>. Note that when you set this property you should also set the UseAdvancedFreeTextSearch&nbsp;to true. This is to avoid ambiguity on whether the value specified for AdvancedFreeTextSearchPhrase&nbsp;or FreeTextSearchPhrase&nbsp;&nbsp;property should be used to perform the search.</P>
<P>Here are some additional search scenarios&nbsp;for which you can use this new property.</P>
<UL>
<LI>You can perform&nbsp;wild card searches by appending * to the search phrase. For eg to return all the products containing search terms beginning with "Commerce". When passing a compound phrase you need to enclose the phrase in quotes. </LI></UL>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT style="BACKGROUND-COLOR: #ffffff"><FONT color=#008000><FONT color=#006400 size=2>catalogSearch.AdvancedFreeTextSearchPhrase&nbsp; = "Commerce*"; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;catalogSearch.AdvancedFreeTextSearchPhrase&nbsp; = "\"Commerce Server*\"";</FONT> </FONT></FONT>
<P></P>
<UL>
<LI>To perform exact searches you should&nbsp;enclose the phrase in quotes. For eg to return rows that contain the exact phrase "Commerce Server 2007" </LI></UL>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#008000 size=2>catalogSearch.AdvancedFreeTextSearchPhrase&nbsp; = "\"Commerce Server 2007\""; </FONT></P>
<UL>
<LI>To return all the products containing the phrases "Commerce Server" and "Sql Server"</LI></UL>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#008000 size=2>catalogSearch.AdvancedFreeTextSearchPhrase=" \"Commerce Server 2007\"&nbsp;AND&nbsp;\"Sql Server\" "; </FONT></P>
<UL>
<LI>To return all the products containing the phrases "Commerce Server"&nbsp;OR "Sql Server"</LI></UL>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#008000><FONT size=2>catalogSearch.AdvancedFreeTextSearchPhrase=" \"Commerce Server 2007\"&nbsp;&nbsp;OR&nbsp;&nbsp;\"Sql Server\" ";</FONT> </FONT></P>
<UL>
<LI>To return all products&nbsp;beginning with Commerce Or Sql server</LI></UL>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; <FONT color=#008000 size=2>catalogSearch.AdvancedFreeTextSearchPhrase=" Commerce*&nbsp;&nbsp;OR \"Sql Server\" "; </FONT></P>
<UL>
<LI>&nbsp;You can also perform proximity searches using the NEAR keyword. For eg to return all&nbsp;products containing the word 2007 near "Commerce Server" </LI></UL>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#008000 size=2>catalogSearch.AdvancedFreeTextSearchPhrase="2007 NEAR \"Commerce Server\""; </FONT></P>
<UL>
<LI>&nbsp;You can perform inflectional searches using the INFLECTIONAL keyword. For eg to return all products with forms of dry&nbsp;like drying, dried etc </LI></UL>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#008000 size=2>catalogSearch.AdvancedFreeTextSearchPhrase="FORMSOF (Inflectional,dry)"; </FONT></P>
<UL>
<LI>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;To return all products containing Commerce or Sql Server and not ASP </LI></UL>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<FONT color=#008000 size=2>catalogSearch.AdvancedFreeTextSearchPhrase="(\"commerce \" OR \"sql server\") and not ASP\"";&nbsp;&nbsp;</FONT></P>
<P>The above are just some of the scenarios. To truly understand what else you can do take a look at this <A href="https://msdn.microsoft.com/library/default.asp?url=/library/en-us/tsqlref/ts_ca-co_2y2h.asp">link</A>. Determine the clause which best reflects your search criteria and pass it to the AdvancedFreeTextSearchPhrase as in the above example.&nbsp; </P>
<P>For a complete code sample and additional filtering using other criteria like "list price &lt; $100 AND IsActive=1"&nbsp; see this <A href="https://blogs.msdn.com/vinayakt/archive/2004/05/04/125476.aspx">post</A>.</P>
<P>&nbsp;</P>]]></content:encoded>
    </item>
    <item>
      <title>Implementing Thesaurus support in the catalog system</title>
      <link>https://docs.microsoft.com/archive/blogs/vinayakt/implementing-thesaurus-support-in-the-catalog-system</link>
      <pubDate>Mon, 12 Jun 2006 03:44:00 GMT</pubDate>
      <dc:creator><![CDATA[vinayakt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vinayakt/2006/06/12/implementing-thesaurus-support-in-the-catalog-system/</guid>
      <description><![CDATA[Sql Server 2005 now&nbsp;provides Thesaurus&nbsp;support through configurable xml files. In a...]]></description>
      <content:encoded><![CDATA[<P>Sql Server 2005 now&nbsp;provides <A href="https://msdn2.microsoft.com/en-us/library/ms142491.aspx">Thesaurus&nbsp;</A>support through configurable xml files. In a nutshell &nbsp;the Thesaurus feature allows you to search for synonyms of the search phrase or replace the search phrase with a&nbsp;replacement phrase and perform the search&nbsp;using the replacement phrase.&nbsp;&nbsp;These synonyms and replacements can be configured using the xml files.See this <A href="https://msdn2.microsoft.com/en-us/library/ms345186.aspx">link</A> for configuring the xml files. </P>
<P>If you are using Sql Server 2005 as your Commerce Server database server then you can take advantage of this cool feature when&nbsp;performing catalog searches.&nbsp; </P>
<P>As an example, suppose &nbsp;that you have a Books catalog. Assume that Description is a fulltext searchable property in this catalog and that this catalog has various C# books. When performing a search&nbsp;on your site users might search for C# or "C Sharp".&nbsp;You can use the Thesaurus feature to allow searches for "C Sharp" to return C# books. </P>
<P>The first step is to edit the tsENU.xml file located in the SQL_Server_install_path\Microsoft SQL Server\MSSQL.1\MSSQL\FTDATA\ directory and add the following element to it</P>
<P>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;expansion&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;sub&gt;C sharp&lt;/sub&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;sub&gt;C#&lt;/sub&gt;<BR>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/expansion&gt; &nbsp;&nbsp;</P>
<P>&nbsp;After you edit the xml file you will have to restart the "SQL Server FullText Search (MSSQLSERVER)" &nbsp;service for the changes to take effect. </P>
<P>The following code sample demonstrates how to perform the catalog search to allow searches for "C Sharp" to return books containing C#: </P><FONT color=#008080 size=2>
<P>CatalogSearch</FONT><FONT size=2> catalogSearch = catalogContext.GetCatalogSearch();</FONT></P>
<P><FONT size=2>catalogSearch.SearchOptions = </FONT><FONT color=#0000ff size=2>new</FONT><FONT size=2> </FONT><FONT color=#008080 size=2>CatalogSearchOptions</FONT><FONT size=2>();</P>
<P></FONT><FONT color=#008000 size=2>// Set appropriate search options</P></FONT><FONT size=2>
<P>catalogSearch.SearchOptions.SetPaging(1,20);</P>
<P></P>
<P>catalogSearch.UseAdvancedFreeTextSearch = </FONT><FONT color=#0000ff size=2>true</FONT><FONT size=2>;</P>
<P>catalogSearch.AdvancedFreeTextSearchPhrase = </FONT><FONT color=#800000 size=2>"FORMSOF(THESAURUS, \"C Sharp\")"</FONT><FONT size=2>;</P>
<P></P>
<P></FONT><FONT color=#0000ff size=2>int</FONT><FONT size=2> totalRecords;</P>
<P></FONT><FONT color=#008080 size=2>CatalogItemsDataSet</FONT><FONT size=2> searchResults = catalogSearch.Search(</FONT><FONT color=#0000ff size=2>out</FONT><FONT size=2> totalRecords);</P>
<P></FONT><FONT color=#008000 size=2>// Iterate through the search results</P></FONT><FONT size=2>
<P></FONT><FONT color=#0000ff size=2>foreach</FONT><FONT size=2>(</FONT><FONT color=#008080 size=2>CatalogItemsDataSet</FONT><FONT size=2>.</FONT><FONT color=#008080 size=2>CatalogItem</FONT><FONT size=2> searchResult </FONT><FONT color=#0000ff size=2>in</FONT><FONT size=2> searchResults.CatalogItems)</FONT></P><FONT size=2>
<P></FONT><FONT color=#008080 size=2>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Console</FONT><FONT size=2>.WriteLine(searchResult.CategoryName);</P>
<P><FONT size=3></FONT>&nbsp;</P></FONT>]]></content:encoded>
    </item>
    <item>
      <title>New Catalogset features in Commerce Server 2007</title>
      <link>https://docs.microsoft.com/archive/blogs/vinayakt/new-catalogset-features-in-commerce-server-2007</link>
      <pubDate>Wed, 07 Jun 2006 02:39:00 GMT</pubDate>
      <dc:creator><![CDATA[vinayakt]]></dc:creator>
      <guid
        isPermaLink="false">https://blogs.msdn.microsoft.com/vinayakt/2006/06/07/new-catalogset-features-in-commerce-server-2007/</guid>
      <description><![CDATA[The catalogsets feature is probably the least known feature in the catalog system.&nbsp;Unlike in...]]></description>
      <content:encoded><![CDATA[<P>The catalogsets feature is probably the least known feature in the catalog system.&nbsp;Unlike in previous versions, the catalogsets feature is now &nbsp;tightly integrated with the catalog sytsem. We have also provided a managed API to create, edit and delete catalog sets.This functionality is also available through the catalog web service.&nbsp;In addition you can now export and import catalog sets just as you can import and export product catalogs. In addition we have also provided&nbsp;appropriate Azman security for catalogsets. More importantly the ability to manipulate the catalog sets has been added in the Catalog Manager application.</P>
<P><STRONG>What are catalogsets anyway?</STRONG></P>
<P><STRONG>&nbsp;&nbsp;&nbsp;</STRONG>Catalogsets provide a way to group together a similar set of product catalogs.You can use catalog sets to&nbsp;decide the appropriate list of catalogs to be displayed&nbsp;to your site users based on their profile.&nbsp;&nbsp;For eg you can create a catalogset containing a list of preferred product catalogs. The catalog set can then be associated to profile of runtime users and when a user browses your site you can then select the list of catalogs the user can browse.This allows you to show a different list of catalogs for anonymous users, registered users or privileged users. See this <A href="https://blogs.msdn.com/vinayakt/archive/2004/04/29/122858.aspx">post </A>for more information and the various fallbacks. </P>
<P>&nbsp;&nbsp;&nbsp;A new feature in Commerce Server 2007 is the ability to create dynamic catalog sets. A catalog set can now be</P>
<UL>
<LI><STRONG>Static</STRONG>, which contains a static list of catalogs. 
<LI><STRONG>Dynamic, </STRONG>which allows you to associate an expression with the catalog set.&nbsp;The catalog set will now contain &nbsp;the list of catalogs which match the expression. A good usage of this feature would be to define a catalog set for active product catalogs. For eg "Active catalogset" can be a dynamic catalogset which has the expression "StartDate&gt; 01/01/2006" and "EndDate&lt;12/31/2006" associated with it. This catalog set will now contain all the catalogs which have a start and end dates that fall in the specified range. </LI></UL>
<P>By default the catalog system creates two default catalog sets</P>
<OL>
<LI><STRONG>Anonymous User Default CatalogSet</STRONG>, is a catalog set for anonymous users 
<LI><STRONG>Registered User Default CatalogSet</STRONG>, is a catalog set for&nbsp;registered users</LI></OL>
<P>As I previously mentioned you can associate catalogsets to a users profile and use the users profile and the catalog sets to display the list of catalogs for that user. The newly added dynamic catalogset&nbsp;feature can be used here&nbsp;to provide a better user experience, increased flexibility and less maintainence. Once you define your expression you dont have to worry about the contents of the catalog set.&nbsp;</P>
<P>New in Commerce Server 2007 is the ability to <A href="https://blogs.msdn.com/vinayakt/archive/2006/03/07/545098.aspx">import </A>and <A href="https://blogs.msdn.com/vinayakt/archive/2006/03/06/544347.aspx">export</A> catalog sets&nbsp;from and&nbsp;to xml files. We have also added&nbsp;Azman security to control which users can view and edit the catalogsets.&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>
<P>&nbsp;</P>]]></content:encoded>
    </item>
  </channel>
</rss>