Gallery2 + C# - Beta 2 Available
A few weeks back I posted beta 2 of the gallery 2 .net toolkit where I have done considerable more work on it than I ever expected I would. Lots of need bits of code and features available. What’s in it now:
There are four items currently available:
- (Tool) For people just wanting to export all their images out of Gallery2, there is g2Export which is a command line tool to export images.
- (Tool) For people wanting to get information out of Gallery2 into a sane format, there is g2 Album Management which is an Excel 2007 add-in to export information about albums and images to Excel.
- (API) For developers wanting to write their own tools or integrations, there is the SADev.Gallery2.Protocol which wraps the Gallery2 remote API. Please see the What you should know? page for information on using the API.
- (Source) Lastly for developers needing some help, there is the source code for the the g2 Export Tool and the g2 Album Management Excel Add-in
Here is a screen shot of g2Export in action:
If you are interested in how much of the Gallery2 API is catered for, it’s most of it (the file upload parts are the only major outstanding ones). The key thing to note on the table is the tested column. While the code is written, it may not be tested and may not work at all. I have found the documentation is not 100% in line with the actual gallery2 code so something it needs considerable rework for it to actually work.
API Call | Basic Request | Basic Response | Tested | Advanced Request | Advanced Response |
login | done | done | done | done | done |
fetch-albums | done | done | done | done | done |
fetch-albums-prune | done | done | done | done | done |
add-item (upload) | done | done | |||
add-item (url) | done | done | done | done | |
album-properties | done | done | done | done | done |
new-album | done | done | done | done | |
fetch-album-images | done | done | done | done | done |
move-album | done | done | done | done | |
increment-view-count | done | done | done | done | |
image-properties | done | done | done | done | done |
no-op | done | done | done | done | done |
Proven Source Control Practises Poster
Maybe one of the toughest things in software development to get right all the time: source control. Well now with this nice bright A3 poster printed on your wall (or maybe above the monitor of the guy who breaks the builds daily) you’ll never go wrong again.
It covers 17 proven practises broken into 5 key areas:
Things YOU should do
- Keep up to date
- Be light and quick with checkouts
- Don’t check in unneeded binaries
- Working folders should be disposable
- Use undo/revert sparingly
Branching
- Plan your branching
- Own the merge
- Look after branches
Management
- Useful & meaningful check in messages
- Don’t use the audit trial for blame
Repository
- Don’t break the build
- Separate your repo
- Don’t forget to shelve
- Use labels
Technology
- Try concurrent access
- Don’t be afraid of branching concepts
- Automerge for checkout only
- For more posters go to www.drp.co.za
ADO.NET Data Services Cheat Sheet (WCF Data Service)
Above is a screen shot of an A3 cheat sheet I created for ADO.NET Data Services (version 1). The poster covers the filters, methods and gives plenty of examples in a nice bright poster.
Outlook 101 Poster
I created this poster (A3 in size) which covers the 8 key areas of Outlook
- Contacts
- Outlook Web Access
- SharePoint Integration
- Calendar
- Tasks
- Misc Outlook Features, like out of office assistant and inline preview
- RSS
The poster also has three areas where you can write key information that will be specific for your organisation like mailbox size limit, SharePoint & OWA URL’s.
More posters at www.drp.co.za
Gallery2 + C#
Gallery2 is a web based PHP gallery system with a remote API for doing many things. I have been using it for a while, but have decided to change and so I wanted to export my images, which is harder than it sounds. To actually get this done I ended up writing a basic wrapper for the Gallery2 remote API and implementing a small console application to do the export.
If you are interested in the wrapper or the tool itself, I have setup a CodePlex project for it where you can download those: http://gallery2.codeplex.com/
The reason it is there, is because I have decided to open source it because it is useful to people besides me and I have gotten what I need from it, so I doubt I’ll spend much time getting it feature complete. This way someone else can get the tool (if that is all they need) or get the source and add to it.
Screen shot of the tool running.
Some new presentations
I’ve been presenting up a storm recently: mostly because I have been on a presentation skills course ;) where I learnt a lot of the soft skills about how to be a better presenter. For that course I had to present with slides on something I knew about, so I choose LINQ. You can watch me do my presentation (it’s a mere 7min) or grab a copy of the slides.
After all that was done I have been presenting on the joys of jQuery recently, and rather than actually bore the audience with slides and constant switching to demos I decided to build a presentation system in jQuery which did both the slides and demos. Which you can view below. A few notes on it, to move to the next slide you need to click the globes at the top or press = and pressing - will make you move back a slide. You can also press the print button in the top section to give you a single page print view (i.e. stripped of colours & with my slide notes). What is great is that the entire thing is a single html page and about 100 lines of JavaScript for the slideshow system. Click the thumb nail below to view it:
Reading and writing to Excel 2007 or Excel 2010 from C# - Part I: Primer
[Note: See the series index for a list of all parts in this series.]
Over the past week I have been learning about the complexity of working with Excel 2007 native file format - XLSX or as it is known correctly, SpreadsheetXL. There is three ways to work with it, firstly build your own parser - just too much work for me or second use OpenXML SDK format which Microsoft provides. The current version, at time of writing that was version 1, of the SDK is not great: there is very little (if any) benefit of using it over the third method. There is a V2 SDK currently in beta which looks brilliant and frankly when released would be the recommend route.
The third way, which is the way I chose is the uses new features introduced in the .NET Framework 3.0.
What is a XLSX file? A XLSX file is actually just a ZIP file which contains a number of XML files in it.
This means all you need to do is open the XLSX file as a ZIP file, get the right XML files (or parts as they are referred to) out of it and parse those.
If you are thinking this is a .NET only solutionthe chart below is from Doug Mahugh which shows a number of ways across a number of technologies/OS’s to do the same thing. This series will focus on the .NET way.
What is nice about using System.IO.Packaging to read the file over the direct ZIP options, is that there are some helper methods to make it easier when working with any of the new formats (docx, xlsx etc...)
My Presentation @ Dev4Devs
If you are attending Dev4Devs on Saturday (or are here after the event) and you are looking for a copy of the slides and code you can get them below! If are looking for the ADO.NET Data Services cheat sheet I mentioned then you need to go here.
Code
The code here is also different from what I presented in the following ways:
- There is a timer control in it - so if you add items to the DB while on the site, it updates and shows those changes within 5 seconds.
- The layout is slightly bigger (bigger header) and has buttons (to make it look like an email client) - these were removed because it doesn’t work at 1024x768 (aka the projector resolution). So they back in their graphical beauty.
- There is a feed button which links to a ATOM feed for the last 10 emails - something I mentioned you could do, well now you can see it.
- There is a database creation script, but no data. You need to create your own data.
Slide Show
Some Free Posters I've Created Recently
One of the things that I do at BB&D, is produce guidance posters. So far I have produced two of them and both are publically available on the BB&D developer guidance site DRP. The first is “Outlook + Exchange = Better Together” and the second is “ADO.NET Data Services Cheat Sheet”, not two things you think about together often.
Outlook + Exchange = Better Together
The title is a bit marketing-ly, but the poster is really a nice over view of the 8 key areas of Outlook namely
- Contacts
- Outlook Web Access
- SharePoint
- Calendars
- Tasks
- Outlook Features
- RSS
The poster looks a little busy, but when printed at A3 it’s not bad at all. It also includes three areas (OWA, Mailbox size, SharePoint) where you can write in your organization details so if you print them out and put them on the wall they have some organization context.
ADO.NET Data Services Cheat Sheet
The next one I developed when learning with ADO.NET Data Services and it’s a bright and fun cheat sheet for it. It includes information on the query operators (with samples along the border), a list of functions, a list of comparison operators (like less than), query order, keys, and $value. I’ve found it very useful to print out and put up. It is designed for A3, but I have it printed at A4 (in grey scale) and it works just as well.
Free SharePoint Developer Training
On May the 23rd InformationWorker and Inobits are getting together and offering FREE SharePoint developer training. It is a full day event where Inobits will be providing a number of lab based training sessions focused on developing with SharePoint. Also being a full day event there will be some lunch provided for everyone (special thanks to 3Fifteen for sponsoring it). It should be a really great event for everyone, because you pick the lab/s you want to do which means if you are a beginner or expert you do the ones that will benefit you.
Because of all the effort to prep for this, you much register for it at http://www.informationworker.co.za/Pages/SLABSRegistration.aspx
A sampling of labs available is:
- Web Parts
- Data Lists
- Event Handlers
- Workflow
- Silverlight
- Page Navigation
- Page Branding
- Web Services
- Content Types
- User Management