coldfusion

Adding a text watermark

I've learned how to add a watermark to a pdf. <cfpdf action="addwatermark" image="NoteToSelf.png" pages="1" position="0,0" showOnPrint="no" source="my.pdf" destination="#myDir#\new.pdf" overwrite="yes" opacity="10"> The way I read it, the watermark has to be an image. But NoteToSelf.png needs to be te...

Dimensions of a pdf page

I'm adding a watermark to pdf document, but position 0,0 is the bottom left-hand corner. I need to put the watermark at the top left-hand corner. Q: Using version 8 of ColdFusion, how do I determine the page size, or how can I position the watermark at the top? Update: I think I should be looking at action="addHeader". Using leftmargi...

Removing set number of characters from end of string with ColdFusion

Hi there, Simple request (hopefully) here. I have a string which whilst it varies in length, will always need the last 6 characters removed. Using a 3rd party web service, so I'm unable to edit the response in the XML before outputting. If anyone can suggest a quick way of trimming them off i'd be really grateful! here is the string...

Compare DateTime values by Min and not by Day in Coldfusion CFQUERY

This is the query that I have. <cfquery name="qryname" datasource="dsn"> UPDATE ticketlist SET status = <cfqueryparam cfsqltype="CF_SQL_VARCHAR" value="Expired"> WHERE expdatetime < <cfqueryparam value = "#yourDate#" cfsqltype = "CF_SQL_DATE" maxLength = "19"> </cfquery> It is able to give me all the results who's expdatetime is l...

username urls like twitter and facebook

how does twitter and facebook etc. make unique url eg. twitter.com/billgates if i would like to do the same (give my users unique urls with username), is it a application or do you crate a directory for each user with a index page?? by the way im using coldfusion. thanks ...

Is there any way to access information about a Coldfusion server's load from within coldfusion?

I am writing a scheduled task which I would like to run frequently. The problem is that I do not want this task to be run if the server is experiencing a high traffic load. Is there any way other then getting the free/total/max memory from java to try and figure out whether this task should continue? ...

Google maps api V3 - Adding multiple markers dynamically from query results

Hi there. I'm trying to set up a map on a page with a couple of links set up underneath that when clicked, will dynamically query my database and the result set output on the map. I've spent quite a lot of time googling this but can't find quite what I'm looking for. I've got as far as using AJAX to return the lat and lon coordinates OK,...

Coldfusion web service error, "Unable to parse WSDL as an XML document."

I'm trying to get a web service running CF9 IIS7 testpage.cfm <cfinvoke webservice ="https://nww.eastwickpark.nhs.uk/cfcs/test.cfc?wsdl" method ="echoString" input = "hello" returnVariable="foo"> <cfoutput>#foo#</cfoutput> test.cfc <cfcomponent output="false" access="public" returntype="string"> <cffunction name = ...

Flash Player Unresponsive on Remoting Error - AS2

We have an application that was developed with Flash, AS2 and ColdFusion backend (remoting). I observed that when there was a database query failure, and that came in to Flash, the _result handler will be called (instead of _status), and the player hangs with the infamous unresponsive / abort the script error. Doing a trace on the resul...

2-legged OAuth in Coldfusion

I am developing a service to get data from Echo System using their Scheduling API. Echo System Scheduling API requires each request to be signed by OAuth(2-legged). I have generated the request URL but I am getting "I/O Exception: Name in certificate" Error. Echo System uses https, so i am thinking it might be the cause but i am not su...

What's wrong with this mergesort?

I'm trying to implement mergesort in Coldfusion, but it is spitting out incorrect results, code: <cffunction name="mergeSort" hint="Sorts arrays of structs"> <cfargument name="arr" type="Array" required="yes"> <cfif Arraylen(arr) LTE 1> <cfreturn arr /> </cfif> <cfset left_ = ArrayNew(1)> <cfset right_ = ArrayNew(1)> <cfset mid_ = ...

How can I do a "deep compare" or "diff" on two Structs?

(This is a coldfusion question) I've got two different Structs that may or may not contain the same data, and I want to be able to see if they do! My Structs will always contain simple values (Numbers, Strings or Booleans) because they are being created with DeserializeJSON, so hopefully this can be done easily. I found Ben Nadel's pos...

What JSON does this CF code return?

Trying to implement the excellent jQuery bidirectional infite scroll as explained here: http://www.bennadel.com/blog/1803-Creating-A-Bidirectional-Infinite-Scroll-Page-With-jQuery-And-ColdFusion.htm For the server-side, which returns JSON, the example is in ColdFusion. Trying to implement it in PHP. I need to find out what the format ...

local SMTP server won't send email from cfmail b/c of rcpthosts issue

We've ported several legacy ColdFusion sites from rackspace to viviotech, and they all work fine except for sending email using the cfmail tag. When viewing the CF mail.log it contains this error message for each attempt: "Error","scheduler-0","07/01/10","06:31:22",,"Invalid Addresses; nested exception is: class javax.mail.SendFailed...

Why are null strings in my database not returned with returnFormat = JSON

{ MESSAGE = LoginWelcomeBackMessage; SUCCESS = 1; USER = { AcceptAllFriendRequests = 0; CreateDate = "June, 07 2010 00:00:00"; DayOfBirth = "April, 24 1974 00:00:00"; UserName = "Erik Madsen"; }; } My CFC defines all the columns in my database table, but when a column is NULL, the field isn't returned as a property ...

jaxb or equivalent for Coldfusion

I'm very new to this, so go easy on me. From my understanding, JAXB allows the programmer to use Java classes to write XML, and it takes care of creating the proper XML structure by reading XSDs. This way, when the schema changes, the programmer doesn't have to go back and rewrite a bunch of hard-coded XML because JAXB automatically tra...

Rewrite url issue

Hi Folks, I'm hoping someone can help me. For my website I have a corresponding mobile site that has the same content as my full site but display it for mobile devices. Basically I want to send all requests from the full site to the mobile site unless the url variable sms exists So in my htaccess file for my full site I have this: R...

How to bind a CFC directly to a select menu?

I'm trying to create a select menu where one can select a department and then select employees in that department. Related Selects... Ok here is the problem...I need to bind directly to the cfc because binding like this: <cfselect name="people" bind = "cfc:test.getPeople({department.value})" /> DOES NOT WORK. It does nothing... here ...

Building a select list inside a loop

How do you NOT use a query of queries inside a loop to solve the problem of having to build a select list for each row? In this example, every customer has a list of actions unique to that customer: <cfquery name="qryAction" datasource="myDataSource"> SELECT ActionID,CustID,ActionName FROM AvailableActions </cfquery> <cfquery name="qry...

ColdFusion 9 Upgrade: Invalid branch target position offset

I'm working on upgrading an app from MX7 to 9 and testing it on my Mac's Dev server. I have a page with a large cfswitch--20 or so different cases, but none more than about 10-12 lines long. In CF9 only, whenever one of these cases does a cfinclude (which is almost all of them), I get an error along the lines of: org.apache.bcel.generic...