"Validating against...." output in com/adobe/epubchcecker/ocf/OCFChecker.java

96 views
Skip to first unread message

Ali Asad Lotia

unread,
Sep 3, 2012, 1:33:38 PM9/3/12
to epub...@googlegroups.com
Hello All,
Thanks for producing such a useful library. It's been a great tool for
us at my current job.
I've checked out the epub3 branch of the SVN repo which is at r324 at
the time I'm writing this post to the list.

I was wondering if instead of printing the version the passed file
being evaluated against to stdout on line 118 of
epubcheck/com.adobe.epubcheck/src/com/adobe/epubcheck/ocf/OCFChecker.java
(listing below)

System.out.println("Validating against EPUB version " +
opfHandler.getVersion());

it could be set as an property which can then be retrieved by the caller?

When using it as a library, it would be very handy to know which
version of the epub spec a particular file is being checked against
which doesn't currently appear to be exposed in
epubcheck/com.adobe.epubcheck/src/com/adobe/epubcheck/api/EpubCheck.java

Currently the verify method results in output to stdout which may not
work when being used as a library.

Before offering a patch, I wanted to float the idea with the community
to see if it had any merit. Thoughts?

Thanks,
Ali

Markus Gylling

unread,
Sep 4, 2012, 6:19:40 AM9/4/12
to epub...@googlegroups.com
Hi Ali,

> Before offering a patch, I wanted to float the idea with the community
> to see if it had any merit. Thoughts?

This sounds like a very useful feature indeed. Patch warmly welcomed!

/markus
> --
> You received this message because you are subscribed to the Google Groups "epubcheck" group.
> To post to this group, send email to epub...@googlegroups.com.
> To unsubscribe from this group, send email to epubcheck+...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/epubcheck?hl=en.
>

Thomas

unread,
Sep 5, 2012, 8:21:15 AM9/5/12
to epub...@googlegroups.com
Hello,

I just add a new issue 207 and a proposed patch in order to be able to retrieve not only errors and warnings but also information out of the parsing of an epub file.

The patch proposed a XMLReportImpl to output all the information in a XML structure format.

Hope this helps
  Thomas

Ali Asad Lotia

unread,
Sep 6, 2012, 6:12:25 AM9/6/12
to epub...@googlegroups.com
Hi Folks,
Please find attached a patch that is much less elegant than the one
Thomas has attached with issue 207.

I have added a couple of unit tests in an attempt to confirm that
things are working as expected.

I have to admit somewhat sheepishly that I'm not currently entirely
sure how to compile a new jar so I can test the CLI util in a terminal
to see if the output is as expected.

Additionally, would there be any benefit to printing out the version
of the checker that has been invoked with the report that goes to
StdOut. Currently the CLI output shouldn't change, it's just that the
printing to console is done in the checker class instead of within the
OCFChecker. The motivation behind this change being that the library
no longer causes a side effect, instead it sets a parameter that can
be retrieved.

I don't normally write a great deal of Java, so any and all criticism
is most welcome.

Best,
Ali Asad
> To view this discussion on the web visit
> https://groups.google.com/d/msg/epubcheck/-/7dJOxRfw9TAJ.
epubcheck3_branch_epub_version_is_returned.patch

Ali Asad Lotia

unread,
Sep 6, 2012, 6:16:51 AM9/6/12
to epub...@googlegroups.com
As a follow up, if folks could share build instructions, or add a
readme that would be great. At present the maven script is disabled,
so is there another way to compile a jar?
Thanks,
Ali

Markus Gylling

unread,
Sep 6, 2012, 7:46:00 AM9/6/12
to epub...@googlegroups.com
Hi Ali,
thanks for your work and input!

The compilation is still done using Ant. So invoke Ant on build.xml (for example in Eclipse, right click on build.xml, select "Run As…")

Hope this helps, and let me know if you run into problems.

/markus

Ali Asad Lotia

unread,
Sep 7, 2012, 4:53:35 AM9/7/12
to epub...@googlegroups.com
Thanks for these. Worked and have tested to see that version output is
printed when running on the CLI. The attached patch should apply
cleanly if applied from the branches/epub3 directory.

Any estimates on how far away it is from being mavenised itself? I'm
aware that you are waiting to have your Jing patches accepted, any
progress on that front?
I have a project that uses epubcheck that uses maven and it would be
fantastic if I didn't have to install epubcheck and jing to my local
maven repo.

Best,
Ali Asad
epubcheck3_branch_epub_version_is_returned.patch

Ali Asad Lotia

unread,
Sep 11, 2012, 3:33:38 PM9/11/12
to epub...@googlegroups.com
Hi All,
Has anyone had a chance to look at the patch yet. If it is preferred
that I open an issue instead of sending patches as attachements, I'm
happy to do so.
Best,
Ali Asad

Markus Gylling

unread,
Sep 12, 2012, 3:40:52 AM9/12/12
to epub...@googlegroups.com
Hi Ali,

> Has anyone had a chance to look at the patch yet


FYI I am currently on a business trip, please give me till next week to look at your patches. I'll get back to you as soon as I can.

/markus

Ali Asad Lotia

unread,
Sep 14, 2012, 6:56:48 AM9/14/12
to epub...@googlegroups.com
Thanks so much Markus.
--
Ali

On Wed, Sep 12, 2012 at 8:40 AM, Markus Gylling

Markus Gylling

unread,
Sep 24, 2012, 5:12:32 AM9/24/12
to epub...@googlegroups.com
Hi Ali,

over the coming month, I, Romain Deltour and Thomas Ledoux will be working on pushing the next version of EpubCheck out. This will include a programmatically accessible report interface as in Thomas' patch (which will include version info). After this is completed we will assess whether there is a need for (more) getters and such, but the expectation is that the report interface will suffice.

I hope these changes will satisfy your needs, and once we make the new version available, please review and let us know if not!

Best regards, /markus

Ali Asad Lotia

unread,
Sep 24, 2012, 5:27:37 AM9/24/12
to epub...@googlegroups.com
Thanks Markus,
So will that make the current patch submitted redundant? The major
motivation behind it was the side effect that caused output to stdout
outside the main function. If that will no longer happen, I'm happy.

Further, we do have some epubs that cause the 3.0b to hang where 1.2
processes them very quickly. We are going to debug against them
shortly and will attempt to provide information at the very least if
not a patch.

Best,
Ali

On Mon, Sep 24, 2012 at 10:12 AM, Markus Gylling

Markus Gylling

unread,
Sep 24, 2012, 11:14:07 AM9/24/12
to epub...@googlegroups.com

On Sep 24, 2012, at 11:27 AM, Ali Asad Lotia wrote:

> Thanks Markus,
> So will that make the current patch submitted redundant?

Not sure yet; we will know more within a few weeks.


> Further, we do have some epubs that cause the 3.0b to hang where 1.2
> processes them very quickly. We are going to debug against them
> shortly and will attempt to provide information at the very least if
> not a patch.

Great! Bugreports are welcome, and patches to fix them are welcomed with warm embraces.

(Hint: when EpubCheck freezes (or becomes seriously slow) it is often due to doctypes with atypical URIs and/or typical DocType URIs that are nevertheless non-represented in the app catalog. This is where I always look first, anyway…)

/markus
Reply all
Reply to author
Forward
0 new messages