Attempting my own question, looks like JavascriptManagerImpl is using URLResource like so:

097        public void setFiles(String files)
098        {
099            _files = buildAssetList(files, "files");
100        }

132        private List buildAssetList(String files, String name)
133        {
134            String[] js = TapestryUtils.split(files);
135 136 List list = new ArrayList(js.length);
137            for (int i=0; i<js.length; i++) {
138                list.add(findAsset(js[i], name + i));
139            }
140 141 return list;
142        }

144        private IAsset findAsset(String path, String description)
145        {
146            IAsset asset = null;
147            if ( !HiveMind.isBlank(path) )
148            {
149                Location location = new DescribedLocation(new 
URLResource(path), description);
150                asset = _assetSource.findAsset(null, path, null, location);
151            }
152            return asset;
153        }

I'm going to subclass JavascriptManagerImpl, add an injected ServletContext property, and override setFiles(..) to ultimately use ContextResource instead.

Jim


Jim wrote:
Hello,

I'm using Dojo 1.0.2 with Tapestry 4.1.5, using the Tacos approach as a guide. I have a question about the "files" property in the following:

<implementation service-id="tapestry.js.JavascriptManager">
   <invoke-factory>
<construct class="org.apache.tapestry.javascript.JavascriptManagerImpl"> <set-service property="assetSource" service-id="tapestry.asset.AssetSource"/> <set property="files" value="http://[host]:[port]/[AppName]/[path-to-dojo.js]"; />
       <set property="formFiles" value="" />
       <set property="widgetFiles" value="" />
       <set property="folder" value="" />
<set property="tapestryFile" value="classpath:/tacos-js/tap-dojo1.0.2.js" />
       <set property="tapestryFolder" value="classpath:/tacos-js/" />
     </construct>
   </invoke-factory>
 </implementation>

That "files" property -- everything works fine if I put an absolute URL in there, and this configuration annoyance is eased somewhat if I use system property-replacement instead of a hard-coded URL. However, I have users accessing this application through SSH tunnels, so this absolute-URL approach breaks down. I tried using various relative paths but get Exceptions stemming from: "Unable to update property files of object [EMAIL PROTECTED]" when I use anything but an absolute path.

Anyone know how to get around this, or a better way?

Thanks,
Jim





---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to