Atlassian had its 3rd FedEx Day today, so Jens and I tried to tackle CONF-1837 and implement an offline client for Confluence. I've been meaning to try out Core Data for a long time, so this was a perfect opportunity (cross-platform issues aside).
I have to say that Core Data is just amazing! We were able to recreate all of the objects required to store Confluence Spaces and Pages using Xcode's data modelling functionality (including referential integrity – weeeee!). What blew me away was that we did not have to write any model, controller or view code to get the interface working:
The only code written for the entire app (please ignore its temporary ugliness) was to retrieve the Spaces and Pages via XML-RPC and pass them onto Core Data. Yep – that entire interface was displayed without writing any code! It's one thing to see it in a tutorial, but a totally different experience to make a 'useful' app.
and now… for the bad part. Jens and I spent half of the day futzing with Apple's WebServices framework to get Page retrieval working. The WebServices framework appears to be a black hole in Apple's Documentation. There's little information on the methods for making SOAP/XML-RPC calls in a Cocoa application, let alone code examples of how to do it!


Take a look at this guys blog:
http://www.ditchnet.org/wp
he’s done a lot of work with Cocoa/SOAP/XML-RPC…
Yeah, his SOAP/XML-RPC tools are really handy! Didn’t really help us to write the remote API code, though…
Isn’t it a breach of privacy by having the code your employer uses published online. Isn’t it owned by the business, how come you’re allowed to post code HAY:P
What code, William?
Wow. I was trying to figure out a way to get SubEthaEdit to do something like this, but all I really care about is to be able to edit my text in a real editor.
When can we see this in action? =)
Jem, improtant lesson for this little project of yours. Whatever you do, DO NOT drop the SOAP.
… i Crack me up.
Hi Kent,
I’m not sure yet, actually… It currently doesn’t do synching back to the Confluence server. We were hoping to get rendering working (so it appears like it does in Confluence), but had pains with that, too.
Perhaps in a couple of weeks, I’ll get some free time to polish it a bit and release a version to the public.
Jeremy
Just an FYI, “please ignore it’s temporary ugliness” should be “please ignore its temporary ugliness.”
Keep up the good work. This little app looks quite promising.
Hey Jeremy,
It would be possible to make a plugin that allows any user to preview content thru a URL POST. That could make it simpler for you to make the preview and let the actual saving of the content come later. I figure its important to get the preview rendered by the actual server you are using due to the plugins and macros.
To be really honest, it would be great to be able to edit the content in SubEthaEdit and have a app which would just give me access to the pages in a way that I could open them in SubEthaEdit and then preview them in a simple way.
Any thoughts on making the code open source or close to it? This is a perfect app where the community could help out with creating a awesome tool.
I get so many ideas just thinking about this that its hard to keep my head to stay with a single idea. ^^
– kent
Hi Kent,
There’s actually a renderContent() method in the Remote API at the moment, so no plugin necessary! It would be cool to have a live preview, though… rendering plugins, macros and attachments could cause some problems, though.
Editing it in your favourite editor would be something neat, as well (Transmit does this).
I’ll have a chat to the guys at Atlassian and see what we can do about making it public. If you have any ideas, feel free to create a page in the CONFEXT space on http://confluence.atlassian.com/ and jot down your thoughts.
Jeremy
Hey Jeremy,
I found the renderContent() command and wrote a python script which could upload the file to it and wrapped that in an AppleScript I got from the SEE guys so I could call it directly from the app but the html had a couple of errors in it. I’ll file bugs on that later.
SEE supports The External Editor Protocol outlined here: http://www.merzwaren.com/external_editor.html so support for that in the editor is just a couple of AppleScript commands away. =)
Hmm, live preview sounds really sweet. Perhaps if there was a check if only text was changed, then it could just edit the html or send a smaller piece of wiki to the renderContent or use a lazy update so it won’t update unless you have idled in the editor for x seconds.
Make sure you write a nice blog or send me a mail if you decide to make the code open.
Anyway, I shouldn’t fill your blog/database with my rantings. =)
– kent
Nice post. Thanks for sharing these tips.