Document Management Add-on Faster than Ever
Wouldn’t it be cool to see updates from other users in real time (or near to real time)? No browser refresh, nothing to do: they would just appear all by themselves.
A few months ago, I published an initial post about the Documents Add-on; you can read it here Developing a Simple Document Management eXo Add-on.
Since then, I have added a lot of new features:
- Support for Microsoft Office and Open Office documents (requested by the community)
- Folder support (requested by the community)
- Internationalization: English and French translations
- Bookmark compliant
- Design updated for Retina displays
- Auto refresh
- Local storage
In the video bellow, I will focus on the last two but you will be able to get a preview of some of the others as well.
Basically, what we call local storage is the capacity for your browser to store data locally. You’ve heard about cookies? Local storage in HTML5 is like “cookies on steroids” 🙂 It allows us to store a large amount of data. Just to take one example, GMail uses it to store all your emails locally so you don’t have to download them from the server each time you want to view an email. Local storage is the first step to offline mode, where you don’t need an internet connection since everything is stored locally and synced back to the server when you get an internet connection.
Auto Refresh and Local Storage
So, wouldn’t it be cool to see updates from other users in real time (or near to real time)? No browser refresh, nothing to do: the updates would just appear all by themselves.
Thanks to the new local storage feature, this is now possible – but how?
Without local storage, I would have to call the server every few seconds, download the contents from my current folder and refresh it, right?
Well, I could do that but it would certainly slow the server down… unless I do a very simple check.
So, what I do is store all my folders in the browser’s local database when I access them and update them only when something changes. If a folder doesn’t change, I can continue to use my files, but I won’t make even one single call to the server (except for timestamp checks). Technically speaking, a timestamp check is one property read of the Content Repository (you can’t do anything simpler 🙂
So, what does it look like in a real-life scenario – watch the video to find out!
In the next few days, I will publish one more post about the technology I use to manage all of this.
Thanks for watching and stay tuned – more improvements are on the way, Benjamin.