rokdd / Zotero-autoexporting

Exports the database automatically
https://rokdd.xyz/tech/zotero-addon-for-autoexporting-files/
15 stars 7 forks source link

special character in collection name appears to cause crash #2

Closed drevicko closed 11 years ago

drevicko commented 11 years ago

I had a collection with an exclamation mark '!' in it's name. The js console reported exporting all the collections until this one, where a translator error happened.

rokdd commented 11 years ago

Hello

thank you for your reports of issue. yesterday I was already informed
by another user about the issue of toolbar and I just created a pre-release, which I
can send you todays evening. The bug of wrong collection name is still new but will be
solved soon too (maybe today in the pre release). Did you used the addon first time or did
you already used older versions?

Thank you for your report, I will provide the file later. Robert

rokdd commented 11 years ago

Well I just uploaded a new version for testing regarding the toolbar issue: http://rokdd.de/private/programmierung/zotero-autoexporting/releases/zotero-autoexporting-1-0-8.xpi

Hope that will be solved this problem.. Robert

rokdd commented 11 years ago

Hello

as mentioned I updated the export routine and the handling of characters. Today I released official 1.0.8 with a lot of improvements in file handling: http://rokdd.de/b/zotero-autoexport#1-0-8 . I hope that it might help you and to get feedback and issues in future too.

Thanks Robert

drevicko commented 11 years ago

Apologies for not getting back sooner - been busy. Thanks for the update - always nice when feedback results in responses and especially action! My firefox appears to have auto-updated to the released 1.0.8 version, these things actually work sometimes! (-;

It seems to work now, producing a file who'se name contains an excalamation mark ("!"). This surprises me as that character was creating a problem before. Looking at the code, the regex you added to clean the file name doesn't do anything special to "!". Has zotero/firefox changed their file handling in the meantime??

A few cautions you're probably aware of:

drevicko commented 11 years ago

fyi: I've made a small hack so that only one chosen collection is exported. The name is hard-coded in the js. My use case: I've a large number of things in zotero, but wish to export a small subset for preparing a paper. I havn't bothered with making a UI for it - perhaps at a later date? Currently I'm pretty snowed under with other stuff..

rokdd commented 11 years ago

I just added the possibility of bug overriding its own files. I am not
sure whether it is so important issue - because who will use such
similiar names for the collections - and if the file is needed, the
collection might be renamed, no data will getting lost. But for next
version I am thinking about collection handling itself, because
related to subcollections it is senseful to create the folders like
the structure of collections. I also thought about filename pattern
with variables to fulfil some dreams for formatting the filename. All
in all it is more a problem of the UI and not of the code. Probably
your wish to choose only some subsets can be arranged there. I will
think about everything and then it can be implemented.

I guess that Zotero does not change anything in the format of
filenames. First I thought to make a big replacement of everything
which is not alphanumeric, but it makes the files not more clear. So I
decided to cut only these chars which are illegal: ,/:*?""<>| . I
happy that working now for you - maybe you have seen that the log is
more detailed which filenames are used to export.

Just a question beside: Do you need to export multiple file formats or
do you think that the export of only one is enough for your needs? I
am quite thinking about profiles, which allow multiple file formats to
multiple directorys... (but it is a lot of work too :) )

drevicko commented 11 years ago

No, currently I only need bibtex. I can imagine at some time in the future maybe needing others too?? Probably not soon though (:

Yes, I saw the expanded log messages. I'd actually implemented something similar with the last version when I was playing with it.

Yeah, the handling of collections is in interesting issue. Do you know about the zotero option with which a collection also "shows" or "contains" all items from it's sub-collections? Not really important here, but interesting in that it increases the redundancy of the current auto-export paradigm.

I think the main issue I had with exporting everything is that it takes a long time. Is it worth thinking about identifying what has changed, and only exporting that? You'd need to be able to manually 'export all' as well... It'd increase the danger of the exported copy getting out of sync with the zotero copy...

I'm happy to play with a new version if you wish to send it or put it up on github or something. I'd throw my little hack in there after a bit though, just so you know (:

rokdd commented 11 years ago

Hi..

because of some people who needed the requested feature also, I published a pre release which make it possible to select the collections which should be exported. it was also necessary because with advanced export options it is possible to export the files/snapshots also and it will produce a mass of data if you cannot filter in the collections. you can download and test the pre release http://rokdd.de/permanent:zotero-autoexporting#1-1-2

let me know if you experiencing any problems, but I guess it will help you a little bit ;) Thanks, enjoy your weekend Robert