documentcloud / document-viewer

The NYTimes Document Viewer
http://open.blogs.nytimes.com/2010/03/27/a-new-view-introducing-doc-viewer-2-0/
Apache License 2.0
691 stars 120 forks source link

Edit capability? #15

Open fodaley opened 12 years ago

fodaley commented 12 years ago

Hello, I was wondering if the document-viewer contains the UI for editing..i.e redactions, annotations..etc.. I see from documentcloud that it should, but going through the code I'm confused if this is only a 'viewer' or if there's a way to turn on the editing capabilities. I can see that there are callback methods I can attach...but that's about the extent. Can someone point me to the source files to go through, or give an overview of how I can turn it on if it's there? Thanks.

knowtheory commented 12 years ago

Hey @fodaley, the annotation framework currently resides entirely in the DocumentCloud workspace (check out https://github.com/documentcloud/documentcloud/tree/master/public/javascripts/editor ).

Currently the DocumentViewer is basically read-only (the only bit of writing the DocumentViewer does is posting to the search endpoint. However, we're just about to embark upon a few sprints to pull the annotation frameworks forward into the viewer itself.

I'd love to hear what you're interested in doing with the annotation framework, feel free to drop me a line (my first name at documentcloud.org) or leave a comment.

askhogan commented 12 years ago

Hey @knowtheory I didn't originally ask this question, but it came to my mind today. Thank you for posting this answer and the link to the code.

I volunteer at an Eviction Defense nonprofit in SF. I am helping them with some internal process changes. One item that occurs in real life on real paper is attorneys receiving documents from opposing counsel and then writing post-it notes on the documents near the paragraph they had a ?!?!? moment. The annotations systems will help tremendously. Thank you for open sourcing all of this.

robertour commented 11 years ago

Hello @knowtheory ,

I am trying to add the annotator to django-docviewer (https://github.com/oxys-net/django-docviewer) in which "all dependecies to jammit and ruby have been removed and replaced by django-pipeline"

I added the .js of the editor and a few more dependences that I found. https://github.com/documentcloud/documentcloud/tree/master/public/javascripts/editor

At this point, I got no more error in the javascript but nothing really happen in the docviewer. I am clueless now. I would appreciate any help that points me out how to get edition mode work.

I can deal with the server side but right now I don't know how to activate the javascript.

Thanks!

knowtheory commented 11 years ago

Hi @robertour, the editing process requires that you have a backend to store the note metadata as well.

We've got a working prototype of the annotations editor incorporated into the viewer which we will be releasing in the next couple of weeks. I'll make sure to post some documentation explaining how the viewer integrates with DocumentCloud when we do.

robertour commented 11 years ago

Hi @knowtheory,

Thanks for the reply. As I said my backend is in Django. I did a fork of https://github.com/oxys-net/django-docviewer.

I just wanted to activate the edit capability in the html interface, so I wouldn't have to re-do all the interaction.

Anyway, I ended up building my own edition system. Not super elegant and tweaking it. https://github.com/robertour/django-docviewer.

Please let me know of the release, we may migrate.

Thanks, Roberto

pifleo commented 11 years ago

Hey @knowtheory, Just saw your comment and I'm interested in this new version with integrated editor. Is it the code in the the branch refactor or do you have a more recent version somewhere else ? Like that I can start on this one and the update will be more easy.

I saw these features in DocumentCloud and started implementing the master branch of the viewer. I'm now at the point where I need to let users generate annotations and sections on the document.

What are the missing points ?

Thanks,

knowtheory commented 11 years ago

@pifleo things are in a bit of an awkward place at the moment. Our functional prototype is here: https://github.com/nathanstitt/document-viewer/tree/tools_integration but there are a pile of things we're extracting and reworking at the moment that we'll merge back into master.

The refactor branch is an attempt to incrementally migrate the viewer over to Backbone, so that tinkering with the viewer will be a bit clearer to folks who haven't spent weeks diving into the code base.

As for how DocumentCloud gathers annotations, you can see how DocumentCloud lets users draw annotations and then save the coordinates here: https://github.com/documentcloud/documentcloud/blob/master/public/javascripts/editor/annotation_editor.js

DocumentCloud on the back end, just stores the note details as a database record, and feeds all of it back out when a document is viewed.

robertour commented 11 years ago

@knowtheory I guess I haven't tried hard enough to install the whole framework in my machine because there is quite a few technologies that I don't know for the whole installation and I am troubled with them.

I know I can use the catalog of document cloud to see it working. Is there any public I can try the annotations functionality, so I can see how them work. I used the annotation_editor to build my owns javascript that handles the editing but could never use the 'editing mode'.

Thanks!

drulang commented 10 years ago

I see this thread is mainly about annotations. What about redactions? I see on the DocumentCloud website that redactions are supported but it doesn't seem that the document-viewer itself supports them. Is that true?

knowtheory commented 10 years ago

That's correct.

From a UI perspective, a user telling DocumentCloud what needs to be redacted is just a matter of annotating a document.

DocumentCloud's platform is what actually performs the redaction and modifies the stored assets which contain all the information to be redacted.

drulang commented 10 years ago

Thanks for the quick reply. Could you point me in the general area in the documentcloud repo where redactions are processed?

knowtheory commented 10 years ago

Our redaction task is here: https://github.com/documentcloud/documentcloud/blob/master/app/actions/redact_pages.rb

And is an action run by our backend CloudCrowd processing cluster.

drulang commented 10 years ago

Great, and thanks again for the quick response