[Kss-devel] plone.app.kss sprint after the Plone Conference in Naples (13-14-15 October)

Balazs Ree ree at ree.hu
Thu Sep 13 13:07:49 CEST 2007


Hi Massimo,

On Thu, 13 Sep 2007 12:07:53 +0200 Massimo Azzolini wrote:

> On 9/12/07 Balazs Ree <ree at ree.hu> wrote:
>> The sprint track will be lead by Balazs Ree and Jeroen Vloothuis, and
>> will be targeted at AJAX functionality for Plone 3.5: the development
>> of the plone.app.kss and archetypes.kss products, and custom kss
>> plugins.
> 
> in the last month a student (nicola senno) spent his stage in our
> company. we projected an "add-on" for plone3 and kss using DnD (drag and
> drop, not dungeons and dragons :).
> 
> the project implements this functionality: since you can define (using
> kss) that some objects are draggable and others are droppable, we
> started defining that everything in the content area and in the
> navigation portlet is draggable and vice versa (they are also
> droppable).
> 
> when you drag an obj A to another obj B, a div appears near the dropping
> point, asking if you want to copy, move or cancel operation (obviously
> you can copy or move depending on your access to both objects and if
> objA can be moved/copied into B). The behaviour is the same as in ms
> explorer or in konqueror..
> 
> after that the system completes the operation refreshing the parts of
> the plone interface that are involved in the operation.
> 
> we planned to define which kind of div/actions we have to draw/implement
> depending on the area you are dropping. I try to explain it better: if I
> drag a page on a folder (inside the navigator) the action is obviously
> "I want to move/copy the page in that folder", but if I drag a an event
> to "march 19, 2007"  on the calendar portlet, which is my goal?
> It could be: " I want to change the start/end date of the event" so the
> div should ask me to choose between if I wanna change the start or end
> date.
> In the same way we can write a shopping-cart-portlet and add item to
> it..
> 
> So we (nicola..) are trying to coding it using adapters which adapts a
> "INavigator"/"ICalendar"/"IMyPortlet" to a obj that draws the div and
> implements the underlying rules.
> 
> we had some problem with the dnd implementation (as balatz said, there
> were problems..) but we  relied on the fact that you surely fix it in
> the future..
> 
> If you may be interested in, we could extend/complete it during the
> sprint.
>
> see you in naples

 As I understand you want to make all (all lots of) elements generally 
draggable, others generally droppable, and build a generic drag-and-drop 
framework on the server side.

I must mention that in our dnd experiments (which is on a currently 
unpublished branch, to be ported to kss.core 1.4 before or at the 
beginning of the sprint), we do not use such a server side mechanism, and 
we make the dnd mechanism work in the following simple way:

1. bind the draggables and droppables from kss, using css selection.
   Binding of draggables and droppables happens grouped: "These goodies 
   can be dropped into these baskets", or "these portlets can be 
   reordered in place". IE, portlets cannot be dropped to baskets and the
   client side is aware of this.
2. the server side is really simple, a single view that gets invoked on 
   drop. All it needs to do is store the change in the content, or
   raise an exception if something went wrong.
3. if you want error handling, the client needs an error handler to 
   revert the drop if the response comes with error.

For a generic application (like shopping cart, or portlets rearrangement) 
when the draggables and droppables are all controlled by the same 
component, there is no need to have more server side logic than this.

But if we want to support that a draggable defined by application 
component X (draggable page) can be dropped to a droppable defined by 
application component Y (nav portlet droppable), then such a construct 
may make sense. But still I think that the logic "what can be dropped to 
where" should be controlled by the kss resource and not on the server 
side zcml. And that we can even keep it in kss in these cases, because 
the css selection is so flexible.

So I would like to ask two things from you:

- you should state the exact usecase you are trying to support. Settle on 
the simplest goal you can think of.

- I would also be interested in seeing the code, where is it available?

Best wishes

-- 
Balazs Ree



More information about the Kss-devel mailing list