File Upload Button redux

10 views
Skip to first unread message

Mike Fellows

unread,
May 19, 2010, 11:02:23 PM5/19/10
to Cappuccino & Objective-J Development List
Hi,

I know I've gone on about this on the other mailing list, but I
thought I would just throw it out there that it might be more
convenient if the File Upload Button code was added to Cappuccino
itself:

http://github.com/MCF/FileUpload

You'd have to rename the class (CPFileUploadButton ?), but other than
that the code could just be dropped in - assuming the changes I made
to bring it up to date with the latest Cappuccino were acceptable.

I've added multiple file upload capabilities as well on the master
branch. This does change the API a bit, now the "selection" returns a
CPArray of file names instead of a CPString with the single file name.

I'd be interested in hearing others' opinions on including or not
including the code in Cappuccino. From my point of view there seems
little point in maintaining it outside the project.

Regards,
Mike

--
You received this message because you are subscribed to the Google Groups "Cappuccino & Objective-J Development List" group.
To post to this group, send email to objecti...@googlegroups.com.
To unsubscribe from this group, send email to objectivej-de...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/objectivej-dev?hl=en.

Hammer

unread,
May 19, 2010, 11:11:02 PM5/19/10
to Cappuccino & Objective-J Development List
I can't say for the integration of FileUpload into Cappuccino, but
optionally you could create a Framework that would be easily
integrated
into Cappuccino. You can look at LPKit or CKKit for examples of that.

Mike Fellows

unread,
May 20, 2010, 1:03:14 AM5/20/10
to Cappuccino & Objective-J Development List
As it now stands my little contribution on github is more or less the
same structure as LPKit or CKKit. A small stand alone add on to
Cappuccino. In my mind it's more a question of how hard does
Cappuccino want to make it to develop apps. I would imagine file
upload is a fairly common control needed. Of course it could be left
as is, people would then have to collect whatever additional controls/
code they need from around github. But it seems needlessly
complicated. Although i would imagine dropping additional controls in
might make the whole Atlas, nib and cib thing more complicated?
Particularly if they deviate from Cocoa conventions?

Regards,
Mike

On May 19, 8:11 pm, Hammer <derek.r.ham...@gmail.com> wrote:
> I can't say for the integration of FileUpload into Cappuccino, but
> optionally you could create a Framework that would be easily
> integrated
> into Cappuccino. You can look at LPKit or CKKit for examples of that.

Ross Boucher

unread,
May 28, 2010, 2:11:45 PM5/28/10
to objecti...@googlegroups.com
So, to expand a bit on my earlier comment about this not being in the mainline, the problem I see is mostly this:

There's no real concept of a "form" in Cappuccino, and I think we should think about that whenever we decide to move this into the project.

In Cocoa there's a sort of form layout thingy which is basically just a matrix. I'm not sure whether or not we need something like that, though I can see the utility of it (esp. if its generic enough to just create forms based on object introspection, a feature common now in things like rails).

But I'm talking more about making the process of sending "forms" and getting responses. In the HTML world forms have evolved to make certain things pretty easy. Constructing the request to send in Cappuccino right now is a bit of a pain in the ass. It would be nice to have some abstraction which tied into various CPControls and automatically constructed the request in the right form (form-encoded, json, whatever).

We'd want support at the CPControl level I think, and it would probably be in the form of something like a formName property. Anyone have any thoughts on this?

-Ross

Mike Fellows

unread,
Jun 7, 2010, 12:27:43 PM6/7/10
to Cappuccino & Objective-J Development List

There is no question that the file upload code is a little rough
around the edges. Perhaps it could be expanded into something more
like a particular Cocoa feature or control. But I really believe that
this is a separate issue to whether or not it is included with
Cappuccino somehow. If you want to do file upload through Cappuccino
you either have to build your own or use the latest update of
FileUpload.j (AFAIK). It works right now and it just seems needlessly
inconvenient to have people collecting controls across github to build
a working Cappuccino app.

What is the concern with having useful controls collected together in
the main Cappuccino build right now? If the concern is that they will
be deprecated in the future perhaps they could live in a new area in
the file structure to advertise that face (maybe an "Extras"
directory). I just don't see what kind of problems it would cause
particularly for these kinds of useful but non-core controls.

Regards,
Mike

Ross Boucher

unread,
Jun 12, 2010, 1:37:48 PM6/12/10
to objecti...@googlegroups.com
Ultimately, what it boils down to, is that we'd like to come up with a good abstraction for submitting forms in general. This is obviously something super easy to do in raw HTML and its not very easy to do in Cappuccino.

The required features are automatically wrapping up the values and submitting the appropriate server request, which probably means adding some sort of form_name property to CPControl, but I'm open to other suggestions. Once we have that, it will be easy to merge in this file upload feature the right way.

Automatic layout for forms is something that *might* be nice to have, but it could also be much more trouble than its worth, especially in a world where everyone is using visual design tools. Still, for things like automatic form generation based on object properties (ala CoreData, though that works only at design time not runtime) it could be useful.

Reply all
Reply to author
Forward
0 new messages