Updating SVN client version from 1.4 to 1.5 with Eclipse and Subversive with Tortoise SVN on Windows

This process is very very frustrating - but due to the way pretty much every SVN client seems to need to update the working files for any SVN managed resources to the latest version it supports, it does seem to be a necessary process - especially when some other svn plugins (such as Ahnk SVN for visual studio) only support 1.5 or later.

During this process I came across a lot of things that didn't work - I'm just trying to document here what did...

[More]

Eclipse Character Encoding issue

I've recently been having the problem that every ColdFusion file that I attempted to open in CFEclipse was displaying character corruption of special characters (e.g. apostrophes, hyphens etc.)  - each corrupted character was being displayed as a black diamond with a question mark in it.

When I checked the character encoding for the file, it was showing as Default (determined from content: UTF-8)

This was not correct - the correct encoding of the files should have been ISO-8859-1.

I checked a number of places, and could not detect where the setting was being applied.  I even tried overriding the Default encoding for the ColdFusion Source File content type - which made no difference at all.

Eventually, the problem turned out to have been caused by me adding the *.cfm extension to the XML Content type (so that I could open any CFM file within the XML editor if required) - which has a default encoding of UTF-8.  This was overriding the setting which had been applied to the ColdFusion Source File content type.

After removing the *.cfm extension from the XML Content type, my ColdFusion files could be opened as saved correctly without any character corruption.

Do not copy SVN working folders to another location in project

This one has had me tearing my hair out - until I discovered what the issue was:

Scenario

  • I copied a folder from one folder to another folder in my working copy for a project
  • I subsequently committed the whole project (a few days later) (seemed to commit ok)
  • After committing the project, I noticed that when I performed an update, it was showing that the files in the old folder had been updated. - This was strange, as no-one else had access to the repository at the time
  • Another colleague started working on the project, but the folder I had copied, did not appear when they performed an update - indeed, it did not appear to be in SVN at all.
  • When I checked the source folder, I could see that this contained the copied (and edited) version of the files - rather than the original files.
  • I then checked the SVN properties of the copied files in Eclipse - and it was clear that the SVN URL of the copied files was the same as the source files!

What Happened:

So what I assume must have happened, is that as I copied the folder, I also copied the SVN subfolder with it - which had all the references to the original SVN location...

Resolution:

  • I deleted the copied folder, and recreated it.
  • I then copied the files from the original folder (these were the ones that had been edited as my edits to the copied folder had been checked in over them)
  • When I then performed an update, Subclipse correctly identified them as New - and I was able to commit them to the repository in the correct location.
  • I then also had to go back to the source folder, retrieve the previous version of the files, and re-commit them.

Fortunately this was noticed relatively quickly - and only affected a small number of files - otherwise it could have been quite a nightmare to resolve!

Ant Rocks!

Just started messing with Ant.

Taken just over an hour to write a couple of scripts to:

  • Deploy an application to a deploymentfolder, and update all the fusebox.xml.cfm files to production mode
  • Deploy application to a staging folder, and alter all the extends attributes within the CFC's to point to the staging CFCs as opposed to the live ones...

Its a bit messy, and not that flexible how I've done it ATM - need to learn how to use Ant properly now ;)

The fact its built in to Eclipse, is a definite bonus :)

Using Eclipse Web Tools XML editor for fusebox xml.cfm files

I've been looking for a decent XML editor for Eclipse since I started working with Fusebox 5.

My main requirements are:

  • Validation of XML syntax
  • Validation of XML against a DTD
  • Location aware content assist - that only prompts with elements that are actually valid for the current location

I tried a few plugins

  • Oribe XML - Not bad, validates against DTD, provides basic content assist, but not location aware
  • I'm Impressed :)

  • Aptana Plugin - this offers an excellent all round web dev IDE for CSS, HTML, Javascript etc. - and also comes with an XML editor. Unfortunately this seems a little lacklustre in comparison to the other tools - no content assist or DTD validation as far as I could see

Reading through the Transfer Documentation, I noticed a link to the Web Tools Platform for Eclipse.

I was amazed - this seems to offer so much out of the box - I'm surprised I hadn't heard more hype about it.

To install, its simply a matter of going to the Help > Software Updates > Find and Install menu item, and selecting Callisto Discovery Site. This gives a huge list of available plugins - including the WTP. Selecting this prompts that there are other dependencies - clicking the Select Required selects them for you.

It is common practice within fusebox, to suffix the fusebox.xml and circuit.xml files with .cfm - this does prevent eclipse from associating the files with the XML editor.

This can be achieved by:

  • Selecting General > Content types from the Preferences dialogue box
  • Selecting Text > XML from the Content types: tree
  • Click the Add... button, and adding the File associations &quo;fusebox.xml.cfm&quo; and &quo;circuit.xml.cfm&quo;
  • Click the File Associations link at the top of the dialogue box
  • Click the top Add... button, and add the &quo;fusebox.xml.cfm&quo; and &quo;circuit.xml.cfm&quo; file types
  • Select each of the file types in turn, and the associated editors should appear in the Associated Editors list at the bottom.
  • Click on XML Editor, and then click the Default button

Now fusebox.xml.cfm and circuit.xml.cfm should open with the WTP XML editor by default.

This offers all my specified features, plus a "Design" view - unfortunately this seems to load by default - but its no problem to click the tab and get the Source view.

NB In order for DTD validation and content assist to operate, there must be a reference to the Doctype at the top of the XML document.

I believe the reference DTD's are located at http://www.fusebox.org/fusebox.dtd and http://www.fusebox.org/circuit.dtd

UPDATE: The files available from http://www.fusebox.org/ are not the latest - the latest DTD's should be included in the framework download, or can be downloaded directly from the repository: http://trac.fuseboxframework.org/fusebox/browser/framework/trunk/fusebox.dtd?format=raw and http://trac.fuseboxframework.org/fusebox/browser/framework/trunk/circuit.dtd?format=raw

I have a copy hosted locally on my development machine, so that the XML editor is not repeatedly retrieving the document from the internet - which can be a problem if i am working offline:

<!DOCTYPE circuit SYSTEM "http://localhost/dtds/circuit.dtd">

Flex - cross-domain-policy - I just don't get it...

I installed Flex Builder 2 plugin last night, - and overall I'm very impressed.

I'm particularly impressed with the documentation, and in particular the lessons - each lesson is really short, but they cover the basics very quickly - great for someone like me who has no previous experience with Flex, and very little with flash.

I've been working through the lessons, and in the second lesson, it goes through creating a (basic) RSS feed reader.

So I went through the example, using the RSS feed given as an example in the lesson (for Matt Chotin's blog). This worked fine, so I though - that's cool, lets point the feed at my own blog...

This didn't do anything, so, I worked out how to view debug mode (for some reason debug mode is only working with IE on my machine, not Firefox - probably an installation issue), and saw the following error:

  • Security error accessing url...
I then went back to the second page of the lesson, where it mentioned about having to set-up a "crossdomain.xml" file on the server hosting the data source...

I'm sorry - but I don't get this - on the domain on which the RSS feed is hosted, you have to set-up a file detailing which domains can host flex / flash applications which access the source domain...

The flash application is responsible for checking this file before deciding whether to access the remote data source...

So... this file on the remote server, instructs the client application to check whether it has permission to access the remote server, based on the domain on which the client app thinks its being served on...

So what on earth does this achieve?

I can see 2 cases where you might want to lock things down:

  1. The remote server is hosting a service with restricted access, and needs to make sure the client is authorised to serve the data before allowing it to be served
  2. The application is running on a local machine, and you want to restrict the sites that the application has access to

The first point is not achieved by the use of the "crossdomain.xml" file - as one of the 1st rules of implementing security within a client-server environment, is that the server is responsible for implementing security, not the client. In addition, I would assume that the flash application knows where it being served from based on the host headers (as it is running in the local machine, not on the domain from which it is served) - which presumably (and I've not checked) could be faked through the use of the hosts file etc.

The second point is not implemented at all - as the crossdomain.xml file is implemented on the remote server - not on the client.

So what on earth does this crossdomain.xml file achieve - other than requiring hosts of a public service to make a concious decision that they will allow flash clients to access the service. Surely the point of open standards such as RSS - is that they are open - and it is the choice of the consumer, how they consume them...

PLEASE - if I have completely missed the point here, let me know - as from what I can see, the crossdomain.xml "security" implementation would appear to be both pointless and obstructive...

I could see the point if the crossdomain.xml file were optional and advisory - a bit like robots.txt - an indication of a preference, if implemented, rather than an absolute requirement if data is to be served to a remote domain.

CFEclipse 1.3.1 Released

The CFEclipse Project is proud to present the latest release of the CFEclipse IDE.

A lot of effort has gone into the project over the last few months and more releases will be happening over the next few months.

A fair few bug-fixes, and a few enhancements as well :)

My Favourite:

Fatal crash for CFSCRIPT has now been fixed...
This one had been the most frustrating thing about using CFEclipse recently for me - it was crashing nearly half as much as Dreamweaver!

See CFEclipse : News page for announcement and more info.

Can I take the chance to thank Mark Drew, and all the others who are involved with the CFEclipse project, for all the time and effort they have put in to produce what is without question the best ColdFusion IDE available.

Why I don't use Dreamweaver - or How to lose 2 hours with a single character

I don't use Dreamweaver personally - I've used CFEclipse for pretty much all CF development since August 2004.

Some of my colleagues however (mainly those of a less code centric bent) do persist in using Dreamweaver - although after this fiasco, at least one of them may move over to CFEclipse.

A colleague asked for my assistance because Dreamweaver had crashed on his machine, and when he tried to reload it Dreamweaver would close immediately after displaying the splash screen.

I initially suspected that Dreamweaver's site cache may have become corrupt when Dreamweaver crashed, and that this might be preventing Dreamweaver from reloading. After a brief google, I found this adobe technote which gives instructions on diagnosing and fixing these kind of issues.

I started by deleting Dreamweaver's site cache - this was progress, as Dreamweaver now took slightly longer to crash, as it had to rebuild the site cache first.

I then renamed the key in the registry that Dreamweaver uses to store its site definitions. Dreamweaver now loaded without crashing.

I then restored the site definitions, and went through removing sites until I had identified which site had caused Dreamweaver to crash (Which not surprisingly was the one he had been working on before Dreamweaver crashed).

My colleague then attempted to recreate the site, but as Dreamweaver attempted to build the site cache, once again it crashed (although it did at least give a (meaningless) error message this time. Fortunately it did crash before saving the site definition - otherwise we would have had to delete the site from the registry again.

My colleague then tested creating another site, pointing to a different location, and had no problem in doing so. This suggested to me that there must be something in one of the files in the problem site that Dreamweaver did not like - possibly an invalid character in the middle of being written to a file when Dreamweaver crashed.

I then instructed my colleague to check all the files that had changed since last checkin - opening them individually to look for anything strange - strange characters, mid file truncation etc.

The 6th file he attempted to open, immediately caused Dreamweaver to crash.

So what, you may ask, was the problem with this file?

The file was a css file.

The invalid line:

width: 489 p'x;

So, there you go - inadvertently inserting a quote mid dimension in a css file, will cause Dreamweaver to go FooBar - and, because of the site cache, this will prevent you from opening the site at all!

BlogCFC was created by Raymond Camden. This blog is running version 5.5.1, hosted by TalkWebSolutions.