Sounds good, question:

If I have this:

<mco src="com.myCompany.myMco"/>

What happens? We will try to make a new com.myCompany.myMco, that that
doesn't exist will we do a require() on it? To me that would make the
most sense.

1. IF there is a path, load from that path
2. If there isn't, try a require on the src

James Margaris 

-----Original Message-----
From: Michael Turyn [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, November 07, 2006 1:12 PM
To: [email protected]
Subject: A change to MCO declarations

A Xal file's mco declarations now can take a "path" attribute in order
to specify source-code for the constructor indicated in 'src', e.g.:
        <mco:mco
                xmlns:mco="http://www.openxal.org/mco
<http://www.openxal.org/mco> "
                id="attributeSetter"
                src="AttributeTesterAlias"
                path="../widgets/AttributeTester.js"
        />


Why?:  It's better that xal pages and even tags be as self-contained as
possible, and in particular a tag that points to an object should be
able to find its definition.  This is good in and of itself (for
example, cutting and pasting from an old file into a new one), and
because eventually I'd like to see a simple servlet page that will take
a xal uri as an argument, and embed the xal in an otherwise blank page:

    [...]
    out.println("<body onload="Xap.createEmbeddedApplications();">") ;
    out.println("<div startPage=\"" + request.getParameter("startPage")
+"\"") ;
    if(request.getParameter("applicationName") != null 
               && request.getParameter("applicationName").length()>0){
         out.println(" applicationName=\"" +
request.getParameter("applicationName") +"\"") ;
    }
    // Any other Xap parameters?: 
    [...] ;
    out.println(">") ;
    [...]

(And, of course, the server could be set to do this embedding
automatically for .xal URIs.)

 

When?:

If the mco "src" doesn't resolve to a valid constructor, we look for a
"path" attribute for the MCO, and if one's found, load from the URI
indicated there (usual restrictions on XmlHttpRequests in mozilla
apply).  (We do this in this order so that we don't make too many
requests---we might want to change that behaviour if we should want the
mco to point to dynamic content from a servlet or server page, perhaps
via an "updatable" attribute.)

 

How?:

A few more blocks of code in McoNamespaceHandler.

 

   

Reply via email to