November Happy Hour will be moved to Thursday December 5th.

Visitor group dropdown property and IsMatch problem

Vote:
 

Hello! I'm implementing a criterion that should determine if a logged in user is of a specific type. Instances of this criterion should then be created as visitor groups. The criterion should include a dropdown that shows the different types a user can belong to. For example if I create a visitor group with the type "Admin", then the pages that has this visitor group will only be viewable by a user that is Admin. I have two problems with this.

1. When I try to create a visitor group with this criterion I get this exception:

"Cannot create an abstract class. MissingMethodException. Unable to load /EPiServer/Cms/VisitorGroups/CriteriaUI status: 500"

I've chekced some tutorials and, this is how I've implemented it, in my settings file, that inherits from CriterionModelBase:

[DojoWidget(SelectionFactoryType=typeof(EnumSelectionFactory))]
public UserType Type { get; set; }

2. If I just create the type property as a string instead and try it out and add my visitor group to a page, IsMatch runs on every page. This seems weird, I believe it should only run on those pages to which I have added the visitor group? Because if I create two visitor groups one "Admin" and one "Normal" based on this criteria, and add those two to two different pages, both visitor groups' IsMatch method is executed when entering the page with the Admin visitor group, which means that the Normal user will get access to an Admin page.

Help appreciated!

Regards, Tobias

#116182
Jan 26, 2015 13:18
Vote:
 

Im interested to know this also, I have the following and it results in a simliar error:

[Required]
        [DojoWidget(
            WidgetType = "dijit.form.FilteringSelect",
            SelectionFactoryType = typeof(EnumSelectionFactory<VisitorRegions>))]
        public VisitorRegions SelectedVisitorRegion { get; set; }
#116407
Jan 29, 2015 17:16
Vote:
 

Hi Tobias,

I've made a little progress on this, I can get my drop down to appear now, doesnt seem to be pulling values but thats the next thing for me to fix.  Basically, in your selection factory, make sure your using the ISelectionFactory from the visitor groups namespace, not the one in ObjectEditing namespace.  That what my problem was.

Cheers,


Adam

#116408
Edited, Jan 29, 2015 17:47
* 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.