1. 2007: It all started with baby
photos...
Yes I could have just used FTP, but that would be too easy!
2. A Little About Me
● Freelance software developer
● Commercial vendor for Milton since 2012
● Lives in New Zealand
● No customers in my own country!
● Also have a startup business – FuseLMS.com
3. About Milton
● Started in 2007 as small webdav servlet
● Now best in the world at what it does – only
library to support webdav,caldav and carddav
● Corporate clients include: Google, HP, Novell
● EU firms: Lukkien, 5Point, QualityOnline,
Careweb, Idiada, SSP Europe
● FOSS projects: ExistDB, BaseX, CouchDB
● github.com/miltonio/milton2
4. About Webdav
● Network protocol, like FTP and Samba
● But extensible
● Its just HTTP, plus a few extras
● Supports structured data as well as binary
content
● Built in with all major Operating Systems
● Supported by most major apps, like MS Office,
Adobe, etc
6. The Awesome-ness of Dav
● Scalability! Stateless protocols allow high
performance, high availability clusters
● Network integration: No hassles with firewalls,
its just http
● Security: Simple, well understood protocols
makes it easy for sys admins to secure
● Integration: Just incremental additions to
existing web applications, for close integration
7. Industry support
● Broad support from industry working groups,
ongoing protocol development
● Early leadership from Microsoft
● Then Apple led charge with MobileMe and
iCloud
● Google sees Dav as strategic to making its
calendar and contact services ubiquitous
8. Productivity Models
Model Where is my software? Where is my content? Exemplors
1 Local Local Microsoft
2 Remote Remote Google,
Facebook
3 Local Remote Apple
3b Local Local synced to Remote Dropbox
Webdav is useful when local applications need access to remote content
There is a war being waged between local software vendors (Apple,MS) and remote
software vendors (Google,Facebook).
Which model is winning?
9. How to build webdav apps?
Create annotated methods that work with your domain objects
@Root
public Repository getRoot() {
return findRootRepository();
}
@ChildrenOf
public List<DataNode> getRootFolders(Repository root) {
return root.getFolders();
}
@ChildrenOf
public List<DataNode> getRootFolders(DirectoryNode root) {
return root.getFolders();
}
@Get
public void getFileContent(FileNode fileNode, OutputStream out){
fileNode.writeContent(out);
}
@PutChild
public FileNode createFile(DirectoryNode dir, String newName, InputStream in) {
DataSession.FileNode newFileNode = parent.addFile(newName);
newFileNode.setContent(inputStream);
return newFileNode;
}
10. How to implement security?
Implement authentication and an access control list:
@Authenticate
public Boolean checkPasswordBasic(Profile user, String password) {
return passwordManager.verifyPassword(user, password);
}
@Authenticate
public Boolean checkPasswordDigest(Profile user, DigestResponse d) {
return passwordManager.verifyDigest(d, user);
}
@AccessControlList
public List<AccessControlledResource.Priviledge> getPrivs(target, Profile user) {
if( currentUser == null ) {
return AccessControlledResource.NONE;
} else {
… // business rules
}
}
11. Competitors to webdav for files
● Dropbox!! (and other sync apps)
● Most users prefer sync'd files to remote access
● Webdav-sync protocol exists, but not widely
implemented
● Ideally support both webdav and sync
● Milton has components to support sync
12. Caldav: Webdav for calendars
● Dav is well suited, given the mix of structured
data and unstructured content
● Probably most widely used Dav protocol
● Coming to Windows Phone 8, just announced
this week!
● So probably available on Window desktop in
near future
● Very well supported on Mac and iOS devices
13. How to build Caldav apps?
Start with a webdav app and add calendar capabilities
@ChildrenOf
public CalendarsHome getCalendarsHome(Profile user) {
return new CalendarsHome(user); // Place holder object
}
@ChildrenOf
@Calendars
public List<Calendar> getCalendars(CalendarsHome cals, @Principal Profile profile) {
return cals.user.getCalendars();
}
@Get
@ICalData
public void getEventIcal(CalEvent event, Calendar calendar, OutputStream out) {
String s = calendarService.getCalendar(event);
out.write(s.getBytes(StringUtils.UTF8));
}
}
@PutChild
public CalEvent createEvent(Calendar calendar, final String newName, InputStream in) {
CalEvent newEvent = calendarService.createEvent(calendar, newName, in);
return newEvent;
}
14. Carddav: for contacts
● Milton was deployed to Google Contacts end of
2012
● Google has deprecated ActiveSync, forcing iOS
users to move to Carddav – millions of users!
● No built in support for Thunderbird, but SOGO
connector is ok
● Very well supported on Mac and iOS devices
15. How to build Carddav apps?
You guessed it … easy!
@ChildrenOf
@AddressBooks
public MusicianAddressBook getAddressBook(AddressBooksHome m) {
...
}
@ContactData
@Get
public byte[] getContactData(MyContact c) {
...
}
16. Milton as a Web Framework
● Annotations support modelled on Spring MVC
● Templating, forms, ajax, data binding and xDav
work seamlessly in a single url namespace
● Automatically has navigable REST API –
includes properties!
● Eg:
@Post(bindData=true)
public Profile saveProfile(Profile profile) {
profile.setModifiedDate(new Date());
return profile;
}
@Get
public ModelAndView showUserPag(Profile p) {
return new ModelAndView("profile", p, "profPage");
}
17. What next for Webdav
● Expect wider adoption of Oauth2 by client and
server vendors
● Ubiquitous support for Caldav + Carddav for
service vendors and client vendors will be a
game changer
● Increasing support for webdav sync … ? Maybe
18. What next for Milton?
● Ongoing: co-ordination with client-side
developers to provide server-side capabilities
● Next protocols: webdav-sync + dav search
● File sync
● Server-to-server sync – eg sync OBM
calendars with Google calendars
● Server application development – simple
file,calendars and contacts server for small
business
19. What next for OBM and Milton?
● An ideal partnership
● First calendars...
● Then contacts...
● Then files … ? Hopefully!