On 17/05/12 00:36, Brion Vibber wrote:
> I'm adding an API module to retrieve UploadWizard upload campaign
> information, which we need for the upcoming mobile application for Wiki
> Loves Monuments. Essentially the app will include a very limited
> implementation of a couple steps of UploadWizard for things like license
> selection and filling the ID field and description, so we have one
> consistent set of configuration for both web upload (using UploadWizard)
> and mobile uploads (using the app).
>
> The change waiting review in gerrit:
> https://gerrit.wikimedia.org/r/#/c/7832/
>
> If anybody's got a prime usage in mind for reading UploadWizard campaign
> data from the API and has recommendations for adjusting the output
> format (maybe for making the editing view more AJAX-y) please give a
> shout -- this is not final and we can adjust it.
>
>
> Currently it'll return XML like this:
>
> <?xml version="1.0"?>
> <api>
> <uploadcampaign>
> <campaigns>
> <campaign name="wlm-es" id="2" isenabled="0" autoCategories=""
> autoWikiText="" defaultAlt="" defaultCategories="" defaultDescription=""
> defaultLat="" defaultLon="" defaultOwnWorkLicence="cc-by-sa-3.0"
> headerLabelPage="sdfsdf" idField="sdfafsdfd" idFieldInitialValue=""
> idFieldLabel="" idFieldLabelPage="" idFieldMaxLength="25"
> licensesOwnWork="cc-by-sa-3.0|cc-by-3.0|cc-zero" ownWorkOption="choice"
> skipTutorial="" thanksLabelPage="" tutorialHelpdeskCoords="27, 1319, 691,
> 1384" tutorialTemplate="Licensing_tutorial_$1.svg" tutorialWidth="720" />
> </campaigns>
> </uploadcampaign>
> </api>
I don't think it should contain all campaign parameters as a single tag,
as parameters.
Specially evil is the licensesOwnWork="cc-by-sa-3.0|cc-by-3.0|cc-zero".
I'd move it to a format like:
<campaigns>
<campaign>
<id>wlm-es</id>
<name>wlm-es</name>
<licenses>
<ownwork default="cc-by-sa-3.0">
<license>cc-by-sa-3.0</license>
<license>cc-by-3.0</license>
<license>cc-zero</license>
</ownwork>
</licenses>
<fields>
<field>
<name>sdfafsdfd</name>
<initialValue/>
<label/>
<labelPage/>
<maxLength>25</maxLength>
</fields>
<tutorial skip="0">
<template placeholder="$1">Licensing_tutorial_$1.svg</template>
<width>720</width>
<helpdeskCoords x0="27" x1="1319" y1="691" y2="1384" />
</tutorial>
</campaigns>
Not necessariliy like that, some options could get collapsed into
attributes. But not with everything as attributes.
_______________________________________________
Mediawiki-api mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-api