Skip to content
Peter Boughton edited this page Jan 18, 2012 · 1 revision

This is a tiny application that you can use to open files from your OS directly into CFEclipse. It is based mostly on the eclipsecall plugin.

There is a properties file you can use to set the socket to listen on and the eclipse install to launch if one isn't open.

A file can be opened regularly by calling:

  • java -jar cfeclipsecall.jar <filelocation>
  • cfeclipsecall.bat <filelocation>
  • cfeclipsecall.exe <filelocation>

Additional options:

  • -G<lineno>; marks the line
  • -G<lineno,col-col> marks the line from column to column
  • -S<socketno> set the socket to use when connecting to eclipse. Default: 2341. The number can be changed here and in the Preferences of the plugin (Preferences - CFEclipse - CFEclipseCall).
  • -E<path_to_eclipse.exe> starts Eclipse with the given call (could be a batch), if it is not already running.

The Java version of the client has handles also the environment variables "cfeclipsecall.socket" and "cfeclipsecall.call", which are used as default values for the "-S" and "-E" parameters respectively.

Stable Download:

Development Download:

Configuration File

Windows Install

Easiest configuration is to just put the cfeclipsecall.exe and the properties.cfeclipsecall files in the eclipse directory itself (same dir as eclipse.exe), and then change the cfeclipsecall.call property to eclipse.exe.

#properties.cfeclipsecall:

cfeclipsecall.call=eclipse.exe

cfeclipsecall.socket=2342

OS X Install

To set the configuration for the OS X version, edit the properties.cfeclipsecall file and then double-click on it to load the settings into the application bundle.

Linux Install

Edit the properties file and use a .sh script and call the jar for now I guess? We'll get a .bin with the installer someday.

Error.cfm

Editing this example from a Railo error.cfm will give you a hyperlinked stacktrace so you can click a link and have it open in CFE at the correct line, column y todo.

As you can see it basically uses createObject to fire off the cfeclipse call-- you only need the location to the eclipse executable if you want it to be able to fire up Eclipse if it isn't running already.

<cfif structKeyExists(url,"cfe")>
<cfset cfecall = createObject("java","org.cfeclipse.cfeclipsecall.CallClient") />
<cfset doOpen = cfecall.doOpen("2342","/path/to/eclipse/command",url.cfe)>
<cfabort />
</cfif></TD></TD></TD></TH></TH></TH></TR></TR></TR></TABLE></TABLE></TABLE></A></ABBREV></ACRONYM></ADDRESS></APPLET></AU></B></BANNER></BIG></BLINK></BLOCKQUOTE></BQ></CAPTION></CENTER></CITE></CODE></COMMENT></DEL></DFN></DIR></DIV></DL></EM></FIG></FN></FONT></FORM></FRAME></FRAMESET></H1></H2></H3></H4></H5></H6></HEAD></I></INS></KBD></LISTING></MAP></MARQUEE></MENU></MULTICOL></NOBR></NOFRAMES></NOSCRIPT></NOTE></OL></P></PARAM></PERSON></PLAINTEXT></PRE></Q></S></SAMP></SCRIPT></SELECT></SMALL></STRIKE></STRONG></SUB></SUP></TABLE></TD></TEXTAREA></TH></TITLE></TR></TT></U></UL></VAR></WBR></XMP>
<cfoutput>
<script>
function oc(id) {
	var code=document.getElementById('__cp'+id);
	var button=document.images['__btn'+id];
	if(code.style) {
		if(code.style.position=='absolute') {
			code.style.position='relative';
			code.style.visibility='visible';
			button.src=button.src.replace('plus','minus');
		}
		else {
			code.style.position='absolute';
			code.style.visibility='hidden';
			button.src=button.src.replace('minus','plus');
		}
	}
}
</script>
<script language="JavaScript">
	var oXmlHttp
	var sDetail

	function openInEditor(file,line) {

		var url=<cfoutput>"#getContextRoot()#/mapping-tag/error.cfm?cfe="</cfoutput> + file + '|' + line;
			oXmlHttp=GetHttpObject(stateChanged)
			oXmlHttp.open("GET", url , true)
			oXmlHttp.send(null)
	}

	function stateChanged() {
		if (oXmlHttp.readyState==4 || oXmlHttp.readyState=="complete") {
		}
	}

	function GetHttpObject(handler) {
		try {
			var oRequester = new XMLHttpRequest();
				oRequester.onload=handler
				oRequester.onerror=handler
				return oRequester
		} catch (error) {
			try {
				var oRequester = new ActiveXObject("Microsoft.XMLHTTP");
				oRequester.onreadystatechange=handler
				return oRequester
			} catch (error) {
				return false;
			}
		}
	}
</script>
<table border="0" cellpadding="4" cellspacing="2" style="font-family : Verdana, Geneva, Arial, Helvetica, sans-serif;font-size : 11px;background-color:red;border : 1px solid black;;">
<tr>
	<td colspan="2" style="border : 1px solid ##350606;background-color :##FFB200;font-weight:bold;">Railo #server.railo.version# Error (#ucFirst(catch.type)#)</td>
</tr>
<cfparam name="catch.message" default="">
<tr>
	<td style="border : 1px solid ##350606;background-color :##FFB200;font-weight:bold;">Message</td>
	<td style="border : 1px solid ##350606;background-color :##FFCC00;">#replace(HTMLEditFormat(trim(catch.message)),'
','<br />','all')#</td>
</tr>
<cfparam name="catch.message" default="">
<cfif len(catch.detail)>
<tr>
	<td style="border : 1px solid ##350606;background-color :##FFB200;font-weight:bold;">Detail</td>
    <td style="border : 1px solid ##350606;background-color :##FFCC00;">#replace(HTMLEditFormat(trim(catch.detail)),'
','<br />','all')#</td>
</tr>
</cfif>
<cfif structkeyexists(catch,'errorcode') and len(catch.errorcode) and catch.errorcode NEQ 0>
<tr>
	<td style="border : 1px solid ##350606;background-color :##FFB200;font-weight:bold;">Error Code</td>
	<td style="border : 1px solid ##350606;background-color :##FFCC00;">#catch.errorcode#</td>
</tr>
</cfif>
<cfif structKeyExists(catch,'extendedinfo') and len(catch.extendedinfo)>
<tr>
	<td style="border : 1px solid ##350606;background-color :##FFB200;font-weight:bold;">Extended Info</td>
	<td style="border : 1px solid ##350606;background-color :##FFCC00;">#HTMLEditFormat(catch.extendedinfo)#</td>
</tr>
</cfif>

<cfif structKeyExists(catch,'addional')>
<cfloop collection="#catch.addional#" item="key">
<tr>
	<td style="border : 1px solid ##350606;background-color :##FFB200;font-weight:bold;">#key#</td>
	<td style="border : 1px solid ##350606;background-color :##FFCC00;">#HTMLEditFormat(catch.addional[key])#</td>
</tr>
</cfloop>
</cfif>

<cfif structKeyExists(catch,'tagcontext')>
	<cfset len=arrayLen(catch.tagcontext)>
	<cfif len>
	<tr>
		<td style="border : 1px solid ##350606;background-color :##FFB200;font-weight:bold;">Stacktrace</td>
		<td style="border : 1px solid ##350606;background-color :##FFCC00;">
		The Error Occurred in<br />
		<cfloop index="idx" from="1" to="#len#">
			<cfset tc=catch.tagcontext[idx]>
		<cfif len(tc.codeprinthtml)>
		<img src="#cgi.context_path#/railo-context/admin/resources/img/debug_#iif(idx EQ 1,de('minus'),de('plus'))#.gif.cfm"
			style="margin-top:2px;"
			onclick="oc('#idx#');"
			name="__btn#idx#"/>
		</cfif>
		<cfif idx EQ 1>
			<b><a href="" onclick="openInEditor('#tc.template#',#tc.line#); return false;">#tc.template#</a>: line #tc.line#</b><br />
		<cfelse>
			<b>called from</b><a href="" onclick="openInEditor('#tc.template#',#tc.line#); return false;">#tc.template#</a>: line #tc.line#<br />
		</cfif>
		<cfif len(tc.codeprinthtml)><blockquote style="font-size : 10;<cfif idx GT 1>position:absolute;visibility:hidden;</cfif>" id="__cp#idx#">
		#tc.codeprinthtml#<br />
		</blockquote></cfif>
		</cfloop>
		</td>
	</tr>
	</cfif>
</cfif>
<tr>
	<td style="border : 1px solid ##350606;background-color :##FFB200;font-weight:bold;" nowrap="nowrap">Java Stacktrace</td>
	<td style="border : 1px solid ##350606;background-color :##FFCC00;"><pre>#rereplaceNoCase(HTMLEditFormat(catch.stacktrace),"(/workspace/.*)+:(\d+):",'<a href="" onclick="openInEditor(''\1'',\2); return false;">\1:\2</a>')#</pre></td>
</tr>
</table><br />
</cfoutput>
Clone this wiki locally