Help needed Indexing Custom Features (2.3.6.7)

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
10/4/2011 10:42:47 AM
Gravatar
Total Posts 2

Help needed Indexing Custom Features (2.3.6.7)

Hello there,

I'm currently building my first mojoPortal custom feature (very new to mojoPortal in general really) and I am having a problem with indexing the content.

We have an existing membership database with a simple table for its members and potential new members can apply for membership through their new site which we are building. I am in the middle of creating a custom feature to handle this. So far I have:

  • a web control that can be embedded that allows users to apply for membership, this same control is used to manage the members in an admin edit page. When a user is approved a mojoPortal user is created
  • a web control that can be embedded to allow users to select a category from a drop down and see all members in that category 
  • a web control that displays a selected member in the previous category select web control. The tag for this sits in the category select web control 

If a user visits a page which has the category select web control on it and the query string has a MemberID, the Category Select control will automatically display the member who has that ID. This is all working brilliantly and I was pleasantly surprised at how easy it was to knock up an extension like this. I am now trying to get these results into the site search, if a user searches for ACME, I would like in the results a link to the page that has the Category Select control on it with the appropriate MemberID. I have added to my Members business class the ContentChangedEventHandler which gets fired correctly and I am currently trying to get my head round building the IndexBuilderProvider for it. 

In my IndexBuilderProvider I am overriding ContentChangedHandler but within this I need to get the list of pageModules for where the Category Select control appears. How do I dynamically get the ModuleID of the Category Select control here. The example in the developer docs (for HtmlContent) is getting it from the HtmlContent item itself. My problem is I have a different control updating Member data from displaying it so I cannot really store it there. I am fairly certain I am missing something here. Do I just hard code a generated ModuleID for my Category Select control?

Any help would be welcome on this one, bonus points for an explanation (as if I were five) on what is going on. I think I understand the indexing, I just think I don't understand the relationship between modules and pages and the likes as well as I thought I did. Maybe I have the architecture of my feature wrong.

Sorry for the essay question, I tend to air on the side of verbose-ness when asking tech questions.

Thanks in advance!

 - Matthew

Ps. The modules are only included once on the site so I don't need to worry about data in the Membership table being related to an instance of a module

10/4/2011 11:09:19 AM
Gravatar
Total Posts 18439

Re: Help needed Indexing Custom Features (2.3.6.7)

Hi Matthew,

In existing features in mojoPortal we don't use more than one ModuleControl per feature so any instance of a feature has one an only one moduleid associated with it. You basically have implemented 2 features and they will each have a different module id.

The way I would have approached this feature is the same as with any other feature, I would only have one ModuleControl that would be put on a CMS page. Then instead of the second control you have implemented I would implement a supporting page or pages for the other aspects of the feature and I would link to the supporting pages from the one ModuleControl and I would pass in the pageid and moduelid in the query string from the links in the ModuleControl to keep the same page and module context. Think of the modulecontrol as the entry point to the feature so there should only be one of them but a more complex feature will have supporting pages. The Html feature is a simple one with no supporting pages, but Blog, Forums, WebStore, are all more cpomplex features that have supporting pages and also implement search.

So for example maybe the select category control would be the one module, and from there I would have a link for "Apply For Membership" that links to a supporting page and this would pass in the pageid and moduleid as params.

This would make it a bit easier to implement the indexbuilder. I would suggest study the code for several index builders for different existing features to see what they have in common and also how they differ. This will give you a broader view and hopefully help you get ideas about how to implement one for your custom feature.

The indexbuilder is basically defining index items that are queued into a table and then the IndexWriter task is launched on a background thread and it processes the rows from the database mp_IndexingQueue table and writes to the actual search index which is a set of files under /Data/Sites/[SiteID]/index

The index items define the url will the result will be found and it also stores the allowed view roles, so when view permissions on a feature are changed the index must be updated. In your case if you hav eno security concerns about hwo can search then you could hard code the roles as "All Users". The main purpose of moduleid and item id in terms of indexing is giving the indexed item a unique key so that if the content changes the index can be updated correctly, ie by deleting the previous index item and then re-creating it.

Hope that helps,

Joe

10/4/2011 11:23:51 AM
Gravatar
Total Posts 2

Re: Help needed Indexing Custom Features (2.3.6.7)

Thanks very much for the quick response.

I suspected it was an architecture problem. I now get how these controls should be designed and will have a rethink retweak.

Thanks again

You must sign in to post in the forums. This thread is closed to new posts.