how to access PipelineInfo.Profiles collection in custom pipeline?

How do I access the PipelineInfo.Profiles collection in custom pipeline?

[101 byte] By [dmsy] at [2008-1-7]
# 1

In my blog I show how to get custom context and you can get any of the Commerce Server context in this way.


Code Snippet
// You need to reference the Microsoft.CommerceServer.Interop.dll
// and a using statement Microsoft.CommerceServer.Interop.Profiles
IDictionary Context = (IDictionary)pdispContext;
IProfileService2 myProfileContext = (IProfileService2)Context["ProfileService"];

Good luck,

-Max

MaxAkbar at 2007-10-2 > top of Msdn Tech,Commerce Server,Commerce Server 2007...
# 2
I have actually read your blog before, but I just can't figure out what key name to use to get PipelineInfo.Profiles out of pdispContext. I could have just stuffed the Profile using another key name, but I prefered not to do that since it is already in PipelineInfo.Profiles collection. So, is there reference of the default key names to get information out of pdispContext? Also, in your code above you assign the result to an OrderContext, is that a typo?
dmsy at 2007-10-2 > top of Msdn Tech,Commerce Server,Commerce Server 2007...
# 3

Yes, it’s a typo cut\paste. You could iterate through the context values since they are a dictionary key to find out what is stuffed there. You could also modify the dumporder.vbs to do this for you.

-Max

MaxAkbar at 2007-10-2 > top of Msdn Tech,Commerce Server,Commerce Server 2007...
# 4
Before running the pipeline I put the UserProfile in the pipeleine profiles collection like this
Code Snippet
pipeline.Profiles.Add("UserObject", CommerceContext.Current.UserProfile);

I retrieved the ProfileService but with the ProfileService I can't see how I can get the profiles collection and the UserObject I store in it.

In a pipeline component, how I can retrieve this user profile within the profiles collection?

Thanks,

Luc

LucGauthier at 2007-10-2 > top of Msdn Tech,Commerce Server,Commerce Server 2007...
# 5

Did anyone have any success getting this to work?

I am struggling to compile this pipeline.

I keep getting the following error message:

Error 103 The type 'ActiveDSLib.IADs' is defined in an assembly that is not referenced. You must add a reference to assembly 'ActiveDSLib, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.

I can't find this assembly can someone please give me a pointer. This is what I am trying to do in my pipeline:

IDictionary Context = (IDictionary)pdispContext;

ProfileService2 profileSvc = (ProfileService2)Context["ProfileService"];

IProfileObject2 temp1 = profileSvc.GetProfileByKey("user_id", user_id, "UserObject", false);

Thanx.
SteveDDAY at 2007-10-2 > top of Msdn Tech,Commerce Server,Commerce Server 2007...
# 6
That assembly is located in C:\Program Files\Common Files\Microsoft Shared\Enterprise Servers\Commerce Server\Internal Assemblies.

Good luck,
-Max

MaxAkbar at 2007-10-2 > top of Msdn Tech,Commerce Server,Commerce Server 2007...