Upgrade Your Drupal Skills

We trained 1,000+ Drupal Developers over the last decade.

See Advanced Courses NAH, I know Enough
Jul 09 2013
Jul 09

If views of my presentations on SlideShare are any indication, a whole lot of you are interested in integrating Drupal and Alfresco. Despite the fact that the presentation is four years old, it consistently makes the “most viewed” list out of my uploads. If you are considering Drupal but need something a bit more document-centric to serve up your files as part of that Drupal site, take a look:

With over 12,000 views, it is safe to say there is definitely something to the combination of Alfresco and Drupal.

Another apparent classic is:

Which is kind of scary given its age and brevity. I think the popularity of this is due to the seemingly inexhaustible demand for “getting started” resources for new Alfresco developers.

This one has similar info, but with more details, and is probably a better choice for developers trying to get an extremely high-level overview:

The CMIS API is now the preferred way to interact with the Alfresco repository remotely, and many people use this presentation to get a quick overview:

In fact, I’ll have a CMIS powerhouse panel on Tech Talk Live tomorrow (July 10, 2013). So if you are just getting started with CMIS, please join us.

If you like CMIS but you don’t want to fool around with your own server, you can use Alfresco in the Cloud. This deck gives a CMIS overview and discusses the Alfresco API at a high-level with links to sample code and screencasts:

Thanks to everyone who has made use of these presentations!

Mar 22 2012
Mar 22

A hands-on learning tool for CMIS with Alfresco

Posted on: Thursday, March 22nd 2012 by Victor

In our Canopy solution, one of the core features is the ability to synchronize the content and its metadata change upon request between Drupal and Alfresco. A typical use case is called R-R (Repository to Repository): publishing content from one repository to another. A common scenario is publishing content from Alfresco directly to Drupal systems for publication to the Intra/Internet. The solution needs to provide two essential functions:

  • be able to provide bidirectional document and metatadata read and write between Drupal and Alfresco. It is vital to support custom content type from Drupal, as well as Alfresco custom content model.
  • be able to receive change notification between Drupal and Alfresco so that each document can be made aware of what changes (document, metadata upload, update and deletion) have happened in other repositories.

    In order for support bidirectional data synchronization, one option is to employ CMIS Alfresco, as I love learning by hands on, my intuition is: why not try it to see what it can accomplish first. cmislib is developed by Jeff Potts (Chief Community Officer at Alfresco) and comes in handy. The beauty of cmislib is a developer can try all sorts of things from command line or favorite IDE and Python is just that elegant to read and write. Even you program in other languages such as PHP/Ruby/Java, the CMIS concepts such as Repository,Document,Folder,Query etc are about the same. Open Chemistry has listed CMIS client for Java, PHP, Python and .NET.

    I have written some demo code based on an Alfresco out of the box installation.The source code is located at bitbucket. "git clone [email protected]:pythonrocks/alfresco.git" will get the source code cmis.py.

    Alfresco Version: 4.0 Enterprise
    Python: 2.7+
    Python add on: cmislib, cmislibalf

    The code above will use the out of box demo data is installed as part of : /Sites/swsdp/documentLibrary/Agency Files/Contracts/
    As you can play with the above source code, you can learn the following:

  • how to create a CMISClient with login credential. For example, cmisClient = cmislib.CmisClient('http://localhost:8080/alfresco/s/cmis', 'admin', 'admin') will get us the entry point for Alfresco Repository.
  • how to get the folder and navigate among its children in CMIS
  • how to retrieve the document and its properties (metadata) in CMIS.
  • how to check out and check in the document in CMIS.
  • how to create and query custom content in CMIS. This is nontrivial for integrating with Alfresco's custom content model. It enables Alfresco 's custom content with automated discovery. The custom content mdoel uses what Jeff has shown in Custom Content type. This method can enable not only Drupal integration without Java code changes due to metadata change, also it can be used for any other Repository to Repository (R2R) integration as long as one of the Repository is CMIS compliant. To name but a few, Drupal to Oracle UCM, Joomla to Alfresco or Oracle UCM.
  • how to perform search on custom content in CMIS.

    To install cmislib is pretty easy with "pip install cmislib". If you don't have pip installed, "sudo apt-get install pip" will install it on debian/ubuntu linux, otherwise please consult PIP install

    cmislib References

  • Mar 22 2012
    Mar 22

    Hands on CMIS with Alfresco

    Posted on: Thursday, March 22nd 2012 by Victor

    Canopy Solution

    In our Canopy solution, one of the core features is the ability to synchronize the content and its metadata change upon request between Drupal and Alfresco. A typical use case is called R-R (Repository to Repository): publishing content from one repository to another. A common scenario is publishing content from Alfresco directly to Drupal systems for publication to the Intra/Internet. In case of performance of document retrieval is a requirement, a solution needs to provide two essential functions:

    • Be able to provide bidirectional document/metatadata synchronization between Drupal and Alfresco. It is vital to support custom content type from Drupal, as well as Alfresco custom content model.
    • Be able to receive change notification between Drupal and Alfresco so that each document can be made aware of what changes (document, metadata upload, update and deletion) have happened in other repositories.

    CMIS

    In order for support bidirectional data synchronization, one option is to employ CMIS Alfresco, as I love learning by hands on, my intuition is: why not try it to see what it can accomplish first. cmislib is developed by Jeff Potts (Chief Community Officer at Alfresco) and comes in handy. The beauty of cmislib is a developer can try all sorts of things from command line or favorite IDE and Python is just that elegant to read and write. Even you program in other languages such as PHP/Ruby/Java, the CMIS concepts such as Repository,Document,Folder,Query etc are about the same. Open Chemistry has listed CMIS client for Java, PHP, Python and .NET.

    Demo code

    I have written some demo code based on an Alfresco out of the box installation.The source code is located at github. "git clone [email protected]:victordude/alfresco.git" will get the source code cmis.py.

    Alfresco Version: 4.0 Enterprise
    Python: 2.7+
    Python CMIS libs: cmislib, cmislibalf

    The code above will use the out of box demo data is installed as part of : /Sites/swsdp/documentLibrary/Agency Files/Contracts/
    As you can play with the above source code, you can learn the following:

  • how to create a CMISClient with login credential. For example, cmisClient = cmislib.CmisClient('http://localhost:8080/alfresco/s/cmis', 'admin', 'admin') will get us the entry point for Alfresco Repository.
  • how to get the folder and navigate among its children in CMIS
  • how to retrieve the document and its properties (metadata) in CMIS.
  • how to check out and check in the document in CMIS.
  • how to create and query custom content in CMIS. This is nontrivial for integrating with Alfresco's custom content model. It enables Alfresco 's custom content with automated discovery. The custom content mdoel uses what Jeff has shown in Custom Content type. This method can enable not only Drupal integration without Java code changes due to metadata change, also it can be used for any other Repository to Repository (R2R) integration as long as one of the Repository is CMIS compliant. To name but a few, Drupal to Oracle UCM, Joomla to Alfresco or Oracle UCM.
  • how to perform search on custom content in CMIS.
  • how to add/remove contributor role for a group calld "demogrp" for /demo folder.

    To install cmislib is pretty easy with "pip install cmislib". If you don't have pip installed, "sudo apt-get install pip" will install it on debian/ubuntu linux, otherwise please consult PIP install

    References

  • Mar 22 2010
    Mar 22

    A lot of people have been asking for the files we used to integrate Alfresco CMIS with Drupal Open Atrium (See ecmarchitect.com blog post). I’ve happily mailed those to whomever asked. I’ve had the intention of testing them with the latest version, cleaning them up, and putting somewhere more appropriate like the Open Atrium feature server, or at the very least, Google Code or GitHub. But it hasn’t happened yet so I figured I’d make them available here and appeal to the Community to give them a good home.

    The zip includes a readme file with (very) rough install/config directions.

    Good luck!

    Feb 16 2010
    Feb 16

    Fellow Optaros colleague, Chris Fuller, and I want to present on the Alfresco-Drupal integration at Drupalcon in San Francisco (April 19-21). If you’re interested in Alfresco, Drupal, and CMIS (any or all of the above), please vote for our session.

    Oct 13 2009
    Oct 13

    UPDATE: Screencast now lives here:

    [embedded content]

    I recorded a quick screencast of a simple integration we did to show Open Atrium leveraging Alfresco as a formal document repository via CMIS. This leverages the CMIS Alfresco module we developed and released on Drupal.org.

    As I point out in the screencast, there’s not much to the integration from a technical standpoint. Open Atrium is Drupal and the CMIS module already has a CMIS repository browser. So, all we had to do was expose the module as a “feature”, which is something Open Atrium uses to bundle modules together that create a given chunk of functionality.

    Readers familiar with Alfresco Share will instantly recognize the Open Atrium concepts. Instead of “sites” Atrium uses “groups”. Instead of “pages” or “tools”, Atrium uses “features”. The overall purpose, self-provisioned team-based collaboration, is the same and many of the tools/features are the same (blog, calendar, member directory). I’m not advocating using one over the other–as usual, what works best for you depends on a lot of factors. I just thought Atrium provided a nice way to show yet another example of Drupal and Alfresco together (post).

    Sep 15 2009
    Sep 15

    People want intranets that are fun and easy to use, full of compelling content relevant to their job, and enabled with social and community features to help them discover connections with other teams, projects, and colleagues. IT wants something that’s lightweight and flexible enough to respond to the needs of the business that won’t cost a fortune.

    That’s why Drupal + Alfresco is a great combination for things like intranets like the one Optaros built for Activision and why we had a record-breaking turnout for the Drupal + Alfresco webinar Chris Fuller and I did today. Thanks to everyone who came and asked good questions. I’ve posted the slides. Alfresco recorded the webinar so they’ll make it available soon, I’m sure. When that happens, I’ll update the post with a link. Until then, enjoy the slides.

    [UPDATE: Fixed the slideshare link (thanks, David!) and added the links to the webinar recording below]

    1. Streaming recording link:
    https://alfresco.webex.com/alfresco/lsr.php?AT=pb&SP=TC&rID=42774837&act=pb&rKey=b44130d69cc9ec5f

    2. Download recording link:
    https://alfresco.webex.com/alfresco/ldr.php?AT=dw&SP=TC&rID=42774837&act=pf&rKey=c50049ac82e1220a

    Apr 20 2009
    Apr 20

    People often need to build a custom user interface on top of the Alfresco repository and I see a lot of people asking general questions about how to do it. There are lots of options to consider. Here are four options for creating a user interface on top of Alfresco, at a high level:

    Option 1: Use your favorite programming language and/or framework to talk to Alfresco via REST or Web Services. PHP? Python? Java? Flex? Whatever, it’s up to you. The REST API is nice because if you can’t find a URL that does what you need it to out-of-the-box, you can always roll-your-own with the web script framework. This option offers the most flexibility and creative freedom, but of course you might end up building constructs or components that you may have gotten “for free” from a higher-level framework. Optaros‘ streamlined web client, DoCASU, built on Ext-JS, is one freely-available example of a custom UI on top of Alfresco but there are others.

    Option 2: Use Alfresco’s Surf framework. Alfresco’s Surf framework is just that–it’s a framework. Don’t confuse it with Alfresco Share which is a team-centric collaboration client built on top of Surf. And, don’t assume that just because a piece of functionality is in Share it is available to you in the lower-level Surf framework. You may have to do some extra work to get some of the cool stuff in Share to work in your pure Surf app. Also realize that Surf is brand new and still maturing. You’ll be quickly disappointed if you hold it to the same standard as a more widely-used, well-established framework like Seam or Django. Surf is a good option for quick, Alfresco-centric solutions, especially if you think you might want to leverage Alfresco’s browser-based site assembly tool, Web Studio, at some point in the future. (See Do-it-yourself Alfresco Surf Code Camp).

    Option 3: Customize the Alfresco “Explorer” web client. There are varying degrees to which you can customize the web client. On one end of the spectrum you’ve got Freemarker “presentation templates” followed closely by XML configuration. On the other end of the spectrum you’ve got more elaborate enhancements you can make using JavaServer Faces (JSF). Customizing the Alfresco Explorer web client should only be considered if you can keep your enhancements to an absolute minimum because:

    1. Alfresco is moving away from JSF in favor of Surf-based clients. The Explorer client will continue to be around, but I wouldn’t expect major efforts to be focused on that client going forward.
    2. JSF-based customizations of the web client can be time-consuming and potentially complex, particularly if you are new to JSF.
    3. For most solutions, you’ll get more customer satisfaction bang out of your coding buck by building a purpose-built, eye-catching, UI designed with your specific use cases in mind than you will by starting with the general-purpose web client and extending from there.

    Option 4: Use a portal, community, or WCM platform. This includes PHP-based projects like Drupal (Drupal CMIS Screencast) or Joomla as well as Java-based projects like Liferay and JBoss Portal. This is a good option if you have requirements that match up well with the built-in (or easily added-on) capabilities of those platforms.

    It’s worth talking about Java portal servers specifically. I think people are struggling a bit to find The Best Way to integrate Alfresco with a portal. Of course there probably is no single approach that will fit every situation but I think Alfresco (with help from the community) could do more to provide best practices.

    Here are the options you have when integrating with a portal:

    Portal Option 1: Configure Alfresco to be the replacement JSR-170 repository for the portal. This option seems like more trouble than it is worth. If all you need is what you can get out of JSR-170, you might as well use the already-integrated Jackrabbit repository that most open source portals ship with these days unless you have good reasons not to. I’m open to having my mind changed on this one, but it seems like if you want to use Alfresco and a portal, you’ve got bigger plans that are probably going to require custom portlets anyway.

    Portal Option 2: Run Alfresco and the portal in the same JVM (post). This is NOT recommended if you need to scale beyond a small departmental solution and, really, I think with the de-coupling of the web script engine we should consider this one deprecated at this point.

    Portal Option 3: Run the Alfresco web script engine and the portal in the same JVM. Like the previous option, this gives you the ability to write web scripts that are wrapped in a portlet but it cuts down on the size of the web app significantly and it frees up your portal to scale independently of the Alfresco repository tier. It’s a fast development cycle once you get it set up. But I haven’t seen great instructions for setting it up yet. Alfresco should document this on their wiki if they are going to support this pattern.

    Portal Option 4: Write your own portlets that make services calls. This is the “cleanest” approach because it treats Alfresco like any other back-end you might want to integrate with from the portal. You write custom portlets and have them talk to Alfresco via REST or SOAP. You’ll have to decide how you want to handle authentication with Alfresco.

    What about CMIS?

    CMIS fits under the “Option 1: Use your favorite programming language” and “Portal Option 4: Write your own portlets” categories. You can make CMIS calls to Alfresco using both REST and SOAP from your own custom code, portlet or otherwise. The nice thing about CMIS is that you can use it to abstract the underlying repository so that (in theory) your front-end code will work with different CMIS-compliant back-ends. Just realize that CMIS isn’t a fully-ratified standard yet and although a CMIS implementation is in the Enterprise version of Alfresco, it isn’t clear to me whether or not you’d be supported if you had a problem. (The last response I saw on this specific question was a Peter Monks tweet saying, “I don’t think so”).

    The CMIS standard should be approved by the end-of-the-year and if Alfresco’s past performance is an indicator of the future, they’ll be the first to market with a production-ready, fully-supported CMIS implementation based on the final spec.

    Pick your poison

    Those are the options as I see them. Each one has trade-offs. Some may become more or less attractive over time as languages, frameworks, and the state of the art evolve. Ultimately, you’re going to have to evaluate which one fits your situation the best. You may have a hard time making a decision, but you have to admit that having to choose from several options is a nice problem to have.

    Apr 07 2009
    Apr 07

    7 Apr 2009

    Posted by jpotts

    UPDATE: Screencast now lives here:

    http://youtu.be/xYgUcpwnDYM

    I’ve created a new screencast that shows the Alfresco-Drupal CMIS integration in action over at Optaros Labs. The screencast shows content moving back-and-forth between Alfresco and Drupal, content being displayed in a Drupal site that lives in Alfresco, and a CMIS CQL query being executed against the Alfresco repository from Drupal.

    The Drupal CMIS module and the CMIS Alfresco module are available at Drupal.org.

    Feb 23 2009
    Feb 23

    23 Feb 2009

    Posted by jpotts

    As I’ve mentioned here and on twitter, we posted our Alfresco-Drupal integration on Drupal.org on Friday. I did a short write-up on it over at Optaros.com that gives the why and the what so I’ll not repeat it here.

    We split the integration into two modules: CMIS API has nothing Alfresco-specific–it just knows how to make RESTful CMIS calls to an arbitrary CMIS repository. The Alfresco CMIS module has the Alfresco-specific logic. You need both to make the integration work. If you’ve got Alfresco 3 (Enterprise or Labs) you don’t need to do anything to your Alfresco install to enable the integration because it’s already CMIS compliant.

    There is still a lot of work to do on this integration. For example, right now we’re only moving plain text content back-and-forth between Drupal and Alfresco. And we use a “single account” approach so that to Alfresco, every request appears to come from one user instead of passing through the authenticated Drupal credentials. But this is an imporant integration to us so I expect it to evolve substantially in the coming months.

    I got good feedback on the recent screencasts I put together for Share (Part 1, Part 2) so if I get some time this week I’ll do one that gives a quick tour of the Drupal integration.

    About Drupal Sun

    Drupal Sun is an Evolving Web project. It allows you to:

    • Do full-text search on all the articles in Drupal Planet (thanks to Apache Solr)
    • Facet based on tags, author, or feed
    • Flip through articles quickly (with j/k or arrow keys) to find what you're interested in
    • View the entire article text inline, or in the context of the site where it was created

    See the blog post at Evolving Web

    Evolving Web