You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@cocoon.apache.org by Luca Morandini <lu...@tin.it> on 2005/05/23 14:19:15 UTC

Server-side image map in CForms ?

Folks,

I need a server-side image map with Cocoon Forms. AFAIK there's no such 
a widget in Cocoon 2.1.7... hence, my question: is there someone already 
working on it or should I start from scratch ?

Regards,

P.S.
I will contribute the results of my efforts... provided they're good 
enough, of course.

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Server-side image map in CForms ?

Posted by Reinhard Poetz <re...@apache.org>.
Luca Morandini wrote:
> Folks,
> 
> I need a server-side image map with Cocoon Forms. AFAIK there's no such 
> a widget in Cocoon 2.1.7... hence, my question: is there someone already 
> working on it

not that I know of

> or should I start from scratch ?
> Regards,
> 
> P.S.
> I will contribute the results of my efforts... provided they're good 
> enough, of course.

Fine!

-- 
Reinhard Pötz           Independent Consultant, Trainer & (IT)-Coach 

{Software Engineering, Open Source, Web Applications, Apache Cocoon}

                                        web(log): http://www.poetz.cc
--------------------------------------------------------------------


Re: [OT] Re: Server-side image map in CForms ?

Posted by Luca Morandini <lu...@tin.it>.
Jorg Heymans wrote:

> Luca Morandini wrote:
> 
>>Don't get me wrong, I like SVG, but forcing user to install a plug-in
>>would be an unpopular option.
> 
> With Firefox nightlies having native SVG support, this option is not so
> unpopular anymore as it was say a few months ago.

Yes, I know :)  ... but IE still lacks it :(

Well, rumors had that IE7 will sport native SVG support... but 'til that 
day I won't sacrifice 80% or so of my prospective users for SVG (on an 
Intranet it may be different though).

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


[OT] Re: Server-side image map in CForms ?

Posted by Jorg Heymans <jh...@domek.be>.
Luca Morandini wrote:

> Don't get me wrong, I like SVG, but forcing user to install a plug-in
> would be an unpopular option.

With Firefox nightlies having native SVG support, this option is not so
unpopular anymore as it was say a few months ago.


Jorg


Re: Server-side image map in CForms ?

Posted by Luca Morandini <lu...@tin.it>.
oceatoon wrote:
> 
> I am not at all from the GIS , and project Geoid seems to be just that, If
> I'm not mistaken it allows to plug into existing ArcIMS and others with
> Cocoon. I'm really looking to find a Map system I can integrate directly
> into my(and others) project. I really think a simple Mapping system has
> it's place within many websites especially connected with a data generation
> system like cocoon which seems to be the main idea behind GEOID, I will
> need to have an appropriate Graphic Map to associate to my connector, is
> there such a module?

Well, let me clarify that geographic data are inherently big, you would 
most probably need a map-server to produce them for client consumption.

Think of DBMSs: you need one but for the most trivial tabular data... 
for geographic data it's the same: you need a map-server (MapServer, 
GeoServer, ArcIMS, etc.) but for the most trivial geographic data.


> If nothing really exist I will be glad to start a vulgarised Map solution
> within Geoid. 
> MapBuilder is quite a good solution, but 100% JS which I like but people
> don't allways have.
> do you know any other ones by any chance ?

IIUC, you're thinking of a map client, aren't you ?

At the moment I'm working on a generalized map client based on Cocoon, 
with three levels of functionality:
1) Base (most accessible, even for impaired people): server-side image 
maps with no JavaScript and no frames on the client.
2) Intermediate: server-side images with client-side JavaScript and frames.
3) Advanced: SVG.

I've started by building some JavaScript classes (they can be used both 
on the client or on the server) and some CForms widgets... don't know 
wether my effort will go into Geoid though.

BTW, MapBuilder works great, but you need WMS servers to make it work, 
don't forget it.


>>If what you have to do is just position points, use DIVs live happy
>>after that :)
> 
> well yes that could a solution but quite limited.
> It would be good to go on adding functionalities once the mapping system is
> done, and div solutions will probably be blocking after that.

Most web-based GIS apps don't need SVG: just some background data and 
clickable points (when clicked some data are shown) will do for most 
applications.

Sure, SVG adds local pan/zoom and a lot of nice graphic effects, but 
carefully consider the potential problems with plugins before going for it.


>>Don't get me wrong, I like SVG, but forcing user to install a plug-in
>>would be an unpopular option.
> 
> The idea would be to have clickable jpegs generated from svg and later when
> fully supported directly svg. Do you think GML is something to look into or
> is it a huge load and not necessary ? could it make my development easier ?

Wait, there are map-servers that already generate SVG for you (i.e. 
MapViewer for Oracle) and established standard (SLD) for styling GML... 
don't re-invent the wheel ;)

BTW, the SVG to JPEG rendering is pretty slow.

Regards,

P.S.
Would you please start a thread on the Geoid list ? I think that would 
be the best place for talking about such issues.

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Server-side image map in CForms ?

Posted by oceatoon <t....@systheo.com>.
> Sure we can. 
Great.
> Shall I remember you our little Geoid project ( 
> http://geoid.cocoondev.org/ ) ?
I am not at all from the GIS , and project Geoid seems to be just that, If
I'm not mistaken it allows to plug into existing ArcIMS and others with
Cocoon. I'm really looking to find a Map system I can integrate directly
into my(and others) project. I really think a simple Mapping system has
it's place within many websites especially connected with a data generation
system like cocoon which seems to be the main idea behind GEOID, I will
need to have an appropriate Graphic Map to associate to my connector, is
there such a module?
If nothing really exist I will be glad to start a vulgarised Map solution
within Geoid. 
MapBuilder is quite a good solution, but 100% JS which I like but people
don't allways have.
do you know any other ones by any chance ?

> 
>> I was thinking of doing this in SVG having dynamic positionning
>> functionalities and easy graphic separation, and offcourse have points
>> url-clickable on the map.
> 
> If what you have to do is just position points, use DIVs live happy
> after that :)
well yes that could a solution but quite limited.
It would be good to go on adding functionalities once the mapping system is
done, and div solutions will probably be blocking after that.
> 
> Don't get me wrong, I like SVG, but forcing user to install a plug-in
> would be an unpopular option.
The idea would be to have clickable jpegs generated from svg and later when
fully supported directly svg. Do you think GML is something to look into or
is it a huge load and not necessary ? could it make my development easier ?

Regards
Tibor



Re: Server-side image map in CForms ?

Posted by Luca Morandini <lu...@tin.it>.
oceatoon wrote:

>  We are having an intern work on this from tuesday so I'm setting up the
> guidelines, maybe we can cooperate on this? 

Sure we can. Shall I remember you our little Geoid project ( 
http://geoid.cocoondev.org/ ) ?


> I was thinking of doing this in SVG having dynamic positionning
> functionalities and easy graphic separation, and offcourse have points
> url-clickable on the map.

If what you have to do is just position points, use DIVs live happy 
after that :)

Don't get me wrong, I like SVG, but forcing user to install a plug-in 
would be an unpopular option.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Server-side image map in CForms ?

Posted by oceatoon <t....@systheo.com>.
> The map-viewing platform I envisage will be very simple and work even
> with very big fonts and buttons, and it should do this without
> JavaScript, frames and mouse (I mean, mouse is considered an optional,
> useful, but not necessary).

Very interesting, 
Maps are largely laking around internet and we are looking into creating an
easy map positionning system for generic websites and offcourse our own.
Cocoon has the ability to support such an extensive solution, with Simple
XML2Map functionalities using SVG.
 We are having an intern work on this from tuesday so I'm setting up the
guidelines, maybe we can cooperate on this? we need such a map because to
simply position elements on a european map, connect them to url's, and have
styling capabilites.

I was thinking of doing this in SVG having dynamic positionning
functionalities and easy graphic separation, and offcourse have points
url-clickable on the map.
This community is perfect proof that doing things as a group produce more
efficient and active solutions, So Should we try something out? and how to
procede ?

Regards
Tibor 




Re: Server-side image map in CForms ?

Posted by Luca Morandini <lu...@tin.it>.
Sylvain Wallez wrote:

> Luca Morandini wrote:
> 
>> Jorg Heymans wrote:
> 
> Hmm... can't multi-channelling techniques apply here also? e.g. if the 
> browser is a voice browser for visually impaired, use a special 
> dedicated stylesheet.

Ahem... have you ever tried to describe a geographic map using VoiceXML ;) ?

Seriosuly now, I'll heavily use the multi-channel capability of Cocoon 
for textual pages... but maps are different.

For maps I'm not (obviously) targeting blind people, rather, I'm 
targeting people with *some*  coordination problems and *some* sighting 
problems, like the old folks (hmm... I'm pushing 40 this year, I should 
be careful with this "old" label).

Yes, according to an Eurostat estimate (see [1]) some 17% of people over 
55 are Internet users, and their numbers will steadily increase: making 
maps easily accessibile to them is a sensible move, marketing-wise.

The map-viewing platform I envisage will be very simple and work even 
with very big fonts and buttons, and it should do this without 
JavaScript, frames and mouse (I mean, mouse is considered an optional, 
useful, but not necessary).

Regards,

[1] 
http://epp.eurostat.cec.eu.int/cache/ITY_OFFPUB/KS-NP-05-018/EN/KS-NP-05-018-EN.PDF


--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Server-side image map in CForms ?

Posted by Sylvain Wallez <sy...@apache.org>.
Luca Morandini wrote:

> Jorg Heymans wrote:
>
>> I have been doing waaay too much GIS stuff ... I saw something about
>> "map" and straight away thought you meant geo-map :-)
>
>
> Well, sort of... I need this widget for GIS stuff.
>
> A recent law in Italy forces web-sites belonging to state agencies 
> (ministries, local government offices, state-owned companies, etc.), 
> to allow impaired people accessing their contents.
>
> The guidelines are very strict (not to say narrow-minded): no 
> JavaScript, no frames, only strict-XHTML, etc.


Hmm... can't multi-channelling techniques apply here also? e.g. if the 
browser is a voice browser for visually impaired, use a special 
dedicated stylesheet.

> Hence, I'd like to meet this challenge with our beloved Cocoon (and 
> learn something about CForms along the way). Anyway, this stuff won't 
> fit well into Geoid, since server-side images may be useful for other 
> application domains as well.


Definitely!

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: Server-side image map in CForms ?

Posted by Luca Morandini <lu...@tin.it>.
Jorg Heymans wrote:

> I have been doing waaay too much GIS stuff ... I saw something about
> "map" and straight away thought you meant geo-map :-)

Well, sort of... I need this widget for GIS stuff.

A recent law in Italy forces web-sites belonging to state agencies 
(ministries, local government offices, state-owned companies, etc.), to 
allow impaired people accessing their contents.

The guidelines are very strict (not to say narrow-minded): no 
JavaScript, no frames, only strict-XHTML, etc.

Hence, I'd like to meet this challenge with our beloved Cocoon (and 
learn something about CForms along the way). Anyway, this stuff won't 
fit well into Geoid, since server-side images may be useful for other 
application domains as well.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


[OT] Re: Server-side image map in CForms ?

Posted by Jorg Heymans <jh...@domek.be>.
oceatoon wrote:
>  
> 
>>I have been doing waaay too much GIS stuff ... I saw something about
>>"map" and straight away thought you meant geo-map :-)
> 
> What is geo-map ? is this a current project ?
> I'm looking for simple (dynamic clickable points on map, with possibility to
> play on the gfx styling) GIS systems, are there any Cocoon based solutions? 

With geo-map i meant a "map" that simply displays and relates data in a
geographical way (think map24.com, googlemaps etc). I don't know if
there are any cocoon based OS solutions, the one i'm working on is
cocoon based but not OS.

Try http://opensourcegis.org .


Regards
Jorg


Re: Server-side image map in CForms ?

Posted by oceatoon <t....@systheo.com>.
 
> 
> I have been doing waaay too much GIS stuff ... I saw something about
> "map" and straight away thought you meant geo-map :-)
What is geo-map ? is this a current project ?
I'm looking for simple (dynamic clickable points on map, with possibility to
play on the gfx styling) GIS systems, are there any Cocoon based solutions? 

Regards
Tibor



Re: Server-side image map in CForms ?

Posted by Jorg Heymans <jh...@domek.be>.
Luca Morandini wrote:
> Jorg Heymans wrote:
> 
>> What is your server-side image map supposed to do ?
> 
> 
> Very simple stuff:
> 1) An user clicks on the image.
> 2) The form is sent to the server together with mouse coordinates.
> 3) The relevant action is called (mouse coordinates should be sent to
> the action somehow).
> 
> Hmm... I think this image-map widget should be a kind of action widget,
> since the form is sent to the server when widget is clicked upon.
> 

I have been doing waaay too much GIS stuff ... I saw something about
"map" and straight away thought you meant geo-map :-)

I can't comment much on your image map idea though, it seems like a
useful addition so just go for it !


Jorg


Re: Server-side image map in CForms ?

Posted by Sylvain Wallez <sy...@apache.org>.
Luca Morandini wrote:

> Sylvain Wallez wrote:
>
>> Luca Morandini wrote:
>>
>>> morever, setting the image source from a action-handler flow script 
>>> would be more elegant.
>>
>>
>> That's exactly what the ${image_name} is, e.g.:
>>  form.showForm("my-form-pipeline", {image_name : "map-" + areaId});
>
>
> Sure, you set the value and pass that parameter from within flow, but 
> to understand its use you should take a look at the form template as 
> well... while the setValue() is completely understandable from the 
> flow code.
>
> I mean, nothing really substantial here... only I'd like it to be done 
> in more straightforward way: suppose there's a developer willing to 
> add a dynamic image using CForms, which way he would find easier to 
> understand ?


You may be right. I don't want to refrain you from writing a special 
widget, but just want to outline the possible options we have today! Now 
if you feel the itch, just scratch it ;-)

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: Server-side image map in CForms ?

Posted by Luca Morandini <lu...@tin.it>.
Sylvain Wallez wrote:

> Luca Morandini wrote:
> 
>> morever, setting the image source from a action-handler flow script 
>> would be more elegant.
> 
> That's exactly what the ${image_name} is, e.g.:
>  form.showForm("my-form-pipeline", {image_name : "map-" + areaId});

Sure, you set the value and pass that parameter from within flow, but to 
understand its use you should take a look at the form template as 
well... while the setValue() is completely understandable from the flow 
code.

I mean, nothing really substantial here... only I'd like it to be done 
in more straightforward way: suppose there's a developer willing to add 
a dynamic image using CForms, which way he would find easier to understand ?

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Server-side image map in CForms ?

Posted by Sylvain Wallez <sy...@apache.org>.
Luca Morandini wrote:

> Sylvain Wallez wrote:
>
>> Luca Morandini wrote:
>>
>>> Well, but I should be able to change the image's src attribute 
>>> dynamically, wich is not allowed in action widget... right ?
>>
>>
>> Yes you can, as the image src is in the form template. Of course you 
>> have to use a dynamic template (e.g. JXTG):
>>  <ft:action id="map">
>>    <fi:styling type="image" src="images/${image_name}.jpg"/>
>>  </ft:action>
>
>
> Sure, but I'd rather avoid using dynamic templates for otherwise 
> static forms...


I see. However, I'm not sure that executing a template composed of 
near-static compiled SAX events is that much slower than a regular XML 
parser.

There's also the solution of a custom cforms styling stylesheet that 
could set this src attribute from a sitemap parameter.

> morever, setting the image source from a action-handler flow script 
> would be more elegant.


That's exactly what the ${image_name} is, e.g.:
  form.showForm("my-form-pipeline", {image_name : "map-" + areaId});

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: Server-side image map in CForms ?

Posted by Luca Morandini <lu...@tin.it>.
Sylvain Wallez wrote:

> Luca Morandini wrote:
>> Well, but I should be able to change the image's src attribute 
>> dynamically, wich is not allowed in action widget... right ?
> 
> Yes you can, as the image src is in the form template. Of course you 
> have to use a dynamic template (e.g. JXTG):
>  <ft:action id="map">
>    <fi:styling type="image" src="images/${image_name}.jpg"/>
>  </ft:action>

Sure, but I'd rather avoid using dynamic templates for otherwise static 
forms... morever, setting the image source from a action-handler flow 
script would be more elegant.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Server-side image map in CForms ?

Posted by Sylvain Wallez <sy...@apache.org>.
Luca Morandini wrote:

> Sylvain Wallez wrote:
>
>> Luca Morandini wrote:
>>
>>> Hmm... I think this image-map widget should be a kind of action 
>>> widget, since the form is sent to the server when widget is clicked 
>>> upon.
>>
>>
>> You already have it :-)
>>
>> Use an action with <styling type="image">. When the image is clicked, 
>> the action's event listeners are triggered, and you can read the 
>> click coordinates using the {action-name}.x and {action-name}.y 
>> request parameters.
>
>
> Well, but I should be able to change the image's src attribute 
> dynamically, wich is not allowed in action widget... right ?


Yes you can, as the image src is in the form template. Of course you 
have to use a dynamic template (e.g. JXTG):
  <ft:action id="map">
    <fi:styling type="image" src="images/${image_name}.jpg"/>
  </ft:action>

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: Server-side image map in CForms ?

Posted by Luca Morandini <lu...@tin.it>.
Sylvain Wallez wrote:
> Luca Morandini wrote:
>
>> Hmm... I think this image-map widget should be a kind of action 
>> widget, since the form is sent to the server when widget is clicked upon.
> 
> You already have it :-)
> 
> Use an action with <styling type="image">. When the image is clicked, 
> the action's event listeners are triggered, and you can read the click 
> coordinates using the {action-name}.x and {action-name}.y request 
> parameters.

Well, but I should be able to change the image's src attribute 
dynamically, wich is not allowed in action widget... right ?

That is possible (via the setValue method) in output widgets, but you 
can't trigger an action with this kind of widget... or did I miss 
something ?

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Server-side image map in CForms ?

Posted by Sylvain Wallez <sy...@apache.org>.
Luca Morandini wrote:

> Jorg Heymans wrote:
>
>> What is your server-side image map supposed to do ?
>
>
> Very simple stuff:
> 1) An user clicks on the image.
> 2) The form is sent to the server together with mouse coordinates.
> 3) The relevant action is called (mouse coordinates should be sent to 
> the action somehow).
>
> Hmm... I think this image-map widget should be a kind of action 
> widget, since the form is sent to the server when widget is clicked upon.


You already have it :-)

Use an action with <styling type="image">. When the image is clicked, 
the action's event listeners are triggered, and you can read the click 
coordinates using the {action-name}.x and {action-name}.y request 
parameters.

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director


Re: Server-side image map in CForms ?

Posted by Luca Morandini <lu...@tin.it>.
Jorg Heymans wrote:

> What is your server-side image map supposed to do ?

Very simple stuff:
1) An user clicks on the image.
2) The form is sent to the server together with mouse coordinates.
3) The relevant action is called (mouse coordinates should be sent to 
the action somehow).

Hmm... I think this image-map widget should be a kind of action widget, 
since the form is sent to the server when widget is clicked upon.

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Server-side image map in CForms ?

Posted by Jorg Heymans <jh...@domek.be>.
Hi Luca,

What is your server-side image map supposed to do ?

Thanks
Jorg

Luca Morandini wrote:
> Folks,
> 
> I need a server-side image map with Cocoon Forms. AFAIK there's no such
> a widget in Cocoon 2.1.7... hence, my question: is there someone already
> working on it or should I start from scratch ?
> 
> Regards,
> 
> P.S.
> I will contribute the results of my efforts... provided they're good
> enough, of course.
> 
> --------------------
>    Luca Morandini
> www.lucamorandini.it
> --------------------
> 
> 


Re: Server-side image map in CForms ?

Posted by Luca Morandini <lu...@tin.it>.
Sylvain Wallez wrote:

> Can you elaborate on "server-side image map"? Does this mean the areas 
> would be computed on the server?

Hmm... it surely makes sense, but I don't need this feature; hence, I'd 
rather pass only the relevant mouse coordinates to the event handler.

BTW, I guess an output field with "picture" styling type (I've already 
seen a post with some code) could be another nice addition to Forms... 
nothing to do with server-side images though, just an output field that 
happens to have a graphic content: your take ?

Regards,

--------------------
    Luca Morandini
www.lucamorandini.it
--------------------


Re: Server-side image map in CForms ?

Posted by Sylvain Wallez <sy...@apache.org>.
Luca Morandini wrote:

> Folks,
>
> I need a server-side image map with Cocoon Forms. AFAIK there's no 
> such a widget in Cocoon 2.1.7... hence, my question: is there someone 
> already working on it or should I start from scratch ?


Can you elaborate on "server-side image map"? Does this mean the areas 
would be computed on the server?

> I will contribute the results of my efforts... provided they're good 
> enough, of course.


Great!

Sylvain

-- 
Sylvain Wallez                        Anyware Technologies
http://apache.org/~sylvain            http://anyware-tech.com
Apache Software Foundation Member     Research & Technology Director