Developer forum

Forum » CMS - Standard features » Extending the UserIndexBuilder

Extending the UserIndexBuilder

Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Hi there,

I am looking into ways to extend a user index with data such as the email marketing performance score or voucher codes used by a user. This allows us to created targeted marketing campaigns to involved users.

How would I go about this? Should I inherit UserIndexProvider and add additional functionality to its Build method? Or do I need to create new builder from scratch myself?

Any pointers would be great.

Thanks,

Imar


Replies

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Also, if I do inherit UserIndexProvider to build my own, how do I make my queries a user query from the UI's perspective so that it shows up under Repository Queries under User Management and as the target query for an email campain in the Marketing center?

 
Nicolai Høeg Pedersen
Reply
This post has been marked as an answer

Hi Imar

You can extend the indexer by creating a IIndexBuilderExtender like you would on Ecommerce. It is a generic, so it has to be a IIndexBuilderExtender of UserIndexBuilder. You can see an example of one for Ecommerce here: http://developer.dynamicweb.com/forum/cms-standard-features/new-index-sort-product-order-in-product-group.aspx

BR Nicolai

Votes for this answer: 1
 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Excellent; that got the job done. I am now adding an array of voucher codes used by the user in a new custom field. I also created my own IndexSchemaExtender. In GetFIelds I am leveraging the UserIndexSchemaExtender to get all the basic fields and then add my own string[] field to the list.

Now on to the next challenge: getting a distinct list of voucher codes in the query so an admin can pick one from the list without having to manually type in a string. Is that possible? I looked into macros but those execute at run-time. Is there an equivalent that runs at design time while building the query in the Management Center? I am looking for something similar to the Constant option but then have the standard text field turn into a drop down list with options that I can supply somehow.

Thanks,

Imar

 
Nicolai Høeg Pedersen
Reply

Hi Imar

If I understand correct, that is currently not possible. You basically want a list of distinct values in a given field to choose from when setting up the search?

NP

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Yes, exactly. Like you can do with custom fields where you can either hard code a list or use a SQL Query to get the results.

It's not a big deal, but it would be nice if you could somehow build your own macros or parameters or whatever needs to be done to support this. The current index is a bit techy here and there in the UI. Something that would allow me to build my own "Voucher Code" or a "Target Country" macro or the like that would work similar to a Marco but then present a data-driven list instead of the hard coded options would be great. Then developers can build the complex part of it, while a backend user, building a query for a marketing campaign for example could simply pick stuff from the list without knowing that "United States" is actually stored with the country code in the database and thus you need to use US instead. Just examples but hopefully you get the point.

Here's a visual of it: http://jhh24y.axshare.com/ Under the hood, the selected value would be stored in the same way as a constant is today.

Imar

 
Nicolai Høeg Pedersen
Reply

Hi Imar

I agree that the UI is a bit techy - we have a user friendly version of it on the agenda for the fall also to support using it as a replacement for smart searches. Having the option to tell the index what kind of information is in a given field and give it a specific picker is one very important feature.

Just to be sure, you can already cretae your own macros today, just not with data-driven list.

BR Nicolai

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

>> Just to be sure, you can already cretae your own macros today, just not with data-driven list.

Yep, but those execute at run-time, don't they? Whereas my request above deals with the design-time building of the query.

Looking forward to a UI that can replace Smart Searches. One limitation we found with Smart Searches was that they aren't extensible, so you can't implement my scenario to find all users that, say, used a specific voucher code, without you building it into the system. It would be great if we got that ability in the new indexing engine and UI.

Thanks!

Imar

 
Nicolai Høeg Pedersen
Reply

Yes, they execute at runtime.

And yes, we need it to be fully extendable, so it will be a add-on to the indexing engine based on extensibility.

 
Imar Spaanjaars Dynamicweb Employee
Imar Spaanjaars
Reply

Excellent!

 

You must be logged in to post in the forum