Hi.
I set my FILE namespace to have a default form to edit with which adds semantic properties with default values based on the article name.
The problem is that when I upload a file, the upload process doesn't use the form. (There is also the problem that hundreds of legacy files need to go through the "edit with form and save" steps to get the semantic properties set with their default values.
My question is --- is the a maintenance script I can run that will automate the task of "editing with form" and then "save" for each article without me having to visit each article?
An alternate question is --- is there a non-SMW way to include an in-page, in-line image gallery that is the result of a keyword search for the image and file article names?
better way to get searchable semantic properties with default
Thank you! -Rich
Hi Rich,
I'm somewhat confused - when you wrote "each article", did you mean "each file page"?
Assuming yes - it sounds like what you need is a way to add a blank template call, like "{{My file template}}", to every page in the "File:" namespace. There's no maintenance script that does that, but you could create your own script to do it - the easiest way may be to have it go to "action=pfautoedit" in your wiki's API separately for each file page. See the documentation at your wiki's api.php for more information on how to do that, if you know how to get to api.php.
-Yaron
On Thu, Sep 28, 2017 at 11:21 AM, Evans, Richard K. (GRC-H000) < richard.k.evans@nasa.gov> wrote:
Hi.
I set my FILE namespace to have a default form to edit with which adds semantic properties with default values based on the article name.
The problem is that when I upload a file, the upload process doesn't use the form. (There is also the problem that hundreds of legacy files need to go through the "edit with form and save" steps to get the semantic properties set with their default values.
My question is --- is the a maintenance script I can run that will automate the task of "editing with form" and then "save" for each article without me having to visit each article?
An alternate question is --- is there a non-SMW way to include an in-page, in-line image gallery that is the result of a keyword search for the image and file article names?
better way to get searchable semantic properties with default
Thank you! -Rich
MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
Hi Yaron,
Yes. Basically, the form associated with the File namespace adds a template, but the user has to manually go through the "edit with form" for the template to be added.. this is what I am trying to automate so your advice seems to provide me with a path to doing so. I was hoping that there was a script out there that would essentially call the "formedit" action and save it.
The "pfautoedit" action is unknown to me, that might be ideal.. I'll let you know.
Thank you! -Rich
Hi Rich.
Have a look at https://github.com/s7eph4n/SimpleBatchUpload.
It's an extension, not a script, but it was developed with exactly your use case in mind. It provides a Special page for uploading multiple files to MediaWiki and setting a standard template call as the wikitext of the uploaded file's page. That template could then set your properties or a category. (You will need to use the development version to get the full functionality.)
Cheers Stephan
-------- Original Message -------- On Sep 28, 2017, 17:21, Evans, Richard K. (GRC-H000) wrote:
Hi.
I set my FILE namespace to have a default form to edit with which adds semantic properties with default values based on the article name.
The problem is that when I upload a file, the upload process doesn't use the form. (There is also the problem that hundreds of legacy files need to go through the "edit with form and save" steps to get the semantic properties set with their default values.
My question is --- is the a maintenance script I can run that will automate the task of "editing with form" and then "save" for each article without me having to visit each article?
An alternate question is --- is there a non-SMW way to include an in-page, in-line image gallery that is the result of a keyword search for the image and file article names?
better way to get searchable semantic properties with default
Thank you! -Rich
MediaWiki-l mailing list To unsubscribe, go to: https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
[SimpleBatchUpload] Very nice, Stephan. Thank you! I will look into it and likely use it.
I think Yaron’s recommendation [API pfautoedit] will solve my problem of legacy images and your recommendation will provide me with a path forward for new uploads.. Happiness is!
-Rich
mediawiki-l@lists.wikimedia.org