I've been on a bit of a tear with CMIS lately. Every time I have a project requirement that mentions document storage or a document library, I think "hey, let's use Alfresco, that CMIS interface is pretty nifty". I have heard some people grumble that CMIS isn't ready for "prime time" (whatever that means), but my experience suggests otherwise. So far I have used Alfresco's CMIS interface in iPad / iPhone applications, Python scripts (running in Jython) and a few J2EE web applications.
Well, let's add another one. My company makes extensive use of Drupal for internal and external web sites. It's lightweight, pretty easy to train content owners to use, is dead simple to host and has LOTS of support among the various designers and agencies we work with. I'm not a huge fan of PHP personally, but I like the modularity and simplicity Drupal offers. One of the Drupal sites I have been called on to improve is a communication portal for a large internal project. The portal is pretty simple, with just a few menus and a couple of custom content types. The project participants are already using Alfresco to manage many of their internal documents, and they want to expose two Alfresco Share document libraries to the portal. One of these sites contains general project information and the other contains training materials. Sound like a use case for CMIS? You bet.
There are a few options available for integrating CMIS content into a PHP web application. The first way I explored was writing my own module using phpclient from the Apache Chemistry project. I have used this in the past and found it to be a solid implementation of CMIS for PHP. However, there is a better solution out there for Drupal users. There is a CMIS API module that encompasses a CMIS query tool, a repository browser, content synchronization and a few other goodies. Let's step through setting it up.
First, download the module package and add it to your Drupal installation. Installing a Drupal module is as simple as unpacking it into <drupal_base>/sites/all/modules/contributed. Once you have the module installed, open up your settings.php (I use the site-specific config file in <drupal_base>/sites/<hostname>/settings.php), and configure a new repository by adding the following bit of PHP to the end of your settings file. If you like, you can configure multiple repositories by adding multiple entries like the 'default' entry to the outer array:
1 2 3 4 5 6 7 8 9 10 |
/** * CMIS repository configuration */ $conf['cmis_repositories'] = array( 'default' => array ( 'user' => 'alfresco_username', 'password' => 'alfresco_password', 'url' => 'http://my.server/alfresco/service/cmis' ) ); |
Now that the module is installed and a repository is configured, log into Drupal with an Administrator account and go to the module list. At this point you should see a new section in the list for CMIS modules.
There are a few modules here that are of particular interest. The CMIS module has to be enabled, as it is required by the rest of the modules in the package. Other modules I have found useful are the CMIS Browser and CMIS Query modules. I haven't had a occasion to use the headerswing, Dev or Sync modules, but I went ahead and enabled them anyway for evaluation. Check the requisite boxes and click "Save" at the bottom of the page to enable the modules you want to use. Once enabled, you have some new functionality to explore. Let's take a quick look at the CMIS Browser module first.
The browser can be accessed at http://your.server.com/yourdrupalpath/cmis/browser. It provides a navigable, "explorer-like" view of your CMIS repository, as well as actions for creating content and folders:
The Browser module can also be directed to a specific repository path by appending that path to the end of the URL. For example, if you want to see the contents of the "Sites" folder displayed, just append "Sites" to the end of your URL, like so: http://your.server.com/yourdrupalpath/cmis/browser/Sites. This is very handy if you want to link to the CMIS browser from a Drupal menu and drop into a specific folder in your repository.
The query module works in a similar fashion. It provides a CQL (Content Query Language) interface to the configured repository. You can access the query module at http://your.server.com/yourdruplapath/cmis/query. Just enter a valid CQL query and click "Run":
Like the browser module, the query module can take the specific query as a part of the URL. If you append the query after the base URL, the module will be displayed with the query already executed.
Both of these modules are very handy for exploring and searching a repository, but I need something a bit simpler. I just want to display a table of folders and documents that my users can click through. No tree views, no queries, no breadcrumb trail, no actions. Just a simple little file/folder list. To that end, I grabbed some of the code from the existing query and browser modules (thanks guys, I love open source!) and created a simple CMIS Display module:
The CMIS Display module works much like the CMIS Browser module. It will display any repository path that is appended to the URL. So, if you wanted to display everything in your "Sites" folder in the repository, this is the URL you would use: http://your.server.com/yourdrupalpath/cmis/display/Sites. It's simiple, clean and easy to use. The CMIS Display module isn't part of the CMIS module package, but if you want to add it to your Drupal installation, just download the zip file here, and unzip it into your CMIS module installation directory. This will create a cmis_display directory alongside your cmis_browser and cmis_query directories. If you install it after the rest of your CMIS module is installed, don't forget to go to the Drupal Modules list and activate it. Big thank you to all of the Drupal CMIS module contributors for making my life a little easier!
相关推荐
* Build a community by integrating with user-generated content on Flickr and YouTube * Use Google Maps to make it easy for customers to find you -- display a professional map on your “where to find...
【ORDERED NEURONS INTEGRATING TREE STRUCTURES INTO RECURRENT NEURA】 自然语言的理解与处理在人工智能领域中占据着核心地位,尤其是对于自然语言处理(NLP)算法来说,理解和利用语言的内在层次结构至关重要。...
the book explores the core and contributed landscape for decoupled Drupal, authentication mechanisms, and the surrounding tooling ecosystem before delving into consumer implementations in a variety ...
### 整合 JMeter 与 Ant 的方法及实践 #### 概述 在软件开发过程中,性能测试是一项至关重要的任务,它有助于确保应用程序能够在高负载下稳定运行。JMeter 是一款广泛使用的开源负载测试工具,它能够模拟大量并发...
Integrating the Orca Optimizer into MySQL 在 MySQL 中集成 Orca 优化器是为了解决 MySQL 查询优化器的限制,特别是在处理复杂查询时。MySQL 查询优化器原本设计用于简单的 OLTP 类型查询,但是在处理更复杂的...
Part IV Integrating BIRT Functionality into Applications Chapter 13 Understanding the BIRT APIs Chapter 14 Programming using the BIRT Reporting APIs Chapter 15 Programming using the BIRT Charting API ...
In this paper, we will look at what is required to create a shared library with FireMonkey in RAD Studio that can be used across multiple platforms, specifically with Windows and Mac OS X. We will ...
【Zenoss 网络管理】与【Opengear 控制台服务器集成】是现代数据中心IT管理的关键技术。Zenoss Enterprise 是一款先进的IT管理产品,它优化了对业务应用程序和服务支持基础设施的监控,尤其在动态的数据中心环境中。...
### 集成高级GLSL着色与XML驱动代理到学习型3D引擎 #### 摘要概览 本文介绍了一种集成了高级GLSL(OpenGL着色语言)着色技术和XML驱动代理的支持虚拟角色的学习型3D引擎。该引擎在设计时考虑到了教育目的,简化了...
BIRT is a powerful ...into other enterprise applications. Two companion books, BIRT: A Field Guide to Reporting and Integrating and Extending BIRT, cover the breadth and depth of BIRT’s functionality.
根据提供的文件信息,文章题目为《Integrating Case Frame into Japanese to Chinese Hierarchical Phrase-based Translation Model》,中文可译为《在日到中文层次短语翻译模型中整合案例框架》。这是一篇研究论文...
Prentice Hall - Service Oriented Architecture A Field Guide to Integrating XML and Web Services (2004) Prentice Hall - Service Oriented Architecture A Field Guide to Integrating XML and Web Services ...
Hierarchical Deep Reinforcement Learning: Integrating Temporal Abstraction and Intrinsic Motivation 分层强化学习论文总结
Apress - Integrating Serverless Architecture.2019.epub
CMU的Russ Salakhutdinov教授在第十三届年度机器学习研讨会(13th Annual Machine Learning)上完成一场题为"Integrating domain-knowledge into deep learning"的学术报告,详细介绍了各种类型的“知识(knowledge...
《Integrating Voice and Data Networks》是由Cisco Press出版的一本经典教材,主要面向网络管理人员、开发人员以及希望使用Cisco公司的语音和数据集成产品的CCIE(Cisco Certified Internetwork Expert,思科认证...
NASA 应用遥感培训 (ARSET) NASA ARSET为灾害监测和其他遥感主题提供网络研讨会,其中许多使用地球引擎。 华盛顿大学 此页面具有出色的集科开发的入门教程的 凯瑟琳·库恩和吉利安Deines为电子科学研究所的...
STK-Disk913x-Integrating a 913X OPENstorage Disk Pyramind Enviro