archives (or I just cant search right :-/ ) but its a little factory /
java browser do dad (I call it jBrowse). I would *not* recommend you put
this in a publicly available place on your server
+============ snip ================+
<cfparam name="url.class" default="coldfusion.server.ServiceFactory"
type="String"/>
<cfparam name="url.service" default="1" type="numeric"/>
<cfparam name="custom" default="" type="String"/>
<cfparam name="eval" default="" type="String"/>
<cfscript>
//if you want to change the language
txt_itl = arrayNew(1);
txt_itl[1] = "Cold Fusion MX java object browser - by Rob Rohan";
txt_itl[2] = "Custom:";
txt_itl[3] = "Public Methods";
txt_itl[4] = "Returns";
txt_itl[5] = "Methods";
txt_itl[6] = "Params";
txt_itl[7] = "No Parameters";
txt_itl[8] = "Public Variables";
txt_itl[9] = "Variable";
txt_itl[10] = "Value";
txt_itl[11] = "Error:";
txt_itl[12] = "Reset";
txt_itl[13] = "Show";
knownServices = arrayNew(1);
methods = arrayNew(1);
returns = arrayNew(1);
params = arrayNew(1);
</cfscript>
<cftry>
<!---
/////////////////////////////////////////////////////////////////////
--->
<cfscript>
if(len(custom) eq 0){
factory = createObject("java","#url.class#");
//get a list of the known services
knownServices = structKeyArray(factory);
hndl = Evaluate("factory." & knownServices[url.service] &
".getClass()");
}else{
factory = createObject("java","#trim(custom)#");
hndl = factory.getClass();
url.class = hndl.getName();
}
/* if(len(eval) gt 0){
Evaluate("#eval#");
} */
//get a list of the public variables
caster = createObject("java","#hndl.getName()#");
objVariables = structKeyArray(caster);
function viewer(objHndl){
tmethods = objHndl.getMethods();
for(x=1; x lte arraylen(tmethods); x=x+1){
methods[x] = tmethods[x].Name;
returns[x] = tmethods[x].ReturnType.getName();
params[x] = tmethods[x].ParameterTypes;
}
}
viewer(hndl);
</cfscript>
<!--- //////////// Begin Page
///////////////////////////////////////////// --->
<html>
<head>
<title><cfoutput>#txt_itl[1]#</cfoutput></title>
<link rel="stylesheet" type="text/css" href=""> </head>
<body>
<cfoutput>
<!--- info bar and form for custom class viewing --->
<table width="100%">
<tr>
<td style="text-align: left; vertical-align: top;">
<a href="" title="#txt_itl[12]#"
class="reset"> #mid(txt_itl[12],1,1)# </a>
<span class="tclass">#url.class#</span>
<cfif len(custom) lt 1>
<span class="service"> - #knownServices[url.service]#
(#hndl.getName()#)</span>
</cfif>
</td>
<td style="text-align: right;">
<form name="shower" style="font-size: 10pt;">
<input type="hidden" name="service" value="#service#"/>
#txt_itl[2]#
<input type="text" value="#custom#" name="custom" size="30"><br/>
<a href="" document.shower.submit();"
class="reset">#txt_itl[13]#</a>
</form>
</td>
</tr>
</table>
<br/>
<!--- nav menu (knownServices) --->
<div class="servicelist">
<cfloop from="1" to="#arrayLen(knownServices)#" index="q">
<a href=""> class="reset">#knownServices[q]#</a>
<cfif q mod 8 eq 0>
<br/>
</cfif>
</cfloop>
</div>
<br/>
<!--- method list --->
<div class="public">#txt_itl[3]#</div>
<table class="info">
<tr>
<td class="header">#txt_itl[4]#</td>
<td class="header">#txt_itl[5]#</td>
<td class="header">#txt_itl[6]#</td>
</tr>
<cfloop from="1" to="#arrayLen(methods)#" index="q">
<cfif q mod 2 eq 0>
<cfset cRow="row">
<cfelse>
<cfset cRow="altrow">
</cfif>
<tr>
<td class="#cRow#">
<cfdump var="#returns[q]#"/>
</td>
<td class="#cRow#"><cfdump var="#methods[q]#"/></td>
<td class="#cRow#">
<cfif arraylen(params[q]) gte 1>
<cfloop from="1" to="#arrayLen(params[q])#" index="x">
<cfif find('.',params[q][x].getName())>
[<a
href=""> <cfelse>
[#params[q][x].getName()#]
</cfif>
</cfloop>
<cfelse>
#txt_itl[7]#
</cfif>
</td>
</tr>
</cfloop>
</table>
<br/>
<!--- public variables list --->
<div class="public">#txt_itl[8]#</div>
<table class="info">
<tr>
<td class="header">#txt_itl[9]#</td>
<td class="header">#txt_itl[10]#</td>
</tr>
<cfloop from="1" to="#arrayLen(objVariables)#" index="q">
<cfif q mod 2 eq 0>
<cfset cRow="row"/>
<cfelse>
<cfset cRow="altrow"/>
</cfif>
<tr>
<td class="#cRow#">#objVariables[q]#</td>
<td class="#cRow#">
<cftry>
<cfif arrayLen(knownServices) gt 1>
<cfset currentvalue = Evaluate("factory." &
knownServices[url.service] & "." & objVariables[q])/>
<cfelse>
<cfset currentvalue = Evaluate("factory." & objVariables[q])/>
</cfif>
<cfdump var="#currentvalue#"/>
<cfcatch type="any">
#txt_itl[11]# #cfcatch.message#
</cfcatch>
</cftry>
</td>
</tr>
</cfloop>
</table>
</cfoutput>
</body>
</html>
<cfcatch type="any">
<cfoutput>
<form name="nada">
<input type="button" value="<--"/>
</form>#txt_itl[11]# #cfcatch.message#<br/>
#txt_itl[2]# #custom# <br/>
<cfdump var="#cfcatch#"/>
</cfoutput>
</cfcatch>
</cftry>
+============ snip ================+
On Thu, 2004-02-19 at 10:44, Ramene Anthony wrote:
> Team
>
> Kinda off topic. Id like to get into the guts of MX via its internal
> functionality calls available to us all via Java api. But Im having a
> bit of difficulty finding any documentation on any of it of whatsoever.
>
> For arguments sake, say I wanted to learn how MX stores and looks up
> cached queries. Where would I start ?
>
> Granted Brandon Purcell's Component Invoker is an good start... but it's
> almost like shooting in the dark with your parents in the room! (oopps,
> sorry Mom!)
>
> Even learning how to add/manage/manipulate mappings like the following:
>
> <cfscript>
> factory = createObject('java','coldfusion.server.ServiceFactory');
> mappings = factory.runtimeservice.getMappings();
> mappings['/foo'] = "c:\somepath\foo";
> </cfscript>
>
> Best Regards
> R . Anthony
>
>
>
> This email and any files transmitted with it are confidential and intended solely for the use of the individual or entity to whom they are addressed. If you have received this email in error please notify the system manager. This message contains confidential information and is intended only for the individual named. If you are not the named addressee you should not disseminate, distribute or copy this e-mail.
>
>
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

