Importing documents
  • Another idea here :D

    Booktype needs possibility to import documets. Right?
    I mean it would be nice if you could import partially written book let's say in OpenOffice (to stay in open source environment - could use anything else ;)).
  • 16 Comments sorted by
  • One component of Objavi is called Espri and it is used for importing content from other sources. At the moment you can import book from archive.org, epub book, or other book from Booktype source (and before you could import books from wikibooks).

    It would be awesome if you could also import other documents and that is why we are changing the architecture of Objavi and Espri to support things like that (and many other things). OpenOffice and Word would be something that most of the users would probably want.
  • Vote Up0Vote Down adamadam
    Posts: 88Member
    yeah i get asked a lot about this. we really need to extend import
    possibilities and think how people could do this without too much prep.
    for example, i think we need to support odt import etc but maybe for CMS
    imports we could define a syntax like:



    http//www.mysite.com


    /introduction.html
    /how_to_swim.html
    /learning_to_dive.html



    or something...that way content management systems dont need to develop
    complex import plugins...they can do it in straight out valid html



    adam

    On 06/20/2012 05:23 PM, Aleksandar Erkalović wrote:
    > One component of Objavi is called Espri and it is used for importing content from other sources. At the moment you can import book from archive.org, epub book, or other book from Booktype source (and before you could import books from wikibooks).It would be awesome if you could also import other documents and that is why we are changing the architecture of Objavi and Espri to support things like that (and many other things). OpenOffice and Word would be something that most of the users would probably want.
    >
  • Vote Up0Vote Down adamadam
    Posts: 88Member
    ah...damn...the html got stripped out...i enclosed all those in
    tags....this is another reason (forums stripping out tags) that i think we
    should have plain text email for dev mail


    adam

    On Wed, Jun 20, 2012 at 5:48 PM, Adam Hyde <<br />booktype-dev@lists.sourcefabric.org> wrote:

    > yeah i get asked a lot about this. we really need to extend import
    > possibilities and think how people could do this without too much prep.
    > for example, i think we need to support odt import etc but maybe for CMS
    > imports we could define a syntax like:
    >
    >
    >
    > http//www.mysite.com
    >
    >
    > /introduction.html
    > /how_to_swim.html
    > /learning_to_dive.html
    >
    >
    >
    >
    > or something...that way content management systems dont need to develop
    > complex import plugins...they can do it in straight out valid html
    >
    >
    >
    > adam
    >
    > On 06/20/2012 05:23 PM, Aleksandar Erkalović wrote:
    > > One component of Objavi is called Espri and it is used for importing
    > content from other sources. At the moment you can import book from
    > archive.org, epub book, or other book from Booktype source (and before
    > you could import books from wikibooks).It would be awesome if you could
    > also import other documents and that is why we are changing the
    > architecture of Objavi and Espri to support things like that (and many
    > other things). OpenOffice and Word would be something that most of the
    > users would probably want.
    > >
    >
    >
  • Hey Aleksandar

    I would like to try objavi, but where can I get it?
  • It is here - https://github.com/sourcefabric/Objavi
    Parts of the instructions are outdated (git repository and etc for instance). Also, Calibre (for mobi output) is missing in the list of required software.
  • Do I see it correctly? You need to have a web server for Objavi to work?
  • Vote Up0Vote Down adamadam
    Posts: 88Member
    yes


    On 06/20/2012 09:33 PM, Boštjan Jerko wrote:
    > Do I see it correctly? You need to have a web server for Objavi to work?
    >
  • Oj Aleksandar.
    Can I have objavi on different server than Booktype?
    I am trying such arrangement and have some strange results.
  • Yes you can. In fact, that is how we are running it. What kind of funny results do you get? You should configure Booktype with url to your Objavi instance and configure Objavi (objavi/config.py) with info about your Booktype instance. Objavi will not receive requests from your Booktype if you don't tell him so.

    That is how it is at the moment with Objavi from github. We are doing some major changes in this field.
  • I get the url of the "exported" pdf book, but there is no book created.
    I get: urllib2.URLError: <urlopen error [Errno -2] Name or service not known>
    in book_utils.py  
    after
    f = urlopen(url)
  • Ah... This could be anything really :)
     - Objavi does not have url where to fetch the book
     - There are some errors in HTML so pdf can not be produced

    Check the logs on Objavi side... That should help you.
  • Damn.
    I hoped you'll have a magical solution and tell me what url should be ...*sigh* I knew it.
    I'll check log in Objavi and see what I can work out from it.
  • OK. Found the problem. I messed with URL and didn't use my version ... one of the links was still the old one.
    Got covered here, but here is another error:
      File "/home/bostjan/Objavi/htdocs/objavi.cgi", line 477, in <module>
        main()
      File "/home/bostjan/Objavi/htdocs/objavi.cgi", line 470, in main
        output_function(args)
      File "/home/bostjan/Objavi/htdocs/objavi.cgi", line 354, in mode_book
        book.make_simple_pdf(context.mode)
      File "/home/bostjan/Objavi/objavi/fmbook.py", line 633, in make_simple_pdf
        n_pages = count_pdf_pages(self.pdf_file)
      File "/home/bostjan/Objavi/objavi/pdf.py", line 285, in count_pdf_pages
        return int(m.group(1))
    AttributeError: 'NoneType' object has no attribute 'group'

    Looks like it want's to count pages in pdf, but searching for "Pages" doesn't produce any results.
    Do you have an idea what might be wrong?
  • Heh... hard to say :) This part of code does not check if pdf file was produces. It executes external program which reads pdf file and outputs on stdout number of pages. External program shows some error, there is no "Pages" string on stdout and it dies. So... what does it not produce pdf file? :) Who knows... you should check for messages before this error.
  • Found the problem: wkhtmltopdf...unknown long argument --javascript-delay and when I remove that I get error due to unpatched qt lib... damn.. Seems I'll have to put in some manual work (and not get-apt).
  • WOOOOOHOOOOO. Installed patched version of qt and wkhtmltopdf dependent of it .. works like magic.
    Must admit it's a drag to install it though.
    Wrote a short "what I am doing" on the way, but I'm not sure if I covered all the bases.