Archive for the ‘Java’ Category

How to convert IFields to Fields

April 15, 2008

 

I am trying connect to external database (simple standalone DBF) to one of layer dynamically using ADF. I wrote a method to connect to database and return the fields. I can able to join with database but retrieving fields seems bit tough!. The RelQueryTable class has method  getFields() which returns  IFields objects . How to convert to IFields to Fields object in com.esri.arcgisws which has getFieldArray() to obtain fields list.

 

Can anyone ping me or give me any clues? 

 

private Fields JoinTable(IServerContext pSC, IFeatureClass pFeatclass){

try{                

ShapefileWorkspaceFactory filefactory = (ShapefileWorkspaceFactory)pSC.createObject(ShapefileWorkspaceFactory.getClsid());

Workspace ws = (Workspace) filefactory.openFromFile(”C:/test/”, 0);

IRelationshipClass pRelationshipClass ;              

ITable table = ws.openTable(”1Z.dbf”);

factory = (MemoryRelationshipClassFactory)pSC.createObject(MemoryRelationshipClassFactory.getClsid());

MemoryRelationshipClass rclass = (MemoryRelationshipClass)factory.open(”test”, pFeatclass, “ZONENO”, new ObjectClass(table),”ZONENO”, “forward”, “backward”, esriRelCardinality.esriRelCardinalityOneToOne);                     

RelQueryTableFactory relQueryTableFact = (RelQueryTableFactory)pSC.createObject(RelQueryTableFactory.getClsid());

RelQueryTable relQueryTab = (RelQueryTable) relQueryTableFact.open (rclass, true, null, null, “”, true, true);

System.out.println(”After Joining total Field count::::::”+ relQueryTab.getFields().getFieldCount())                        

return  relQueryTab.getFields();        

 }

catch(Exception ex){

System.out.println(”ERROR in JOINTable Method”+ ex.toString());

return null;

}

 

SP5 offers IBM Portal Server ArcGIS Portlet development

April 15, 2008

ArcGIS Server 9.2 Service Pack 5 includes an enhancement to the ArcGIS Server Java ADF which provides support for IBM Portal Server ArcGIS Portlet development. This gives you the ability to create and publish GIS Mapping Portlets inside IBM Portal Server. In conjunction, SP5 includes a plug-in for the IBM Rational Application Developer (RAD) environment so that you can create and deploy those ArcGIS Portlets more efficiently. The following documents have been added related to this SP5 enhancement.

Install ArcGIS RAD plug-in

Developing ArcGIS portlet Applications in RAD

Will ESRI upload these plug-in s as zip file who don’t have internet connection. ESRI please awake!

Chart Renderering using Web ADF

April 8, 2008

 

These are days am working with ArcGIS Server [9.2+SP3]- Java edition. I’ve started with ESRI samples and grown up to creating tasks for my application. Task framework is handy to create our own custom business logic with rich UI. I’m trying to recreate or mimic ‘Charts’ functionality similar to Arc Map.  User can select a layer (yet to code), field(s) and chart type to draw charts.   User has option to prevent overlap, change map base symbol color, field(s) color also. It works fine. No harm, charts draws fine. 

 

While I try to remove the rendering, I couldn’t do so. Later, When I investigated, chart rendering has been applied to the map service (i.e. on server objects) since it is pooled one. I have searched in forum/developers help, I learnt that com.esri.adf.web.data.renderer package has ONLY five classes WebClassBreakInfo, WebClassBreaksRenderer, WebSimpleRenderer, WebUniqueValueInfo, and WebUniqueValueRenderer.  The Chart Rendering option is NOT available with the web ADF.  My senior colleague who attended Dev Summit has explained me that only ArcIMS has this functionality through ArcXML using Chart Symbol Object and not in 9.2. ESRI will incorporate in 9.3 ;adding charts in graphics layer or from other source. This helps me that am working in right direction.

 

As a developer, you should not expect that everything can only done thru available methods/properties, sometimes we may need to use reverse logic to obtain desired result. One of my fellow colleague suggested that before applying chart rendering to layer object, feature renderer of the layer is stored temporarily once chart renderer is applied , web context is refreshed. Then now apply the feature renderer stored in temporary object to server object so that user can see the charts whereas a server object doesn’t get changed. This is simple and better idea for time being. 

 

There are several other interesting learning’s/findings in creating this task. I’ve used custom xsl from Daniel Garcia Roman Class break rendering. 

 

I’m facing some problems like how to update overview map dynamically when rendering type is changed, while changing radio events are not firing properly (I’ve to click twice). Yet to implement normalization, exclusions, orientation, size etc. For a developer who is fairly having good understanding of ArcObjects doing task is not so tough. Here, we are working with ArcObjects remotely. I always use VBA help to understand methods/properties of classes. Then try to migrate to java. Proper casting, creating objects in server context, error handling, using appropriate packages are very vital in server app development. I strongly feel that lack of samples in Developer help for Java as in .NET is a big handicap. We have depend on forums/experts  to understand certain basic issues.

 

 

Eclipse plug-in for debugging ArcObjects code

March 27, 2008

 Intro

Finally ESRI has made Eclipse plug-in for debugging ArcObjects Code. This is great news for java devlopers who uses print line statements.  One of the most important aspect of any tool is debugging.I strongly feel that Mircosoft products brings great developer productivity.  This is also one of  reasons why many huge fans for MS products than java.  Its better late than never, ESRI shown some concern to java developers!. Kudos ESRI :)

About the plug-in

One of the most valuable tools that developers have at their disposal is a debugger through which they can step through code one statement at a time and inspect objects in the application. As many of you may already know, Java classes in the ArcObjects API are really only proxies to underlying COM ArcObjects. As a result, examining these proxies in the debugger only reveals their internal details and not the state of the ArcObjects. This makes it difficult to find out information such as the coordinates of a geometry, or the layers in a map service. Consequently, developers have to sprinkle their code with System.out.printlns and analyze traces on the console to get this information. This approach can be inconvenient and time consuming.

With this new Eclipse plug-in, Java developers can examine the state of the underlying ArcObjects right in Eclipse IDE’s Debug Perspective by enabling the “Show Logical Structure” option on the Expression and Variables window. Here’s an example of a Point object without the “Show Logical Structure” option enabled.

untitled.jpg

This information provides little insight into the underlying ArcObject and is not helpful in reasoning through a workflow while debugging. Now here’s the logical representation of the same object with the “Show Logical Structure” option enabled.

untitled1.jpg

The logical representation presents more comprehensible information about the underlying ArcObject’s state. This state is defined by the no-argument getter methods on it. You might sometimes see exception messages like “Exception Occurred: com.sun.jdi.InvocationException occurred invoking method” in the logical representation. This is normal and happens when some property of the ArcObject is not valid in the current context of the application.

The underlying ArcObjects could be running remotely in a separate process as in the case of ArcGIS Server web applications, or in the same process like in ArcGIS Engine applications. Thus, both Engine and Server developers can take advantage of this plug-in to debug their applications.

How to get the plug-in

Follow these steps to download and install the plug-in from the EDN Website:

  1. In the Eclipse workbench, go to Help > Software Updates > Find and Install
  2. Select Search for new features to install, and click Next
  3. Create a New Remote Site for the URL “http://downloads.esri.com/EDN/java/plugins/eclipse”
  4. Enable this remote site and click Finish.
  5. Expand the EDN tree in Search Results, and select the ArcGIS Debug feature.
  6. Proceed to install the plug-in, and restart the workbench when prompted.

ESRI Code Challenge Results!

March 25, 2008

Dear ESRI Devleopers,

Its time to congratulate  the winners of the 2008 ArcGIS Server Code Challenge contest

First Place: $15,000

Display Geospatial Analysis results in Google Maps and Microsoft Virtual Earth with ArcGIS Server

John Waterman, Vice President of Geospatial Solutions, East Burke, Vermont, USA

Second Place: $7,500

ArcGIS Server Virtual Earth Tile Server

Dave Bouwman, Senior Software Architect, Data Transfer Solutions (DTS), Fort Collins, Colorado, USA

Third Place: $2,500

SDE Web Catalog

Loganathan Vijay Sambandhan, GIS Developer, Buffalo, New York, USA

Honorable Mention

Google Maps Adapter to ArcGIS Server Map Cache

Nianwei Liu, Senior System Analyst Programmer, Charlotte, North Carolina, USA

Google Summer of Code 2008 Ideas

March 24, 2008

Here is another Code contest for students on Open Source from Google.  

The Open Source Geospatial Foundation would like to extend a welcome to all SoC students. On this page you will find links to a host of ideas organized by project. You will find ideas ranging from the depths of computer science graph theory to the heights of visualization. One thing all these ideas have in common is lots and lots of spatial data.

These ideas are *only* to motivate you, and serve as example of the kind of hills we want to charge up. Your own ideas are more than welcomed - they are encouraged. We view you as the next wave of open source leaders; show us what you’ve got.

If you need more information on how to apply try this guide for applicants

This is not only helpful for students and even for GIS community to know latest development trends in Open Source GIS, ideas, prespectives, future arena etc. If you are G-enthu (GIS Enthusiast) go through your favourite open source project.

ArcGIS Server on ICEFaces Technology

March 3, 2008

Hello,

Here is latest development on developing ArcGIS Server Applications on Java by integrating ICEFaces Technology. My friend (see photo below) is working on this new model and details can be found here.

 Guide : http://www2.pch.etat.lu/pchViewer/guide.pdf

Download Script : Script submitted to code Challenge contest

URL : http://www2.pch.etat.lu/pchViewer/

I wish him all the very best for this efforts!.

 dsc03334.jpg

 Tom Cruise :)-

Cheers

Building JAVA Applications Using the ArcGIS Server Web ADF and AJAX (Dev Summit ‘08)

February 28, 2008

Listen podcast from Jayant Sai, Developer, and Antony Jayaprakash, Product Engineer, ESRI on ArcGIS Server Web ADF intro

Listen here

SOME GIS BOOKS

February 27, 2008

Here are some books on GIS application development which I recently came across on surfing. Here are the details.

Programming ASP.NET for ArcGIS Server (English) - (ISBN: 9781418018757)

Web Mapping Illustrated Using Open Source GIS Toolkits

Beginning MapServer: Open Source GIS Development

Personally, I haven’t read any of these books listed above. If anyone has free copy (e-book) pl pass it on :)

ArcGIS Server 9.2 Javascript OMD

February 22, 2008

Here is PDF doc Java Web ADF 9.2 Javascript Object Model Diagram

ArcGIS Server 9.2 Javascripts OMD