override existing form functionality

Vote:
 

Is this possible to customize or extend the functionality of existing module. Let say while creating user in CMS, I want to create same user in other system (integration) and want to add the other system's user id in existing EPI user's metadata field. This way I can relate the users of 2 different system. Please suggest if this is achivable.

Thanks.

#179875
Jun 23, 2017 16:09
Vote:
 

Hi this post might be what you are looking for: https://www.dcaric.com/blog/how-to-intercept-the-user-provider-in-episerver-10

#179878
Jun 23, 2017 18:42
Vote:
 

Hi David,

Thanks for prompt response. Yes, provided link is helpful. Can you please point out where this interceptor code should be written. Do we need to write add on? I am going through QuickSilver application. Let say if someone ask me to intercept the user creation module of QuickSilver, where should I implement the code. Should I add the provided interceptor code directly in QuickSilver or need to write it separatly? Please help, I am bit confused in writing code directly or through addon.

Thanks!

#179973
Jun 27, 2017 14:26
Vote:
 

You need to register your interceptor using initialization module. It's a regular C# class which can be created anywhere in your solution.

#179974
Jun 27, 2017 14:34
Vote:
 

Ok, so can someone confirm my understanding below on overriding existing functinality??

For eg, if I have to call a web service (in Quick silver application) of another system while creating user, should I do the following:

  1. Add separate class libray project
  2. Write interceptor
  3. Add a service call in interceptor
  4. Write intialization module to register above interceptor
  5. Create nuget package of this library project
  6. Install this package in quick silver
  7. Once package installed, on creation of user in Quick silver application, it will also call webservice for integration
#180002
Edited, Jun 28, 2017 10:03
Vote:
 

You should use IInterceptor only if you have to. For example, site administrators insist on using the built-in views, or you're building an add-on and don't have control over other people's code...

Otherwise, it's much better to create a custom registration form.

I don't think that separate project/class library is necessary unless you're building something that will be used in several projects and/or packed as a NuGet package.

Are you trying to make changes to cms users or customers in Commerce Manager?

Can you describe in more detail what you're trying to solve?

#180026
Jun 28, 2017 15:38
Vote:
 

Basically, I am referring Quick silver application available on Git and I want to integrate QuickSilver with my application. QuickSilver provides CMS and Commerce features. On creating user in CMS, I want to create  the same user in my system using REST API available at my end.

Currently when I place the cursor on "Create User" menu in QuickSilver, it shows the navigation path as "episerver/CMS/Admin/EditUser.aspx" but this page is not available in application for change. It resides under Modules/_protected/CMS/CMS.zip". 

I am trying to find out a place to call my service on user creation in QuickSilver CMS. Can you please give me a pointer.

Thanks.

#180028
Jun 28, 2017 16:11
Vote:
 

The simplest solution would be to create a user registration controller in EPiServer.Reference.Commerce.Site project.

You can borrow the code from Alloy sample project (RegisterController).

This controller will then make rest calls, etc.

If you want to use the built-in view (episerver/CMS/Admin/EditUser.aspx), then you can solve this with an interceptor.

UserProviderInterceptor and UserProviderInterceptorModule from my blog post can be created anywhere in your project (EPiServer.Reference.Commerce.Site). Episerver will pick them up on application start.

Rest communication should be done in CreateUser, UpdateUser and DeleteUser methods of UserProviderInterceptor.

No need for NuGet packages, add-ons, etc.

Hope this helps!

#180030
Jun 28, 2017 16:34
Vote:
 

Hi Dejan, Thanks for the pointer. Intercaptor is working as expected. Can we create Interceptor on product creation as well Like let say want to intercept while adding Book title in catalog??

#180099
Jun 29, 2017 16:51
Vote:
 

You should use IContentEvents for that. http://www.jondjones.com/learn-episerver-cms/episerver-developers-guide/episerver-event-handling/how-to-hook-into-the-episerver-cms-events-pipeline

#180100
Jun 29, 2017 17:03
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.