I believe Peter is correct - I think this is not documented because in
part this is not encouraged. The core team tries very hard to maintain
backward compatibility for tool wrappers - I don't think tools that do
uploads like this however will receive the same consideration (though
that is just my own opinion - I don't speak for the team at large).
Certainly you can implement custom upload tools - I have seen other
people do it and Jorrit and I did it for the work that eventually
landed up in galaxy-extras (e.g.
https://bitbucket.org/jmchilton/galaxy-extras/src/be4dd61311a9c08c4e1cb6e85409c155a5abe1cb/tools/data_source/multi_upload.xml?at=extras).

If you want to do it - I would just start by copying over upload.xml
and upload.py in tools/data_source and start modifying them to do what
you want. The code backing up the underlying tag can be found
scattered around the code base but some of the key files can be
summarized as:

upload.py and upload.xml in the data_source file define the user
interface and the command-line tool that actually performs the upload.

Various infrastructure that aids this includes:

A custom tool action (that I believe calls upload.py in data_source)
https://bitbucket.org/galaxy/galaxy-central/src/d2300bcd600861bd4b2e5b5ec2d0e0303f7da1f0/lib/galaxy/tools/actions/upload.py?at=default
A custom widget in the form builder code:
https://bitbucket.org/galaxy/galaxy-central/src/d2300bcd600861bd4b2e5b5ec2d0e0303f7da1f0/lib/galaxy/web/form_builder.py?at=default#cl-140
A special abstract tool parameter:
https://bitbucket.org/galaxy/galaxy-central/src/d2300bcd600861bd4b2e5b5ec2d0e0303f7da1f0/lib/galaxy/tools/parameters/grouping.py?at=default#cl-120

Here is one of the key commits of galaxy-extras that enabled multiple
upload widgets - hopefully it gives some indication of how the pieces
can fit together.
https://bitbucket.org/jmchilton/galaxy-extras/commits/e7f99b748e07fb2738cf5e91189111431e2e17dc

Hope this helps.
-John


On Thu, May 15, 2014 at 11:04 AM, Peter Cock <p.j.a.c...@googlemail.com> wrote:
> Hi Robert,
>
> I'm not sure that is a good idea - the existing upload tool gets
> special treatment in many places in Galaxy (e.g. turning a history
> into a workflow), and is itself being partly replaced with the newer
> Galaxy work (there's a little icon above the tool panel to import
> data).
>
> Peter
>
> P.S. Don't forget to CC the galaxy-dev list.
>
> On Thu, May 15, 2014 at 4:59 PM,  <de...@gmx.de> wrote:
>> Hi Peter,
>>
>> thanks for your reply. I think there is a little misunderstanding: I want to
>> implement the upload tool itself.
>> I have code from someone else who has used the upload_dataset tag (I cannot
>> just use his code because I want to modify something - but when I try to
>> re-implement everything myself I need documentation). And my problem is that
>> I do not find any documentation for this tag.
>>
>> Regards,
>> Robert
>>
>> Gesendet: Freitag, 09. Mai 2014 um 16:21 Uhr
>> Von: "Peter Cock" <p.j.a.c...@googlemail.com>
>> An: de...@gmx.de
>> Cc: "galaxy-dev@lists.bx.psu.edu" <galaxy-dev@lists.bx.psu.edu>
>> Betreff: Re: [galaxy-dev] Upload a file
>> On Fri, May 9, 2014 at 12:46 PM, <de...@gmx.de> wrote:
>>> Hi,
>>>
>>> I am a student who's trying to implement a simple galaxy tool. I am trying
>>> to provide the user with the option of uploading a file. I have copied
>>> code
>>> from another tool ...
>>
>> The upload tool is special (and separate). Normally the user must
>> separately upload their file(s) or import them from a shared library
>> BEFORE trying to use any of the analysis tools.
>>
>> Peter
> ___________________________________________________________
> Please keep all replies on the list by using "reply all"
> in your mail client.  To manage your subscriptions to this
> and other Galaxy lists, please use the interface at:
>   http://lists.bx.psu.edu/
>
> To search Galaxy mailing lists use the unified search at:
>   http://galaxyproject.org/search/mailinglists/
___________________________________________________________
Please keep all replies on the list by using "reply all"
in your mail client.  To manage your subscriptions to this
and other Galaxy lists, please use the interface at:
  http://lists.bx.psu.edu/

To search Galaxy mailing lists use the unified search at:
  http://galaxyproject.org/search/mailinglists/

Reply via email to