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

[Feature Request] Export bookmarks #294

Open
redmanmale opened this issue Feb 12, 2015 · 15 comments

Comments

@redmanmale
Copy link

commented Feb 12, 2015

I'd search through and found many issues (#272, #135, #111, #107) that ask for a such useful feature as export bookmarks to external file (xml, plain text, etc.). But for none of them official respond had been received.
So I'll try one more time and ask developers, will this functionality be implemented in nearest future, or won't. Because even in roadmap and todo-lists there is no mention for this.

@liquiddandruff

This comment has been minimized.

Copy link
Contributor

commented Feb 12, 2015

Thanks for the issue list. This should be straightforward to implement. You just want to export them so you can backup your bookmarks right? IE you're only importing these bookmarks into FBReader, not anything else? I will look into this for a bit.

liquiddandruff added a commit to liquiddandruff/FBReaderJ that referenced this issue Feb 17, 2015

liquiddandruff added a commit to liquiddandruff/FBReaderJ that referenced this issue Feb 17, 2015

@liquiddandruff

This comment has been minimized.

Copy link
Contributor

commented Feb 17, 2015

Wondering where's the best place for people to access this. Maybe a clickable TextView in BookmarksActivity beside the "New bookmark" button, to export/(import) bookmarks of the current book; and another clickable TextView in the "All Books" tab, to export/(import) all bookmarks?

I was thinking to export/import favourites/statistics/general FBReader preferences as well, so if this happens we could instead have a dedicated "Export/Import" row in the settings activity to handle all exporting/importing of data.

Currently we have this.
demo

Generated XML (still some encoding errors? the garbled A appears only in the title of intro book)

<?xml version='1.1' encoding='UTF-8'?><bookmark id="10" visible="true">
<book id="1" title="FBReader: an introduction"/>
<text>Looking for more books?Just go to the Network library. There are several catalogues with lots of books, for free and for a fee. You can add</text>
<history date-creation="Feb 16, 2015 7:48:49 PM Pacific Standard Time" access-count="0"/>
<start paragraph="4" element="3" char="0"/>
<end paragraph="5" element="50" char="3"/>
<style id="2"/>
</bookmark>

<?xml version='1.1' encoding='UTF-8'?><bookmark id="11" visible="true">
<book id="1" title="FBReader: an introduction"/>
<text>Store your ebooks in the cloudWant to copy your ebooks from the desktop to this device? Or maybe you want to store your downloaded books in a safe space? FBReader</text>
<history date-creation="Feb 16, 2015 7:48:59 PM Pacific Standard Time" date-access="Feb 17, 2015 4:50:09 AM Pacific Standard Time" access-count="3"/>
<start paragraph="7" element="3" char="0"/>
<end paragraph="8" element="51" char="8"/>
<style id="3"/>
</bookmark>

<?xml version='1.1' encoding='UTF-8'?><bookmark id="17" visible="true">
<book id="1" title="FBReader: an introduction"/>
<text>FBReader: an introductionStart readingWant to start reading right away?</text>
<history date-creation="Feb 16, 2015 7:19:09 PM Pacific Standard Time" access-count="0"/>
<start paragraph="0" element="0" char="0"/>
<end paragraph="2" element="13" char="5"/>
<style id="1"/>
</bookmark>

...

Need to find a good solution for wrong bookmark IDs/duplicate bookmarks/wrong book IDs when reimporting bookmarks. Unique book identifiers like epub UIDs would work for this.

liquiddandruff added a commit to liquiddandruff/FBReaderJ that referenced this issue Feb 17, 2015

liquiddandruff added a commit to liquiddandruff/FBReaderJ that referenced this issue Feb 17, 2015

@geometer

This comment has been minimized.

Copy link
Owner

commented Feb 18, 2015

As for book ids: use hashes instead. (IBookCollection.getHash(Book), IBookCollection.getBookByHash(String)). This is a correct portable solution.

@liquiddandruff

This comment has been minimized.

Copy link
Contributor

commented Feb 21, 2015

That's perfect, thanks Nikolay!

@geometer

This comment has been minimized.

Copy link
Owner

commented Feb 21, 2015

We plan to implement bookmarks synchronisation soon. (Via FBReader Book Network.) The main problem is, of course, conflict resolving. How to detect if some bookmark is deleted or not added on the device yet?

liquiddandruff added a commit to liquiddandruff/FBReaderJ that referenced this issue Feb 21, 2015

liquiddandruff added a commit to liquiddandruff/FBReaderJ that referenced this issue Feb 21, 2015

liquiddandruff added a commit to liquiddandruff/FBReaderJ that referenced this issue Feb 21, 2015

liquiddandruff added a commit to liquiddandruff/FBReaderJ that referenced this issue Feb 21, 2015

@liquiddandruff

This comment has been minimized.

Copy link
Contributor

commented Feb 21, 2015

I've thought about it for a while and I don't think we can get away from exhaustively searching all bookmarks in the worst case to ensure correctness, unless the network has something like git where we have a guaranteed file state to search from.

Some thoughts

  • On local bookmark deletion
    • Notify network of bookmark deletion
    • Send the hash of the book belonging to the deleted bookmark, its bookID, and the bookmark's creation-date to network
      • use the creation-date as a unique identifier for the bookmark
      • bookmarks currently can't be edited, so this should work for now
  • On remote bookmark deletion sync
    • Does remote bookID exist locally?
      • Yes: Using remote bookID, does the local book's hash match the remote book's hash?
        • Yes: Does remote bookmarkID exist locally?
          • Yes: Using remote bookmarkID, does the local bookmark creation-date match the remote creation-date?
            • Yes: delete local bookmark; finished
            • No: fall-through (it might already be deleted, but might not)
          • No: Scan all bookmarks of current book for matching creation date, delete matching; finished
        • No: fall-through
      • No: Scan all bookmarks for matching creation-date, check for matching book hash, delete matching; finished
  • On local bookmark creation
    • Notify network of bookmark deletion
    • Send the hash of the book belonging to the deleted bookmark, its bookID, and the bookmark's creation-date to network
  • On remote bookmark creation sync
    • Does remote bookID exist locally?
      • Yes: Using remote bookID, does the local book's hash match the remote book's hash?
        • Yes: Does remote bookmarkID exist locally?
          • Yes: Using remote bookmarkID, does the local bookmark creation-date match the remote creation-date?
            • Yes: ignore since already created; finished
            • No: fall-through (it might already be created, but might not)
          • No: Scan all bookmarks of current book for matching creation date, if no match found, create bookmark; finished
        • No: fall-through
      • No: Scan all bookmarks for matching creation-date, if no match found, create bookmark; finished

Generated XML v2

# Lines beginning with # are ignored
# Successfully exported 2 bookmarks
# Failed to export 0 bookmarks
HASHES:cdeb63cef26a9bc6798fe185910da932b36e0f6d,cdeb63cef26a9bc6798fe185910da932b36e0f6d,
<?xml version='1.1' encoding='UTF-8'?><bookmark id="362" visible="true">
<book id="73" title="Cibola Burn"/>
<text>With the enemy encumbered and slowed, two more grapnels connected.</text>
<history date-creation="Feb 21, 2015 6:31:38 AM Pacific Standard Time" access-count="0"/>
<start paragraph="2555" element="150" char="0"/>
<end paragraph="2555" element="168" char="10"/>
<style id="2"/>
</bookmark>

<?xml version='1.1' encoding='UTF-8'?><bookmark id="363" visible="true">
<book id="73" title="Cibola Burn"/>
<text>One hundred and thirteen times a second, it reaches out,</text>
<history date-creation="Feb 21, 2015 6:31:55 AM Pacific Standard Time" access-count="0"/>
<start paragraph="2567" element="4" char="0"/>
<end paragraph="2567" element="22" char="4"/>
<style id="3"/>
</bookmark>
@fullstopslash

This comment has been minimized.

Copy link

commented Jul 14, 2015

Actually, being able to export bookmarks as text snippets, or to email them would be super spiffy.

@mike-fabian

This comment has been minimized.

Copy link

commented Jul 14, 2015

Yes, exporting bookmarks would be great.

@redmanmale

This comment has been minimized.

Copy link
Author

commented May 26, 2016

Is there any progress on this one?

@gregretkowski

This comment has been minimized.

Copy link

commented Nov 28, 2017

Checking on this ticket. I too would like to be able to export bookmarks from FBReader. My use case isn't to re-import them - it is to be able to collect my annotations/highlights from books I've read in a format I can then put into other note-taking apps or just into text files.. Having FBReader export (xml, json, or other structured format) would meet this need. I've seen references to getting the info out by scraping through the sqlite database directly (https://android.stackexchange.com/a/158673) but that seems inelegant to me.

@lasdfdv

This comment has been minimized.

Copy link

commented Mar 26, 2018

Same usecase as gregretkowski here. Plain txt, xml, sth like that.

@liquiddandruff

This comment has been minimized.

Copy link
Contributor

commented Mar 27, 2018

Unfortunately it has been a while since @geometer has updated the public sources for FBReader. There's still as yet no decent open source epub reader out there too, so hopefully he will change his mind in the future.

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 28, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 28, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 28, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 28, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 28, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 28, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 28, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 29, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 29, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 29, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 29, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 29, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 29, 2018

redmanmale added a commit to redmanmale/FBReaderJ that referenced this issue Mar 29, 2018

@Alexsey

This comment has been minimized.

Copy link

commented Dec 15, 2018

It is already possible - check out this answer!

@ildar

This comment has been minimized.

Copy link

commented Dec 16, 2018

@Alexsey

This comment has been minimized.

Copy link

commented Dec 16, 2018

Oh, sorry. I'm using FBReader from Store and was googling on how to export bookmarks, and found this discussion shortly before finding the solution. I'm not aware of differences between Store and open source versions

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
9 participants
You can’t perform that action at this time.