w3hello.com logo
Home PHP C# C++ Android Java Javascript Python IOS SQL HTML videos Categories
ColdFusion 8 to ColdFusion 10 Migration: CFloginUser Not Working As Expected
ColdFusion 10 Application Based User Security Is Broken I have deployed two test sites, using Adobe's own example code for application based user security, copied in its entirety from the Adobe website. One test site is in ColdFusion 8, one is ColdFusion 10. The code and databases are identical on both sites. I added cfdump output to monitor session variables and login status as they are set. Test Site ColdFusion 8: http://cf8loginadobe.cimhost.com/securitytest.cfm Test Site ColdFusion 10: http://cf10loginadobe.cimhost.com/securitytest.cfm Logging in using a user of "Bob" and password of "secret" demonstrates the failure in CF10. Initially it appears login was successful, but note that the cfdump of the session does not show a cfauthorization_orders value in CF10, where in CF8 the val

Categories : Iis

Any way configure to configure visual studio mvc build views release mode
Are you specifically setting something to compile the views like the Razor Generator? (http://razorgenerator.codeplex.com/) If not views in MVC are not compiled.

Categories : Asp Net Mvc

TFS 2012 Configure Features Error - Unable to configure Planning Tools
Try this: Rename your User Story to "Product Backlog Item". Set the Initial State of you "Bug" to "Active". Try the Upgrade Rename your User Story Type back to "User Story". Remove the "Active" Initial State. Export your Common Process Config and add in your "Proposed" State into the Bug Configuration (see below). Import your Common Process Config. Example BugWorkItems <BugWorkItems category="Microsoft.BugCategory"> <States> <State type="Proposed" value="Proposed" /> <!-- more --> </States> </BugWorkItems>

Categories : Tfs

ArrayDeleteAt - ColdFusion
I tried to extract your problem into a self-contained test case, but I cannot reproduce your problem using CF10. <cfset session.orders = [{item='blah',qty=1},{item='blah2',qty=2}]> <cfdump var="#session.orders#" format="text" label="before arrayDeleteAt(session.orders, 1)"> <cfset arrayDeleteAt(session.orders,1)> <cfdump var="#session.orders#" format="text" label="after arrayDeleteAt(session.orders, 1)"> Output: before arrayDeleteAt(session.orders, 1) - array - Top 2 of 2 rows 1) [struct] ITEM: blah QTY: 1 2) [struct] ITEM: blah2 QTY: 2 after arrayDeleteAt(session.orders, 1) - array - Top 1 of 1 rows 1) [struct] ITEM: blah2 QTY: 2

Categories : Arrays

Xml Namespace - Coldfusion
You could just build the XML object yourself (without using the built-in functions). Something like: <cfsavecontent var="my_doc"> <?xml version="1.0" encoding="UTF-8"?> <Invoice xmlns="urn:oasis:names:specification:ubl:schema:xsd:Invoice-2" xmlns:cbc="urn:oasis:names:specification:ubl:schema:xsd:CommonBasicComponents-2"> <cbc:UBLVersionID>2.0</cbc:UBLVersionID> </Invoice> </cfsavecontent> The variable my_doc will now contain the XML in your preferred format.

Categories : Xml

How to set .NET enum in ColdFusion
(Disclaimer: My current test environment is CF9, but the results were the same as yours) Normally you can modify a field by using set_FieldName( value ). However, I can see from your screen shot that method does not exist. I was not sure why, so I did a little searching. Based on what I have read, your class is using Nullable Types: public static Environments? Environment { get; set; } That seems to be the root of the problem. From what I can tell, jnbridge (underlying tool used for .net interop) does not seem to generate proxies when Nullable Types are involved. That would explain why the methods to access the Evironment field are missing. If you remove the ? operator, it works just fine. CF Code: <cfscript> goCardless = createObject(".net", "GoCardlessSdk.GoCardless

Categories : Dotnet

How to conduct A/B test with ColdFusion?
You may want to look into Mark Mandel's Squabble. It's an A/B testing solution that's written in CF. It hasn't been updated in a while but Mark presented on it at cf.Objective in 2012, so it's compatible with ACF 9, at least.

Categories : Testing

Extracting XML data with ColdFusion
Try this, where xmlData represents pulling the file into a variable. This will spit out all of the blocks underneath. Just change the output to a test for the resname being the league you wanted. You could then reference the source.xmltext under the loop block as well. <cfscript> xmlContent = xmlParse(xmlData); subSet = xmlSearch(xmlContent,'/xliff/file/body/trans-unit/'); for(i=1; i LTE arrayLen(subSet); i++) { writeoutput(subSet[i].XMLAttributes.resname & "<br />"); } </cfscript>

Categories : Xml

Validating Checkboxes with Coldfusion
Here is an example from a form I've done. <cfif isDefined("form.submit")> <cfif form.checkbox1a EQ "" > <p class="text-error">Please check at least one answer below</p> </cfif> </cfif> <fieldset data-role="controlgroup"> <legend>*Pick some chips</legend> <input type="checkbox" name="checkbox1a" id="checkbox1a" value="a" <cfif ListFind(form.checkbox1a,"a") GT 0>checked="checked"</cfif>/> <label for="checkbox1a">Cheetos</label> <input type="checkbox" name="checkbox1a" id="checkbox2a" value="b" <cfif ListFind(form.checkbox1a,"b") GT 0>checked="checked"</cfif>/> <label for="checkbox2a">Doritos</label> <input type="checkbox" name="checkb

Categories : HTML

coldfusion variables into powershell
What you can do is make it in to a function that allows parameters. Then you can call the function with the params as necessary. Example: function CreateText { param ( [string]$MyVar ) $MyVar | out-file -FilePath "C:\_Testing est.txt" } CreateText -MyVar "Content Here" And you can call it this way: <cfexecute name="C:WindowsSystem32WindowsPowerShellv1.0powershell.exe" arguments="C:ColdFusion9wwwroot estsitewwwroot\_TestingpowershellTest.ps1 -MyVar "conent" "/>

Categories : Powershell

Coldfusion , returns nothing
Your cfreturn is invalid <cfreturn myToken = webservice.struct.token> If you want to return webservice.struct.token Your cfreturn should just be <cfreturn webservice.struct.token>

Categories : Function

ColdFusion soap client
I've modified a function I've used in the past to pass data form ColdFusion to Dynamics GP via soap. <cffunction name="callWebService" access="public" output="false"> <cfargument name="soap" type="xml" required="true"> <cfhttp url="https://webservices.nbs.rs/CommunicationOfficeService1_0/CompanyAccountXmlService.asmx" method="post"> <cfhttpparam type="header" name="content-type" value="application/soap+xml"> <cfhttpparam type="header" name="SOAPAction" value="http://communicationoffice.nbs.rs/GetCompanyAccountByNationalIdentificationNumber"> <cfhttpparam type="header" name="accept-encoding" value="no-compression"> <cfhttpparam type="header" name="content-length" value="#len(Arguments.soap)#"> <cf

Categories : Web Services

Copyable Coldfusion SQL Exception
I've finally created this helper function to build that copyable query line: <cffunction name="limnSQLDump" output="no" access="public" returntype="string"> <cfargument name="sql" required="yes" type="string"> <cfargument name="params" required="yes" type="string"> <cfset var arrParam = ListToArray(arguments.params, ' , ', false, true)> <!--- Arrayify Dat Param String ---> <cfset var sub = StructNew()> <cfset var objParam = StructNew()> <cfloop from="1" to="#ArrayLen(arrParam)#" index="i"> <!--- Loop through each param string ---> <cfset arrParam[i] = REReplace(arrParam[i], '(param d+) = [([^]]+)]', '1', 'all')> <!--- Scoop out the meat ---> <cfset

Categories : Sql Server

Coldfusion breaking an array into two
I think without seeing your array example, you mean splitting the data in the array into two lists? <cfset selectList1 = listAppend(selectList1, listFirst(i,':')) > <cfset selectList2 = listAppend(selectList2, listLast(i,':')) >

Categories : Arrays

Using a wildcard in cfqueryparam - Coldfusion
Your syntax looks fine. I use the same kind of logic in some of my code running against Microsoft SQL Server. Try this to debug your code and see the SQL that is being generated. <!--- Comment out your query tag to debug <cfquery name="sample" datasource="database"> ---> <cfoutput> <!--- add a cfoutput tag to "see" your generated code ---> SELECT * FROM table WHERE <cfloop from="1" to="#listLen(selectList1)#" index="i"> #ListGetAt(selectList1, i)# LIKE <cfqueryparam cfsqltype="cf_sql_varchar" value="%#ListGetAt(selectList2,i)#%" /> <cfif i neq listLen(selectList1)>AND</cfif> </cfloop> </cfoutput> <!--- add a cfoutput tag to "see" your generated code ---> <!--- Comment out your query tag to debug </cfque

Categories : SQL

Getting string between two characters - Coldfusion
If it really is as simple as getting the text between the first and second underscore character, you don't need a regex. This'll do it: myStr2 = listGetAt(myStr, 2, "_"); That said, this should do for the regex in that context: ^.*_([^_]+)_.*$, eg: myStr2 = reReplace(myStr, "^.*_([^_]+)_.*$", "1", "all");

Categories : Regex

Using the Bing Web Search API with ColdFusion
Purely through frustration, I now have this working. In a nutshell, it works if you DON'T Base64 encode, and you add username & password to the cfhttp tag, like so; <cfhttp url="https://api.datamarket.azure.com/Bing/SearchWeb/v1/Web?Query=%27MY_QUERY%27&Market=%27en-GB%27" method="get" username="MyACCOUNTKEY" password="MyACCOUNTKEY">

Categories : Api

ColdFusion .Net class not found
Problem solved. I needed to included the supporting DLLs: <cfobject type=".NET" name="GoCardless" class="GoCardlessSdk.GoCardless" assembly="#expandpath("../GoCardlessSdk.dll")#,#expandpath("../Newtonsoft.Json.dll")#,#expandpath("../RestSharp.dll")#">

Categories : Dotnet

Deleting a file in coldfusion
So you have a form plus a link. If the user selects the link, you want an alert to come up and if the user accepts, a file gets deleted on the server, but the user stays on the form? My approach would be: Put a 1 pixel iframe on your form page that contains the code to delete the file. For your anchor tag, have it link to javascript so that you can use the confirm popup. In the page that deletes the file, add some extra code that uses javascript to do something about the link on the form page. You can get rid of it completely, or replace it with a statement saying the file has been deleted. Note that step 3 will be easier if you have your link inside a <div>.

Categories : File

Coldfusion CGI.HTTP_IF_MODIFIED_SINCE seems not to work in IE
I am not sure why you are trying to manage this functionality yourself. Let the browsers do the work they are designed to do. If you set the Expires header to some point of time in the future the browsers should "automatically" do what you are trying to do; use the locally cached version. Once the Expires time has passed the browser should request a fresh copy. You will also want to set the Cache-Control header. This page gives a pretty good description of the process: Increasing Application Performance with HTTP Cache Headers. Note: If both Expires and max-age are set max-age will take precedence.

Categories : Tomcat

ColdFusion 8 ArrayFind Substitute
Your question may be answered to a point here "Is there a function similar to ArrayFind from ColdFusion 9 in ColdFusion 8?" but I don't see any other way apart from looping. You can always create and use an UDF but it would have to use looping. Why exactly you don't want to use looping anyway? Do you have that many elements in the array? Just remember to use cfbreak after finding your element to stop going through the rest of the array.

Categories : Arrays

Using jQuery-barcode.js with ColdFusion
Actually I just setup your code and found the issue. First, you have an extra closing parenthesis ")" at the end of your code: output:bmp})); Also, the output value is a string so it needs to be in single quotes. So in that one line of code, remove the single quotes that encase the line, remove the extra closing parenthesis, and put the format in single quotes to treat it as a string: $("#bcTarget").barcode("1234567", "code39",{barWidth:2, barHeight:30, output:'png'}); That should work.

Categories : Jquery

Rewrite issue with ColdFusion and IIS
You should add conditions in case the website hosts images, js, css, etc. You also don't want to rewrite any possible URls that have CFM in them. These are the conditions we're using: <conditions> <add input="{SCRIPT_FILENAME}" matchType="IsFile" negate="true" /> <add input="{SCRIPT_FILENAME}" matchType="IsDirectory" negate="true" /> <add input="{PATH_INFO}" pattern="^.*(/index.cfm/).*$" negate="true" /> </conditions>

Categories : Iis

ColdFusion 10 REST API UTF-8 Characters
I can't guarantee that adding a Content-Type header and specifying a charset of UTF-8 would fix your problem; but what I can tell you is that Taffy assumes UTF-8 and it doesn't have this problem: Here's an excerpt of Taffy's code that gets the request body: <cffunction name="getRequestBody" access="private" output="false" hint="Gets request body data, which CF doesn't do automatically for some verbs"> <cfset var body = getHTTPRequestData().content /> <cfif isBinary(body)> <cfset body = charsetEncode(body, "UTF-8") /> </cfif> <cfreturn body /> </cffunction>

Categories : Rest

Include Java Files into Coldfusion
The easiest way to add class or jar files to your class path is to simply drop them in the lib directory where they are automatically picked up. The directory is located at {cf_installation}/servers/lib. These class files will be available to all servers. http://blogs.adobe.com/cantrell/archives/2004/07/the_definitive.html

Categories : Java

Calling functions between components in Coldfusion
My solution was to have mandrill.cfc extend the general.cfc component: <cfcomponent extends="general" name="mandrill" ...> See also CreateObject

Categories : Function

Decrypting a gpg4Win encrypted CSV with Coldfusion 10
(Note: I am assuming you first verified the above file settings work successfully from the command line. If not, go back and do that first) If that is your actual CF code, it contains a few syntax errors. There is no closing quote after the arguments attribute, and no opening quote after outputfile attribute (which is also misspelled). So the CF code should compile, but might not produce any output files. Try fixing the quotes and you should get some output, even if its just an error: <cfexecute name="C:Program Files (x86)GNUGnuPGgpg2.exe" arguments="--passphrase=#gKeyPassphrase# --batch -o #inputFilePath# -d -r #gEncryptionKeyID#" outputfile="#outputpath#/test.csv" timeout="300"> </cfexecute> Also, while I am not familiar with gpg2, a quick search s

Categories : Csv

How do I consume a WCF web service with net.tcp binding in ColdFusion?
You need to supply wsdl2javaargs flags supplying the username and password in order for the ColdFusion server to read the "imports" files that WCF uses, instead of having an all-in-one page for the wsdl. E.g. <cfset yourPassword="whatever"> <cfset yourUsername="whoever"> <cfobject type="webservice" name="ws_eWard" webservice="http://url.to.web-service.org/yourWebService.svc?wsdl" password="#yourPassword#" username="#yourUsername#" wsdl2javaargs="-U #yourUsername# -P #yourPassword#" > Found this pointer at: http://forums.adobe.com/thread/642095

Categories : Wcf

Java method not found in ColdFusion
Assuming you are not invoking that method, it probably means exactly what it says. The codec version loaded by the jvm does not contain a method with that signature. You can verify it by creating an instance of org.apache.commons.codec.binary.Base64 class and checking the available methods with cfdump. (It might also be a class loader conflict, but the former is more likely.) As far as the reason, when multiple versions of a jar are present in the class path, the jvm can only pick one of them. It probably picked the older version that ships with ColdFusion, which may not have that method. See: Identifying which jar a class was loaded from... The simplest way to load a newer jar version is to remove the old jar in /lib, replace it with the newer version, and restart CF. Keep in mind that

Categories : Java

Playing around with date range in ColdFusion 8
If I were you I would really consider re-working the qDatabase query it is VERY inefficient! As far as downloading a csv the best way is to write a file to a temp area that frequestly gets cleaned out so it doesn't fill up you HD. I will help with writing the file but not the clean up lol. You can do something like this: <cfscript> var tl =''; var nl = (Chr( 13 ) & Chr( 10 )); var fileContent = createObject("java","java.lang.StringBuffer").init(); var counter =1; fileContent.append( 'OPEN,BOUNCE,DEFERRED,DELIVERED, etc'); fileContent.append(nl); for(i=1;i<=qDatabase.recordCount;i=i+1){ tl = qDatabase.OPEN&','qDatabase.BOUNCE&','qDatabase.DEFERRED&','qDatabase.DELIVERED&',' etc; fileConten

Categories : Mysql

How to install java class for Coldfusion 10
The only difference in CF10 is there is an extra directory layer between the {install root} and {web root}. ie coldfusion8wwwroot coldfusion10cfusionwwwroot However, it does not change the rules about class loading. Jars can be placed anywhere, as long as they are accessible to the CF service, and the directory is in CF class path, or the default jvm class path. There are several directories in the default class path that CF checks automatically, such as {cf_webroot}web-inflib. The simplest option is to place them in that directory. Then CF will pick them up automatically, no need to muck with the class path settings. Just drop your jars in that folder, restart the CF service, and you are good to go.

Categories : Java

ColdFusion Mail Spool Timeout
This would be a poor use of spoolenable="false". What that setting does is set the email to send immediately bypassing the built in mail spooler. This makes the client request have to wait to return till the email is sent. This impacts the users of the system as they now have to wait for the CF server to actually send the email. This now adds a potential point of failure to the client request and could cause other issues. If you want to avoid the spool I would do the mail send in a cfthread. This way you are at least not impacting the client with the mail send.

Categories : Java

Caching a stored procedure in ColdFusion
You're passing in (what looks like) a date/time. Query caching is based on the arguments to the query (or more specifically, the SQL that would be used). I'm assuming you're passing in different date/time valus each time. Each different date/time value would have its own cached result, unless you're just passing in the same date value each time? e.g. these would be treated as two different objects for caching: <cfstoredproc datasource="#XXX#" procedure="XXX" cachedWithin="#CreateTimeSpan(0,3,0,0)#"> <cfprocparam type="In" value="2013-06-13 09:00:00" cfsqltype="CF_SQL_TIMESTAMP"> </cfstoredproc> <cfstoredproc datasource="#XXX#" procedure="XXX" cachedWithin="#CreateTimeSpan(0,3,0,0)#"> <cfprocparam type="In" value="2013-06-13 10:00:00" cfsqltype="CF

Categories : Caching

Issues parsing JSON in ColdFusion
ArrayLen() returns an integer, the length of the array. On the following lines... <cfset colList=ArrayLen(cfData.COLUMNS)> <cfset cityIdx=ListFind(colList, "City")> You set colList to the return of ArrayLen() (an integer) and then try to reference it as a list. That's probably causing an error.

Categories : Javascript

ColdFusion Function Similar to PHP mb_convert_encoding
Update: By default CF uses UTF-8 to decode URL variables. "To decode .. URL variables in any other encoding ... you must use the setEncoding function." <cfscript> setEncoding("URL", "shift_jis"); writeDump(URL.brand); // result 日�Y自動車 </cfscript> When you have questions like this, the first place to look is in the Functions by Category view of the documentation. All of the functions are descriptively named. You can usually figure out the function you need by its name alone. If you look over the String Functions section, you will find two functions that (combined) should do the trick: CharsetDecode(string, encoding) - Decodes a string in the given encoding into binary CharsetEncode(binary, encoding) - Converts binary into a string using the specified en

Categories : PHP

Consuming ColdFusion RESTful Service
Have you looked using at the JSONReader in extjs or jQuery.getJSON function? NOTE : Despite the fact that the web service was created using ColdFusion, this is a javascript/ext.js question and not a ColdFusion question.

Categories : Web Services

Migrating web service from ColdFusion 8 to 10 issues
I found the solution to my problem. The ColdFusion connector was causing the fault. After installing ColdFusion 10 and patching, I had run the wsconfig to rebuild the connector. I had either done this incorrectly, or for some reason it didn't take. I ran it this morning, removed the connector, re-added it.... everything working fine now. Very frustrating.

Categories : Web Services

coldfusion finding a struct in an array
Instead of building an array of structures from an existing query I would recommend performing a Query of Queries. It will allow you to use SQL statements to query your existing result set in memory. This is assuming that all of the data you need is already available in the existing query (sounds like it is from your question). An example query of query would be: <cfquery dbtype="query" name="qoqexample"> SELECT id, text, other_columns FROM variables.qQuery WHERE id = <cfqueryparam cfsqltype="cf_sql_integer" value="#nID#"> </cfquery>

Categories : Java

Coming from ColdFusion, where and how to set Session Variables in PHP
To start a session, sesson_start: session_start(); add a value to a session: $_SESSION['name'] = 'value'; End a session, session_destroy: session_destroy(); Save path for sessions, session_save_path:

Categories : PHP

Getting click of li created in a ColdFusion file
I had to ask a similar question a while ago. The problem you're facing is that you're trying to interact with objects that don't exist in the DOM when you created the function. You want to use the jQuery's .on() to attach an event to newly created objects. Bonus tip, .on() replaced .live() in jQuery 1.7. so if you've picked up any free code using live() or anyone tells you to use live() use on() instead <script type="text/javascript"> $("#plates").on("click","li",function() { var strLicense=$(this).text(); strLicense=$.trim(strLicense); }); </script>

Categories : Jquery



© Copyright 2017 w3hello.com Publishing Limited. All rights reserved.