When would this be added to the content? For example, upon acceptance (= entry into the production/publication part of the workflow)?
We’re looking at adding some generic content-management tools permitting better control over the published presentation of a submission, mostly for OMP, but also applicable to OJS. I’m wondering whether this would be a good candidate for an OJS requirement.
Regards,
Alec Smecher
Public Knowledge Project Team
Correct, in my use case this information would be provided only by an editor/admin (i.e. in the production phase). It wouldn’t be harmful to display the field/textarea it on submission, though, so whatever is easier or more generic would be fine for me.
This seems like a good application of the kind of content management tools for publication that I mentioned above, rather than a metadata field like the DC set. Tagging @stranack, as he’s doing some related requirements work on OMP.
Regards,
Alec Smecher
Public Knowledge Project Team
@asmecher, thanks, that sounds like the best solution—
If you have any pointers, though, for doing this with the current Submission class, they would be much appreciated, as I need to implement this sooner rather than later…
For a quicker fix, I’d suggest grepping through the code for a similar metadata field and following its pattern – e.g. “coverage”, since that term isn’t used elsewhere in a different way, and it doesn’t have many dependencies.
Regards,
Alec Smecher
Public Knowledge Project Team
For anyone else looking to add custom metadata (in the most minimal kind of way—this doesn’t tie in with the translation system, DC, etc.), here is what you need to modify:
In lib/pkp/classes/submission/PKPSubmissionMetadataFormImplementation.inc.php:
In the initData function, add 'myField' => $submission->getData('myField', null) to the formData var
In readInputData, add 'myField' to the userVars var
In getLocaleFieldNames, add 'myField' to the array (not sure if this is necessary)
In lib/pkp/classes/submission/SubmissionDAO.inc.php: in getLocaleFieldNames, add 'myField' to the array
In lib/pkp/templates/submission/submissionMetadataFormTitleFields.tpl: append something like the following to the end of the template (here is a case where you might want to do some extra work to integrate with translations):
It is basically a plugin that enables you to create new custom metadata fields using the database. I am not going to use it myself, because I only need one custom metadata field and the same plugin that creates that field does a lot of different things as well. But if someone has been thinking of something similar I did above, then my plugin is probably worth checking first.
At the moment it only supports single locale and only a text input field, but the concept could be easily expanded to support multilingual fields and for example textarea as well. Also notice that if someone tries the plugin, it does not at the moment create the required database table.
yes, I know it’s not ready-to-use, I was just asking.
It would be possible just to quicksubmit an article and later in the workflow alter the metadata…
Yes, I am just washing my hands off any mess the plugin creates
If the quicksubmit plugin has some sort of hook in metadata section then it should be fairly easy to implement it there. I think that this is a more general question: there are many other plugins that would benefit from being able to hook into quicksubmit.
QuickSubmit plugin does use already existing component, but I am not sure if that is enough – I will have to check, if all necessary hooks are there… I will then come back to you again…
Yes, the QuickSubmit plugin uses the existing components and thus also the hook Templates::Submission::SubmissionMetadataForm::AdditionalMetadata.
You would however have to consider the QuickSubmitForm in your plugin, similar like OpenAIRE plugin is considering the SubmissionSubmitStep3Form in these code lines:
In general, the OpenAIRE plugin is a good example how to extend the article metadata with an additional filed – what hooks should be used and how to do that. Additionally to the code lines above s. also:
Hi,
Reviving this thread, is there any new way to add a custom metadata field? I followed the steps suggested by @kardeiz and managed to add a custom field but its value is not stored anywhere; after submitting the form the custom field is empty. I’m using OJS 3.1.1.4.