flex lowercase to uppercase issue - string

I got one problem. I called one image from server. example: "www.sample.com/images/image1.jpg"
But if someone changed the name to uppercase like IMAGE1.jpg. Flex doesn't display image.
solution plz?

One solution is to use a web server that does not requre case sensitive paths, like Microsoft's Internet Information Services.
Another option is to limit access to your server so that people cannot change the names of files.

If you've got only two possible spelling for each name ("image1.jpg" and "IMAGE1.jpg") you can apply a dirty hack. Listen to Image's error events (ioError and securityError) and after one fail try to load image by another path.

Related

Use Chef to modify settings for all IIS sites running on a node

our ops team wants to make sure that all IIS web sites are (a) logging to the right place and (b) logging the right things. The most awesome IIS Cookbook allows me to do both of these things if I know what sites are running on this old box, which, sadly, I do not. So a fairly straightforward implementation could be:
list_of_sites.each do |s|
iis_site s do
log_directory 'c:/fireplace'
etc.
end
end
But ... I don't know what sites are running on a given node. Ohai doesn't seem to have this info, but maybe there is a wonderous (I like this spelling better) Ohai plugin that my google-foo couldn't find. I could write an ohai plugin for this I suppose. But it would be my first so a little reluctant to go there. Are there other options?
Good list of ways to list sites is here: Display all sites and bindings in powershell, but not sure how to use a list of sites generated by powershell from within a recipe.
We're running chef 12 and various IIS's but oldest is 7.0.
Thx for any advice!
Making an Ohai plugin for this one thing is probably overkill, I would just use powershell_out with a variant of the code you linked to. You would want something like this:
cmd = powershell_out!(<<-EOH)
# A bunch of PS code goes here
EOH
sites = some_kind_of_parsing(cmd.stdout)
sites.each do |site|
The example PS code you linked is using Format-Table which would suck to parse back out, but I bet you can find some way to output it as JSON which would be much easier, or even just a line-based table without the header lines.

XPage not found because database name is in uppercase

We have inherited a web application in Lotus Notes in which we are trying to introduce XPages (we are new to both Lotus Notes and XPages, please forgive our inexperience).
We have a view that we are trying to swap with an XPage. The current view is called like this from the application menu (the view is being called from a form):
<a href="FRVWFACSPROVXEstadoAno?openform" target="ifat">
And we are trying to call the XPage like this:
<a href="Prueba.xsp" target="ifat">
For some reason, the link is expanded at runtime to this:
http://tbsdesa.es.lladro.com/FORMACION/CARLOS/TBS_AGORA_FIN.NSF/Prueba.xsp
The page is not found because the database name is in uppercase (in fact, if we change TBS_AGORA_FIN.NSF to TBS_AGORA_FIN.nsf, it works). It is also strange that the current link is in uppercase, too, but nevertheless it works:
http://tbsdesa.es.lladro.com/FORMACION/CARLOS/TBS_AGORA_FIN.NSF/FRVWFACSPROVXEstadoAno?openform
We would like to know why the database is in uppercase. Could the Domino server be doing this?
I'm going to assume based on your question that you're calling your link from a form or page that's rendering as HTML. Since it's a relative link, you're probably navigating to it through a link that includes uppercase for the .NSF in the title. This can be solved either by fixing all your links so that .nsf is lowercase, or by calculating your XPages links better.
To do the latter, I usually do the following for XPage Links:
Link
Where XPage.xsp is the name of my xpage and the value of the Computed Text is:
"/" + #WebDbName + "/"
This will calculate the link based on what Notes wants to refer to the database as.
Hope this helps.
What OS is the server running on? If the server is running on Linux/Unix then you need to be aware that directories and filenames are case sensitive. The tricky thing, however, is that once they have been opened they are cached by the server - and will work without being case sensitive (for some time...). This can be really tricky to troubleshoot if you are not aware of the cause ;-)
I agree with the possible solution suggested by Aaron, however, it really should not be necessary... It should be better to leave that to the server.
If you are running on a *nix OS then ensuring that all paths and filenames are in the same case (I use lowercase) is a good practice...
/John

ExpressionEngine file manager - default to thumbnail view

At the moment when you go to select an image inside an entry using the EE default file manager, the default view is 'show files as a list'.
Is there a way to show the thumbnail view as the default?
At this point I would be happy with a core hack.
I don't usually use the file manager for sites (much prefer Assets) but this client had a tight budget
I've wondered about doing this in the past as well - turns out it's pretty simple. Open up ee_filebrowser.js and search for the first instance of a("#dir_choice").val(). Immediately after that add this:
; a("#view_type").val('thumb').change();
Make sure you include the leading ;.
I've only tested this in Safari but I can't see why it wouldn't work everywhere. Incidentally, JS beautifier makes this sort of thing infinitely easier.
I don't recommend hacking core for any reason and I suggest it should be avoided at all cost.
With that said, I will provide what I've found out just the same.
Looks like the following files, in EE 2.5.3, are what you'd want to edit:
/themes/javascript/compressed/jquery/plugins/ee_filebrowser.js
/system/expressionengine/libraries/File_field.php
I found these doing a file search in my text editor for view_type which was from the id of that dropdown. The javascript is minified so you'd probably want to un-minify it and then rewrite the part which handles the switch. I'm not the best JS/jQuery person out there, and un-minified js makes it a bit harder too so, I won't offer any more than what I've found so far.
Consider pulling out the parts parts from the two files if you aren't great with js and maybe start a new post tagged accordingly.
Also note: there might be more to this than just those two files so consider this answer a start and nothing more.

View. Show values as Links. Strange behaviour

Xpage (listPostits.xsp) has a "View" container control, where one of the column is set "show values in this column as links".
Now, here comes "Strange behaviour".
When i work with this application on my own (developer) PC (Win XP, Chrome or IE), the Domino generate the link, which can't be really processed:
/servername/db/postit/postit.nsf/listPostits.xsp/onePostit.xsp?documentId=many_numbers&action=editDocument
Namely, the Bold-marked portion shouldn't be there ! This portion is the name of the XPage, where the View control is in.
When i work with the application from other PC (Mac, Firefox) then i get the correct link (the same as above but without the XPage name inbetween):
/servername/db/postit/postit.nsf/onePostit.xsp?documentId=many_numbers&action=editDocument
update: let us leave for the moment the differencies in generated links between two machines. The first question is - why the extra portion is inserted into automatically generated link?
After playing around i think i might have found the reason for this strange behaviour. Namely, the "Substitution" Rules on the server side. One of them is to substitute "*/postit/all" with "/db/postit/postit.nsf/listPostits.xsp"
If i switch it off, then the Links are generated properly. Still, it's pretty strange to me that these settings influence the way Domino generates the links. I thought it works on the fly with them and those settings have nothing to do with the way how Links are generated inside the application.
So, the help now is needed regarding Web Site Rule Topic, but for that, i guess, i have to create another topic. But in case somebody has some good Info on this, please share it with me. I'm a bit confused at the moment :)
Final Update: Spent some more hours of testing and the results confirmed the initial idea.
If i open the page with the standart URL, i.e.
http://servername/db/postit/postit.nsf/listPostits.xsp then everything is fine, links are generated properly. When i however open the same page with short URL http://servername/postit/all , then server adds the substitute URL (db/postit/postit.nsf/listPostits.xsp) to every single link he generates automatically to be used as the link to open/edit the underlying document.
Is it bug or feature ? Don't know.
As a workaround (because i want to keep simple URL's for the application) i have to manually generate links.

More efficient ExpressionEngine server moves

I'm trying to find a better way to move my Expression Engine 2 sites from development to live servers. I have a checklist that I go through, starting with running a find and replace for the old/new URLs and server paths, then I update the database config file. This however misses out a huge amount of settings that I then have to go through and change manually, but I don't see why I should need to (unless these are encrypyed somewhere).
For example, I have to change the "Basepath to Template File Directory" in the Global Template Settings manually, along with member settings and a handful of others. There must be a file or entry with these in somewhere that I can change before I upload but I can't find it.
Does anyone know where these are stored?
Those are stored in the database, unless you are using global config variables.
I would highly recommend looking into some sort of config bootstrap. There are quite a few solutions to this, but it's really up to you to pick what's right for your development style / environment(s).
Take a look at the following articles:
http://eeinsider.com/articles/creating-a-robust-config.php-file/
http://boblet.tumblr.com/post/68095239/ee-localhost
http://eeinsider.com/articles/multi-server-setup-for-ee-2/
I've tried those solutions, but in my opinion the best option is NSM config bootstrap.
Check it out here: [http://ee-garage.com/nsm-config-bootstrap][4]
The only thing (currently) missing from these solutions are new config vars regarding file upload paths and locations. You can add those to any of these solutions by adding the variables detailed in this article:
http://expressionengine.com/user_guide/cp/content/files/file_upload_preferences.html#overriding-upload-paths-and-urls-using-configuration-variables
I know I'm late on this one, but for anyone else searching, this plugin is very useful and I have used it on numerous occasions.
ExpressionEngine stores your website URL and Server Path in a ridiculous number of places.
REElocate helps you update these in one simple step.
https://github.com/expressodev/reelocate

Resources