Active
Project:
FillPDF
Version:
8.x-4.x-dev
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
29 May 2012 at 21:21 UTC
Updated:
5 Apr 2019 at 09:14 UTC
Jump to comment: Most recent
I'm working on a site that is going to have a LOT of PDFs. It would be great to be able to create views of the PDFs in FillPDF. The ideal scenario for this would be that a PDF form would actually be an entity and would inherit all of the other entity functionality. Short of that, I wonder if the module could at least utilize the file_usage table when saving pdf files - then we could do a view of files filtered by module usage.
Comments
Comment #1
wizonesolutionsHmm, I haven't thought of making PDF forms entities, but it isn't a bad idea. Would that provide Views integration for free?
In terms of file_usage, how do I use that? I know I use the managed file functions for the PDF forms.
Of the two options, though, it sounds like making PDF forms entities would be a better idea. The only question is what the bundle would be. Would I just create a default bundle in the
.installfile and then have each form have that type? Would the form itself be an attached File field?Thoughts welcome, since you seem to have put some thought into this.
Comment #2
dafederHi there! File usage is primarily used to tag a particular file as being in use by a specific module, particularly to avoid file deletions with unforseen consequences. But it has the added benefit of providing a field to the views API, so you could make a file view and filter on file usage = "fillpdf".
See: http://api.drupal.org/api/drupal/includes!file.inc/function/file_usage_add/7
Would just be a question of adding something like this somewhere around the file save function:
file_usage_add($file, 'fillpdf', 'fillpdf_form', $fid);I've never created a new custom entity type, but as I understand it, deeper views integration should in fact be free with it. But maybe there is an easier solution - making forms be either a custom file entity bundle using the file_entity module, or even a predefined node type!
Comment #3
dafederAnother idea - a sort of middle way. There could be a PDF filefield widget, which creates a reference from another node type to a pdf form already added to the FillPDF system. This could be a second optional module included in the package, that left the basic functionality alone but provided the option to create a new content type around the PDf forms. It would need to include a formatter to create fillpdf links based on the fid of the filefield value, and an arbitrary nid - (say, from a views argument!).
The schedule for this project is actually uncertain at this point, but will likely allow me to build this within budget at some point this year and contribute back to the project. Will let you know!
Comment #4
wizonesolutionsdafeder: If you would like to re-title this issue to encompass what you plan to do, that'd be great.
I will be exposing Fill PDF information to Views in time, so no need to detail that here. But interested in that "Fill PDF field" idea.
Thanks!
Change status whenever you start on it or let me know if the idea falls through. Most do, so I won't be upset or anything.
Comment #5
dafederWill do! Keeping it postponed for now, I'd say there's about a 50/50 chance this will happen.
Comment #6
dafederSo, the idea I'm leaning toward right now is to create a fillpdf_field module (which would hopefully still be part of this same project). I still think it would be more drupalistically correct to build fillPDF forms out as entities, but that's less crucial to getting this all working
The field options would be:
1. FillPDF file - select or autocomplete field of all pdf forms in the fillpdf system.
2. Data node - chose between the current node and any nodereference fields on the current node.
3. Link text
The field would then display a link built from the fid and nid supplied, using the link text. This would really make both views and the display of links on node pages easy to manage. Thoughts?
Comment #7
wizonesolutionsYeah, I'm for this. Create a separate issue for it and update the title of this one to be "Expose metadata to Views."
If the field can both be added to content types (node bundles) and as a Views field, that'll be killer. In Views, it should have options that will equate to the fid, and nid and then build the link. Well, same as the content type field I guess.
Marking this as normal-postponed in anticipation of the other issue.
Comment #8
wizonesolutionsComment #9
wizonesolutionsWill be continued in linked issue #2343507: FillPDF field (for Drupal 8).
Comment #10
panchoReopening this feature request as FillPdfForms are entities now, so we don't need FillPDF field to expose metadata to views.