Thursday, November 3, 2011

Offline AIR Sync with ColdFusion Difficulty

Well, I have tried my hand at this for some time, but can't seem to get it to work, AND I really have no idea why not, nor how to fix it. This is one of those problems that is too big for Twitter :)

Anyways, I have a mobile AIR app that I have built (and it works great!), however I need the data to be synced back to the server and then accessible to other mobile devices. I have CF9 set up, with ORM, I've tried to keep it simple, and have all the data stored in a single table. Below is the CFC for the data...


And here is the object from ActionScript...




Now anytime I try to update the object on the server, I just get an error. Doing some logging and tracing, it seems that two of the data items in the struct sent to the server do not have a value, just a '?'. Um, the data is fine on the device, but not when it sends it to the server. So WTF?

Does anyone out there have any suggestions for me? This has been bugging me for a couple of days (its a side project so I had to find time to post about it). If you need any further data or code, please just post for it in the comments. Thanks in Advance for any assistance!

Tuesday, November 1, 2011

ColdFusion 9 and Exchange 2010

So during the set-up of the network that I have had to build, I've run into a few snares with the server and getting the system (that was provided to me). The biggest one that was problematic, was the OWA access for my Exchange server stopped working. At first I thought it was something with the SSL certificate that I had created for the mail server and I went through a LOT of work to fix the Exchange server. Once the server was running and OWA was operating properly (yeah, uninstall Exchange and mess around with IIS) I was quite happy.

I then wanted to add ColdFusion 9.01 to the server (again) before adding the large custom 'program' to the server that has to be installed to the default website (same as OWA) and creates a crazy number of virtual directories and whatnot to the IIS server. So I installed CF9 in advance... with the default settings, and applied it to all IIS websites. Then I went to access OWA and, um it didn't work. I finally figured out that adding ALL websites to CF9 caused the issue (yeah there was a LOT of Googling, but not much was out there, and I can't seem to find the post that helped me to find the problem... )

Anyways, I uninstalled CF9 and OWA worked no problem, so then I re-installed CF9 and assigned it to a couple of sites that I created but have yet to populate... and well it worked. It seems that CF9 adds a default mapping for its requests, and that interferes with the pre-existing default mapping for OWA.

So, for my own reference and if anyone else experiences this, you cannot have CF9 working on the same website that has OWA running on it. You can apply CF9 to other sites on IIS, just not the one running OWA. Hope that this helps someone! :)

Too Busy...

It has been a REALLY long time since I have posted anything here. Life has taken a few ups and downs, and so has work.

A few months ago, I changed jobs, after spending almost a year focusing on a single enterprise Flex app, that was scraped once the company I worked for was bought by a larger organization... It was quite a piece of software if I do say so myself, a nice ColdFusion backend and a Flex frontend. It was a bunch of work, but a great learning experience, disappointed that it never got to production though :(

Anyways, with my new job I get to do something similar. At this initial stage, I am leaving Flex out of it, and going straight ColdFusion ad jQuery. Given that I have been at this job for three months now, I am a) getting everything set up the way I want (finally) b) getting the crap cleared out of the way and c) starting to feel the pressure to get more done :)

I have encountered a few things lately that I thought I should share, so I am resurrecting my blog, and hoping for more consistent posting in the future!

Wednesday, January 27, 2010

WDDX in ColdFusion 9

So, I have been using CF8 and Flex 3 to build an application. I am getting to the point of having a stable 1.0 release, and as such, I am looking forward to the second phase of the project. The second phase is going to be based on a new database architecture, and as such, I thought that it would be a good time to flip everything to Flex 4 and CF9, so that I can take advantage of some of the DCD features of Flex 4 and the ORM features of CF9.

In some preliminary testing, I have run into the following issue:

I make good use of ColdFusion Reports (CFRs) in the current release, and I pass a query object that is built and passed into the CFR from a constructing component. When the system has created the query object, and the user flags it as a 'passed' report, the query is stored into the Database as a WDDX encoded object. This of course will allow me at a later time to do other actions on the object if needed, as I can just extract the data and convert it back to CFML, and I will have a Query Object in my code to work with and pass to the CFR.

Anyways, over the holidays, I formatted my system, and started over, and at that time I decided that I would be using CF9 as my main Development CF engine, as opposed to CF8. Last week, I was fine-tuning my read/write routine, and adding some flags as to WHEN those things would happen, and I ran into a roadblock. I created the query just fine and sent it to the CFR where it was rendered properly. I took the same Query and converted it to WDDX and saved it to the DB, then retrieved it and converted back to a Query Object and the CFR fails with an extra '<'. Now, dumping the query, it looks fine, so I can't say where the error is occurring. The real kicker of course, is that the code works fine on CF8. It will convert to WDDX and back again with no issues from the CFR.

I have filed a bug (81726) and would appreciate some votes for this. This bug will stop me from going to CF9. I guess I need to test out converting the query to JSON, but I thought that JSON did not keep its CF type when converted back, and everything would come out as a struct, when I need a query. Any suggestions?

Cheers!

Wednesday, January 20, 2010

Charts in ColdFusion Reports

So, I have taken to using ColdFusion Reports quite a bit more than I am used to I guess. I find them pretty usable most of the time. The interface for editing them is not the greatest, but I am hoping for a BIG improvement to come with CF10 - maybe an integration with CFB v. 2?

Anyways, my current beef is with the charting. I have a couple of SIMPLE bar charts, it generates just fine, not a big deal. However my client thinks that the labels would look sooo much nicer (along the X axis) if they were on an angle... Has anyone come across this? Is there a way to modify the CFR to handle this, or just the way that the chart is created? The CFR is not a human-readable format.

Would it be easier to create the chart in CF and save it as an image to insert into the CFR? That however seems like a ridiculous amount of work when Charts are built-in...

Thanks for any direction. If I come up with a solution, I will blog about it.

Cheers!

Thursday, January 7, 2010

Flex Builder Debugging

So, I am a sorta newb a Flex. I have been working in it on and off now for about a year. Most of the stuff I had worked on was pretty basic and I got by with using Alert.show to tell me what was going on, being 'ignorant' of debugging mode - Ignorant meaning, I knew it was there, and that I could use it, but I never did.

Well, now I have a bigger, little project on the go, and after seeing Jeffry Houser do a quick little Flextras Friday on the debugging mode, I thought I should go for it. I added a couple of watch statements and a trace() or two, and, WOW what a difference in debugging. Yeah, I know I should have learned about it way earlier, but hey, better late than never!

So, although this is a short one, I will say to all new/less experienced/ignorant (see above) Flex Developers. Time to take a look at what is built in to Flex Builder. My next step? To check out Debugging in Flash Builder 4! In the coming weeks/months I will be doing a LOT of Flex 4 work, so I better get better at using the debugging!

ANT and CFBuilder

SO, I am an ANT Newbie. I noticed though that CFBuilder has ANT built in, which I thought was cool, I mean, I see blog posts and twitter posts about ANT, but I would have to say that I wasn't overly tempted to try it for myself. Well this is a new year, so I am pushing my boundaries.

Anyways, so I looked at ANT a bit last week, and found it intriguing. All the samples that were on the site though were for Java mostly (not a big surprise really, but I don't compile any code before deployment). So, I Monday, I sent out a Twit to see if there was anyone with a good CF reference for ANT to do the simple stuff. I just want to copy some files from one location to another, so I can test it and then deploy. Marc Esher sent me over to http://www.mxunit.org/ where he had done a presentation on ANT and CF for CFUnited.

I downloaded the zip file, and found the reference file I was looking for. I worked on it a bit, and then forgot about it as phone calls and emails pored in... damn first day back from vacation.

So, later in the day, I was working along in CFB and accidentally hit CTRL-B, and I got a lovely console message telling me that my Build File wasn't right, the build.xml gained focus in CFB and the line with the error was selected... Was I ever shocked. So, I opened the sample again, and set back to work at it. I am impressed, with ANT, as well as its integration to CFB.

CFB popped up a content menu with ANT Tasks that I could choose from as well as descriptions of each - just like it does for CF tags, nice. So, I trundled along (it took about 5 minutes to get it working exactly the way I want it to) and finished off my first build script, then I hit CTRL-B again, but on purpose this time. ANT just ran along and boom, all the files I had wanted moved, were moved. The ones I didn't weren't. I would have to say I was a little excited.

So, I will be doing some more digging into the ANT docs, and Marc's preso and sample code, as I know that ANT can handle FTP'ing as well, so that is my next step. Oh, and the step after that? Well CFB as a plugin to FB4 and see if I can't get my Flex applications to build when I run the ANT script. That way I can run the routine and have the SWF compile and move with the CFCs needed to power it. I guess I need to figure out a way to have options in ANT, so that I can select if I want to run a 'Release build' or maybe just update the SVN... all from the same build file..

You know the more I think about how cool ANT is, the happier I am that the CFBuilder team included it! (I have never been one to continually add plugins to Eclipse, so this is just so easy... I like easy!)