Closed janmichaelyu closed 8 years ago
Filtering is a good first step, but ideally i'd expose the result as a memo, which then shows up automatically in details page.
We should try to preserve more formatting though to make that look good. For pdf we have pdf-convert, and for .docx we could disect the zipped xml. Other doc formats will have to do with filtering..
I think you need to rebase.. :)
@grtjn Please review.
Had a quick look just now. I notice you apply fn:string
to the result of pdf-convert and doc-filter. Doesn't xdmp:quote
make more sense? Memo's should be capable of handling quoted HTML.
Also thinking we may need to prevent people from editing these memos. Can we add a flag to such memos? Something like converted: true?
Do I also tie the memo to the attachment like if the attachment gets deleted, should I delete the memo?
I was thinking of disabling editing of memo title, and disallowing deleting such memos, but hadn't considered deletion of attachments themselves yet. Yes, makes sense. You could implement that with a trigger as well perhaps..
Got it. Please review.
Looks pretty good at first glance, I'll try to run a test with it this week..
Please hold off on the merge. Will fix a bug when adding two attachments for conversion at the same time.
Ok, finished fixing the bug. Please review. Also I noticed some weird page refreshes when the attachments are too big. Is this possible connected to the new trigger?
Just tested: I disabled the adding of memos and added 3 files, one which is 2Mb. I get 401 Unauthorized in the console and multiple page refreshes until the detail page appears again with the uploaded files.
The 401's sound suspicious. No worries, I'll test thoroughly before merging.. :-)
Hmm, you are right, that looks very suspicious. I didn't deploy your changes yet, and am indeed seeing odd network traffic. I'll see if I can make sense out of that..
Added PR #273 that resolves the odd 401 issue.
Thnx Ryan, I'll see if I can take a renewed look at this PR with your changes piled on top..
@janmichaelyu I ran a quick test, and it looks good at first glance. A few notes:
@grtjn I made the changes you asked for. Pre-commit helped a bit but big files still take a while to convert and show up as memos. Let's raise another issue for the PDF extracted memo?
Yeah, fair enough, this is a good start. Someone else might have interest in jumping in, or maybe I will myself..
@grtjn Please review. Let me know if I also need to add the filtered content to be visible in the UI when searching or detail view. #269