<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to use dynamic workspaces correctly? in Java Maps SDK Questions</title>
    <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486942#M1502</link>
    <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can add that while we do not support this capability in our current software, it is one that is highly requested, and on our roadmap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;True, initially, we will primarily focus on adding support for consuming mosaic datasets, but our users will want the ability to add to an existing mosaic as well, and we will need to be able to leverage geoprocessing, or some more direct api, to do so.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In general, I must agree with Carlos that limiting the capabilities of local gpk packages is a particularly pain point in moving to Runtime sdk from Engine.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
    <pubDate>Sat, 03 Aug 2013 03:10:09 GMT</pubDate>
    <dc:creator>GeneLege</dc:creator>
    <dc:date>2013-08-03T03:10:09Z</dc:date>
    <item>
      <title>How to use dynamic workspaces correctly?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486935#M1495</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I modified the "Dynamic Layers - Simple Renderer Sample" by using a LocalMapService and added a new WorkspaceInfo instance as dynamic workspace. After modifying the data source by using DynamicLayerInfo::setLayerSource and refreshing the layer by ArcGISDynamicMapServiceLayer::refresh, an EsriServiceException &lt;/SPAN&gt;&lt;STRONG&gt;"Requested an image but received content type text. Either the token used to access this server has expired or the parameters of this request are invalid."&lt;/STRONG&gt;&lt;SPAN&gt; occurs. The workspace is a copy of the unpacked usa.gdb from the package folder.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;It would be nice to have a sample showing how to use dynamic workspaces.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks in advance.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN style="text-decoration:underline;"&gt;Modifed code:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE class="plain" name="code"&gt;private WorkspaceInfo workspaceInfo;&amp;nbsp; private JMap createMap() { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Add a new workspace &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LocalMapService mapService = new LocalMapService(getPathSampleData() + "MPKs/USCitiesStates.mpk"); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapService.setEnableDynamicLayers(true); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; WorkspaceInfoSet dynamicWorkspaces = mapService.getDynamicWorkspaces(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; workspaceInfo = new WorkspaceInfo("WORKSPACE", WorkspaceInfo.WorkspaceFactoryType.FILE_GDB, "DATABASE=C:/data/arcgis/USA/usa.gdb"); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynamicWorkspaces.add(workspaceInfo); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; mapService.start();&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynamicLayer = new ArcGISDynamicMapServiceLayer(mapService.getUrlMapService());&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; ... }&amp;nbsp; private void render(Renderer&amp;lt;Graphic&amp;gt; renderer, int layerId) { &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Create new drawing info from our renderer, with set transparency &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DrawingInfo drawingInfo = new DrawingInfo(renderer, TRANSPARENCY);&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Get the layerInfo from the dynamic layer and set the drawing info &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DynamicLayerInfoCollection layerInfos = dynamicLayer.getDynamicLayerInfos(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; DynamicLayerInfo layerInfo = layerInfos.get(layerId); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layerInfo.setDrawingInfo(drawingInfo);&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; TableDataSource tableDataSource = new TableDataSource(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tableDataSource.setWorkspaceId(workspaceInfo.getId()); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; tableDataSource.setDataSourceName("Cities");&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; LayerDataSource layerDataSource = new LayerDataSource(); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layerDataSource.setDataSource(tableDataSource); &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; layerInfo.setLayerSource(layerDataSource);&amp;nbsp; &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; // Refresh the layer &amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; dynamicLayer.refresh(); &amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/PRE&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2012 18:10:07 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486935#M1495</guid>
      <dc:creator>Jan-Tschada</dc:creator>
      <dc:date>2012-08-03T18:10:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to use dynamic workspaces correctly?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486936#M1496</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hello Jan.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;This is something the team is still working on at the moment. So your approach will not work with Java + accerated display at 1.0 Final.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;Please stay tuned, the team is working on fixing it.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 03 Aug 2012 20:16:21 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486936#M1496</guid>
      <dc:creator>EricBader</dc:creator>
      <dc:date>2012-08-03T20:16:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to use dynamic workspaces correctly?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486937#M1497</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;What is the status of this functionality? Has it being implemented in 10.1.1?&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Tue, 14 May 2013 16:30:15 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486937#M1497</guid>
      <dc:creator>CarlosColón-Maldonado</dc:creator>
      <dc:date>2013-05-14T16:30:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to use dynamic workspaces correctly?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486938#M1498</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Yes this works at 10.1.1. The samples showing a simple dynamic workspace functionality workflow are in the sample app under 'Datasources' called 'Add Raster' and 'Add Shapefile'. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Note I've also just given Jan's code above a spin, i.e. modifying the Dynamic Layers 'Simple Renderer' sample, and that workflow works nicely as well. By switching one of the mpk layers to point to a local shp file instead, the 'render' button displayed/udpated my local shapefile's renderer, in my case instead of the 'states' layer. (Note that I used WorkspaceInfo.CreateShapefileFolderConnection("WORKSPACE", "c:/data/shapefile") to create the workspaceInfo in my test code, and I put my actual shp file name in tableDataSource.setDataSourceName("MyShapefile").)&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;~elise&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Mon, 20 May 2013 09:52:53 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486938#M1498</guid>
      <dc:creator>EliseAcheson1</dc:creator>
      <dc:date>2013-05-20T09:52:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to use dynamic workspaces correctly?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486939#M1499</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Thanks for responding, Elise.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;This works at 10.1.1. The samples showing a simple dynamic workspace functionality workflow are in the sample app under 'Datasources' called 'Add Raster' and 'Add Shapefile'.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I am aware of those two sample code source files, but neither use a geodatabase as data source for workspace, as shown on the desired code that J.T. posted.&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt; &lt;/SPAN&gt;&lt;BR /&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;I've also just given Jan's code above a spin, i.e. modifying the Dynamic Layers 'Simple Renderer' sample, and that workflow works nicely as well. By switching one of the mpk layers to point to a local shp file instead, the 'render' button displayed/udpated my local shapefile's renderer, in my case instead of the 'states' layer. (Note that I used WorkspaceInfo.CreateShapefileFolderConnection("WORKSPACE", "c:/data/shapefile") to create the workspaceInfo in my test code, and I put my actual shp file name in tableDataSource.setDataSourceName("MyShapefile").)&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Your modifications to J.T.'s code shy away from using geodatabase connection, which makes it similar to the code on the examples. The examples make mention of geodatabase connection capability for obtaining data source for work-spaces, but I can't find any sample code to demonstrate this.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 23 May 2013 17:38:02 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486939#M1499</guid>
      <dc:creator>CarlosColón-Maldonado</dc:creator>
      <dc:date>2013-05-23T17:38:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to use dynamic workspaces correctly?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486940#M1500</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;Hi Carlos, &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Apologies for not being more specific. We didn't quite get this right at 1.0 so I assumed the post was about the dynamic workspaces in general. &lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Just to confirm that yes this workflow works with a file geodatabase and the other workspace factory types (see the static WorkspaceInfo creation methods and also WorkspaceFactoryType enum).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The change in code in this case would be one line:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;workspaceInfo = WorkspaceInfo.CreateFileGeoDatabaseConnection("WORKSPACE", "c:/data/ArcObjectsData/portland/portland.gdb");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;(where I have the portland.gdb file gdb at the location in the code, and "WORKSPACE" is an arbitrary String since when I create the TableDataSource I retrieve this name programatically).&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Plus you also need to make sure that the data source name is correct/exists in the gdb. In my case for example:&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;PRE __default_attr="plain" __jive_macro_name="code" class="jive_macro_code jive_text_macro"&gt;tableDataSource.setDataSourceName("Zones");&lt;/PRE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;cheers,&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;~elise&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Fri, 24 May 2013 13:35:40 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486940#M1500</guid>
      <dc:creator>EliseAcheson1</dc:creator>
      <dc:date>2013-05-24T13:35:40Z</dc:date>
    </item>
    <item>
      <title>Re: How to use dynamic workspaces correctly?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486941#M1501</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;After further investigation and Esri support, I've learned that using work spaces to connect to geodatabases for adding rasters to mosaic data sets is not currently supported. Using work spaces to add data for display is temporary only for the current session, and persistence can only be achieved by continually loading the data per session which is not efficient. I've attempted to use a geoprocessing package containing the "AddRastersToMosaicDataset" tool with package scheme only and ArcGIS Runtime support, only to find that the tool "is not licensed for use in an ArcGIS Runtime package."&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;The given explanation was that ArcGIS Runtime's workflow was primarily designed to "consume" services rather maintaining its own locally. While I agree with its primary functions in support of other ArcGIS software and services, I believe that, as part of its disconnected capabilities, this capability will support the need of many existing customers, primarily in the defense and intelligence community, as well as bring more customers to Esri's door steps.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;I recommend that the "AddRastersToMosaicDataset" and "RemoveRastersFromMosaicDataset" tools be licensed for use in an ArcGIS Runtime package at minimum.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Thu, 01 Aug 2013 15:10:24 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486941#M1501</guid>
      <dc:creator>CarlosColón-Maldonado</dc:creator>
      <dc:date>2013-08-01T15:10:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to use dynamic workspaces correctly?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486942#M1502</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;SPAN&gt;I can add that while we do not support this capability in our current software, it is one that is highly requested, and on our roadmap.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;True, initially, we will primarily focus on adding support for consuming mosaic datasets, but our users will want the ability to add to an existing mosaic as well, and we will need to be able to leverage geoprocessing, or some more direct api, to do so.&lt;/SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;In general, I must agree with Carlos that limiting the capabilities of local gpk packages is a particularly pain point in moving to Runtime sdk from Engine.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sat, 03 Aug 2013 03:10:09 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486942#M1502</guid>
      <dc:creator>GeneLege</dc:creator>
      <dc:date>2013-08-03T03:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use dynamic workspaces correctly?</title>
      <link>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486943#M1503</link>
      <description>&lt;HTML&gt;&lt;HEAD&gt;&lt;/HEAD&gt;&lt;BODY&gt;&lt;BLOCKQUOTE class="jive-quote"&gt;In general, I must agree with Carlos that limiting the capabilities of local gpk packages is a particularly pain point in moving to Runtime sdk from Engine.&lt;/BLOCKQUOTE&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;SPAN&gt;Thanks, Gene. If you and any user supports this idea, please go to the &lt;/SPAN&gt;&lt;A href="http://ideas.arcgis.com/ideaHome?c=09a300000004xET"&gt;Esri ArcGIS Ideas&lt;/A&gt;&lt;SPAN&gt; site and promote my suggestion &lt;/SPAN&gt;&lt;A href="http://ideas.arcgis.com/ideaView?id=087E00000004pNl&amp;amp;returnUrl=%2Fapex%2FideaList%3Fc%3D09a300000004xET%26category%3DArcGIS%2BRuntime"&gt;here&lt;/A&gt;&lt;SPAN&gt;.&lt;/SPAN&gt;&lt;/BODY&gt;&lt;/HTML&gt;</description>
      <pubDate>Sun, 04 Aug 2013 22:48:50 GMT</pubDate>
      <guid>https://community.esri.com/t5/java-maps-sdk-questions/how-to-use-dynamic-workspaces-correctly/m-p/486943#M1503</guid>
      <dc:creator>CarlosColón-Maldonado</dc:creator>
      <dc:date>2013-08-04T22:48:50Z</dc:date>
    </item>
  </channel>
</rss>

