You are viewing a plain text version of this content. The canonical link for it is here.
Posted to batik-users@xmlgraphics.apache.org by Dylan Browne <db...@mango-solutions.com> on 2007/07/23 16:12:53 UTC

Capturing Client Side DOM changes

Hi,

I've encountered a problem with exporting an SVG document to JPG after
it has been modified by the client.

In the client browser the user is able to drag and drop elements within
the SVG document, which is generated via Batik. The JS interaction is
provided in a JS file, and the events registered using something like:

g.setAttribute("onmouseover", "doonmouseover(evt)");

If the document is exported using the Transcoder API after client side
modifications, the export does not include these modifications, and
shows the components in their original locations.

Is there any way to inform the server side of the client side
modifications to the DOM.

Thanks very much in advance for any tips,

Dylan
		

---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: Capturing Client Side DOM changes

Posted by Dylan Browne <db...@mango-solutions.com>.
Good to hear that, as that is the road I have started down, hoped it was
the correct method.

Will post back with any useful snippets for future reference.

Thanks as ever,
Dylan


-----Original Message-----
From: thomas.deweese@kodak.com [mailto:thomas.deweese@kodak.com] 
Sent: 25 July 2007 15:14
To: batik-users@xmlgraphics.apache.org
Cc: batik-users@xmlgraphics.apache.org
Subject: Re: Capturing Client Side DOM changes

Hi Dylan,

"Dylan Browne" <db...@mango-solutions.com> wrote on 07/23/2007
10:12:53 
AM:

> In the client browser the user is able to drag and drop elements
within
> the SVG document, which is generated via Batik. 
 
  [...]

> Is there any way to inform the server side of the client side
> modifications to the DOM.

   The simplest way is to simply serialize the DOM on the client
(printNode, DOMUtilities.writeNode) and use 'postURL'/XmlHttpRequest(?)
(JS functions) to send it back to the server.  I don't know what client 
you are using (Batik, ASV, Opera, FF), so I can't provide real details 
but that should get you started.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


RE: Capturing Client Side DOM changes

Posted by Dylan Browne <db...@mango-solutions.com>.
Hi,

A bit of extra advice gratefully received....

I've got my DOM serialized and posted back to the server, I'm now trying
to update my initial SVG doc with the new DOM (or create a new doc)..

So my initial SVGDocument is something like....

<?xml-stylesheet type="text/css" href="http://blah/blah.css"?>
<?xml-stylesheet type="text/css" href="http://blah/blah.css"?>
<svg contentScriptType="text/ecmascript.... etc etc>
<old stuff />
</svg>

And my new Node to overwrite the previous is...

<svg contentScriptType="text/ecmascript.... etc etc>
<new stuff />
</svg>

And I thought I could call something like..

doc.replaceChild(oldDocNode, newDocNode);
or
doc.importNode(newNode, true);

But I'm getting various errors with the various combinations of
parameters/methods I'm trying. I guess what I am trying to do is very
simple, and I can't see the wood for the trees...

Any tips greatly appreciated,

Dylan.
		



---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org


Re: Capturing Client Side DOM changes

Posted by th...@kodak.com.
Hi Dylan,

"Dylan Browne" <db...@mango-solutions.com> wrote on 07/23/2007 10:12:53 
AM:

> In the client browser the user is able to drag and drop elements within
> the SVG document, which is generated via Batik. 
 
  [...]

> Is there any way to inform the server side of the client side
> modifications to the DOM.

   The simplest way is to simply serialize the DOM on the client
(printNode, DOMUtilities.writeNode) and use 'postURL'/XmlHttpRequest(?)
(JS functions) to send it back to the server.  I don't know what client 
you are using (Batik, ASV, Opera, FF), so I can't provide real details 
but that should get you started.


---------------------------------------------------------------------
To unsubscribe, e-mail: batik-users-unsubscribe@xmlgraphics.apache.org
For additional commands, e-mail: batik-users-help@xmlgraphics.apache.org