I am totally geeked to be here at Google IO. My main interest is in the Google Application Engine followed by the OpenID and OpenAuth stuff.
The coolest announcement is that AppEngine is now wide open for business - anyone can get an account.
It is amazing how open things are - it is so open that things seem unfinished at times - it is like we just showed up inside of a companies' R/D lab and are a fly on the wall. I am sure there are many things that Google has in the works that we are not hearing about - but those things they are telling us about are their "trunk" of ideas. We are supposed to dive in and be part of it and evolve it. (whatever it is). It is OK that thinks feels like version 0.9 sometimes - hey some of my favourite software never got past version 0.9!
The people here are surprisingly serious - this is not a geek fest.
App Engine is awsome - it will cost money but a base level account will remain free - basically they are giving everyone a simple dr-chuck.com site - a place to experiment and develop their software and content. Think of this as an ultimate personal portfolio where you can make your own software to augment your portfolio.
The AppEngine is based on Google's BigTable - a really fast hash/array/shard data store - it is an extremely fast object store - not a relational database.
Probably the coolest thing about App Engine and the talks that I went to is that it is all bout speed and scalability. They want you to write applications that use a small amount of resources - and that scale beautifully and so you don't get nailed with CPU charges.
I have not been in a crowd so obsessed with speed and scalability since the Supercomputing crowd in the mid 1990's - when I wrote my HPC book for O"Reilly - it is refreshing to listen to folks talk about how to write kick-arse software - not just easy software - but the great thing is that it is also pretty easy - you just have to avoid doing any filtering in memory! Hmmm - sounds like http://bugs.sakaiproject.org/jira/browse/SAK-13584.
I ran into Chase Phillips of NCSA/NEES project and Nicola Monat-Phillips from NYU - but have not yet run into Casey Dunn - and Casey is easy to spot unless of course he changed his hair style.
Off to the party tonight and open bar - more tomorrow.
Update: I ran into Casey Dunn and David Mills (of Angel) at the evening party.
So, I am chilling in Edinburgh this week - I was asked to serve on the Science Advisory Board of the National eScience Centre (http://www.nesc.ac.uk/) in Edinburgh. I love the eScience center because it is a neural cross-disciplinary place where it is not about a single science or field - where all fields meet on neutral turf - I have learned much from the people I have met and friends I have made during my six visits to the NESC in the past 4 years. Now I am on their advisory board - Sweet!
But NESC is not what this story is about.
After the day long board meeting, most of the participants scattered to the airport and their hotels - a four of us including Malcolm Atkinson decided to get a pint (or two) at the Royal Oak - Malcolm's favourite pub - it is on a side street off Bridge street about a mile from downtown and the train station.
Here is a link to a map showing the Royal Oak on Infirmary Street in Edinburgh
It is smaller on the inside than on the outside - it is about 16-feet by 16-feet and we were four guys having a pint and one other person who looked like a street person getting warmed up (perhaps earlier he had been sitting on a park bench...). The place could only hold about 18-20 people max. A guy walked in and started talking at the bar. Malcolm noticed my eyes get really wide and asked me "what is the matter" - I stammered "I think I know that guy" - who was about 4 feet away but had not even looked at me because he was trying to find out if the bar was serving food. He was wearing weird glasses so I was a bit confused. But his accent was right and everything else about him looked right.
Apparently the bar was not serving food so this guy started to bolt out the door because he had a group of people waiting on the street for him - again he was not looking at me because he was so focused on getting food for his entourage.
Before he got out the door - I took a risk and shouted "Hey Tony - is that you???". My eScience pals were confused - we had just been talking about Tony Hey (a UK eScience legend - picture at the right) - so they thought that somehow I had seen Tony Hey. Tony Hey *is* on the Science Advisory Board but he could not make it because he was busy at Microsoft - so it would be weird for Tony Hey to not make the meeting and yet come all the way from Redmond, Washington to have a pint at the Royal Oak.
But it was *not* Tony Hey it was none other than Sakai's own Tony Atkins (aka Dr. Collab) - sporting his new glasses (see photo) that he recently had to get to take his UK drivers test.
It turns out Tony and his family was on vacation from Stornaway in Edinburgh. We laughed and hugged and took a picture - and then Tony had to scoot because his whole family was pretty hungry. We said that we would see each other again in Paris.
With me 3000 miles from home and Tony 150 miles from home and given that I am only in Edinburgh for 36 hours and Tony was only likely here for a day or so - and that the bar is pretty far away from downtown - and on a side street - it will be pretty hard to top this "small world" story.
I only regret that the Sakaiger was not with me to say hi to Tony! Sakaiger was back at my hotel room.
SO I am in Edinburgh to visit the eScience Center (one of my favorite places). The trip was pretty cool - I got upgraded to business class on United - mad props to them. But this story is about something else.
- The hotel has free networking - but not WiFi
- I have a Mac Air with no wired network port
- I had not bought the $10.00 USB Ethernet adapter (because I am stupid)
So here I am at a hotel and not able to connect to a free network. That is a tiny bit ironic but mostly sad.
The ironic bits are what happened next...
Irony #1: I walk around for a while asking various Internet cafes if they have USB Ethernet (knowing that this is very rare) and finally one tells me there is an Apple store *1 block away from my hotel* and if I had made a left turn out of the hotel - I would have walked right past it.
Irony #2: I get to the Apple store right before close and walk in thinking my problems are over. The guy says he is all out of Apple USB Ethernet adapters - there is not much call for them - but strangely today three people came into the store and bought his stock completely out.
So close and yet so far - Ironic.
Tomorrow at the meeting - I bet I will see a bunch of Mac Airs sporting nifty new USB Ethernets - I was the latest one to arrive. So I lost.
Here I am at a Wifi Cafe.
I took Brent and one of his friends to Speed Racer last night. I liked it a lot. Originally, I figured that I owed the Wachowski brothers a look at the movie given how much I enjoyed the Matrix series. I even sprung for the iMAX version of the Movie at a cost of an extra four bucks per person.
I really liked the movie - I never got the feel that it was a video game. I felt the editing was outstanding and they almost never spent too much time on a SFX shot or fight scene. The neat thing was the strong character development and strong plot line - for me it felt as though the plot revealed itself nicely - just enough to keep you on the edge of your seat abut the *characters* - not about the SFX.
The plot layers many common themes - hidden identity, evil manipulative business types, the little guy fighting for truth, justice and the car racing way. There was romance - Trixie is very very pretty and well played - she is the perfect live Anime girl - her eyes are so big one wonders if it were special effects.
All the characters were well cast and while there was always a temptation to go over the top with the characters - they did not go over the top - to the extent when the evil businessman gives his expected speech - you want to listen to see *how* it will turn out so that evil and greed always triumph. Everything in the movie had a little tiny twist and additional layers to avoid the cliches that would have been so easy to fall in to.
In a sense, the Wachowski brothers know that great writing is the bedrock of film making and great editing is what brings it all together. For me - I was pleased with all aspects of this film.
I have a couple of nitpicks on editing and pacing - I thought that the rally sequences should have been edited a bit tighter - the fact that the good guys pretty much did the same thing to several sets of bad guys in the desert bit - this could have been shortened and focused. The two main fight scenes (in the hotel and at the pass) also felt a bit repetitive.
Some of the break through cool bits - I loved the parking scene and how the background turns to hearts - they do this several times where the background fades to some graphical representation of emotion or feeling - very cool. I particularly liked the graphics when you looked at the crowd from the wining podium at the end - it was like a form of new-age impressionist painting that captures the essence of something without fine detail. Instead of representing reality - they represent how we remember reality.
My overall rating is that it was worth the iMax price - I truly enjoyed it.
Deb Balzhiser Morton was preparing for a presentation at an upcoming conference and started an interesting discussion in the Pedagogy group. The following slightly edited excerpt of her questions triggered me to try to clarify some aspects of openness.
I'm presenting at the Computers & Writing conference next week: The theme is open source. I was recently talking to a colleague who is completely against Sakai. I honestly do not know all of his issues and concerns, but I would like to be prepared for responses and those like his at the conference. When I talked to him, he said that he found Sakai to be the least open of open source CMS communities (Sakai, Moodle, Drupal). In part, he says this because of the cost to join.
Here is my response.
Deb,
I would make a couple of observations:
(1) It is common for someone who becomes a "fan" of something - to look for "faults" is other choices to make sure their "choice" is always stays the "best" in their mind. My guess is that your colleague is pro-Drupal and was happy to take a quick look and quickly mis-perceive how Sakai really works. For example, in regards to the notion of "paying for Sakai" - it turns out Drupal also has memberships:
http://association.drupal.org/node/147
Paying to support Drupal is optional - just like paying to support Sakai is optional. Perhaps your colleague read that "membership in Sakai costs $X" and then neglected to notice that membership is not a pre-requisite for use of the software and membership is not required to be part of the developer community. Membership in Sakai gets you in free to Sakai conferences and allows you to vote on the board of Directors and gets your name in a nice list - not much else.
Many open source groups raise funds this way to pay for servers, source code hosting, meetings, etc. Generally because people and organizations love the project enough to dedicate hours of free labor to the project - often they are willing to voluntarily give money as well (particularly companies or organizations).
One of the very interesting aspects of Sakai fund raising is the large number of organizations that voluntarily give money to Sakai that *don't even run the Sakai software*. Those organizations feel that it is important that Sakai succeeds even if that organization has no immediate plans to use the Sakai software.
(2) I am guessing that your colleague is more of an end-user than an IT professional. Drupal, Moodle, and many other PHP-based applications really appeal to folks who are not part of IT organizations - often these folks dislike/distrust their IT organizations and want to run "their own" server. PHP applications are ideal for these types of folks because the code is simple and easy to modify, configuration is simple, and as long as you just run it for a few users - it is fine to just let it run on some server under your desk or in a department.
Sakai is designed like most applications that IT professionals are used to working with. IT folks tend not to like modifying the core code of a large/complex application - they prefer lots of configuration options and lots of flexible plug-ins so the core code can remain unchanged as one upgrades from release to release. End users who run systems generally just make changes to their code to customize it and then never upgrade.
The problem is that the kind of features that IT folks like (lots of options and plugins for data) seem really daunting when someone just wants to get it up and running under their desk - so many people take a look at Sakai and walk away because it is "not trivially easy to set up and run" like PHP applications. I am not saying that this difficulty of setup is a "good thing" - someday we in Sakai will come up with a simple version of Sakai that just comes up and runs - otherwise people will take a look at us and look no further because the steep learning curve for installation - we know this is an issue and someday we will find the time to work on that (like any open source community priorities depend on who is working on what at any given time).
(3) In regards to "openness" - there are lots of ways to look at openness - I think that Sakai is average or better than average in terms its willingness to admit new folks into the community - if someone wants to contribute - we usually find a way - we have this area called "contrib" that folks can start working in very quickly to establish their credibility. Take a look at this web page to see the folks playing with the Sakai contrib space:
http://www.ohloh.net/projects/4006/contributors
You will see 86 people doing all kinds of stuff ranging from solid production features to little experiments.
Here is a little table showing the number of folks who are working on the core code (the main release) and contrib space (experimental stuff) for each of these projects:
Sakai: 71-core 86-contrib
Moodle: 133-core 96-contrib
Drupal: 19-core 1196-contrib
You can look at the core number as the number of people who have gained enough trust to really impact the released product - in a sense the contrib folks are often "super-fans" who care enough to build an add-on for the rest of the community - but it is never as simple as this. Part of the difference in the above numbers is because the Sakai core and Moodle core are about 1 million lines of code while the Drupal core is about 100,000 lines of code. Moodle and Sakai's contrib areas are about a million lines of code whereas Drupal's contrib is three million lines of code.
Pretty much any way you look at this - the communities are almost mirror images of one another - all three of the communities are diverse, healthy and open.
Kind of in summary - what I think that you are seeing is the classic "blind man and the elephant" - folks with limited experience in open source tend to think that these open source projects are somehow *dramatically* different and draw really strong conclusions that generally suggest that whatever they "like" is great - and everything else is not so great.
Once you have done open source for a while - you realize that everyone is just trying to do good things - and that among the experienced people working in the core of these projects there is great respect between the projects and any sense of competition between projects is just enough for us all to strive to for our work to be the best that it can be.
Thanks to Adam Marshall of Oxford - the Sakai developer list recently started a discussion about an exit strategy for an organization which adopts Sakai.
Not because Oxford is thinking about exiting Sakai before it even enters - but because planning and documenting an exit strategy from any IT choice is a responsible thing to do - and is best done *before* you adopt the software :).
Here is my response - feel to use/adapt this text in any way you like.
This is a great question and one (as others have said) where open source should have the best possible answer IMHO.
Here are several theme areas:
(a) IMS Common Cartridge in the future will be a great vehicle once it is widely adopted and it has sufficiently rich content types. Of course Sakai only has limited IMS CC import (Thanks Mark, Zach, Unicon, and others) - wanting a good exist strategy for any LMS is a good reason for folks to get involved in IMS CC efforts in the standards making or in the software development (yes I am an IMS contractor :) ). But IMS is not the sure solution for now. In the future if we can get IMS CC adopted widely - it can be both you exit strategy and entrance strategy all rolled into one.
(b) Sakai from the very beginning has provided its own proprietary archive/export tool for the system admin - this is our own format - but it gets 100% of the content for those tools that properly support archive. If I were to switch from Sakai right now - this is the route I would take - make a gigantic export - getting all of the files and metadata and then write some Python scripts to munge this into whatever form you needed. Because Sakai is open - you are 100% encouraged to reverse-engineer this format and bend it any way you like - even though you are exiting - we would be happy to host that code in our contrib repository - so others could follow out the same door with less effort.
(c) Write a special bit of code in Sakai to export into whatever format you needed. This is how Indiana got from OnCourse to OnCourseNG (now called OnCourse Classic and OnCourse respectively) - they added a special export bit to their old system that made stuff importable in the new system. The advantage of this approach is that if the new system is not particularly standards compliant or the standards based import does not transfer 100% of what you want - you simply make the connection with all the data that is fit to transfer. In addition if there are tools (some) in Sakai that do not participate in the system archive capability - then you just call the APIs in your tool and export the bits you want. Again if you want to develop this code - please put it in contrib so all can benefit.
(d) One last and more long-term approach which I would like us to think about is the HTML-only option (Luke alluded to this). We have no support for this right now in Sakai :( :(. This is one of (many) things that impressed me about Stellar and impresses me about LAMS. All tools have a way to produce HTML Stellar uses this for materials that are several versions old - Stellar runs several versions of its services and UI at the same time (kind of like running Sakai 2.3, 2.4, and 2.5 on one system) - but for older versions that are no longer running in Stellar - stellar converts the sites to flat HTML - and since Stellar has a very good REST-style URL naming scheme - the HTML simply lives at the same URL as it did when the data was live and editable - in effect what you see is a non-editable version of the site at the same URL as before. For LAMS the thinking is more of a tool-by-tool basis and is intended for portfolio applications - you do something great in a discussion in a class - you snag that discussion as a bit of HTML and pull it into your portfolio. Brilliant. Taking this approach would also allow bits of comments/metadata to be in the HTML so that the HTML could be somewhat imported into a new system - kind of like blog programs scrape each other's HTML to convert you from one blog program to another. Note that Sakai has none of these HTML features --- yet.
Frankly IMHO we should be developing these kinds of things regardless of whether schools want to "exit" Sakai or not. Because as faculty move from organization to organization - they end up "exiting" in the small - as faculty depend increasingly on systems like Sakai and Moodle - a move to a new school, losing all one's content is pretty not good.
A few weeks back - my venerable home computer (Athlon 1400) finally just gave up - it won't even boot to the BIOS. I figured after years of slipping in new parts and tiny upgrades - it was finally time to get a new computer. I figured that I had avoided upgrading long enough to make a whole new computer worth my time.
And since dual Intels were the norm - I was double pre-disposed to upgrade.
I grabbed the Sunday paper and found an ad for a $400 Compaq with 1GB RAM, 250 GB HD, and dual Intels (mmm tasty). I drove over to Best Buy and purchased it - just plopped down the credit card and took it home - I figured - this was amazing hardware for the price. I figured I would try Vista which it came with and if I did not like that I would drop back to XP - I even looked at the restore capability in the store to make sure I knew how to "go back".
Vista was plan A. XP was plan B.
So I get it home and fire up Vista - I kind of like it - but after things were set up the way I like it - none of my printer sharing worked - Vista and Mac OS/X do not seem to be on speaking terms w.r.t. printers. Yikes - I should have checked with Google first!
So I figured - back to XP I go. I install XP on the new Compaq and it comes up great - except for the hardware drivers that are all missing - not even a network driver so I could search for other drivers - yikes!
Hey I have done this a bunch of times - off to the Compaq site to get the XP drivers for my shiny new hardware. Big OOPS - this is a Vista Only computer. Now I am starting to get mad (mostly at myself for not checking for XP drivers before I bought it). I figure oh well - I will just restore to Vista and see what happens - at worst I might give the new hardware to the kids and start over.
Nope - this does not work - the restore that comes with Compaq it *NOT* a separate partition - it is the virtually useless WIndows "System Restore" capability - when I whacked the first partition - I whacked my ability to get VIsta back. Now I do own a legal copy of Vista Ultimate (Thanks Chris) - so I could have formatted it and gone back to Vista - or I could have waited a few days and got a CD from Compaq. But I was in impulse mode - I started this adventure on an impulse and did not want to start thinking rationally at this point.
So I started to get mad. I got mad at Vista for not interoperating with Mac OS/X - I got mad at Compaq because they did not give me XP drivers - I got mad at Best Buy thinking about the conversation I would have to have trying to return hardware which was unrecoverable and a totally formatted first partition.
In my anger I decided to try to take the computer back to Best Buy - pay the restock fee - take my lumps and buy something else. On the drive to Best Buy I rehersed my speech to the customer service person at Best Buy - I rehearsed everything - faces - tone everything - It was about to be a masterpiece of acting. But knowing this was my stupid mistake, I was ready to (a) pay a restock fee or (b) keep the computer install Vista and give it to my son for games. I knew I had really screwed up - so I wanted to do my unhappy customer bit and than once that was done - I would keep the box if necessary.
Best Buy cheated me out of my grand speeches - they were amazingly nice and amazingly intelligent. The first person I met said "sure we will take it back" - when I offered to pay a re-stock fee - she said that would not be necessary. When I insisted that I had messed up the hard drive so I should pay a restock fee - she agreed to get a Geek squad guy to talk to me (this was not going according to my plan at all). The Geek squad guy was really nice and really sharp - quickly we were talking about which partition and which restore was needed and how was sorry I missed the fact it was using Windows Restore - he just looked at me and kept telling me everything would be fine. He said he would take a quick look and let me know.
Ten minutes later I had 100% of my money back - no matter how hard I tried to punish myself for my poorly-researched purchase - Best Buy provided me awesome customer service. I was stunned and very impressed and very pleased. I need to write a letter thanking them.
So I immediately went back in the Best Buy store and bought an iMac for $1200. Ironically Apple has a better commitment to old versions of Windows than Compaq. I figured I would go the BootCamp route.
So I walk out with a bright shiny new iMac and a big smile on my face. I get home and fire up the mac - get the OS/X side working - get Parallels working - get all my software installed and then start on BootCamp - The repartition works well. I drop in my XP / SP1 disk and boot it up. I notice that the partition map does not look anything like I expect - I don't see the partitions I want to see and the size of the partition I do see is wrong.
I figure - what the heck - must be some magic emulation fakery going on. So I format the disk and install XP SP1. This is looking great - until the reboot at the end of the install. Nothing - blank screen - there is no longer *any* bootable partition - anywhere on this hard drive.
Back to Google - I quickly find that when it said XP/SP2 on that popup - I should have read more carefully. Now my shiny new iMac was trashed. But not to worry - I popped in the Mac restore disks (thanks Apple) and after an hour or so was again treated to the welcome movie on the mac - I love that music and video - I might reformat a system from time to time just to watch the "welcome" video".
This time I decided to go with Vista on BootCamp because I did not have an XP/SP2 disk handy. I knew this would make trouble with printers but I was still operating on adrenaline - with the family computer down and out - I was on the hot seat.
So I install my legal copy of Vista Ultimate under boot camp and make it default boot into Windows for the family. When I am working I will just boot into OS/X.
Once it comes up I start noticing things I really really like about Vista. It notices my Brother Network-attached printer immediately. DVD's play beautifully out of the box. The User interface is better than XP by a long shot - I love the right side widget dock - I put family pictures rotating on everyone's account (this saves me a $100 electronic picture frame).
So now I set about fixing my printer sharing problem. I realize that it is just silly to share printers through computers. My Brother ink jet printer is Ethernet already and it has drivers in OS 10.5 and Vista (XP requires an install) making it so that the operating system is not a factor in printer sharing is great.
I decide to trash my Hp LaserJet 4 and get a Brother Laser with Ethernet for $100 - this will solve my problems forever!! But it turns out my brother has an old JetDirect card laying around - I install that and dang if it just works on XP, Mac OS/X and VIsta. Things are looking up.
Now I have all my printers working - the family liking the new computer - me loving the fact that I can work on a iMac with a nice big screen and perhaps save my vision a little bit. I love the fact that the iMac has no box under the table and almost no cables (there is a bit of a USB rats nest behind the computer). The iMac and Air is a super combination (Thanks to Ian D for that suggestion about four months ago).
As the month of post-Vista has passed am really growing to like Vista - not for development - but as an end-user operating system. I tried to force my family to use OS/X to simplify my tech support calls (mostly about printers) - but they did not like it and even after I taught them a few things - they still did not like Mac OS/X. Brent liked Mac OS/X so he is a convert (Garage Band helps in this religious conversion). When I gave them Vista - they liked it.
Here is the interesting bit - When I compare XP to Vista and XP to Mac OS/X - the amount of cosmetic change is pretty significant in both situations. So I felt that perhaps that in some ways Vista is simply more usable than Mac OS/X in some ways.
I still love the Mac - because I am a developer - I could never ever use an operating system unless it was based on UNIX. Sorry Windows. But for end-user things - Vista is pretty nice. I like the start icon and system tray better on Vista - I like the color scheme better on Vista - I like the fact that menus stick with the windows (an increasing problem as screen sizes become gigantic). All in all - as wonderful as Mac OS/X is - there is a little catching up to be done IMHO.
I also love Vista because of the fewer patches and more functionality out of the box (more like Mac OS/X). Even after a few weeks, I would not go back to XP - XP seems so clunky all of a sudden compared to Vista - both in usability and in maintenance. Vista just built-in more stuff that I had to add before. Funny - it took far longer for me to let go of Windows-98 compared to how long it took me to let go of Windows-XP.
I think that it would be nice for Mac OS/X to look at Vista and see if there are some ways that Mac OS/X could be improved. I would like the best of both worlds. Not that I dislike Mac OS/X - but there is always room for improvement. Perhaps as we switch from the current UI to the iPhone influenced UI - they could do a little nip and tuck in the Mac UI without seeming to admit that Microsoft *might* have done something right :)
So this experience surprised me in many ways - I learned a lot. My pre-concieved notions about how things would work out were often wrong. The heros and goats of this saga are as follows
Heros of my Story
Best Buy impressed the heck out of me in their competent and courteous service.
Microsoft Even though people are dissing Vista all the time - Microsoft has made something pretty nice - and I think that if you give it a chance in the right situation - I think that like me - it will win you over with capabilities well beyond XP. It makes XP look sad (of course I am talking about home use and not gaming/hacking here - just normal humans doing normal human things).
Brother Printers the future is networked printing - Brother has this built Ethernet and (usually) WiFi into their cheapest printers now - laser and ink jet. The next time your printer does not work - throw it away and buy a Brother printer - reward the company that chooses to support all operating systems for direct networked printer sharing. It is cheaper to replace your printer hardware than to bring in Geek Squad for $250 to debug your $50 ink-jet printer. Hey when you run out of ink - throw away your printer and buy a networked Brother printer. Note to Hewlett-Packard: HP should learn a lesson and put in cheap JetDirect support in every single printer on down to the lowest ink Jet and make sure to support it on all operating systems - even old ones - if you do not Brother might just eat your lunch. Brother is about 2-3 years ahead of HP on this one.
Apple - Funny how Apple makes a stronger commitment to supporting multiple Windows operating systems than some Windows-only vendors. Apple Hardware kicks arse. It is more expensive - but with the ability to do more than one thing - it is like you are getting more than one computer. The iMac is such an awesome piece of hardware for a home computer.
Goats in my Story
Compaq - They build great hardware that they treat like a microwave - it is throw-away. There is no commitment to thinking about how I will use it or giving me flexibility. I am thinking that they change hardware IDs just to spite me. I am glad to be rid of that hardware - technically it was beautiful - but the tech support was equivalent to the support you would get with a vacuum cleaner. Of course for $400 it costs about the same as a vacuum cleaner - so I should not complain so much. Interestingly we bought a $400 Dyson vacuum cleaner and did not like it so much either.
So in conclusion - this was fun once it was over and I am really happy with my current home configuration - like any technology transition - you don't want to do this very often. But if you wait a while and make a big jump - it can be pretty nice.
Just a little side note to Microsoft - Apple is a better friend to Microsoft than Compaq - when your operating system is viewed through some of these Windows-only vendors that sell hardware with poor support - it ends up reflecting badly on Microsoft. The fact that Compaq picked a silly way to handle restore is not your fault - Compaq was just trying to save a buck.
I finally got back to this!
Stuff to merge for SAK-11544
I took a copy of the 2-5-x code and reapplied the mods to that code and tested it. I attach the file that should slide right into 2-5-x.
search-impl/impl/src/java/org/sakaiproject/search/component/adapter/message/MessageContentProducer.java
Actually most of the differences were in formatting - someone had checked out the code - made a small mod but reformatted the code w.r.t. line ends and checked it back in. So it looks like there are lots of differences - it was not a refactor - just a reformat :)
This code should go in and make pretty diffs.
$ svn diff
Index: search-impl/impl/src/java/org/sakaiproject/search/component/adapter/message/MessageContentProducer.java
===================================================================
--- search-impl/impl/src/java/org/sakaiproject/search/component/adapter/message/MessageContentProducer.java (revision 45952)
+++ search-impl/impl/src/java/org/sakaiproject/search/component/adapter/message/MessageContentProducer.java (working copy)
@@ -49,6 +49,7 @@
import org.sakaiproject.search.component.Messages;
import org.sakaiproject.search.model.SearchBuilderItem;
import org.sakaiproject.search.util.HTMLParser;
+import org.sakaiproject.javax.PagingPosition;
/**
* @author ieb
@@ -499,17 +500,22 @@
final Iterator ci = l.iterator();
return new Iterator()
{
- Iterator mi = null;
+ MessageChannel mc = null;
+ int messageCount = -1;
+ int nextMessage = -1; // Index overall messages - Starts at 1
+ List messages = null;
+ int listPos = 0; // Index each chunk - Starts at zero
+ int chunkSize = 100; // Retrieve 100 at a time
public boolean hasNext()
{
- if (mi == null)
+ if (mc == null)
{
return nextIterator();
}
else
{
- if (mi.hasNext())
+ if (messageCount > 1 && nextMessage <= messageCount)
{
return true;
}
@@ -528,13 +534,12 @@
String chanellId = (String) ci.next();
try
{
- MessageChannel c = messageService
- .getChannel(messageService.channelReference(
- context, chanellId));
- List messages = c.getMessages(null, true);
- mi = messages.iterator();
- if (mi.hasNext())
+ mc = messageService.getChannel(messageService
+ .channelReference(context, chanellId));
+ messageCount = mc.getCount();
+ if (messageCount > 0 )
{
+ nextMessage = 1; // Pager starts at 1
return true;
}
}
@@ -542,22 +547,56 @@
{
ex.printStackTrace();
log.warn("Failed to get channel " + chanellId); //$NON-NLS-1$
-
}
}
+ mc = null;
+ nextMessage = -1;
+ messageCount = -1;
return false;
}
+ /*
+ * Loop though the messages in the channel grabbing them
+ * in chunkSize chunks for efficiency.
+ */
public Object next()
{
- Message m = (Message) mi.next();
- return m.getReference();
+ if ( messages != null && listPos >= 0 && listPos < messages.size() )
+ {
+ Message m = (Message) messages.get(listPos);
+ nextMessage = nextMessage + 1;
+ listPos = listPos + 1;
+ return m.getReference();
+ }
+
+ // Retrieve the next "chunk"
+ PagingPosition pages = new PagingPosition(nextMessage, (nextMessage + chunkSize - 1));
+ try
+ {
+ messages = mc.getMessages(null, true, pages);
+ if ( messages != null && messages.size() > 0 )
+ {
+ listPos = 0;
+ Message m = (Message) messages.get(listPos);
+ nextMessage = nextMessage + 1;
+ listPos = listPos + 1;
+ return m.getReference();
+ }
+ }
+ catch (Exception ex)
+ {
+ ex.printStackTrace();
+ log.warn("Failed to get message " + nextMessage); //$NON-NLS-1$
+
+ }
+ // We are done looping through this channel
+ nextMessage = messageCount + 1;
+ return null;
}
public void remove()
{
- throw new UnsupportedOperationException(
- "Remove not implemented"); //$NON-NLS-1$
+ throw new UnsupportedOperationException("Remove not implemented"); //$NON-NLS-1$
}
};