Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

No automatic exports from saved search #904

Open
4 tasks done
Jmuccigr opened this issue Feb 7, 2018 · 11 comments
Open
4 tasks done

No automatic exports from saved search #904

Jmuccigr opened this issue Feb 7, 2018 · 11 comments

Comments

@Jmuccigr
Copy link
Contributor

Jmuccigr commented Feb 7, 2018

Any plan for this to change? I was using it in a few places. Thanks.

@retorquere
Copy link
Owner

retorquere commented Feb 8, 2018

I'd love to actually, but Zotero doesn't tell me that it's exporting saved searches, it just says "export these items" where "these items" happen to be the search result. For collections and libraries I'm actually getting the library/collection to be exported so these are easy to detect. I used to have an elaborate way to reconstruct that a search-export was taking place, but that involved some fairly invasive runtime changes to Zotero that I'm no longer comfortable making. If Zotero would mark the export so I could recognize it was a saved search, it would be easy to do.

@Jmuccigr
Copy link
Contributor Author

Jmuccigr commented Feb 8, 2018

Would it be possible just to do an export on a schedule?

@retorquere
Copy link
Owner

It's not the auto-export that's the problem, it's detecting that the thing being exported is a saved search; technically, when you right-click on a collection and select "export", one of two things happen:

  • for a library or a collection, Zotero hands its internal exporter the library or collection. I've patched the internal exporter to pick this up, I schedule the auto-exporter, done.
  • for a saved search, zotero gathers the items being displayed, hands that list to the internal exporter, but my patch can now only see that Zotero told the internal exporter to "export these n references". I cannot see why these n references are being exported -- maybe you ctrl-clicked them together, maybe it was a saved search, but there's no (good) way for me to tell.

If Zotero would say "export these n references, which are the result from saved-search X", it'd be easy (not trivial, but easy enough) to add auto-export.

@Jmuccigr
Copy link
Contributor Author

Jmuccigr commented Feb 8, 2018

So I could pester them about that? :-)

@retorquere
Copy link
Owner

You could, I could, but my schedule is hectic these days, so I prefer to currently limit my work to what I can do without having to coordinate, and there's still some gnarly bugs that need my attention. I could provide any required technical insights, but showing a user need would probably help, yes.

@retorquere
Copy link
Owner

I've opened the discussion here.

@laspic
Copy link

laspic commented Feb 22, 2018

Hello.
I've opened a discussion on the zotero forum. See : https://forums.zotero.org/discussion/70534/auto-exporting-saved-searches

@John-foobar-Doe
Copy link

John-foobar-Doe commented May 15, 2022

(Continued from #2139 (reply in thread)) So Zotero 4 (with Firefox) used to mark exports for saved searches, such that BBT 1.6.100 can distinguish between a saved search being exported or a manually selected list of items? And Zotero 5 & 6 no longer do so?

@retorquere
Copy link
Owner

(Continued from #2139 (reply in thread)) So Zotero 4 (with Firefox) used to mark exports for saved searches, such that BBT 1.6.100 can distinguish between a saved search being exported or a manually selected list of items? And Zotero 5 & 6 no longer do so?

No, but it was easier for me to capture the action of the right-click on the saved export and smuggle it all the way to the export being started by tacking the info onto some data structures that were for Zotero internal use but which tolerated extra data being tacked on. It was always a fragile way of doing things, it just got so fragile I no longer felt I could support it.

Zotero however knows it's just handled a right-click on a saved search and that an export was started, so it could safely mark the export as "export these items, oh and should you care, these items were the result of saved-search X". The extra information wouldn't bother anyone not using it, but for BBT it would mean a safe way to capture these exports. Such tagging as "collection" or "library" is already done for those two types, but mostly as an artefact of how export was implemented.

Note that saved-search auto-export is always very expensive, because Zotero does not notify "this search now also yields this extra item" or "this item no longer matches that search". If you had a saved-search export, BBT would fire off the search(es) for any item that changed, see whether the search result included the changed item, and then kick off that export.... and come to think of it, I'm not sure that I cached what items were matched previously, so there's a good chance that "item no longer matches search" never updated the auto-export.

@John-foobar-Doe
Copy link

Thanks for that details. So for your own use case, you simply gave up all auto-exports of saved searches, and only export them manually when needed, by right clicking on the saved searches in Zotero to export them?

@retorquere
Copy link
Owner

Correct. The explanation above was incorrect BTW -- I wasn't tacking it onto something that would tolerate it, I was replacing some internal data of Zotero in an incompatible way, which would break Zotero if it tried to access it, but because I knew the call chain precisely, and everything was synchronous, I was sort of sure I could change it back just in time before Zotero tried to use it. It was easily one of the more crazy monkey-patches BBT employed.

Z5 changed all that, and I could no longer realistically oversee all call chains. Something was bound to break sooner rather than later, in impossible to debug ways. If Z adds the information to the export context, it would not be too hard to add it back -- not trivial, so it would take some time, but feasible.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Status: Todo
Development

No branches or pull requests

5 participants