Table of Contents

Universal Remoting Service Browser API

The service browser works in conjunction with a remote service names org.osflash.ur.ServiceBrowser. In order for the class to be as self-contained as possible, the remote service will only send untyped objects and arrays.

ServiceBrowser has the following methods:

getCapabilities

Proposed capabilities (currently all have data set to null):

Evert: would like to see namespaces capabilites, e.g. org.osflash.ur.authentication, org.osflash.ur.codegen

Patrick: makes sense

verifyLogin

Evert: is this really needed? We can throw exceptions in AMF0 if a user doesn’t have the permission, where the servicebrowser can respond to.. also in AMF3 we can respond immediately to a Login CommandMessage..

Patrick: In AMF0 a generic /onStatus message will be generated, but the codes for missing authentication are not the same across Remoting implementations, so we can’t reliably determine whether we have an authentication error or a generic error

getServices

{services:
 {
  "com.packageName":
  [
   "Clazz1", 
   "Clazz2",
   "Clazz3"
  ]
  "topLevel":
  [
   "Clazz1",
   "Clazz2"
  ]
 }
}

Evert: could we get a an array of objects here.. in the case people want to build on top of the api?

Patrick: I guess it’s not impossible that classes within the same package might be of different types. How about:

"topLevel":
[
 {name:"Clazz1",type:"service",data:null},
 {name:"style",type:"asset",data:{type:"css"}}
]

I know that this would be easier:

"topLevel":
[
 new ServiceNode("Clazz1"),
 new AssetNode("style", "css")
]

...but it wouldn’t be portable across JSON-RPC. What if we had a version of the service browser in AJAX?

getService

{
 name:"com.myPackage.Clazz1",
 description:"This is a clazz that does stuff",
 methods:
 [
  {
   name: "methodName1",
   description: "a method that does stuff. Extra things like author tags and whatnot may be added to description",
   arguments: [{name:"arg1", 
                type:"* for untyped languages, type for typed languages", 
                description:"description if available"}],
   returns: {type:"*", description:"Could return anything"},
   extra: {roles:"admin, user"}
  }
 ]
}

Evert: not sure if ‘roles’ should be in the spec, since I think AMFPHP is the only implementation which actually uses this.. I think most people would go for an ACL list.. At the very least the servicebrowser should not show this field of its not being returned.. How about using “mixed” or “any” for type, instead of “*”

Patrick: updated definition to have “extra” key. Everything in the “extra” field should be appended to the end of the service description in the UI, unless a specific key is recognized and there is code in the service browser to format it accordingly. If extra is null, then don’t do anything.

getTemplates

[
 {name:"AS3", description:"AS3 template"},
 {name:"service-config.xml", description:"Services config file, for Flex 2"}
]

createCode

[
 {filename:"services-config.xml", data:"XML data"}
 {filename:"views/ServiceShortName_view.mxml", data:"MXML data"}
]

saveCode

getInfo