Giter Club home page Giter Club logo

pattypan's Introduction

Logo

Tool that simplifies Wikimedia Commons batch file uploading for GLAM institution volunteers and employees. Created thanks to Wikimedia Foundation IEG Grant.

For more information on usage, see Commons:Pattypan.

⬇️ Download


Build and run

Apache Ant is used for building Pattypan. You need to have JDK 11 or later installed as well as a download of OpenJFX for each platform you want to support. In order to download and build source code, do the following:

git clone https://github.com/yarl/pattypan.git
cd pattypan
ant

This will run the default build target. It assumes that the current directory contains the OpenJFX SDK ZIP(s) and will unpack the required files to the correct locations. The resulting JAR will support Linux, Windows or both. The ZIPs present dictates what platforms will be supported. Note that the ZIPs should have their default name to be included.

A temporary directory will be used during the build process and removed afterwards. It's default path is tmp/ and can be set using ant -Dtmp=...

You can also set test server or any other server:

java -jar pattypan.jar wiki="test.wikipedia.org"
java -jar pattypan.jar wiki="test2.wikipedia.org" protocol="https://" scriptPath="/w"

Please note, that on test server file upload may be disabled for regular users. Admin account is suggested, you can request rights here. If you have problems with program running, check article on project wiki.

License

Copyright (c) 2016 Paweł Marynowski.

Source code is available under the MIT License. See the LICENSE file for more info. Program is using external libraries listed here.

Credits

Name by Wojciech Pędzich. Logo by Rickterto, licensed under the Creative Commons BY-SA 4.0 license.

pattypan's People

Contributors

abbe98 avatar aktron avatar ash-crow avatar coderwassananmol avatar don-vip avatar edouard-lopez avatar intracer avatar jhsoby avatar owcz avatar papuass avatar rachmat04 avatar sebastian-berlin-wmse avatar siebrand avatar sjoerddebruin avatar tobias47n9e avatar yarl avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pattypan's Issues

Exporting the result of the upload

Hello @yarl,

  1. Thank you for creating this great tool. I've already managed to upload some files to Commons this way, and am planning to do more in the future! (With special thanks to @Lanbot84.)

  2. My issue is as follows. When an upload is done, I cannot copy/paste the text of the uploading process to easily identify and isolate errors via spreadsheet. Is it possible to make the resulting text copy/pastable or even make it available as a report in a txt- or csv-file?

Greetings,
Renier.

Metadata fields for Template:Book misrepresented

Dear Pawel,

Thanks for Pattypan 17.05, it is great! Extending the Simple Manual with some examples, I just hit upon your use of the metadata Template:Book https://commons.wikimedia.org/wiki/Template:Book/doc and it appears something is wrong with the data fields presented in the field selection menu.

  1. At the end the fields License and Partnership occur 2 times.
  2. The names of the fields sometimes differ slightly from their definition, e.g., "Page overview" instead of "Pageoverview" and "Home category" instead of "Homecat". I didn't test if this a problem with an upload.

Yours sincerely, Hans Muller
https://commons.wikimedia.org/wiki/User:Hansmuller

Error: Could not find or load main class pattypan.Main

In OpenJDK 1.8.0_92, I cannot launch the jar:

$ LANG=EN java -jar pattypan.jar                                                                                                                    
Error: Could not find or load main class pattypan.Main 
$ java -version
openjdk version "1.8.0_92"
OpenJDK Runtime Environment (build 1.8.0_92-b14)
OpenJDK 64-Bit Server VM (build 25.92-b14, mixed mode)

FLAC file upload not supported

screen shot 2017-03-08 at 12 40 50 am copy

I tried to create a spreadsheet for a folder containing .flac files but it wouldn't show the "Next" button. Can you please add FLAC as it is a lossless open standard and would be very useful? Thanks.

Hangs without feedback upon creating spreadsheet

screenshot
screenshot

After creating the spreadsheet, I don't see feedback to indicate that the operation was successful. The app is still processing, but I can only tell by hovering my mouse over the menu bar and seeing the waiting icon. If I clicking out of the window and go do something else (like edit the spreadsheet), it finishes running and displays properly after a while.

Use EXIF date when no date is specified

I would like to suggest making it an option to use the EXIF date if no date is specified.

Alternatively, this date could be put in automatically when the user chooses to start out by generating an Excel sheet.

Feature request: mark bad filenames as red

when the spreadsheet is generated, filenames like IMP01843.jpg will be marked red.

I found some regex the UploadWizard used to use

// @codingStandardsIgnoreStart
        // XXX this is horribly confusing -- some file restrictions are client side, others are server side
        // the filename prefix blacklist is at least server side -- all this should be replaced with PHP regex config
        // or actually, in an ideal world, we'd have some way to reliably detect gibberish, rather than trying to
        // figure out what is bad via individual regexes, we'd detect badness. Might not be too hard.
        //
        // we can export these to JS if we so want.
        // filenamePrefixBlacklist: wgFilenamePrefixBlacklist,
        //
        // filenameRegexBlacklist: [
        //  /^(test|image|img|bild|example?[\s_-]*)$/,  // test stuff
        //  /^(\d{10}[\s_-][0-9a-f]{10}[\s_-][a-z])$/   // flickr
        // ]
        // @codingStandardsIgnoreEnd

Semicolons in category names

As per the Pattypan simple manual, Pattypan uses semicolons to separate category names in the spreadsheet. However, semicolons are valid in category names, and there doesn't seem to be any guidance discouraging creating categories with semicolons. One user took great issue with the fact that the tool I was using did not support semicolons in category names, though I've never seen anyone but him create such categories.

I suppose changing the separator for category names in Pattypan spreadsheets would break backwards compatibility, but is there a way to escape semicolons in the category column? I don't see anything in the documentation suggesting so. Can this be added?

Allow galleries

When an upload is finished, allow an automated edit with the content of the upload a gallery on User:USERPAGE/gallery with all uploaded files between the and tags.

Include Map template

The Map template is a well-functioning template and uniform with other content templates.

French translation

Hi, I've done the french translation for PattyPan. Should I try an pull request for that?

Regards, Antoine

Embedding in a Web page

Is it possible to embed Patty Pan in a Web Site?

If so, is there instructions somewhere for that?

Antoine.

Upload error with two-factor permissions

Getting Error: Permission denied.. and Error: The action you have requested is limited to users in one of the groups: *, [[Commons:Users]].. In the console:

Mar 28, 2017 1:48:29 AM Wiki upload
SEVERE: [commons.wikimedia.org] EXCEPTION: java.io.IOException: No filekey present! Server response was <?xml version="1.0"?><api servedby="mw1285"><error code="permissiondenied" info="The action you have requested is limited to users in one of the groups: *, [[Commons:Users|Users]]." xml:space="preserve">See https://commons.wikimedia.org/w/api.php for API usage. Subscribe to the mediawiki-api-announce mailing list at &amp;lt;https://lists.wikimedia.org/mailman/listinfo/mediawiki-api-announce&amp;gt; for notice of API deprecations and breaking changes.</error></api>

Also lots of warnings about WARNING: getPageInfo: watchtoken and editoken are deprecated and will be removed shortly.

Followed directions in https://commons.wikimedia.org/wiki/Commons:Pattypan/Two-factor_authentication

Feature request: save constants from previous uploads

Would be nice if when you switch on a particular value being a constant, the value you used for that constant on a previous upload would appear.

I upload a fair few of my own photographs using Pattypan, so I keep putting in

{{own}}
[[User:1Veertje|Vera de Kok]]
{{self|CC-BY-SA-4.0|author=Vera de Kok}}

for source, author and license.

I like Pattypan a lot more than Commonist, but this is one thing that Commonist has that Pattypan doesn't.

Use OAuth?

Seems pattypan is using User/Password input to authenticate to Wikimedia Commons, but it could be more secure (and possibly convinient) to use OAuth to authenticate.

Failing to upload larger files

I have been trying a 283 MB and 107 MB file one at a time. But have not been able to upload them after multiple attempts. Each time I try to upload them it takes a few minutes and I see an update on Pattypan saying it has failed to upload. Any particular reason?

Unable to resize outside window

screenshot

Unable to resize the outer edge—not sure if it's specific to the program or to the Java implementation. In any event, might be worthwhile to make the window bigger since the contents will always need to be expanded to fit properly.

Downloaded .jar release, run with java -jar pattypan.jar

Not in GZIP format

Hi there,

Every time I try to upload some batch, it gives this error. I don't know a reason.
For example, this following file, can't be uploaded
abdon insunza ortiz

Blank screen after clicking generate spreadsheet

Hi everyone,

When I click on 'generate spreadsheet' the application window simply goes blank. Has anyone else experienced this.

My system:
MAC OS Sierra: 10.13.5 (17F77)

schermafbeelding 2018-07-18 om 16 44 20

The problem persists when I use the .jar executable, this is the terminal output, hope it helps.
at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method) at java.base/jdk.internal.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62) at java.base/jdk.internal.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45) at java.base/java.lang.reflect.Constructor.newInstance(Constructor.java:488) at pattypan.elements.WikiButton.getPaneByPaneName(WikiButton.java:75) at pattypan.elements.WikiButton.goTo(WikiButton.java:106) at pattypan.elements.WikiButton.lambda$linkTo$0(WikiButton.java:87) at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:86) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:49) at javafx.base/javafx.event.Event.fireEvent(Event.java:198) at javafx.graphics/javafx.scene.Node.fireEvent(Node.java:8865) at javafx.controls/javafx.scene.control.Button.fire(Button.java:200) at javafx.controls/com.sun.javafx.scene.control.behavior.ButtonBehavior.mouseReleased(ButtonBehavior.java:206) at javafx.controls/com.sun.javafx.scene.control.inputmap.InputMap.handle(InputMap.java:274) at javafx.base/com.sun.javafx.event.CompositeEventHandler$NormalEventHandlerRecord.handleBubblingEvent(CompositeEventHandler.java:218) at javafx.base/com.sun.javafx.event.CompositeEventHandler.dispatchBubblingEvent(CompositeEventHandler.java:80) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:238) at javafx.base/com.sun.javafx.event.EventHandlerManager.dispatchBubblingEvent(EventHandlerManager.java:191) at javafx.base/com.sun.javafx.event.CompositeEventDispatcher.dispatchBubblingEvent(CompositeEventDispatcher.java:59) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:58) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.BasicEventDispatcher.dispatchEvent(BasicEventDispatcher.java:56) at javafx.base/com.sun.javafx.event.EventDispatchChainImpl.dispatchEvent(EventDispatchChainImpl.java:114) at javafx.base/com.sun.javafx.event.EventUtil.fireEventImpl(EventUtil.java:74) at javafx.base/com.sun.javafx.event.EventUtil.fireEvent(EventUtil.java:54) at javafx.base/javafx.event.Event.fireEvent(Event.java:198) at javafx.graphics/javafx.scene.Scene$MouseHandler.process(Scene.java:3876) at javafx.graphics/javafx.scene.Scene$MouseHandler.access$1300(Scene.java:3604) at javafx.graphics/javafx.scene.Scene.processMouseEvent(Scene.java:1874) at javafx.graphics/javafx.scene.Scene$ScenePeerListener.mouseEvent(Scene.java:2613) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:397) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler$MouseEventNotification.run(GlassViewEventHandler.java:295) at java.base/java.security.AccessController.doPrivileged(Native Method) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.lambda$handleMouseEvent$2(GlassViewEventHandler.java:434) at javafx.graphics/com.sun.javafx.tk.quantum.QuantumToolkit.runWithoutRenderLock(QuantumToolkit.java:389) at javafx.graphics/com.sun.javafx.tk.quantum.GlassViewEventHandler.handleMouseEvent(GlassViewEventHandler.java:433) at javafx.graphics/com.sun.glass.ui.View.handleMouseEvent(View.java:556) at javafx.graphics/com.sun.glass.ui.View.notifyMouse(View.java:942) at javafx.graphics/com.sun.glass.ui.mac.MacView.notifyMouse(MacView.java:127) _Caused by: java.lang.NoSuchMethodError:_ com.sun.javafx.tk.FontLoader.computeStringWidth(Ljava/lang/String;Ljavafx/scene/text/Font;)F at pattypan.elements.WikiLabel.setTranslateByHalf(WikiLabel.java:67) at pattypan.elements.WikiProgressBar.createContent(WikiProgressBar.java:90) at pattypan.elements.WikiProgressBar.<init>(WikiProgressBar.java:42) at pattypan.elements.WikiPane.<init>(WikiPane.java:69) at pattypan.panes.ChooseDirectoryPane.<init>(ChooseDirectoryPane.java:57) ... 51 more

Support for ODS files

Hi @yarl,
Thank you for this awesome tool, very useful. I am user of LibreOffice and normally what I usually work with spreadsheets is in ODS format. Would there be any possibility to support ODS files in Pattypan?

I don't know if it's impossible due to technical problems o any related issue, but it could be interesting. It is comfortable work with open formats even in the smallest issues.

I await your answer. Thanks in advance!

Regards,
Iván

Cannot login

I seem unable to login user either method, and I have tried several accounts. I simply get a 'Login Failed' message. Any ideas?

Retry button for failed uploads

Currently there is no option to retry failed uploads. Even a much slower uploader like Upload Wizard has this option. And an efficient batch uploader like Pattypan should have this option. Right now one has to search for the error message that looks like this:
screen shot 2017-03-12 at 9 04 02 am
[10/99] Error: Operation timed out (Connection timed out).
where 10 and 99 being variables where 10 is the 10th file and 99 is the total number of files in the batch, and upload again by removing the uploaded files from the spreadsheet, and run Pattypan again. It would be great to include the feature of retrying to upload the failed uploads. Thanks in advance!

Cannot launch with OpenJDK 1.7.0_101

Launching the jar fails completely in Ubuntu 15.10:

guest-fJvug7@faggio:~/Scaricati$ java -jar pattypan.jar 
Exception in thread "main" java.lang.UnsupportedClassVersionError: pattypan/Main : Unsupported major.minor version 52.0
    at java.lang.ClassLoader.defineClass1(Native Method)
    at java.lang.ClassLoader.defineClass(ClassLoader.java:803)
    at java.security.SecureClassLoader.defineClass(SecureClassLoader.java:142)
    at java.net.URLClassLoader.defineClass(URLClassLoader.java:449)
    at java.net.URLClassLoader.access$100(URLClassLoader.java:71)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:361)
    at java.net.URLClassLoader$1.run(URLClassLoader.java:355)
    at java.security.AccessController.doPrivileged(Native Method)
    at java.net.URLClassLoader.findClass(URLClassLoader.java:354)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:425)
    at sun.misc.Launcher$AppClassLoader.loadClass(Launcher.java:308)
    at java.lang.ClassLoader.loadClass(ClassLoader.java:358)
    at sun.launcher.LauncherHelper.checkAndLoadMain(LauncherHelper.java:482)
guest-fJvug7@faggio:~/Scaricati$ java -version
java version "1.7.0_101"
OpenJDK Runtime Environment (IcedTea 2.6.6) (7u101-2.6.6-0ubuntu0.15.10.1)
OpenJDK 64-Bit Server VM (build 24.95-b01, mixed mode)

remove previous uploads from validate and upload screen

Hi Jarl,

Another thing that was pointed out to me while using the tool at GLAM offices (see #32) is that when you change the files you upload, or add other you want to upload, the previous uploads you did before that stay visible at the last step in the upload screen. This made people question whether they got the process right and made them 'afraid' to upload the same image again.

Maybe this could be adjusted?

Thanks!

Michelle

Change name button 'back to start' to 'continue and upload'

Hi Jarl,

Firstly: thank you for creating this great tool! I have been working as WiR with GLAMs in the Netherlands learning them to use it, and I would like to share a suggestion they made.

In step three, when you finish generating your spreadsheet and proceed to uploading, the button is labeled 'back to start'. This confused the employees using the tool, because they tought they would undo there process and were looking for something to continue the process. Therefore, it might be a good idea to change the name of the button to 'continue and upload' or something like that.

Cheers and keep up the good work!

Best wishes,
Michelle

By the way, let me know if there are special things you want to user test with GLAM employees, my residency continues to run till the end of this year.

Error loading TIFF files

Hello everyone, I use Pattypan very often to upload images to Commons and today I came across an error that I could not resolve, the error message is as follows:

Could not extract data from tiff file / tmp / 1xt8d3

Could someone help me please
Thank you

Define templates in individual files

Currently all templates are defined in Settings.java and the majority of the code found there is just template definitions. Defining all templates in individual files(in a sub-directory) would be an enchantment when the number of templates increases.

Blank page after selecting spreadsheet

Since yesterday (28/12) I am trying to upload files with Pattypan (version 17.12) but I keep getting the same problem: a blank page (screenshot: Window 2) after I have selected the spreadsheet (screenshot: Window 1) and clicked on 'next'. I am using a spreadsheet that worked well before and was created with the previous Pattypan version (I have tested the spreadsheet on 17/12 and was able to upload 2 files from the complete batch).

I did some tests trying to solve the problem, I have created a new spreadsheet with the new Pattypan version and tried to upload it but the problem still exists. I have set Windows explorer as standard browser (instead of Chrome) but that didn't help.
I did have a Windows update recently, can that be the problem?

window1
window2

Timestamp is being written in US date format

in de spreadsheet my dates were formatted:
7-7-2011 12:22:00

This was translated upon uploading into US date format:

7/7/11 12:22

This is a format Mediawiki doesn't understand, the proper format would have been:

2011-07-07 12:22:00

Preview substitute page does not generate {{subst:OP}} template

Hi guys,

When I add an {{subst:OP}} template (for pending OTRS requests) to the permission field, the template does not generate a label in preview mode. See here

I think it is because the label has recently been changed or something.
If you can't do anything about it let me know where I should report this!

Thanks for all the hard work!

Michelle

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.