Viewing By Entry / Main
Oct 14, 2006
Generate Your Transfer ORM Templates
I did some work recently (and recently committed) an early draft of some templates for my Illudium PU-36 Code Generator that will generate components for use with Mark Mandel's Transfer ORM. These are still in the early stages somewhat, but the templates would include an XML snippet for the Transfer config (this is the part that needs some additional tweaking on data types I believe), a service component with methods that call the proper Transfer generated methods, and the ColdSpring snippet to inject Transfer into your service. It also still includes a gateway mostly out of personal preference. Transfer will handle some of your gateway type calls as well, but in the end (for the moment) I prefer to write my own SQL for this since 1) I don't hate writing SQL; 2) I think generated gateway methods are usually not flexible enough...at least in my experience so far. Anyway, if you want to check out the templates, you can pull the latest commit from Subversion and it will be in the /xsl/project/transfer folder. To use this, copy and rename the folder with the same name as your datasource, and the generator will use that set of templates instead automatically. (and remember these are still in the works...so send any issues or improvement suggestions along)On a side note, I am actually done enough to launch my rewrite of the open-source list, but I am having some issues with extraneous mappings at HostMySite causing it to fail. To summarize what is a very weird issue, HostMySite has a mapping /fckeditor2 that points to the root folder for all the sites on the shared server (no idea what this would be used for). Transfer uses relative dot notation paths on the components. For some reason, these were picking up the mapping causing them to appear as type fckeditor.uuhc2t.transfer.whatever rather than transfer.whatever. To find this out I had modified the core code and dumped the value of the objects. I tried changing the path to transfer.whatever instead of just whatever, and it worked as expected, but this would mean changing code everywhere in the Transfer core. Here is where it gets weird, I changed it back to the relative path (i.e. just whatever) and it still worked!? It turned out any file I did this to would magically start working again but this isn't a solution since it means going through every single Transfer file, which would be a long and tedious process (and doesn't really get at the core of the problem it seems). I am, however, quite curious why this is happening. Any ideas out there?
Comments
FCKEditor is the OSS HTML editor. I'm guessing they created this as a default mapping to please someone's desire to use FCKEditor, and didn't want to go through the hassle of configure scripts to allow each site to use a seperate copy of FCKEditor.
Thanks, right, I actually use that editor as well myself. What I don't get is why point it to the web root - from my understanding, they essentially have it pointed to c:/inetpub/ and not to any fckeditor folder...I don't know what that would be used for.
Just an FYI, they removed the mapping and then needed to restart CF and everything started working just fine. You can see the updated open source list is up.
Nice to see it all up and working!
That is really cool you have that generating Transfer config files ;oD
Glad to see you got Transfer up and running!
Glad to see you got Transfer up and running!
Thanks Mark. Would love any feedback you might have on the generated config file - I know it is in need of some revision...this was a quick first draft (it also generates the service using Transfer methods).
The issues I had, while they generated errors in Transfer, were actually something screwed up on my shared server...as in, nothing Transfer's fault.
The issues I had, while they generated errors in Transfer, were actually something screwed up on my shared server...as in, nothing Transfer's fault.
How come the transfer template does not include a bean or a DAO? At first I thought maybe Transfer does some introspection and generates those but Mark has told me that it does not do any introspection. What am I missing?
Nevermind my previous question, Transfer generates beans and DAO's based on the config xml file, which explains why you have to put all the field names in the config.

