The following part is going to provide how Stephan Hartmann’s Metamesh Driver has been installed in the all-in-one OpenCms Stack Installation and how to use Grive to synchronize your Google Docs documents with the whole thing.
We use the Real File System (RFS) to Virtual File System (VFS) Driver in production by our clients to upload large videos, but you might use it to manage your documents through a network drive (i.e. Samba Share).
From a developer perspective the main benefit of RFS / VFS Driver is to provide developer productivity, for more detailed information about the RFS / VFS Driver please visit the following link on Github:
https://github.com/stephan-hartmann/opencms-rfs-driver
To install the RFS / VFS Driver on your docker OpenCms Stack Container run the following commands:
cd /home/
wget https://github.com/stephan-hartmann/opencms-rfs-driver/archive/master.zip
unzip master.zip
cd opencms-rfs-driver-master/
cp releases/metamesh_rfs-8.5.0.8.jar /var/lib/tomcat7/webapps/opencms/WEB-INF/lib/
Adapt the opencms-vfs.xml (in production environments, backup your file):
vi /var/lib/tomcat7/webapps/opencms/WEB-INF/config/opencms-vfs.xml
<!-- loader class="org.opencms.loader.CmsDumpLoader" / →
<loader class="com.metamesh.opencms.rfs.RfsAwareDumpLoader" />
<loader class="org.opencms.loader.CmsImageLoader">
<param name="image.scaling.enabled">true</param>
</loader>
<loader class="org.opencms.loader.CmsPointerLoader" />
<!-- loader class="org.opencms.loader.CmsJspLoader" →
<loader class="com.metamesh.opencms.rfs.RfsAwareJspLoader">
Change your opencms.properties like this:
vi /var/lib/tomcat7/webapps/opencms/WEB-INF/config/opencms.properties
#
# Configuration of the driver manager*
#################################################################################
driver.vfs=rfs,db
rfs.vfs.driver=com.metamesh.opencms.rfs.driver.RfsDriver
#driver.vfs=db
driver.project=db
driver.user=db
driver.history=db
driver.subscription=db
Copy the metamesh_rfs.properties under the config folder:
cp src/conf/metamesh_rfs.properties /var/lib/tomcat7/webapps/opencms/WEB-INF/config/
chown -R tomcat7.tomcat7 /var/lib/tomcat7/webapps/opencms/WEB-INF/config/metamesh_rfs.properties
mkdir /var/lib/tomcat7/webapps/opencms/videos
chown -R tomcat7.tomcat7 mkdir /var/lib/tomcat7/webapps/opencms/videos
vi /var/lib/tomcat7/webapps/opencms/WEB-INF/config/metamesh_rfs.properties
#one-2-one-mapping.webapp-relative=one2one:/sites/default/one2one
one-2-one-mapping.webapp-relative=videos:/sites/default/videos
one-2-one-mapping.webapp-relative=downloads:/sites/default/downloads
Login to your OpenCms Workplace and create a new folder "videos" and “downloads” under your default site.
Restart Tomcat:
root@8b899284d695:# service tomcat7 restart
For Testing create a file on RFS under the vidoes folder which you created in the previous step:
touch /var/lib/tomcat7/webapps/opencms/videos/test.rfs
Reload your Workplace, you should see the new RFS file "test.rfs" in your VFS :-)
In this section we will use Grive to synchronize our Google Docs files under our videos oder documents folder.
Note: Grive is the Open Source google Drive Client for Linux and is not that I’d like to use in the long term, for more information please visit this link:
http://www.webupd8.org/2012/05/grive-open-source-google-drive-client.html
First we install some required python packages:
$ sudo apt-get install software-properties-common python-software-properties
$ mkdir /var/lib/tomcat7/webapps/opencms/downloads
$ cd /var/lib/tomcat7/webapps/opencms/downloads/
$ add-apt-repository ppa:nilarimogard/webupd8
$ apt-get update
$ apt-get install grive
$ grive -a
At this point you'll get a URL shown on the console, paste it to the browser and provide the authentication string in the console and synchronize your docs in the RFS (Real File System).
After synchronizing your documents you shall see your Google Driver Docs in OpenCms VFS (Virtual File System) and you can integrate them into your OpenCms Container Pages on your OpenCms Stack Container.