public void Describe(DescribeFilterContext describe)
        {
            foreach (var part in _contentDefinitionManager.ListPartDefinitions())
            {
                // This query returns all EncryptedStringFieldDefinitions in the parts where there's at least one EncryptedStringField.
                var encryptedStringFieldDefinitions = part.Fields.Where(fd => fd.FieldDefinition.Name.Equals("EncryptedStringField"));
                var localPart = part;

                foreach (var field in encryptedStringFieldDefinitions)
                {
                    var localField = field;

                    // The following code generates the list of filters you can apply on EncryptedStringFields.
                    // Fields are grouped by part.
                    describe
                    .For(
                        part.Name + "ContentFields",
                        T("{0} Content Fields", part.Name.CamelFriendly()),
                        T("Content Fields for {0}", part.Name.CamelFriendly()))
                    .Element(
                        localPart.Name + "." + localField.Name,
                        T(localField.DisplayName),
                        T("Value for {0}", localField.DisplayName),
                        context => ApplyFilter(context, part, field),
                        DisplayFilter,
                        SecureStringFieldForm.FormName);
                }
            }
        }
Exemplo n.º 2
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Search", T("DataProtection"), T("Data Protection"))
     .Element("Data Protection Filter", T("Apply Data Protection"), T("Apply Data Protection to current query."),
              ApplyFilter,
              DisplayFilter);
 }
Exemplo n.º 3
0
        public void Describe(DescribeFilterContext describe)
        {
            foreach (var part in _contentDefinitionManager.ListPartDefinitions())
            {
                var booleanFields = part.Fields.Where(field => field.FieldDefinition.Name == typeof(BooleanField).Name);

                if (!booleanFields.Any())
                {
                    continue;
                }

                var descriptor = describe.For(
                    part.Name + "ContentFields",
                    T("{0} Content Fields", part.Name.CamelFriendly()),
                    T("Content Fields for {0}", part.Name.CamelFriendly()));

                foreach (var field in booleanFields)
                {
                    descriptor.Element(
                        typeof(TokenizedBooleanFilter).Name,
                        T("{0}: Tokenized Value", field.DisplayName),
                        T("The tokenized boolean value of the field."),
                        context => ApplyFilter(context, part, field),
                        context => DisplayFilter(context, part, field),
                        TokenizedBooleanFilterForm.FormName
                        );
                }
            }
        }
        public void Describe(DescribeFilterContext describe)
        {
            var builder = new BindingBuilder();

            foreach (var bindingProvider in _bindingProviders)
            {
                bindingProvider.GetMemberBindings(builder);
            }

            var groupedMembers = builder.Build().GroupBy(b => b.Property.DeclaringType).ToDictionary(b => b.Key, b => b);

            foreach (var typeMembers in groupedMembers.Keys)
            {
                var descriptor = describe.For(typeMembers.Name, new LocalizedString(typeMembers.Name.CamelFriendly()), T("Members for {0}", typeMembers.Name));
                foreach (var member in groupedMembers[typeMembers])
                {
                    var    closureMember = member;
                    string formName      = _filterCoordinator.GetForm(closureMember.Property.PropertyType);
                    descriptor.Element(member.Property.Name, member.DisplayName, member.Description,
                                       context => ApplyFilter(context, closureMember.Property),
                                       context => _filterCoordinator.Display(closureMember.Property.PropertyType, closureMember.DisplayName.Text, context.State),
                                       formName
                                       );
                }
            }
        }
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("ContentOwner", T("Content Owner"), T("The owner of the content item"))
     .Element("LoggedInUserOwnerMatch", T("Logged in user"), T("Is owned by logged in user"),
              ApplyFilter,
              context => T("Content is owned by logged in user")
              );
 }
Exemplo n.º 6
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("ContentOwner", T("Content Owner"), T("The owner of the content item"))
     .Element("AuthorOwnerMatch", T("Author of current content"), T("Is owned by the author of the page's main document. Works best with widgets."),
              ApplyFilter,
              context => T("Content is owned by main document author")
              );
 }
Exemplo n.º 7
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("ContentOwner", T("Content Owner"), T("The owner of the content item"))
     .Element("ProfilePageUserMatch", T("Profile page user"), T("Is owned by the current profile page user. Only works in widget on profile page."),
              ApplyFilter,
              context => T("Content is owned by profile page user")
              );
 }
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("CommunicationContacts", T("Communication Contacts"), T("Communication Contacts"))
     .Element("DeviceType", T("Device Type"), T("The type of the device the contact registered with (i.e. Android, Apple, Windows)."),
              ApplyFilter,
              DisplayFilter,
              "DeviceTypeForm");
 }
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Taxonomy", T("Taxonomy"), T("Taxonomy"))
     .Element("SelectedTerms", T("User selected Terms"), T("User can select terms"),
              ApplyFilter,
              context => T("User selected taxonomy terms")
              );
 }
Exemplo n.º 10
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Transform", T("Transform"), T("Transform"))
     .Element("Format", T("Format"), T("Change the format of the image."),
              ApplyFilter,
              DisplayFilter,
              "FormatFilter"
              );
 }
Exemplo n.º 11
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Search", T("Search"), T("Search"))
     .Element("SearchFilter", T("Search filter"), T("Filters for items matching a search query in the site search index."),
              ApplyFilter,
              DisplayFilter,
              "SearchFilter"
              );
 }
Exemplo n.º 12
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("ContentOwner", T("Content Owner"), T("The owner of the content item"))
     .Element("OwnerMatch", T("Specified user"), T("Is owned by the specified user"),
              ApplyFilter,
              DisplayFilter,
              UsersFilterForms.FormId
              );
 }
Exemplo n.º 13
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Content", T("Content"), T("Content"))
     .Element("ContainedByFilter", T("Contained by filter"), T("Filters for items contained by a container."),
              ApplyFilter,
              DisplayFilter,
              "ContainedByFilter"
              );
 }
Exemplo n.º 14
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Profilling", T("User Profilling"), T("User Profilling"))
     .Element("User Tracking Filter", T("User Tracking Filter"), T("Filter for a specific tracking element."),
              ApplyFilter,
              DisplayFilter,
              "UserTrackingFilterForm"
              );
 }
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Transform", T("Transform"), T("Transform"))
     .Element("FormatAndResize", T("Format and Resize"), T("A single step filter that can change format as well as resize (preferred)."),
              ApplyFilter,
              DisplayFilter,
              "FormatAndResizeFilter"
              );
 }
 public void Describe(DescribeFilterContext describe)
 {
     describe
     .For("User", T("User Device"), T("User Device"))
     .Element("UserDEvice", T("User Device"), T("Filter for device associated to User"),
              ApplyFilter,
              DisplayFilter
              );
 }
Exemplo n.º 17
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Content", T("Content"), T("Content"))
     .Element("ContentTypes", T("Content Types"), T("Specific content types"),
              ApplyFilter,
              DisplayFilter,
              "ContentTypesFilter"
              );
 }
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Tags", T("Tags"), T("Tags"))
     .Element("TagsMatch", T("Has tags that match content tags"), T("Tagged content items"),
              ApplyFilter,
              context => T("Tags match content"),
              TagMatchTypeForm.FormId
              );
 }
Exemplo n.º 19
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Transform", T("Transform"), T("Transform"))
     .Element("Resize", T("Resize"), T("Resizes using predefined height or width."),
              ApplyFilter,
              DisplayFilter,
              "ResizeFilter"
              );
 }
Exemplo n.º 20
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Content", T("Content"), T("Content"))
     .Element("IdsInFilter", T("Ids In filter"), T("Filters for items having the specified ids."),
              ApplyFilter,
              DisplayFilter,
              "IdsInFilter"
              );
 }
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Content", T("Content"), T("Content"))
     .Element("EagerFetch", T("Eager fetch"), T("Eager fetch content part records"),
              ApplyFilter,
              DisplayFilter,
              "ContentPartRecordsForm"
              );
 }
Exemplo n.º 22
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Search", T("Search reactions"), T("Search reactions"))
     .Element("Reaction Clicked Filter", T("Reaction clicked filter"), T("Filter for a specific reaction."),
              ApplyFilter,
              DisplayFilter,
              "ReactionClickedFilterForm"
              );
 }
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Tags", T("Tags"), T("Tags"))
     .Element("TagsInQuerystring", T("Has tags in querystring"), T("Dynamically match tags from the querystring. Usage: ?tags=x1,x2"),
              ApplyFilter,
              context => T("Tags match querystring tags"),
              TagMatchTypeForm.FormId
              );
 }
Exemplo n.º 24
0
        public IEnumerable <TypeDescriptor <FilterDescriptor> > DescribeFilters()
        {
            var context = new DescribeFilterContext();

            foreach (var provider in _filterProviders)
            {
                provider.Describe(context);
            }
            return(context.Describe());
        }
 public void Describe(DescribeFilterContext describe)
 {
     describe
     .For("Content", T("Content"), T("Content"))
     .Element("OrchardQuery",
              T("Orchard Query"),
              T("Allows using a different Orchard Query to filter content results."),
              ApplyFilter,
              DisplayFilter,
              UseOtherQueriesFilterProviderForm.FormName);
 }
 public void Describe(DescribeFilterContext describe)
 {
     describe
     .For("Taxonomy", T("Taxonomy"), T("Taxonomy"))
     .Element("HasTermsIfAny",
              T("Has the selected terms (if any was selected)"),
              T("ContentItems with the given terms, or any ContentItem if no term si provided to the query."),
              ApplyFilter,
              DisplayFilter,
              "SelectTermsForm");;
 }
Exemplo n.º 27
0
 public void Describe(DescribeFilterContext describe)
 {
     describe
     .For("Localization", T("Localization"), T("Localization"))
     .Element("ForSelectedCultureOrAny",
              T("Selected culture or any"),
              T("Localized content items for a given culture (or any culture if none provided)."),
              ApplyFilter,
              DisplayFilter,
              "SelectCultureForm");;
 }
 public void Describe(DescribeFilterContext describe)
 {
     describe
     .For("Search", T("HQL Query"), T("Allows using a parametrized HQL query to select content items."))
     .Element("HQLQuery",
              T("HQL Query"),
              T("Allows using a parametrized HQL query to select content items."),
              ApplyFilter,
              DisplayFilter,
              "ParametrizedHQLForm");
 }
Exemplo n.º 29
0
 public void Describe(DescribeFilterContext describe)
 {
     describe.For("Content")          // The category of this filter
     // Defines the actual filter (we could define multiple filters using the fluent syntax)
     .Element(
         "ProductParts",             // Type of the element
         T("Product Parts"),         // Name of the element
         T("Product parts"),         // Description of the element
         ApplyFilter,                // Delegate to a method that performs the actual filtering for this element
         DisplayFilter               // Delegate to a method that returns a descriptive string for this element
         );
 }
Exemplo n.º 30
0
        public void Describe(DescribeFilterContext describe)
        {
            var descriptor = describe.For(CategoryName, T("ContentItemPermission Fields"), T("ContentItemPermission Fields"));

            // User
            descriptor.Element(
                type: "ContentItemPermissionPartRecord.User_Id",
                name: new LocalizedString("User"),
                description: T("User Selection"),
                filter: (context) => ApplyUserFilter(context),
                display: context => Display(context, "Selected User"),
                form: UserServiceUserForm.FormName
                );

            // BusinessUnit
            descriptor.Element(
                type: "ContentItemPermissionPartRecord.BusinessUnit_Id",
                name: new LocalizedString("BusinessUnit"),
                description: T("BusinessUnit Selection"),
                filter: (context) => ApplyBusinessUnitFilter(context),
                display: context => Display(context, "Selected BusinessUnit"),
                form: BusinessUnitSelectionForm.FormName
                );

            // All items that current user has access to them
            descriptor.Element(
                type: CurrentUserPermissions,
                name: new LocalizedString("Current User Permissions"),
                description: T("All items that current user has access to them"),
                filter: (context) => AllItemsCurrentUserHasAccessFilter(context),
                display: context => Display(context, "Current User Permissions"));

            // All of the selected BusinessUnits, Teams and Users
            descriptor.Element(
                type: AnySelectedUserTeamBusinessUnit,
                name: new LocalizedString("Multiple Users or Teams or BusinessUnitss Filter (System Only)"),
                description: T("All items that belong to any of the given teams, users and businessUnits. (This is only used by the system)"),
                filter: (context) => ApplyAnyUserOrTeamOrBusinessUnitsFilter(context),
                display: context => Display(context, "ApplyAnyUserOrTeamOrBusinessUnitsFilter"),
                form: UserAllItemsFilterForm.FormName
                );

            // Items without any assignee
            descriptor.Element(
                type: UnassignedItems,
                name: new LocalizedString("Items without any assignee"),
                description: T("All items without any assignee"),
                filter: (context) => ItemsWithoutAnyAsignee(context),
                display: context => Display(context, "Items Without any Asignee")
                );
        }