<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
		>
<channel>
	<title>Comments on: Chart Renderering using Web ADF</title>
	<atom:link href="http://gisprog.wordpress.com/2008/04/08/chart-renderering-using-web-adf/feed/" rel="self" type="application/rss+xml" />
	<link>http://gisprog.wordpress.com/2008/04/08/chart-renderering-using-web-adf/</link>
	<description></description>
	<lastBuildDate>Sat, 14 Nov 2009 18:17:51 +0000</lastBuildDate>
	<generator>http://wordpress.com/</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: iamlaksh1</title>
		<link>http://gisprog.wordpress.com/2008/04/08/chart-renderering-using-web-adf/#comment-190</link>
		<dc:creator>iamlaksh1</dc:creator>
		<pubDate>Wed, 16 Apr 2008 04:09:43 +0000</pubDate>
		<guid isPermaLink="false">http://gisprog.wordpress.com/?p=93#comment-190</guid>
		<description>Expanding TOC dynamically calls MapService, hence we default renderer is seen even after chart renderer is applied. This could be solved using workaround , by default you keep the TOC nodes expanded( you can use the expandLevel property - ContextAttributes). And remove the submit event from the rendererNode function in esri_toc.js file . Hope you agree with me</description>
		<content:encoded><![CDATA[<p>Expanding TOC dynamically calls MapService, hence we default renderer is seen even after chart renderer is applied. This could be solved using workaround , by default you keep the TOC nodes expanded( you can use the expandLevel property &#8211; ContextAttributes). And remove the submit event from the rendererNode function in esri_toc.js file . Hope you agree with me</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iamlaksh1</title>
		<link>http://gisprog.wordpress.com/2008/04/08/chart-renderering-using-web-adf/#comment-189</link>
		<dc:creator>iamlaksh1</dc:creator>
		<pubDate>Tue, 15 Apr 2008 08:44:13 +0000</pubDate>
		<guid isPermaLink="false">http://gisprog.wordpress.com/?p=93#comment-189</guid>
		<description>Thanks for your answers. Your idea is good. I&#039;ll try this one. Once again thanks for your time!</description>
		<content:encoded><![CDATA[<p>Thanks for your answers. Your idea is good. I&#8217;ll try this one. Once again thanks for your time!</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David García</title>
		<link>http://gisprog.wordpress.com/2008/04/08/chart-renderering-using-web-adf/#comment-185</link>
		<dc:creator>David García</dc:creator>
		<pubDate>Tue, 15 Apr 2008 08:39:29 +0000</pubDate>
		<guid isPermaLink="false">http://gisprog.wordpress.com/?p=93#comment-185</guid>
		<description>Hi,

Thanks to answer me. 

When I say that you will have to override all the defaults tasks and operations I meant that all the default tasks that gives you a map ( zoom in, zoom out, zoom to extent, etc..) will render this new image with the original render of the layer that we have changed for our session. 

If you make a class that extends com.esri.adf.web.tasks.MapToolsTask, reference it in the faces-config.xml flie, and overrides all the methods that have a ADFEvent (TaskEvent or MapEvent) as parameter, in these methods call the parent method (super.method(event);) and then replace the original render for ours, call the refresh method and then replace our render for the original. It will avoid that when we navigate in the map through a tool of the MapToolsTask the layer returns an image with the original render.

A better way to do this, is to use a class that extends of com.esri.adf.web.data.WebContext and overrides the refresh (Object object) method like this:

public class AGSExtendedWebContext extends WebContext
{
    protected IFeatureRenderer renderer;
    protected int layerId;


      public int getLayerId() {
          return layerId;
      }

      public void setLayerId(int layerId) {
          this.layerId = layerId;
      }

      public IFeatureRenderer getRenderer() {
          return renderer;
      }

      public void setRenderer(IFeatureRenderer renderer) {
          this.renderer = renderer;
      }

    public void refresh()
    {
        super.refresh();
    }

    public void refresh(Object object)
    {
        Map resources = this.getResources();
        AGSLocalMapResource agsResource = (AGSLocalMapResource)resources.get(&quot;ags0&quot;);
        IFeatureRenderer oldRenderer = null;
        if ( this.renderer != null)
        {
            try
            {
                oldRenderer = ((IGeoFeatureLayer)agsResource.getLocalMapServer().getLayer(agsResource.getMapName(),layerId)).getRenderer();
                ((IGeoFeatureLayer)agsResource.getLocalMapServer().getLayer(agsResource.getMapName(),layerId)).setRendererByRef(renderer);
            }
            catch(Exception ex)
            {
                ex.printStackTrace();
            }
        }        
        super.refresh(object);
        if ( this.renderer != null)
        {
            try
            {
                ((IGeoFeatureLayer)agsResource.getLocalMapServer().getLayer(agsResource.getMapName(),layerId)).setRendererByRef(oldRenderer);
            }
            catch(Exception ex)
            {
                ex.printStackTrace();
            }
        }

    }
}

Well, the only problem that I found now is the webTOC. when I click in the cross to deploy the layer render legend, it shows me the original render. I think that it makes a request to the Gis Server to do this. I will try to extend the webTOC to control this.

Thanks for your help, if I discover something I notice you.

Sorry for my english,

Regards,

David García</description>
		<content:encoded><![CDATA[<p>Hi,</p>
<p>Thanks to answer me. </p>
<p>When I say that you will have to override all the defaults tasks and operations I meant that all the default tasks that gives you a map ( zoom in, zoom out, zoom to extent, etc..) will render this new image with the original render of the layer that we have changed for our session. </p>
<p>If you make a class that extends com.esri.adf.web.tasks.MapToolsTask, reference it in the faces-config.xml flie, and overrides all the methods that have a ADFEvent (TaskEvent or MapEvent) as parameter, in these methods call the parent method (super.method(event);) and then replace the original render for ours, call the refresh method and then replace our render for the original. It will avoid that when we navigate in the map through a tool of the MapToolsTask the layer returns an image with the original render.</p>
<p>A better way to do this, is to use a class that extends of com.esri.adf.web.data.WebContext and overrides the refresh (Object object) method like this:</p>
<p>public class AGSExtendedWebContext extends WebContext<br />
{<br />
    protected IFeatureRenderer renderer;<br />
    protected int layerId;</p>
<p>      public int getLayerId() {<br />
          return layerId;<br />
      }</p>
<p>      public void setLayerId(int layerId) {<br />
          this.layerId = layerId;<br />
      }</p>
<p>      public IFeatureRenderer getRenderer() {<br />
          return renderer;<br />
      }</p>
<p>      public void setRenderer(IFeatureRenderer renderer) {<br />
          this.renderer = renderer;<br />
      }</p>
<p>    public void refresh()<br />
    {<br />
        super.refresh();<br />
    }</p>
<p>    public void refresh(Object object)<br />
    {<br />
        Map resources = this.getResources();<br />
        AGSLocalMapResource agsResource = (AGSLocalMapResource)resources.get(&#8220;ags0&#8243;);<br />
        IFeatureRenderer oldRenderer = null;<br />
        if ( this.renderer != null)<br />
        {<br />
            try<br />
            {<br />
                oldRenderer = ((IGeoFeatureLayer)agsResource.getLocalMapServer().getLayer(agsResource.getMapName(),layerId)).getRenderer();<br />
                ((IGeoFeatureLayer)agsResource.getLocalMapServer().getLayer(agsResource.getMapName(),layerId)).setRendererByRef(renderer);<br />
            }<br />
            catch(Exception ex)<br />
            {<br />
                ex.printStackTrace();<br />
            }<br />
        }<br />
        super.refresh(object);<br />
        if ( this.renderer != null)<br />
        {<br />
            try<br />
            {<br />
                ((IGeoFeatureLayer)agsResource.getLocalMapServer().getLayer(agsResource.getMapName(),layerId)).setRendererByRef(oldRenderer);<br />
            }<br />
            catch(Exception ex)<br />
            {<br />
                ex.printStackTrace();<br />
            }<br />
        }</p>
<p>    }<br />
}</p>
<p>Well, the only problem that I found now is the webTOC. when I click in the cross to deploy the layer render legend, it shows me the original render. I think that it makes a request to the Gis Server to do this. I will try to extend the webTOC to control this.</p>
<p>Thanks for your help, if I discover something I notice you.</p>
<p>Sorry for my english,</p>
<p>Regards,</p>
<p>David García</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: iamlaksh1</title>
		<link>http://gisprog.wordpress.com/2008/04/08/chart-renderering-using-web-adf/#comment-184</link>
		<dc:creator>iamlaksh1</dc:creator>
		<pubDate>Tue, 15 Apr 2008 04:12:03 +0000</pubDate>
		<guid isPermaLink="false">http://gisprog.wordpress.com/?p=93#comment-184</guid>
		<description>Dear David,
Can you elborate &quot;&lt;em&gt;so you will have to override all the defaults tasks and operation to change the render, refresh and restore the original render&lt;/em&gt;&quot; how to do this. You have to update webtoc and webover view and refresh the context.

//refresh the context because the Mapdescription has changed and we want to see the changes
			
			  WebToc newToc = new WebToc();
			  newToc.init(webContext);
			  webContext.setWebToc(newToc);
			  
			  WebOverview wOverview = new WebOverview(); 		  
			  wOverview.init(webContext);
			  webContext.setWebOverview(wOverview);		 
			 
			  webContext.refresh(wOverview);
			  webContext.refresh(newToc);
			  
			  webContext.refresh();</description>
		<content:encoded><![CDATA[<p>Dear David,<br />
Can you elborate &#8220;<em>so you will have to override all the defaults tasks and operation to change the render, refresh and restore the original render</em>&#8221; how to do this. You have to update webtoc and webover view and refresh the context.</p>
<p>//refresh the context because the Mapdescription has changed and we want to see the changes</p>
<p>			  WebToc newToc = new WebToc();<br />
			  newToc.init(webContext);<br />
			  webContext.setWebToc(newToc);</p>
<p>			  WebOverview wOverview = new WebOverview();<br />
			  wOverview.init(webContext);<br />
			  webContext.setWebOverview(wOverview);		 </p>
<p>			  webContext.refresh(wOverview);<br />
			  webContext.refresh(newToc);</p>
<p>			  webContext.refresh();</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David García</title>
		<link>http://gisprog.wordpress.com/2008/04/08/chart-renderering-using-web-adf/#comment-182</link>
		<dc:creator>David García</dc:creator>
		<pubDate>Mon, 14 Apr 2008 10:47:53 +0000</pubDate>
		<guid isPermaLink="false">http://gisprog.wordpress.com/?p=93#comment-182</guid>
		<description>The solution about the change of the render without change the state of the service works well, but I have a question. Did you realize about the fact that all the operations that you performed in your map ( zoom in, zoom out, etc...) will remove your new render? Because if you request an operation from the GIS Server, it will send you the response with the &quot;old&quot; render, so you will have to override all the defaults tasks and operation to change the render, refresh and restore the original render.

Other problem is the TOC. This control will show you the original render, because it takes the information of the layer from the GIS Server which have the original render. Do you have a solution for this?

Regards,

David García García</description>
		<content:encoded><![CDATA[<p>The solution about the change of the render without change the state of the service works well, but I have a question. Did you realize about the fact that all the operations that you performed in your map ( zoom in, zoom out, etc&#8230;) will remove your new render? Because if you request an operation from the GIS Server, it will send you the response with the &#8220;old&#8221; render, so you will have to override all the defaults tasks and operation to change the render, refresh and restore the original render.</p>
<p>Other problem is the TOC. This control will show you the original render, because it takes the information of the layer from the GIS Server which have the original render. Do you have a solution for this?</p>
<p>Regards,</p>
<p>David García García</p>
]]></content:encoded>
	</item>
</channel>
</rss>
