3 Replies Latest reply on Jul 31, 2008 5:48 AM by qhuynh

    adding filter properties to TagResultFilter in TagCloudAction not doing anything?

      Hi,

      I'm overriding tags action (browse by tags page) so that users can filter on custom documents (that are just documents with some extended properties including a doctype field) so I have a couple of extra checkboxes there for our doctypes the user can check. I'm extending TagsAction - a straight copy from source - the only difference is that it extends our custom TagCloudAction class which is where the tagcloud gets generated and we want to do the filtering. Extended tagcloudaction overrides execute and getTagCloud so that if a user has checked our custom types, they get the custom tagcloud. The tagfilter object is

      exactly the same as in regular tagcloudaction, except I am adding tf.addProperty("doctype",checked-doc-type-value); for all the doctypes the user checked. I have added logging and tf.getPropertyName(x) and tf.getPropertyValueString(x) are returning the correct values.

       

      But this.tagCloud =getJiveContext().getTagManager().getTagCloud(getCommunity().getTags(tf,typeArray), getNumOfBuckets(), getSort()); still returns the same

      results as the original unextended action - my filtered properties don't seem to have any effect at all. I've tried both AND/OR property modes. Any ideas?

       

       

       

      I also noticed that resultFilter.addProperty(name,value) can only have one "name" property it seems (if I added 2 "doctype" properties with

      different values to the tagfilter, the last one is the only one saved) -

      is there any way to filter over various values for a single property?

       

       

      Thanks for the help.

        • Re: adding filter properties to TagResultFilter in TagCloudAction not doing anything?

          Actually I suppose for a workaround with the second question dealing with filtering over a property name with multiple values, I could just work with using CONTAINS_MATCH in the resultfilter since there are only 3 possible values my custom property can have and there are enough letters in the string values to work with all the permutations of querying across them.  But hopefully there's a more elegant way available to do that, but the bigger concern is of course getting the filter to actually do any filtering in the first place. Thanks.

          • Re: adding filter properties to TagResultFilter in TagCloudAction not doing anything?

            hi James,

             

            It looks like the manager responsible for retrieving tags based on the tagresultfilter doesn't actually check the properties you set. You can see this for yourself in the class SQLGenerator, method 'getTagListSQL'.

             

            Cheers,

             

            AJ

              • Re: adding filter properties to TagResultFilter in TagCloudAction not doing anything?

                Hi,

                I'm a current customer and I also added customize objects to the tag search.  I ran into a few issues and one of them was that when your adding a in a new type, it goes against the container proxy and runs a check to see what types are available to use.  You might want to try to look at that if you haven't.  I posted an example below and in my case I was dealing with an objecd within the groups implementation class...

                 

                 

                 

                public ContentRetrieval.ContentType[] getAvailableContentTypes() {
                        ArrayList<ContentRetrieval.ContentType> types = new ArrayList<ContentRetrieval.ContentType>();
                        types.add(ContentRetrieval.ContentType.THREAD);
                        types.add(ContentRetrieval.ContentType.DOCUMENT);
                        types.add(ContentRetrieval.ContentType.BLOG_POST);
                        // TODO ADDED NEW OBJECT
                        types.add(ContentRetrieval.ContentType.XXXXX);

                        return types.toArray(new ContentRetrieval.ContentType[types.size()]);
                    }

                 

                 

                 

                I hope that helps. 

                 

                ~ Qui