CS2007: Can SiteTerms ranked?
Web Server forum
Back To The Forum Home!Search!Private Messaging System

Web Server Talk Web Server Talk > Web Servers reviews > Microsoft Commerce Server > Commerce Server General > CS2007: Can SiteTerms ranked?




  Last Thread   Next Thread Next
  Show Printable Version Email this Page Subscribe to this Thread      Post New Thread    Post A Reply      

    CS2007: Can SiteTerms ranked?  
Pascal


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-17-06 12:28 AM

hi,
what would be the best approach for "ranking" site terms in a similar
fashion products can be ranked (sequenced) in the catalog. I don't want them
to be in alphabetical order but having the possibility of a business user to
determine the order in which the site terms are presented to the customer.

It does seem I would either need to extend the MemAttrib table, use my own
stored proc and UI (ext to Smart Client  just for that...) OR holding
somewhere an array of site term names ranked the way I want, providing my ow
n
UI (again) and handling the sequence logic in the code (via wrapper class).

Is there a better approach requiring less effort? I would really like
avoiding changing the Cust & Ord mgr for such a simple requirement.

Thanks





[ Post a follow-up to this message ]



    RE: CS2007: Can SiteTerms ranked?  
David Messner [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-17-06 12:28 AM

Pascal,

The first thing that comes to mind is to define your site term values
(referred to as the term "names" in both the Customer and Orders Manager UI
and in the CS2002 BizDesk, go figure) in an order that you can use to
rank/sort them on the site.  You would then use the DisplayNames of the
SiteTerms to actually show to the user in the order sorted by value.  Of
course this presumes you have control over the values you are you using for
your site terms and don't need to use the values for other purposes.

Unfortunately the default SiteTermElement CompareTo implementation sorts by
DisplayName (SiteTermElement.Name), not what you want here.  So you'll need
to be aware of that and provide your own sorting.

The below code sample shows how you can enumerate all the Site Terms from
the rumtime.

using Microsoft.CommerceServer.Runtime;
using Microsoft.CommerceServer.Runtime.Profiles;

private void IterateSiteTerms()
{
ProfileContext profiles = CommerceContext.Current.ProfileSystem;
ArrayList names = profiles.SiteTermNames;
foreach (string name in names)
{
Response.Write(string.Format("<p>SiteTerm={0}</p>\n", name));
SiteTerm term = profiles.GetSiteTerm(name);
SiteTermElementCollection elements = term.Elements;
foreach (SiteTermElement element in elements)
{
Response.Write(string.Format("Name={0} value={1}<br/>",
element.Name, element.Value));
}
}

}

[Partial output]:

SiteTerm=UserRole

Name=Normal User value=1
Name=Administrator value=2

SiteTerm=Days

Name=Sunday value=0
Name=Monday value=1
Name=Tuesday value=2
Name=Wednesday value=3
Name=Thursday value=4
Name=Friday value=5
Name=Saturday value=6

Good luck
-djm
--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2006 Microsoft Corporation.  All rights
reserved.

--------------------
From: examnotes <Pascal@discussions.microsoft.com>
Subject: CS2007: Can SiteTerms ranked?
Date: Thu, 14 Sep 2006 14:07:02 -0700


hi,
what would be the best approach for "ranking" site terms in a similar
fashion products can be ranked (sequenced) in the catalog. I don't want
them
to be in alphabetical order but having the possibility of a business user
to
determine the order in which the site terms are presented to the customer.

It does seem I would either need to extend the MemAttrib table, use my own
stored proc and UI (ext to Smart Client  just for that...) OR holding
somewhere an array of site term names ranked the way I want, providing my
own
UI (again) and handling the sequence logic in the code (via wrapper class).

Is there a better approach requiring less effort? I would really like
avoiding changing the Cust & Ord mgr for such a simple requirement.

Thanks




Attachment:
This has been downloaded 0 time(s).



[ Post a follow-up to this message ]



    RE: CS2007: Can SiteTerms ranked?  
Pascal


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-19-06 12:36 AM

If I understand you right, your suggestion is to use the "Names" field for
ranking the site terms. I thought about that but is not flexibile as you add
new site terms or you simply want to re-sort them. Once you set the Name
field you cannot really change them without the pain of values of changing
all references to that site terms (including multi-value site term
attributes.. yikes)

"David Messner [MSFT]" wrote:

> Pascal,
>
> The first thing that comes to mind is to define your site term values
> (referred to as the term "names" in both the Customer and Orders Manager U
I
> and in the CS2002 BizDesk, go figure) in an order that you can use to
> rank/sort them on the site.  You would then use the DisplayNames of the
> SiteTerms to actually show to the user in the order sorted by value.  Of
> course this presumes you have control over the values you are you using fo
r
> your site terms and don't need to use the values for other purposes.
>
> Unfortunately the default SiteTermElement CompareTo implementation sorts b
y
> DisplayName (SiteTermElement.Name), not what you want here.  So you'll nee
d
> to be aware of that and provide your own sorting.
>
> The below code sample shows how you can enumerate all the Site Terms from
> the rumtime.
>
>     using Microsoft.CommerceServer.Runtime;
>     using Microsoft.CommerceServer.Runtime.Profiles;
>
>     private void IterateSiteTerms()
>     {
> 	    ProfileContext profiles = CommerceContext.Current.ProfileSystem;
> 	    ArrayList names = profiles.SiteTermNames;
> 	    foreach (string name in names)
> 	    {
> 		    Response.Write(string.Format("<p>SiteTerm={0}</p>\n", name));
> 		    SiteTerm term = profiles.GetSiteTerm(name);
> 		    SiteTermElementCollection elements = term.Elements;
> 		    foreach (SiteTermElement element in elements)
> 		    {
> 			    Response.Write(string.Format("Name={0} value={1}<br/>",
> element.Name, element.Value));
> 		    }
> 	    }
>
>     }
>
> [Partial output]:
>
> SiteTerm=UserRole
>
> Name=Normal User value=1
> Name=Administrator value=2
>
> SiteTerm=Days
>
> Name=Sunday value=0
> Name=Monday value=1
> Name=Tuesday value=2
> Name=Wednesday value=3
> Name=Thursday value=4
> Name=Friday value=5
> Name=Saturday value=6
>
> Good luck
> -djm
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> You assume all risk for your use. © 2006 Microsoft Corporation.  All righ
ts
> reserved.
>
> --------------------
> From: examnotes <Pascal@discussions.microsoft.com>
> Subject: CS2007: Can SiteTerms ranked?
> Date: Thu, 14 Sep 2006 14:07:02 -0700
>
>
> hi,
>   what would be the best approach for "ranking" site terms in a similar
> fashion products can be ranked (sequenced) in the catalog. I don't want
> them
> to be in alphabetical order but having the possibility of a business user
> to
> determine the order in which the site terms are presented to the customer.
>
> It does seem I would either need to extend the MemAttrib table, use my own
> stored proc and UI (ext to Smart Client  just for that...) OR holding
> somewhere an array of site term names ranked the way I want, providing my
> own
> UI (again) and handling the sequence logic in the code (via wrapper class)
.
>
> Is there a better approach requiring less effort? I would really like
> avoiding changing the Cust & Ord mgr for such a simple requirement.
>
> Thanks
>





[ Post a follow-up to this message ]



    RE: CS2007: Can SiteTerms ranked?  
David Messner [MSFT]


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-19-06 06:28 AM


Yes, you are correct, if you expect to be adding or changing values this
solution won't work.  Given that ranking isn't a capability of the site
terms feature, you're back to the sort of workarounds you originally
suggested.  Changing the stored procs included with Commerce Server is not
strictly supported, so I can't suggest you go there.

We'll certainly take this scenario into account in future development work.
Thanks for raising it.

regards
-David
--
This posting is provided "AS IS" with no warranties, and confers no rights.
You assume all risk for your use. © 2006 Microsoft Corporation.  All rights
reserved.

--------------------
From: examnotes <Pascal@discussions.microsoft.com>
Subject: RE: CS2007: Can SiteTerms ranked?
Date: Mon, 18 Sep 2006 12:53:03 -0700


If I understand you right, your suggestion is to use the "Names" field for
ranking the site terms. I thought about that but is not flexibile as you
add
new site terms or you simply want to re-sort them. Once you set the Name
field you cannot really change them without the pain of values of changing
all references to that site terms (including multi-value site term
attributes.. yikes)

"David Messner [MSFT]" wrote:

> Pascal,
>
> The first thing that comes to mind is to define your site term values
> (referred to as the term "names" in both the Customer and Orders Manager
UI
> and in the CS2002 BizDesk, go figure) in an order that you can use to
> rank/sort them on the site.  You would then use the DisplayNames of the
> SiteTerms to actually show to the user in the order sorted by value.  Of
> course this presumes you have control over the values you are you using
for
> your site terms and don't need to use the values for other purposes.
>
> Unfortunately the default SiteTermElement CompareTo implementation sorts
by
> DisplayName (SiteTermElement.Name), not what you want here.  So you'll
need
> to be aware of that and provide your own sorting.
>
> The below code sample shows how you can enumerate all the Site Terms from
> the rumtime.
>
>     using Microsoft.CommerceServer.Runtime;
>     using Microsoft.CommerceServer.Runtime.Profiles;
>
>     private void IterateSiteTerms()
>     {
> 	    ProfileContext profiles = CommerceContext.Current.ProfileSystem;
> 	    ArrayList names = profiles.SiteTermNames;
> 	    foreach (string name in names)
> 	    {
> 		    Response.Write(string.Format("<p>SiteTerm={0}</p>\n", name));
> 		    SiteTerm term = profiles.GetSiteTerm(name);
> 		    SiteTermElementCollection elements = term.Elements;
> 		    foreach (SiteTermElement element in elements)
> 		    {
> 			    Response.Write(string.Format("Name={0} value={1}<br/>",
> element.Name, element.Value));
> 		    }
> 	    }
>
>     }
>
> [Partial output]:
>
> SiteTerm=UserRole
>
> Name=Normal User value=1
> Name=Administrator value=2
>
> SiteTerm=Days
>
> Name=Sunday value=0
> Name=Monday value=1
> Name=Tuesday value=2
> Name=Wednesday value=3
> Name=Thursday value=4
> Name=Friday value=5
> Name=Saturday value=6
>
> Good luck
> -djm
> --
> This posting is provided "AS IS" with no warranties, and confers no
rights.
> You assume all risk for your use. © 2006 Microsoft Corporation.  All
rights
> reserved.
>
> --------------------
> From: examnotes <Pascal@discussions.microsoft.com>
> Subject: CS2007: Can SiteTerms ranked?
> Date: Thu, 14 Sep 2006 14:07:02 -0700
>
>
> hi,
>   what would be the best approach for "ranking" site terms in a similar
> fashion products can be ranked (sequenced) in the catalog. I don't want
> them
> to be in alphabetical order but having the possibility of a business user
> to
> determine the order in which the site terms are presented to the customer.
>
> It does seem I would either need to extend the MemAttrib table, use my
own
> stored proc and UI (ext to Smart Client  just for that...) OR holding
> somewhere an array of site term names ranked the way I want, providing my
> own
> UI (again) and handling the sequence logic in the code (via wrapper
class).
>
> Is there a better approach requiring less effort? I would really like
> avoiding changing the Cust & Ord mgr for such a simple requirement.
>
> Thanks
>




Attachment:
This has been downloaded 0 time(s).



[ Post a follow-up to this message ]



    RE: CS2007: Can SiteTerms ranked?  
Pascal


View Ip Address Report This Message To A Moderator Edit/Delete Message


 
09-19-06 06:25 PM

And btw, multi-lingual support for Site Term would be a great add-on too but
you already know that one ;) and the workaround has been documented already.

Thanks David,
Pascal

"David Messner [MSFT]" wrote:

>
> Yes, you are correct, if you expect to be adding or changing values this
> solution won't work.  Given that ranking isn't a capability of the site
> terms feature, you're back to the sort of workarounds you originally
> suggested.  Changing the stored procs included with Commerce Server is not
> strictly supported, so I can't suggest you go there.
>
> We'll certainly take this scenario into account in future development work
.
>  Thanks for raising it.
>
> regards
> -David
> --
> This posting is provided "AS IS" with no warranties, and confers no rights
.
> You assume all risk for your use. © 2006 Microsoft Corporation.  All righ
ts
> reserved.
>
> --------------------
> From: examnotes <Pascal@discussions.microsoft.com>
> Subject: RE: CS2007: Can SiteTerms ranked?
> Date: Mon, 18 Sep 2006 12:53:03 -0700
>
>
> If I understand you right, your suggestion is to use the "Names" field for
> ranking the site terms. I thought about that but is not flexibile as you
> add
> new site terms or you simply want to re-sort them. Once you set the Name
> field you cannot really change them without the pain of values of changing
> all references to that site terms (including multi-value site term
> attributes.. yikes)
>
> "David Messner [MSFT]" wrote:
> 
> UI 
> for 
> by 
> need 
> rights. 
> rights 
> own 
> class). 
>





[ Post a follow-up to this message ]



    Sponsored Links  




 





   All times are GMT. The time now is 05:29 AM.      Post New Thread    Post A Reply      
  Last Thread   Next Thread Next


Most Popular forums 

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is OFF
 
Medical and Health forum | Computer Games Reviews | Graphics design forum

Back To The Top
Home | Usercp | Faq | Register