Hi Yakov,

Wouldn't you rather have to loop over all tiddlers and remove those
from the store that are not in the resulting filtered list? Haven't
yet looked at filterTiddlers, but why not just make a clone of it,
call it 'removeByFilter' and instead of adding matching tiddlers to
some result list, directly remove from a given store those that do NOT
match the filter criteria? I'm not sure though about the right method
to remove a tiddler from an included store.

In fact, I believe I would not use filers at all but rather use
variables to define...
- exludeTags
- overrideExcludeTags (in order to keep sth. nonetheless)
...and then hijack or even modify the inclusion method to directly not
even import those unwanted tiddlers, instead of removing them
afterwards.

Haven't we already had this discussion or was I just dreaming?

Cheers, Tobias.

On 14 Dez., 19:14, Yakov <[email protected]> wrote:
> Hello,
>
> I have a question which is important for extending IncludePlugin with
> core filtering ([1], [2]).
>
> In the IncludePlugin, an instance of TiddlyWiki() is created for each
> included document; fetchTiddler method is used to get tiddlers in
> those stores. I'm going to use core filters in a following way: for
> each included store a set of "filtered" tiddlers is created using core
> filters and then this set should substitute the initial set of
> tiddlers.
>
> The question is: how do I override the set of tiddlers in a
> TiddlyWiki() correctly? First simple idea is to use smth like
>
> for(aStore in ...) {
>     filteredTiddlers = TiddlyWiki.prototype.filterTiddlers(filter); //
> filter is [tag[SomeTag]] or an expression like it
>     aStore.clear();
>     var i;
>     for(i = 0; i < filteredTiddlers.length; i++)
>         aStore.addTiddler(filteredTiddlers[i]);
>
> }
>
> but I'm not sure if I should change some other things to have
> constraints satisfied (like use TiddlyWiki.prototype.setDirty or
> whatever).
>
> Thanks in advance,
> Yakov.
>
> [1] previous implementation 
> discussion:http://groups.google.com/group/tiddlywikidev/browse_thread/thread/491...
> [2] some questions regarding 
> filters:http://groups.google.com/group/tiddlywikidev/browse_thread/thread/979...

-- 
You received this message because you are subscribed to the Google Groups 
"TiddlyWikiDev" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/tiddlywikidev?hl=en.

Reply via email to