PDA

View Full Version : Request - A variable for the Base URL



m4chine
Jun 10, 2008, 8:04 PM
I'm not totally sure that this isn't already implemented, but if it is, I didn't find the surfaced property. What I need in order to use coolite in our current environment (BEA AquaLogic Portal) is a property to set the base url. Here's why...

p1 is the url/iis server we use to access the site and only serves the BEA/portal content. p2 is basically a portlet server that hosts the portlets.
When a applicate using coolite is hosted on p2, but surfaced through p1, the js grabs the full url (which is p1 etc.), but infact the actual url should read p2 etc. So my problem is that the coolite.axd and cool.axd files are not found on p1 because they exist on p2.

If a base url property was surfaced in .net, I could then set the base url instead of letting the js discover an incorrect url. This of course would be optional, if not used default to the js discovered url.

Let me know if this makes any sence and/or if you need more information.

Thanks again,
Brandon

geoffrey.mcgill
Jun 11, 2008, 1:13 AM
Try setting the CleanResourceUrl property to "false". Then the Embedded Resource (.js, .css, images) paths will not get rewritten by Toolkit and everything will use the standard webresource.axd handlers.

You can also completely turn off rendering the linked <script> and <style> files by setting the RenderScripts and RenderStyles property to "None".

Hope this helps.

m4chine
Jun 11, 2008, 2:04 PM
Geoffrey,

I should make that change on the scriptmanager, correct?

thanks,
Brandon

m4chine
Jun 11, 2008, 2:25 PM
Geoffrey,

Thanks for the tip, I set CleanResourceURL to false and it did the trick. One thing I noticed while debugging the GET/POST requests with HTTPWatch v5.1, I see this on every request, before and after I made this change:

Started Time Sent/Received Method Result Type URL
+ 0.331 0.000 0 0 GET ERROR_INTERNET_INVALID_URL * https://:/


It doesn't seem to be causing problems, just caught my attention.

Thanks again,
Brandon

m4chine
Jun 11, 2008, 2:43 PM
Well, I was semi mistaken when I said it did the trick. By setting the CleanResourceURL to false fixed my issue when using and IFRAME. But when I attempt to "Gateway" the page, there is no way that the porlet server (p2) will be able to know the gatewayed url + params

eg. http://p1.blah/gateway/PTARGS_0_XXXXX_XXXXX?=http%#B/p2.blah/coolitedemo.aspx


Did that help clarify? Thanks.

Brandon

geoffrey.mcgill
Jun 12, 2008, 6:42 AM
How about setting the RenderScripts and RenderStyles properties to "File"?

That way the resources (.js, .css, images) will pull directly from the domain and not pass through the Embedded webresource.axd filter.

The following forum posts should help provide information on setting the RenderScripts and RenderStyles properties.

http://forums.ext.net/showthread.php?threadid=11-4-1.aspx

http://forums.ext.net/showthread.php?threadid=112-4-1.aspx#bm177

Thanks for pointing out the ERROR_INTERNET_INVALID_URL issue. I'll try and track down the source of the problem.

m4chine
Jun 17, 2008, 2:52 PM
Geoffrey,

File sounds promissing, with the v0.5 version I am testing (I only received the coolite.ext.web.dll), I'll need the files that would be in this directory?

[INSTALL DRIVE]:\Program Files\Coolite\Coolite.Web.UI - Version 0.5\Coolite


Let me know, and thanks again.

Brandon

geoffrey.mcgill
Jun 17, 2008, 2:59 PM
Hi Brandon,

All the files are available from the main Download page (http://www.ext.net/download/). Both the automatic installer and/or manual installation package will add the /coolite/ folder to your install drive.

Look for a folder labeled "Coolite - Drag into your Project [not required]". Remove everything after "Coolite".

Hope this helps.

m4chine
Jun 17, 2008, 7:26 PM
Geoffrey,

I'd like to send you an HttpWatch log file with a single page request (Let me know you'd like to view it or if its not needed). This visually will show you what I'm going through. I've tried all the permutations that I could muster up, but with no success. I've reached near success with the following situation, but feel that I may be setting myself up for failure down the road.

I have set the RenderStyles and RenderScripts to File, and have created an approot virtual directory on both my servers that contains the Coolite embedded resources, to deal with my 404 errors. Why? Because the client browser only communicates with server p1; p1 then communicates with the other server p2 which contains the web application. Since js is client side, the only knowledge the js has comes from the headers. Well, the headers aren't rewritten upon p1 requesting p2's page and because of that the js produces a url to p2. But what the URL should look like is something like this for EVERY request made to p2: https://p1/portal/server.pt/gateway/PTARGS_0_XXXXX_XXXX_X_X_XX/https%3B/p2/somepagehere; But its not, the request to p2 is strictly the page url https://p2/somepagehere. So like I said, I create the Coolite resource directory and dropped it on both servers and for the most part, things work, page is rendered and post backs work. But that is all I have tested. I do still get 404's on the WebResources.axd or Coolite.axd depending on the ClearResourceURL Boolean property.

So after exploring the various prebuilt features, is it possible/theasible to add a property called gatewayURL or baseURL that I can hardcode, which would flow to the js and override the default this.url js function?


thanks again,
Brandon

geoffrey.mcgill
Jun 17, 2008, 7:59 PM
Hi Brandon,

Try to set the ResourcePath property. The ResourcePath property is the prefix used by the controls to point them to the correct local path of the resouce files (.js, .css, image). It was designed to be a local path, but I think it would work with a hardcoded "http://" path.

The ResourcePath property is another Global config option and can be set in the Web.config, Application variable, Session variable and ScriptManager.

I'll run a few tests right now to confirm.

m4chine
Jun 17, 2008, 8:00 PM
It just hit me, I am still seeing requests going to the WebResources.axd/Coolite.axd even though I have specified 'File' for both RenderedStyles and RenderedScripts. Is this correct?

thanks,
Brandon

geoffrey.mcgill
Jun 17, 2008, 8:01 PM
Ok, looks like the ResoucePath property would work. I just pointed a localhost page to our testing server and it created the proper paths.

Example


<ext:ScriptManager
runat="server"
ResourcePath="http://sandbox.ext.net/"
RenderScripts="File"
/>

geoffrey.mcgill
Jun 17, 2008, 8:08 PM
I just ran a few tests with setting the RenderScripts and RenderStyles properties and they both appear to be working correctly. They point directly to the correct local application path for the files.

The following sample demonstrates setting the RenderScripts and RenderStyles properties. I also set the ResourcePath property to look to the root of the Application for the extjs folder, instead of the default "~/Coolite/" path.

Example


<ext:ScriptManager
runat="server"
RenderScripts="File"
RenderStyles="File"
ResourcePath="~/"
/>

m4chine
Jun 17, 2008, 8:29 PM
So it works for like 99% of the requests. I still have 3 requests that are going to the WebResource.axd ( is this even supposed to be happening when setting both resources to "File" ?? ) and are producing 404's.

I will do more testing and report my findings.

thanks,
Brandon

geoffrey.mcgill
Jun 17, 2008, 8:37 PM
I found something. Looks like under two scenarios the local path is not being rendered correctly.

1. If you set a .Icon, the path in the inline Css is still getting rendered with the /coolite.axd path.
2. If you use the ext:ViewPort it includes an extra .js file and that file appears to still be pointing to /coolite.axd.

These both should be an easy fix. I'll work on them right now.

m4chine
Jun 18, 2008, 12:58 PM
Geoffrey,

Right on, I really appreciate your support and time. Please let me know how/when I can test the fixes. Thanks again.

Brandon

geoffrey.mcgill
Jun 18, 2008, 1:13 PM
Hi Brandon,

Oops. I forgot to update this post. The revisions were included in the 0.5.2 release which was published earlier today. You can download from the following location:

http://www.ext.net/download/

Give this new build a try and let me know how it goes.

m4chine
Jun 18, 2008, 5:33 PM
Right on, that totally fixed it. I was using the viewport and I had an icon being displayed with incline css. Thanks again for the great product and great support.

Brandon