lesserj

ESRI Javascript Code Assist API 2.7 Doesn???t work in Aptana and How to Fix it.

Discussion created by lesserj on Feb 19, 2012
Latest reply on Feb 20, 2012 by lesserj
For those of you trying to get the jsapi2.7 Code Assist for Aptana working, there are three small errors in the jar package that prevent it from showing up correctly in Atana's Global References.  These are pretty easy to fix. Here's how:

Step 1: After extracting the jar file, open it up using your favorite zip manager (I use 7-zip).  Inside you'll see a single folder called 27.  Inside that folder are all of the files needed to make Code Assist work, however, they need to be in the root of the jar package.  Go ahead and move everything in the 27 folder to the root and delete the now empty 27 folder.  If 7-zip or your other favorite zip manager complain about moving the files because it is being used by another process, then create a copy of the jar file and open it up in another instance of your zip program.  Move the files from the original package to the root of the new package.

Step 2: In the support folder, you'll see a file named arcgis_jsapi_2_7_oam.xml.  Go back to the root of the jar package and open up the plugin.xml file in a text editor.  Look for this line:

<xml-file path="support/arcgis_jsapi_2_6_oam.xml" user-agent="ArcGIS JSAPI 2.7" icon="icons/esri.png" />

If you look closely, you'll see that the path is wrong to the xml file we just saw in the support folder. Replace the "2_6" with a "2_7" so it looks like this:

<xml-file path="support/arcgis_jsapi_2_7_oam.xml" user-agent="ArcGIS JSAPI 2.7" icon="icons/esri.png" />

Step 3: After making these changes, you will be able to see the ArcGIS JSAPI 2.7 Code Assist in the Global References of Aptana.  However, references do not seem to pop up when you are typing your code. There is an error in the arcgis_jsapi_2_7_oam.xml file.  Open up the support/arcgis_jsapi_2_7_oam.xml in a text editor.  You'll notice that the xml definition appears on line 2.

<?xml version="1.0" encoding="UTF-8"?>

Delete the empty line 1 so the definition is the first line.  Save the file.  After you've made these three changes, in your jar package, Code Assist should work properly in Aptana.  But don't forget to restart Aptana if you had it open.

Hopefully ESRI can update the code assist package for 2.7 soon so that we don't have to fix it ourselves.

Outcomes