-
-
Notifications
You must be signed in to change notification settings - Fork 652
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
save and load templates, with tabula-java-1.0.0 #711
Conversation
…button if there are any selections on the page
@jazzido I'll also note: this converts from the old workspace.json format to the new one. The new singleton Tabula::Workspace thingy works great, thanks for adding that! |
webapp/tabula_web.rb
Outdated
|
||
def create_template(template_info) | ||
puts template_info.inspect | ||
template_name = template_info["name"] || "Unnamed Template #{Time.now.to_s}" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@jeremybmerrill can we move this to Tabula::Workspace
? Thanks!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I inlined it in the route where it's called. I think it's not really about manipulating the workspace, but instead about manipulating templates. e9fd394
Awesome, @jeremybmerrill ! Thanks a lot. Just submitted a minor change request. |
@@ -3,6 +3,7 @@ language: ruby | |||
before_install: | |||
- gem update --system | |||
- gem install bundler | |||
- gem install jbundler |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Man, Travis is driving me nuts. jbundler
is in the Gemfile
, so that wouldn't be necessary right? So frustrating.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Soooo frustrating, yes.
BTW, it'd be nice to give some feedback when the user clicks the "Save as template" button. |
OMG it worked. Thanks! |
save and load templates, with tabula-java-1.0.0
please how can i c reate a template.json |
this set of commits adds UI and serverside ability to
save a template from the extraction view
load an already-saved template from the extraction view
upload/download/rename a template from disk in the Library (front page) view
this incorporates @cheapsteak's #669 PR. this will close the feature requested in #608, #483, #93, #505.
The "template" is the same as the JSON output you can already download from the export view. Template metadata is recorded in workspace.json, which now has a new format (with stuff to automatically convert existing workspace.json files).
@jazzido @mtigas, anyone else, wanna take a look? (I already showed Mike IRL)
this is kind of just a first-stab at the problem, there's a bunch of enhancements that could be done now:
refactor tabula_web.rb's template persistence stuff, which is a little repetitive and gross right now
reimplement Autodetected Selections as a template, since it's really the same thing
how should we handle repeated selections? (i.e. if the template is saved with one selection repeated on pages 2 thru 100 of 100 page PDF, and that selection is loaded on a 102 page PDF, should we apply the selection to the following pages?)
you should be able to name templates from PDFView
you should be able to "overwrite" old templates from PDFView (i.e. loading a template, modifying it, and saving it as teh same one, not a new one)
maybe you should be able to upload templates in PDFView (rather than just on the front page)
"batch" mode from front page, applying one template to multiple PDFs all at once.
how to handle selections that don't "match" the PDF they're applied to -- maybe a selection's coordinates are outside the page on the new PDF, or there are selections on pages that don't exist in the new PDF.
This PR is an updated version of #705, except it's proposed to merge into tabula-java-1.0.0 per @jazzido's request, so we can do it all at once.