Quantcast

Help please on filters

classic Classic list List threaded Threaded
16 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Help please on filters

Tim Lyons
Administrator
I have fixed:
0006849: citationtreeview with search bar only searches in sources,  
not citation data
0006848: citationtreeview corrupts when search bar open and edit occurs
0006829: Searching into source/citation selector disallows to select  
all related citations, only matching rows

by fixing treebasemodel so it properly deals with secondary objects,  
and also citationtreemodel so it adds secondary odes even when the  
parent is not present.


The effect now is that in treeviews, the 'Search Bar' (at the top of  
the main display area) causes the display of any primary or secondary  
objects that match the criteria. So in Citation Tree View, you get  
matching sources and citations. If a citation matches, but its source  
does not, you get the citation as a top level node in the display. The  
same thing works with the 'Select Source or Citation' dialogue.

However, when you use the sidebar filters, objects of the 'wrong' type  
are are allowed through. So if you apply a Source filter for  
'Title==mysource' to a citation, it behaves as if it matches. This is  
symmetrical, so if you use a source filter, you get the matching  
sources and all citations. If you use a citation filter you get  
matching citations, and all sources.


Can you please help, because I don't understand
(1) why both the Citation filter and the Source filter are available  
in the sidebar under 'Add a gramplet'. (I can see that  
citationtreeview get_default_gramplets establishes the Source Filter  
as the default, but I don't know how the available filters are defined).

(2) treebasemodel._rebuild_filter applies the filter that the user has  
specified first to the primary objects and then the secondary objects.  
I don't understand how or why applying a source filter to a citation  
object lets it get through. Should this happen? What would be the  
consequence elsewhere if this behaviour were changed? How could it be  
changed?






There is another question I have got about the code, but it's not very  
important:
(3) treebasemodel.set_search tests search[0] for zero, one or another  
value. The other value is used for 'Fast Filter'. However, I think  
that search[0] is actually a boolean, and if 'Fast Filter' means just  
typing something into the main display area, and jumping to the entry  
starting with that, is this done somewhere else?

Regards, and thanks in advance,
Tim.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Doug
On 29/08/13 19:16, Tim Lyons wrote:

> I have fixed:
> 0006849: citationtreeview with search bar only searches in sources,
> not citation data
> 0006848: citationtreeview corrupts when search bar open and edit occurs
> 0006829: Searching into source/citation selector disallows to select
> all related citations, only matching rows
>
> by fixing treebasemodel so it properly deals with secondary objects,
> and also citationtreemodel so it adds secondary odes even when the
> parent is not present.
>
>
> The effect now is that in treeviews, the 'Search Bar' (at the top of
> the main display area) causes the display of any primary or secondary
> objects that match the criteria. So in Citation Tree View, you get
> matching sources and citations. If a citation matches, but its source
> does not, you get the citation as a top level node in the display. The
> same thing works with the 'Select Source or Citation' dialogue.
>
> However, when you use the sidebar filters, objects of the 'wrong' type
> are are allowed through. So if you apply a Source filter for
> 'Title==mysource' to a citation, it behaves as if it matches. This is
> symmetrical, so if you use a source filter, you get the matching
> sources and all citations. If you use a citation filter you get
> matching citations, and all sources.

Where have these changes been implemented?
I'm running 3.4.6 svn22976M which displays Source-Citation
data nicely and allows one to switch from Source View to
Citation View on the same item without any hassle.
I only have a tree view present on Sources, not Citations.

I'm not sure how this is supposed to work, so apologies if
my comments are not relevant. However Source: Citation Tree
View has a default Filter sidebar that works with Custom
filters on the data, while the Editor is a Citation Filter
Editor allowing Custom Citation filters to be created and
edited, but not operating on the data AFAICT.
I assumed that adding a Citation filter to the sidebar under
  'Add a gramplet' would make filtering on citation details
available. It seems not to be so.


<snip>

Doug


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Tim Lyons
Administrator
BUMP. Could one of the devs who understands more about filters help me  
out on this??


On 1 Sep 2013, at 18:14, doug wrote:

> On 29/08/13 19:16, Tim Lyons wrote:
>> I have fixed:
>> 0006849: citationtreeview with search bar only searches in sources,
>> not citation data
>> 0006848: citationtreeview corrupts when search bar open and edit  
>> occurs
>> 0006829: Searching into source/citation selector disallows to select
>> all related citations, only matching rows
>>
>> by fixing treebasemodel so it properly deals with secondary objects,
>> and also citationtreemodel so it adds secondary odes even when the
>> parent is not present.
>>
>>
>> The effect now is that in treeviews, the 'Search Bar' (at the top of
>> the main display area) causes the display of any primary or secondary
>> objects that match the criteria. So in Citation Tree View, you get
>> matching sources and citations. If a citation matches, but its source
>> does not, you get the citation as a top level node in the display.  
>> The
>> same thing works with the 'Select Source or Citation' dialogue.
>>
>> However, when you use the sidebar filters, objects of the 'wrong'  
>> type
>> are are allowed through. So if you apply a Source filter for
>> 'Title==mysource' to a citation, it behaves as if it matches. This is
>> symmetrical, so if you use a source filter, you get the matching
>> sources and all citations. If you use a citation filter you get
>> matching citations, and all sources.
>
> Where have these changes been implemented?
> I'm running 3.4.6 svn22976M which displays Source-Citation data  
> nicely and allows one to switch from Source View to Citation View on  
> the same item without any hassle.
> I only have a tree view present on Sources, not Citations.

Yes, I'm talking about the Gramps34 maintenance branch (among others)  
which is now up to svn23001. (22976 is actually a gramps40 revision??)

>
> I'm not sure how this is supposed to work, so apologies if my  
> comments are not relevant. However Source: Citation Tree View has a  
> default Filter sidebar that works with Custom filters on the data,

In Citation Tree View, the default Filter sidebar (right click and  
select 'Restore default gramplets') is a source filter (you can tell  
that because it contains 'Title' which is a source data item). If you  
type something into one of the fields (e.g. the Title field), and  
press Find, it finds all the sources that contain the text you typed,  
but also finds *all* citations, irrespective of whether they are part  
of the source you found, or not. I don't think this is what one would  
expect, so I count that as a fault, and I am surprised if you say you  
think it is working.

You can also create a custom filter with this filter, and you get  
offered various 'General Filters' which all relate to source  
information, and again, these select the source you wanted plus all  
citations.

> while the Editor is a Citation Filter Editor allowing Custom  
> Citation filters to be created and edited, but not operating on the  
> data AFAICT.

I don't understand this. The default editor is a Source Filter editor.  
If you right click on the top of the sidebar, you can also bring up a  
Citation Filer sidebar. This has 'Volume/Page' in it. If you type  
something into that (e.g. type some text into the 'Volume/Page' filed,  
then press find, it finds all the citations which contain the text  
(each displayed under its associated source) just as I would have  
expected, but it also displays *all* sources, even if they don't have  
any citation that contains the requested text. I don't think that is  
what would be expected, so I count that as being a fault.

> I assumed that adding a Citation filter to the sidebar under  'Add a  
> gramplet' would make filtering on citation details available. It  
> seems not to be so.

See above I think it does make filtering available to some extent.  
What result are you seeing with the Citation filter?

Regards,
Tim.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Doug
On 02/09/13 14:57, Tim Lyons wrote:
> BUMP. Could one of the devs who understands more about
> filters help me out on this??
<snip>
> Yes, I'm talking about the Gramps34 maintenance branch
> (among others) which is now up to svn23001. (22976 is
> actually a gramps40 revision??)
>
>>

On 23001M.

<snip>

>
> In Citation Tree View, the default Filter sidebar (right
> click and select 'Restore default gramplets') is a source
> filter (you can tell that because it contains 'Title' which
> is a source data item). If you type something into one of
> the fields (e.g. the Title field), and press Find, it finds
> all the sources that contain the text you typed, but also
> finds *all* citations, irrespective of whether they are part
> of the source you found, or not. I don't think this is what
> one would expect, so I count that as a fault, and I am
> surprised if you say you think it is working.
>

Yes, I had been doing as you say but hadn't appreciated what
was going on. I now see it.



> You can also create a custom filter with this filter, and
> you get offered various 'General Filters' which all relate
> to source information, and again, these select the source
> you wanted plus all citations.
>
>> while the Editor is a Citation Filter Editor allowing
>> Custom Citation filters to be created and edited, but not
>> operating on the data AFAICT.
>
> I don't understand this. The default editor is a Source
> Filter editor. If you right click on the top of the sidebar,
> you can also bring up a Citation Filer sidebar. This has
> 'Volume/Page' in it. If you type something into that (e.g.
> type some text into the 'Volume/Page' filed, then press
> find, it finds all the citations which contain the text
> (each displayed under its associated source) just as I would
> have expected, but it also displays *all* sources, even if
> they don't have any citation that contains the requested
> text. I don't think that is what would be expected, so I
> count that as being a fault.

Yes, I had been doing as you say but hadn't appreciated what
was going on. I now see it.
Sorry!

<snip>

>
> Regards,
> Tim.
>
>

Regards,
Doug

------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Nick Hall-6
In reply to this post by Tim Lyons
On 29/08/13 19:16, Tim Lyons wrote:
> Can you please help, because I don't understand
> (1) why both the Citation filter and the Source filter are available
> in the sidebar under 'Add a gramplet'. (I can see that
> citationtreeview get_default_gramplets establishes the Source Filter
> as the default, but I don't know how the available filters are defined).

This is defined by the navtypes list in the gpr file.


> (2) treebasemodel._rebuild_filter applies the filter that the user has
> specified first to the primary objects and then the secondary objects.
> I don't understand how or why applying a source filter to a citation
> object lets it get through. Should this happen? What would be the
> consequence elsewhere if this behaviour were changed? How could it be
> changed?
>

I would expect an exception to be raised if the wrong type of object is
passed to a rule.  The result will depend on how this is handled.

You could create a citation rule that matches source attributes, but it
doesn't make much sense to apply a source rule to a citation.

Nick.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58040911&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Tim Lyons
Administrator
Nick,

Nick Hall-6 wrote
On 29/08/13 19:16, Tim Lyons wrote:
> (2) treebasemodel._rebuild_filter applies the filter that the user has
> specified first to the primary objects and then the secondary objects.
> I don't understand how or why applying a source filter to a citation
> object lets it get through. Should this happen? What would be the
> consequence elsewhere if this behaviour were changed? How could it be
> changed?
>

I would expect an exception to be raised if the wrong type of object is
passed to a rule.  The result will depend on how this is handled.
Any idea what handles the exception? I couldn't see anything obvious.

Tim.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Tim Lyons
Administrator
Tim Lyons wrote
Nick Hall-6 wrote
On 29/08/13 19:16, Tim Lyons wrote:
> (2) treebasemodel._rebuild_filter applies the filter that the user has
> specified first to the primary objects and then the secondary objects.
> I don't understand how or why applying a source filter to a citation
> object lets it get through. Should this happen? What would be the
> consequence elsewhere if this behaviour were changed? How could it be
> changed?
>

I would expect an exception to be raised if the wrong type of object is
passed to a rule.  The result will depend on how this is handled.
Any idea what handles the exception? I couldn't see anything obvious.

Tim.

The 'problem' seems to be this code in check_and in _GenericFilter.

<pre>
            for data in id_list:
                if tupleind is None:
                    handle = data
                else:
                    handle = data[tupleind]
                person = self.find_from_handle(db, handle)
                if cb_progress:
                    cb_progress()
                val = all(rule.apply(db, person) for rule in flist if person)
                if val != self.invert:
                    final_list.append(data)
        return final_list
</pre>

'person' is the wrong name, because this is actually any object type. find_from_handle using a Citation object when trying to get a source returns None.

I don't quite understand how "all(rule.apply(db, person) for rule in flist if person)" is evaluated, or what it expects to find, but as 'person' is None, it seems to return True (why?).

Hence this means that 'val' is True, and the 'data' which is the handle, is appended to the returned value.

Is this what is supposed to happen? If so, why? I might have thought that if the object didn't exist, it shouldn't be added to the final_list. But what would be the consequences of changing this?

regards,
Tim.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Nick Hall-6
On 04/09/13 19:50, Tim Lyons wrote:

> The 'problem' seems to be this code in check_and in _GenericFilter.
>
> <pre>
>              for data in id_list:
>                  if tupleind is None:
>                      handle = data
>                  else:
>                      handle = data[tupleind]
>                  person = self.find_from_handle(db, handle)
>                  if cb_progress:
>                      cb_progress()
>                  val = all(rule.apply(db, person) for rule in flist if
> person)
>                  if val != self.invert:
>                      final_list.append(data)
>          return final_list
> </pre>
>
> 'person' is the wrong name, because this is actually any object type.
> find_from_handle using a Citation object when trying to get a source returns
> None.

It looks like this dates back to when Gramps only had filters on people.


>
> I don't quite understand how "all(rule.apply(db, person) for rule in flist
> if person)" is evaluated, or what it expects to find, but as 'person' is
> None, it seems to return True (why?).

We don't expect person to be None here.  Perhaps an invalid handle, or a
handle for the wrong object type is being passed?


>
> Hence this means that 'val' is True, and the 'data' which is the handle, is
> appended to the returned value.
>
> Is this what is supposed to happen? If so, why? I might have thought that if
> the object didn't exist, it shouldn't be added to the final_list. But what
> would be the consequences of changing this?

Yes, this is what is supposed to happen.  It is working as expected.

You need to find out why the handle is invalid.

Nick.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Tim Lyons
Administrator
Nick Hall-6 wrote
On 04/09/13 19:50, Tim Lyons wrote:
> The 'problem' seems to be this code in check_and in _GenericFilter.
>
> <pre>
>              for data in id_list:
>                  if tupleind is None:
>                      handle = data
>                  else:
>                      handle = data[tupleind]
>                  person = self.find_from_handle(db, handle)
>                  if cb_progress:
>                      cb_progress()
>                  val = all(rule.apply(db, person) for rule in flist if
> person)
>                  if val != self.invert:
>                      final_list.append(data)
>          return final_list
> </pre>
>
> 'person' is the wrong name, because this is actually any object type.
> find_from_handle using a Citation object when trying to get a source returns
> None.

It looks like this dates back to when Gramps only had filters on people.


>
> I don't quite understand how "all(rule.apply(db, person) for rule in flist
> if person)" is evaluated, or what it expects to find, but as 'person' is
> None, it seems to return True (why?).

We don't expect person to be None here.  Perhaps an invalid handle, or a
handle for the wrong object type is being passed?


>
> Hence this means that 'val' is True, and the 'data' which is the handle, is
> appended to the returned value.
>
> Is this what is supposed to happen? If so, why? I might have thought that if
> the object didn't exist, it shouldn't be added to the final_list. But what
> would be the consequences of changing this?

Yes, this is what is supposed to happen.  It is working as expected.

You need to find out why the handle is invalid.
The handle is for the wrong object type because this is called from treebasemodel for a tree with a secondary object. so:
<pre>
        items = self.number_items()
        _LOG.debug("rebuild filter primary")
        self.__rebuild_filter(dfilter, skip, items,
                              self.gen_cursor, self.map, self.add_row)
        if self.has_secondary:
            items = self.number_items2()
            _LOG.debug("rebuild filter secondary")
            self.__rebuild_filter(dfilter2, skip, items,
                                  self.gen_cursor2, self.map2, self.add_row2)
</pre>

We have a citationtreeview, where primary is source and secondary is citation (might be the other way round). When the filter code above is executed, you don't know whether the filter is a source filter or a citation filter, and don't know which cursor is which.

So for a source filter, the citation cursor is invalid, and vice-versa.

Tim.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Nick Hall-6
On 04/09/13 23:02, Tim Lyons wrote:

> The handle is for the wrong object type because this is called from
> treebasemodel for a tree with a secondary object. so:
> <pre>
>          items = self.number_items()
>          _LOG.debug("rebuild filter primary")
>          self.__rebuild_filter(dfilter, skip, items,
>                                self.gen_cursor, self.map, self.add_row)
>          if self.has_secondary:
>              items = self.number_items2()
>              _LOG.debug("rebuild filter secondary")
>              self.__rebuild_filter(dfilter2, skip, items,
>                                    self.gen_cursor2, self.map2,
> self.add_row2)
> </pre>
>
> We have a citationtreeview, where primary is source and secondary is
> citation (might be the other way round). When the filter code above is
> executed, you don't know whether the filter is a source filter or a citation
> filter, and don't know which cursor is which.
>
> So for a source filter, the citation cursor is invalid, and vice-versa.

The citation tree view uses a citation filter, not a source filter.

First you need to filter citations, then you need to find the associated
sources.  The sources should then be added to the tree before the citations.

There is no reason why citation rules should not access source fields.  
I'm not sure why we don't have source fields in the citation sidebar filter.

Nick.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Tim Lyons
Administrator
Nick Hall-6 wrote
On 04/09/13 23:02, Tim Lyons wrote:
> The handle is for the wrong object type because this is called from
> treebasemodel for a tree with a secondary object. so:
> <pre>
>          items = self.number_items()
>          _LOG.debug("rebuild filter primary")
>          self.__rebuild_filter(dfilter, skip, items,
>                                self.gen_cursor, self.map, self.add_row)
>          if self.has_secondary:
>              items = self.number_items2()
>              _LOG.debug("rebuild filter secondary")
>              self.__rebuild_filter(dfilter2, skip, items,
>                                    self.gen_cursor2, self.map2,
> self.add_row2)
> </pre>
>
> We have a citationtreeview, where primary is source and secondary is
> citation (might be the other way round). When the filter code above is
> executed, you don't know whether the filter is a source filter or a citation
> filter, and don't know which cursor is which.
>
> So for a source filter, the citation cursor is invalid, and vice-versa.

The citation tree view uses a citation filter, not a source filter.

First you need to filter citations, then you need to find the associated
sources.  The sources should then be added to the tree before the citations.

There is no reason why citation rules should not access source fields.  
I'm not sure why we don't have source fields in the citation sidebar filter.
The default filter in the citationtreeview is a source filter, so is that wrong, if citation tree is supposed to use a citation filter - why do you say it should be a citation filter? (The search bar at the top works for finding either sources or citations).

Do you think that in the citationtreemodel I should override the code in treebasemodel to filter citations and then find the associated sources, or should I change this in treebasemodel, where I presumably have to assume that the primary object (or secondary object, whichever it is) corresponds with the filter type?

Tim.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Nick Hall-6
On 05/09/13 00:00, Tim Lyons wrote:
> The default filter in the citationtreeview is a source filter, so is that
> wrong, if citation tree is supposed to use a citation filter - why do you
> say it should be a citation filter? (The search bar at the top works for
> finding either sources or citations).

It depends what you are trying to achieve.

I would create a citation sidebar filter containing both source and
citation fields.  Citation rules can easily access source fields.

Don't you want to be able to filter on citation fields?

Citations don't make sense without a source, so I would always link the
two.  I would also move the citation views into the source category.

>
> Do you think that in the citationtreemodel I should override the code in
> treebasemodel to filter citations and then find the associated sources, or
> should I change this in treebasemodel, where I presumably have to assume
> that the primary object (or secondary object, whichever it is) corresponds
> with the filter type?

Since this is the first view to use secondary objects, just change the
base model.

Nick.


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Tim Lyons
Administrator
Thanks for all the responses, but I think we may be miss-communicating on one point.

I think you are talking about whether the citation sidebar filter should contain source fields.

But, I am asking about the Source Filter. The Source Filter is the default filter in the citation tree view (right click and select restore defaults), despite the fact that it has 'navtypes=["Source"]', not "Citation". I think you are not responding to my questions about "Source Filter". Are you thinking that Source Filter is not, or should not be present for the citation tree view (still less that it should be the default)?

I presume that I can't make the Source Filter have 'navtypes=["Source", "Citation"]', because then it would be available in the citation flat view, which would not be good?

I am trying to work out what it was intended to do before trying to work out whether and how to fix it.

Nick Hall-6 wrote
On 05/09/13 00:00, Tim Lyons wrote:
> The default filter in the citationtreeview is a source filter, so is that
> wrong, if citation tree is supposed to use a citation filter - why do you
> say it should be a citation filter? (The search bar at the top works for
> finding either sources or citations).

It depends what you are trying to achieve.
Good question.

I think of the citation tree view as showing all sources and all citations (in a convenient tree view). So it seems reasonable to me to have both a source filter and a citation filter.

Leave aside for the moment the question of whether citations should always show the source.

I think that if I use a citation filter, I should see all citations that match and nothing else (i.e. no other citations and no sources). At the moment, it shows all matching citations, and *ALL* sources, whether they contain a citation that matches or not.

If we always showed sources for a citation, then it should show citations that match and the sources for those citations and no other sources.

I think that if I use a source filter, I should see all sources that match and nothing else. Before my latest patch, it showed all the matching sources and all citations for the matching sources. After my fix it showed all matching sources and *ALL* citations, both for matching sources and for sources that did not match.

The change is so that the top search bar and the Source/Citation selection dialogue work to show both sources and citations that match any input text.

Nick Hall-6 wrote
I would create a citation sidebar filter containing both source and
citation fields.  Citation rules can easily access source fields.

Don't you want to be able to filter on citation fields?

Citations don't make sense without a source, so I would always link the
two.  I would also move the citation views into the source category.
I agree that it would not be unreasonable to have both source and citation fields in the Citation Filter, but there are two problems:
(1) It would make the filter sidebar rather deep, which would probably be too long for small screens.
(2) It is already possible (though less convenient) to use a custom filter to add source criteria to the citation filter.

Yes, I do want to filter on citation fields, and that is already possible by adding the "Citation Filter" gramplet to the sidebar, it is just that it is not present as the default.

Always link the two? Yes. I think I agree, but I just want to resolve the requirements issues before adding that probably just as a UI issue.

Move citations to source category? I will try that to see how it looks, particularly in conjunction with the new category display features - this is probably just for trunk, whereas the other issues are things I am looking at for the maintenance branches.

Tim.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Nick Hall-6
On 06/09/13 12:41, Tim Lyons wrote:
> Thanks for all the responses, but I think we may be miss-communicating on one
> point.
>
> I think you are talking about whether the citation sidebar filter should
> contain source fields.

Yes.  I think each view should only have one filter.  The source view
should have a source filter, and the citation views should have a
citation filter that also contains source fields.


>
> But, I am asking about the Source Filter. The Source Filter is the default
> filter in the citation tree view (right click and select restore defaults),
> despite the fact that it has 'navtypes=["Source"]', not "Citation". I think
> you are not responding to my questions about "Source Filter". Are you
> thinking that Source Filter is not, or should not be present for the
> citation tree view (still less that it should be the default)?

It will be easier for users to understand if you keep to one filter per
view.


>
> I presume that I can't make the Source Filter have 'navtypes=["Source",
> "Citation"]', because then it would be available in the citation flat view,
> which would not be good?

You could have a source filter on a citation view, because each citation
has a source.  It would be better to put the source fields into the
citation filter.


> I am trying to work out what it was intended to do before trying to work out
> whether and how to fix it.
>
>
> Nick Hall-6 wrote
>> On 05/09/13 00:00, Tim Lyons wrote:
>>> The default filter in the citationtreeview is a source filter, so is that
>>> wrong, if citation tree is supposed to use a citation filter - why do you
>>> say it should be a citation filter? (The search bar at the top works for
>>> finding either sources or citations).
>> It depends what you are trying to achieve.
> Good question.
>
> I think of the citation tree view as showing all sources and all citations
> (in a convenient tree view). So it seems reasonable to me to have both a
> source filter and a citation filter.

You could have two filters, but I think it would be simpler for both
usability and coding to have just one.


> Leave aside for the moment the question of whether citations should always
> show the source.
>
> I think that if I use a citation filter, I should see all citations that
> match and nothing else (i.e. no other citations and no sources). At the
> moment, it shows all matching citations, and *ALL* sources, whether they
> contain a citation that matches or not.

No.  Citations alone don't have any meaning.  We should display the
source for each citation that matches the filter.


>
> If we always showed sources for a citation, then it should show citations
> that match and the sources for those citations and no other sources.

Correct.


>
> I think that if I use a source filter, I should see all sources that match
> and nothing else. Before my latest patch, it showed all the matching sources
> and all citations for the matching sources. After my fix it showed all
> matching sources and *ALL* citations, both for matching sources and for
> sources that did not match.

I would consider the source as part of the citation, so I would include
citations as matching a source filter.


>
> The change is so that the top search bar and the Source/Citation selection
> dialogue work to show both sources and citations that match any input text.
>
>
> Nick Hall-6 wrote
>> I would create a citation sidebar filter containing both source and
>> citation fields.  Citation rules can easily access source fields.
>>
>> Don't you want to be able to filter on citation fields?
>>
>> Citations don't make sense without a source, so I would always link the
>> two.  I would also move the citation views into the source category.
> I agree that it would not be unreasonable to have both source and citation
> fields in the Citation Filter, but there are two problems:
> (1) It would make the filter sidebar rather deep, which would probably be
> too long for small screens.

It will still be smaller than the place filter sidebar.


> (2) It is already possible (though less convenient) to use a custom filter
> to add source criteria to the citation filter.
>
> Yes, I do want to filter on citation fields, and that is already possible by
> adding the "Citation Filter" gramplet to the sidebar, it is just that it is
> not present as the default.

The question you have to ask is, will users find the functionality easy
to use?  Is it intuitive?


> Always link the two? Yes. I think I agree, but I just want to resolve the
> requirements issues before adding that probably just as a UI issue.
>
> Move citations to source category? I will try that to see how it looks,
> particularly in conjunction with the new category display features - this is
> probably just for trunk, whereas the other issues are things I am looking at
> for the maintenance branches.


This is quite easy to try out.  Other possibilities would be to combine
Repositories, Sources and Citations, or perhaps to combine Geography and
Places.

Nick.


> Tim.
>
>
>
>
> --
> View this message in context: http://gramps.1791082.n4.nabble.com/Help-please-on-filters-tp4662277p4662387.html
> Sent from the GRAMPS - Dev mailing list archive at Nabble.com.
>
> ------------------------------------------------------------------------------
> Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
> Discover the easy way to master current and previous Microsoft technologies
> and advance your career. Get an incredible 1,500+ hours of step-by-step
> tutorial videos with LearnDevNow. Subscribe today and save!
> http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
> _______________________________________________
> Gramps-devel mailing list
> [hidden email]
> https://lists.sourceforge.net/lists/listinfo/gramps-devel
>
>


------------------------------------------------------------------------------
Learn the latest--Visual Studio 2012, SharePoint 2013, SQL 2012, more!
Discover the easy way to master current and previous Microsoft technologies
and advance your career. Get an incredible 1,500+ hours of step-by-step
tutorial videos with LearnDevNow. Subscribe today and save!
http://pubads.g.doubleclick.net/gampad/clk?id=58041391&iu=/4140/ostg.clktrk
_______________________________________________
Gramps-devel mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/gramps-devel
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Tim Lyons
Administrator
Thanks, Nick, I'll try changing the filters as you suggest, with just one filter per view. I am all in favour of making things simpler for the users.

Tim.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Help please on filters

Tim Lyons
Administrator
Tim Lyons wrote
Thanks, Nick, I'll try changing the filters as you suggest, with just one filter per view. I am all in favour of making things simpler for the users.

Fixed in gramps34/gramps40/trunk revisions 23141/23142/23143 respectively.

(I haven't changed the categories - options?)

Please give it a try.

Regards,
Tim.
Loading...