GetOpenFileName lpstrInitialDir (directory)... not working for URL (SharePoint) - c++

I bring up a GetOpenFileName dialog, enter a URL to a SharePoint sever, and it lets me browse that server using the Web Client Service (WebDAV mini-redirector). I am trying to get the initial directory to come up as that URL, but it seems to ignore it (using OPENFILENAME struct's lpstrInitialDir). Local paths work fine.
EDIT: Paul requested the form of the URL: it's http://doc.name.com I've also tried a trailing slash (both flavors) to see if that made a difference (saw some reference to that in another posted question). It didn't seem to.
EDIT2: This does work if I use the WebDAV address instead of the HTTP URL (i.e., \doc.name.com\DavWWWRoot. This doesn't solve my problem, as it's not a view of the site that users will recognize and will have difficulty working with.

If your application is for vista, you can use the IFileOpenDialog, which lets you use an IShellItem as the default location, and it should be pretty easy to create a shell item that points to the sharepoint URL.

Related

How to change a URL in the Ember.js router before a route is assigned?

My Ember.js app requires backwards compatibility for links that went to specific file extensions. (i.e. .pdf) In other words, I an example link like this, to return the PDF:
http://www.example.com/docs/my.pdf
I'm trying to preprocess the URL to remove the .pdf before the Ember.js Router assigns a Route to it, by taking a substring, and assigning it back as the URL to process:
http://www.example.com/docs/my
Obviously, getting the substring is trivial, but I don't know how to inject the updated URL back into the Ember.js Router.
Your approach is non-ember compliant from the start. The solution isn't to update the URL, but to simply use the URL you want in the first place.
Instead of sending the user to
http://www.example.com/docs/my.pdf
Send them to
http://www.example.com/docs/my
And then within one of the related route hooks (beforeModel hook would be my preference), send the my.pdf file to the user.
You could just use transitionTo().
Alternatively this answer suggests using
Ember.HistoryLocation.replaceState(<string>);
or
router.replaceWith('index');

SIteCore - multisite - displaying page from wrong site

We have a multisite SiteCore setup with 2 sites within the same .Net solution.
This works by setting the rootPath property on a Site Definition in web.config to limit the site to part of the SiteCore folder structure.
This works well apart from when pages are created with the same name as in the other site then it's serving content from the other site! We have inherited a fair bit of custom code in this solution form the other site so this may be the cause but dont know what Im looking for ...
Thanks
How are you referencing the sites? Do they each have their own host name? Do you have the "hostName" property set for the site node in the Site Defintion?
I will assume that you are not referring to them this way and instead, the sites are using the "virtualFolder" property. If both sites have the same default value of "/" for virtualFolder, attempting to get to either site will result in Sitecore rendering the first site that it matches on, which would be the site listed first.
Try putting the actual site name for "virtualFolder" and "physicalFolder" (e.g. "Site1" and "Site2", respectively). Then you can address your sites as http://yourserver.com/Site1 and http://yourserver.com/Site2. The "virtualFolder" will match first and render the correct site.
See Configuring Sites in the web.config File on SDN for additional information.
Hope this helps.
It turns out this is happening in this case because of a System alias that is redirecting for a subset of pages

ColdFusion cfselect binding not working on production server

I have a few related selects that work perfectly on a testing server with very loose security (basically just a simple default install of CF 10).
I have tried to implement the CF 10 lockdown guide on the production server and all seems well, except that related select don't work. That is, the first select in the chain doesn't populate and therefore, none of the related selects populate either.
I even recreated Ben Forta's art media example: perfect on the testing server, no triggering in production.
All other CFC functions seem to work: SELECT and INSERT queries are just fine. Only CFSELECTs with bindings are hosed. I pretty sure that the problem is a server configuration. The same pages worked just fine on our old CF 9 box. Any ideas would be helpful.
My advice to you would be to NOT use cfselect or any other UI stuff in ColdFsuion - It only causes more headaches than it gets rid of.
That being said, if you followed the lockdown guide, you should have limited access to the CFIDE directory - which is needed for any of the ColdFusion UI stuff. There is an option in CF Admin to use a 'custom' path for the scripts ColdFusion uses - it is on the main Settings page. Set this value and create a virtual directory in IIS with the same name pointing to the {cfroot}CFIDE/scripts directory.

Iframe working correctly on localserver but not production server

A question like this was asked before and the person got nothing but criticisms, hope this won't be the case here.
I have a website that allows a business to add their menu to my site, and some have requested to be able to import a menu (a pdf or jpg) that is already online elsewhere. So I made a form that saves a url to the db and then that url is used in the src of an iframe on my site.
I tested it all and it worked fine on my local machine (using Django development server). When I synced it over to my production server and saved the same url I was testing with, the iframe loads no content.
I imagine that it has something to do with trying to read an individual file from another server because it works if I make the url google.com or to an image that is under my domain name. Is there anything I can do to fix this? Storing a url instead of a pdf in my db is much more efficient so doing this way is preferred over uploading their menu to my site.
I don't think this question needs any code attached, but if you want to see some let me hear it.
Thanks
The menu you're testing with probably has the X-Frame-Options response header set.
Is there a reason you're putting the image/pdf as the src on an iframe instead of just using the img tag (or putting an img tag inside your iframe)? There's still no guarantee that will work for all pages, as some sites will refuse to serve media to an external page, but I suspect this is your problem in this case.

Are there any gotchas for url re-writing a ColdFusion site with ISAPI_Rewrite v2?

I've been asked to help out with some ColdFusion development and one of the tasks will be to undertake url re-writing, mostly turning url parameters into a cleaner url.
The site is on a hosted service with cf8 running on iis, with Helicon Tech ISAPI_Rewrite v2.
Are there any things I should look out for?
Thanks.
This should be fine. IIS (or the ISAPI addin) deals with the URL rewrite and then passes it onto CF as if it were requested as the original URL.
Most people do URL rewriting in order to improve their SERP rankings - key to this is making sure that the original URL that was in place previously now returns a 301 (moved permanently) redirect to your new URL. This preserves the 'link juice' associated with the old URL. Don't use CFLOCATION to do your redirect - that tag does a 302...
I've been using ISAPI_Rewrite and ColdFusion for a few years and had good results.
I would recommend upgrading to version 3 if you can. While version 2 worked fine, I've found the latest version easier to use because it's compatible with mod_rewrite.
The bottom line is that a URL Rewriter and your Application Server (ColdFusion or otherwise) should never have problems working together. If they are, you've probably setup your rewriting rules incorrectly (or are using a crappy rewriter).
The URL Rewriter changes the appearance of the request before it is handed off to the Application Server. As long as the end result is foo.cfm?var=value, whether that be the actual URL or the result of rewriting, it will be fine.