04-15-2014, 03:56 AM | #1 | |
Addict
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
EpubCheck jar/webapp
Hello,
I am using pagina EpubCheck tool to validate my files, for some reason it doesn't work anymore, when I click the exe absolutely nothing happens, tried a bunch of stuff and still nothing. I really dislike to use command line tool, makes me feel like i'm back on DOS :P and so I decided to create a java applet to run the jar file, I used a boilerplate template to make sure I get a clean HTML5 and just added this code: PHP Code:
I get an error trying to run the applet about a ClassNotFoundException since the value in Quote:
Anyone knows how to get this working? EDIT: Is it not meant to run as applet? Thanks! Last edited by odedta; 04-15-2014 at 06:21 AM. |
|
04-15-2014, 10:38 AM | #2 |
Zealot
Posts: 130
Karma: 546310
Join Date: Jun 2011
Device: PocketBook Touch HD, PocketBook Era
|
A workaround:
http://www.ebook-tool.com/epub-validator.htm It's actually a frontend to epubcheck, comes bundled with an older version of it, I just overwrite the epubcheck files in it with the latest 3.01. I thought epubcheck was meant to work as a servlet, not as an applet. |
Advert | |
|
04-15-2014, 01:39 PM | #3 |
Software Developer
Posts: 189
Karma: 89000
Join Date: Jan 2014
Location: Germany
Device: PocketBook Touch Lux 3
|
I find it highly suspicious if somebody provides a proprietary GUI front end to a freely licensed program, because all of the underlying code was written and released in order to respect the digital freedom of the user, and the GUI front end just denies the possibility to change its code, hides what it is actually doing and doesn't contribute back to the community. Further, selling the package isn't illegal, but highly dubious, since the GUI front end part was little work, and the entirely freely licensed back end was much work, the latter not even to the expense of the GUI front end developer. There's a danger that the proprietary package violates the license of the back end (well, not with epubcheck, its BSD-3-Clause license is unfortunately quite permissive to a bad extent), and the "business model" for it is solely based upon the ignorance of the user, who doesn't know that he pays money in order to loose his digital freedom.
So I might look into writing a freely licensed GUI front end for epubcheck, so that the proprietary ones don't need to be used by ordinary users any more, and the provided source code of it will enable you to fix it, if the GUI front end should ever become incompatible with newer versions of the epubcheck back end. Recently, I've written some small starter batch and shell scripts, which do nothing else than executing the Java binaries or jar files on the command line, so that those starter scripts can be run by a double click. run.bat Code:
@ECHO OFF java -jar HelloWorld.jar Code:
#!/bin/bash java -jar HelloWorld.jar Code:
classid="java:HelloWorld.class" Last edited by skreutzer; 04-15-2014 at 01:46 PM. |
04-15-2014, 02:27 PM | #4 |
Addict
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
skreutzer: Yeah, I know that part is missing in my code, I looked all over the src folder and all I get were .java files, not .class files, last time I coded anything in Java was about 3 years ago so it'll take me time to figure this out, that's why I thought posting here might lure someone more experienced than me.
Since this didn't work I went to a different language, PHP, and it worked for me, I created a website where you can upload an ePub to get it validated much like the online validator http://validator.idpf.org/ only I provide the options mentioned here: https://github.com/IDPF/epubcheck/wiki/Running I originally developed this for my own personal use with my xampp server since the pagina-epubcheck doesn't run on my PC and I really dislike command line. I will of course make this open source (with complete transparency) and hopefully people can give me feedback on upgrades. You can see what I've done so far in the attached file, If you have any ideas on improvements let me know! I expect to finish this by tomorrow or two days from now. Thanks! Last edited by odedta; 04-15-2014 at 02:37 PM. |
04-17-2014, 02:11 PM | #5 |
Software Developer
Posts: 189
Karma: 89000
Join Date: Jan 2014
Location: Germany
Device: PocketBook Touch Lux 3
|
This sounds really interesting! If you're going to freely license it, please use “GNU Affero General Public License 3 or any later version of the license”, because this license was designed to protect the freedom of all computer users even if the software is run on a server as a service.
Basically, I would like to learn how one can use PHP to execute Java programs on a webserver, because I'm thinking about writing freely licensed software for highly integrated, automated online publishing, and my standalone offline tools are written in Java for portability. I know both Java and PHP, but up to now I don't know how I could set up an online service. epubcheck could certainly be part of it in order to only publish valid EPUB files. So I would highly appreciate if you would share your experiences, methods, or even code. |
Advert | |
|
04-17-2014, 04:42 PM | #6 |
Addict
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
Well, it's pretty much done, the development took place on my local xampp server, when I uploaded it to my hosting it didn't work since they block the exec command (i think) by default.
You have to be careful with file upload security. Anyhow, I am trying to contact them for 2 days now but it seems that all offshore communications for me this holiday is kind of messed up so it will be online soon but i'm not sure when. In the mean time, like I said, this is totally free and you can download the contents from: http://odedta.com/projects/epubcheck/epubcheck.zip Thanks for the GNU thing, I have 0 knowledge on those things ^_^ EDIT: Regarding the usage of jar files in PHP: In this instance I used the exec command, it's a command I used before in ssh communications when I wanted to server a and stop a server. You basically write the command line as it is introduced in https://github.com/IDPF/epubcheck/wiki/Running PHP Code:
Since the epubcheck-3.0.1 has a built in function to spit out an xml file as the validation log I do that every time a file is checked and using PHP's "simplexml_load_file()" to read the contents then printing them for the user. Last edited by odedta; 04-17-2014 at 04:51 PM. |
04-18-2014, 04:43 AM | #7 |
Software Developer
Posts: 189
Karma: 89000
Join Date: Jan 2014
Location: Germany
Device: PocketBook Touch Lux 3
|
OK, I expected something like exec() (which is for system calls, to invoke something on the command line). Sure, it is restricted on online webservers, because it certainly is a huge security risk for the entire system. Further, do you know if a JavaVM is installed and callable on the webserver? I fear that could not be the case. So I'm more or less looking for a solution which provides the opportunity to run Java programs locally on an online webserver. Probably there's no other way than renting a dedicated Java webserver platform (if such thing exists at all besides cloud computing) or to rent an entire webserver machine and install the JavaVM by hand by being fully responsible for the server security by myself.
|
04-18-2014, 05:14 PM | #8 |
Addict
Posts: 398
Karma: 96448
Join Date: Dec 2013
Device: iPad
|
|
04-23-2014, 05:06 AM | #9 | |
Wizard
Posts: 1,760
Karma: 9918418
Join Date: Feb 2013
Location: Here on the perimeter, there are no stars
Device: Kobo H2O, iPad mini 3, Kindle Touch
|
Quote:
Yes, I can pretty much fix an EPUB just by right-clicking on it a couple of times, then making a few manual adjustments. |
|
|
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
how to convert to .jar? | sammygirl | Conversion | 4 | 05-25-2012 08:27 AM |
.jar format to MOBI | jojobookreader | Other formats | 3 | 02-03-2012 03:08 AM |
Using epubcheck .jar with Java | Erin | ePub | 6 | 06-12-2011 10:57 AM |
PRS-300 the jar wattpad ebooks | nygil123 | Sony Reader | 0 | 10-07-2010 01:53 AM |
Web-based epubcheck upgraded to epubcheck 1.0.5 | kjk | ePub | 4 | 02-09-2010 09:53 PM |