Graphs in Lucee - coldfusion

I see an error using CFCHART with Lucee. Same code works in CF. But in Lucee it try to refer to a file graph.cfm in a folder lucee.
mytestserver.com/lucee/graph.cfm?img=026f01d7b8c85b891a9c35c102623747&type=png
Do I need to create any mapping? Should this mapping be in Lucee admin or in IIS?

The short answer is: No, you don't need to add any additional mapping in IIS, nor in Lucee or Tomcat.
I've seen this question here for too long, so I'm placing an answer here to shed some light into Lucee's graph.cfm.
Some tags in CFML need to create additional image files to later embbed them as an inline HTML element into the reendered output altogether. Examples for such file creation are <cfimage type="captcha" ...> or like you have already noted in your issue, <cfchart>.
For such functionality Lucee needs to create these files temporarily somewhere and also make them publicly available. To achive this for cfimage/cfchart, Lucee creates the files in the web context folder of your webroot (which typically is located at path-to-your-webroot\WEB-INF\lucee\temp\graph ) and embbed them inline with a link to graph.cfm. The template graph.cfm just reads the temporary file from that folder, and delivers it in realtime to your application.
If you want to take a look into Lucees original graph.cfm, we can take a peek thanks to OpenSource:
source of Lucees graph.cfm at github
In order to make the files and the template graph.cfm temporarily publicly available, which by the way sits behind the WEB-INF folder ( which is also hidden/blocked by default in Tomcat for securtiy reasons), Lucee MUST have a virtual mapping. But you don't need to set it up, because these are already set up by default. You can see this in the image below taken from the "Mapping"-section of Lucee Administrator:
Because graph.cfm is a .cfm file, IIS will redirect the request directly through the implemented CFML connector ( probably Boncode Connector ) per AJP to Tomcat. Thus you don't need to set any mapping in IIS neither.
Because you have not submitted any additonal error information, such as http error codes or stack traces, I don't have any clue of what might be the cause of your error. It may also be some incompability issue which might be addressed if you submit it to the Lucee core team.
Another possibility is that many installation guides advise you to lock down the "/lucee/" path with IIS URL Rewrite Module, because this is also the path where the Lucee Administrator sits behind. If so, you can change the setting in IIS Rewrite Rule and adapt the rule in such a manner, that it would not block the graph.cfm.
It's also important to note that many of these cftags are implemented as Lucee extensions (.lex files). These are not necessarily pre-shipped or pre-installed in Lucee, but you may install it within Lucee Administrator or get them from Lucees Download site and upload it through your Lucee Administrator in the "Extension" section.

I've just encountered this too. Issue being though the the default mapping still don't navigate to "graph.cfm" so we've added an IIS virtual mapping instead.

Related

Embedding a functional website inside a Squarespace webpage

First of all, thank you for everything that you do. Without this community, I would hate web design and be reliant on my teacher's outdated, static methods. Much love <3
So, this is a tricky one (maybe).
I want to have, essentially, an iframe on a webpage that contains a website I coded previously. It was a project for school that never went live, but I'd like to include it as part of my portfolio. Problem is, an iframe needs a URL for a source, but I just have the folder with more folders full of code, fonts, and images. How can I tell the browser to populate this box with everything from "name" folder? And then how will it know to run the code instead of just showing a file tree or something?
In the end, I want a page describing a previous web project and let the client experience that project within the one page. And I don't want to get a domain for every project I do.
Maybe there's an easier way I'm not thinking of?
To make it interesting, my new portfolio site is being made in Squarespace...maybe. I bought a domain from them because I had a promo code and wanted to try the platform, but I kind of hate it. I can't change any of the code and it won't maintain a connection to Typekit. So all I can do is change the basic appearance of preexisting elements. It's like WordPress all over again....LAME! Sadly, I already bought the domain.
Can Squarespace just be a host? Is there a way to download the raw code of these templates, edit it, and upload it again?
Thanks for all your help!
I want to have, essentially, an iframe on a webpage that contains a
website I coded previously.
Squarespace's file upload mechanism is very limited. Without using the Developers Platform, there is no effective way to upload many files at once. Furthermore, there is no way to create folders. Therefore, even if you were willing to upload each .html file and each asset one-by-one, there'd be no way to organize the files into folders (assuming that the "tree" you mentioned includes additional sub-folders).
Initially, in order to get the files to be accessible by Squarespace, you'd have to do one of the following:
Use Squarespace Developers Platform (A.K.A. "Developer Mode") and upload your to-be-iframed
(TBI) website files to the "assets" folder using SFTP or Git.
Host your TBI website files somewhere else (a different host
environment, for example) which will maintain your file/folder
structure.
How can I tell the browser to populate this box with everything from
"name" folder? And then how will it know to run the code instead of
just showing a file tree or something?
Assuming that the TBI website has an index.html file or home.html file or similar, and assuming you were to use the Squarespace Developer Platform, you'd insert the iframe either in a Code Block or within a template/.region file directly using something like
<iframe src="/assets/tbiwebsitefolder/index.html"></iframe>
while setting your other iframe attributes (such as height and width) as needed.
Is there a way to download the raw code of these templates, edit it,
and upload it again?
Yes. You select a template and then enable Developer Mode on that template. From there, you use SFTP or Git to download the template files, edit, and reupload.
You may benefit by reviewing some considerations of enabling Developer Mode on a Squarespace Template.
One other idea, to avoid the iframe and Developer Mode entirely, would be to capture images of the TBI website rendered in a browser, and then simply add those images to a gallery block or gallery page. This could allow you to convey the general idea of the project but would of course not capture the full "experience" of it.

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.

Sitecore: default database upon login

How do you change the default database used when loggin in to the backend of Sitecore?
I an solution i am currently working on, whenever a user logs in to the backend it defults to the web database and not the master as it should.
i have checked the sites definition in the web.config, but no luck - it is set to master.
Where else could i look?
Unfortunately there is a number of ways this could be configured. Without actually seeing your configuration files, it is difficult to point out which.
I can tell you this however. The likely cause would either be:
Your site definition for the "shell" site. By default it has a content="master" attribute - by changing this, you would (likely) change the database the users work in. I say "likely", since it isn't really the recommended approach to my knowledge.
The same setting could also be set in a .config include file, so it may not be in the main web.config file itself.
For a reference to how these (web.config include files) work; check out http://www.sitecore.net/Community/Technical-Blogs/John-West-Sitecore-Blog/Posts/2011/05/All-About-web-config-Include-Files-with-the-Sitecore-ASPNET-CMS.aspx

CF10 developer on IIS7.5 / WIN7 - CFM files run ok - but can't see .GIFs

Can anyone help with this strange problem.
I have just installed CF10 developer on Win7 which is using IIS7.5.
Installation went smooth, and can browse .cfm files no problem and connect to datasources no problem .. BUT: even though I can browse all my local cf sites, none of the sites will display images or styles for external .CSS files.
So, I get the site, content from the database, and all the functionality of cfm files being parsed OK, but no styles and no images.
If I browse directly (pasting the filepath in the browser) to one of the images I get a 404 error - file not found - even though the .gif file does indeed exist in the directory.
So, basically, I can run CFM files, and browse a local site built in coldfusion, but none of the images or externally referenced css files will be "found" by the browser/IIS.
Can anyone help?
Thanks in advance if someone can..
Sounds like an issue with those mimetypes, please see the following for information on installing the static content role to IIS and enabling those mimetypes to be served.
No Mime Types Option in IIS 7
Be sure to enable static content in IIS 7.
Had two occurrences of this problem lately.
See here:
http://weblogs.asp.net/anasghanem/archive/2008/05/23/don-t-forget-to-check-quot-static-content-service-quot-in-iis7-installation.aspx
Try restarting the IIS server. Close all browsers and restart.
You need to determine if it is a CF issue or an IIS issue. Try the following:
Check to see if this is an issue with images not being served vs broken paths to the images. There may be CFML code that is creating links to invalid locations.
If the locations are valid then it would be an issue with IIS not server image files.
Also check to see if there is a similar issue with JPEG and PNG files. If JPEGs and PNGs show up, this suggests an IIS issue.
Also try creating a simple HTML page that has an image on it. If it has an image on it, this suggests a CF issue

Why doesn't Railo read the 'customtag' path like CFMX 6.1 does?

I am trying to migrate from CFMX 6.1 to Railo 3.1.
I have custom tags in this directory for CFMX 6.1
C:\cfusionmx\customtags\myapp
I copied the directory to
{railo-web}/customtags/
and added this mapping through the Railo administrator and also enabled the "Search subdirectories" setting.
I get this error the moment I try to access a page that calls anything from this directory:
invalid component definition, can't find mycfc
My Railo installation is deployed through GlassFish v3.
I see the error the moment this script is loaded:
<cfscript>
mycfcinstance = createobject("component","mycfc");
</cfscript>
In the legacy app that I try to migrate, a lot of CFCs have been stored in CFMX 6.1's customtag path.
First of all, Railo simply does not support search for CFC's inside the Custom Tag directory. Seems that it will, one day.
Second, it looks like small misunderstanding the meaning of the Railo CFC-based custom tags, which you can manage using that "Archives & Resources > Custom Tags" page in Admin. You can find more about it in Railo's blog, for example in these posts: part one and two.
As for the Railo workaround for this legacy app, I couldn't find the way to imitate desired behaviour.
It can be inappropriate, but maybe you will end with batch-replacing
createobject("component","components.
with
createobject("component","
and creating mapping in the Application.cfc or Admin.
So, if you want to put cfc somewhere in the application root.
this.mappings["/components"] = getDirectoryFromPath(getCurrentTemplatePath()) & "components";
Yes, it's not really matches your problem, just an example.