About the Alfresco Developer Tutorial Series

The “Alfresco Developer” series of tutorials is aimed at developers new to Alfresco who need an overview of the main customization points. The series uses a single business case as an example that covers many different technical aspects of Alfresco. Each tutorial takes you through hands-on customizations, step-by-step, and includes ready-to-build source code so you can follow along using your own local installation.

Much of the information can be found in the official Alfresco documentation, in the forums, in Jira, and, of course, in the source–my goal was to pull it together into a cohesive, step-by-step story.

Note: The tutorials linked on this page are for SDK 4.0 which works with Alfresco 6.x. For tutorials that use SDK 3.0, which works with Alfresco 4.2 through Alfresco 5.2, use the SDK-3.0.1 tag.

The tutorials are shown below in a rough recommended order of progression:

Getting Started with the Alfresco Maven SDK, Updated July, 2021.

This tutorial shows you how to use the Alfresco Maven SDK to create projects that produce AMPs (Alfresco Module Packages) for both the repository tier and the Alfresco Share tier. AMPs are the recommended best practice for deploying customizations to your Alfresco installation. The Alfresco Maven SDK supersedes the old Ant-based SDK.

Working with Custom Content Types, June, 2007. Updated July, 2021.

This tutorial shows how to extend Alfresco with your own content model, how to configure Alfresco Share to create content that uses your custom content model, and how to use the OpenCMIS API and the CMIS Query Language to create, query, and delete content in your Alfresco repository.

This tutorial introduces the fictitious “SomeCo” company that is planning on using Alfresco for both document management and web content management. SomeCo is going to use Alfresco to manage the authoring process around whitepapers which are subsequently published to their web site. The remaining articles in the series build on the SomeCo example.

“Developing Custom Actions”, January, 2007. Updated July, 2021.

This tutorial builds on the custom content types tutorial. It shows how to create rule actions and UI actions.

“Implementing Custom Behaviors”, September, 2007. Updated July, 2021.

This tutorial builds on the custom content types tutorial by adding support to the content model for user-contributed ratings of whitepapers. The custom behavior is used to calculate the average rating for each piece of rated content.

“Intro to the Web Script Framework”, October, 2007. Updated July, 2021.

The intent of the tutorial is to walk through some hands-on examples using Alfresco’s Web Script Framework. The tutorial shows how to use Web Scripts to create a RESTful API for creating user-contributed ratings.

“Creating Custom Advanced Workflows in Alfresco”, February, 2012. Updated July, 2021.

The tutorial starts by describing high-level workflow concepts and steps for implementing advanced workflows in Alfresco using Activiti and then dives into the details by walking you through an example.

The example extends the “SomeCo Whitepapers” story from earlier articles in the Alfresco Developer series by implementing a business process to enable SomeCo’s engineering team, marketing team, and third-party partners to review whitepapers before being published to the SomeCo web site.

The integration of third-party partners is handled through email–recipients simply click a link to approve or reject the workflow task. The link invokes web scripts to signal the workflow to take the appropriate path in the process.

“Getting Started with CMIS”, November, 2009.

The article first takes you through an overview of the specification. Then, I do several examples. The examples start out using curl to make GET, PUT, POST, and DELETE calls against Alfresco to perform CRUD functions on folders, documents, and relationships in the repository.

Once you’ve felt both the joy and the pain of talking directly to the CMIS AtomPub Binding, I take you through some very short examples using JavaScript and Java. For Java I show Apache Abdera, Apache Chemistry, and the Apache Chemistry TCK.

You might also be interested in “Getting Started with CMIS” on SlideShare.

Source Code

The source code for these tutorials resides on GitHub. The version of the tutorials that work with SDK 4.0 is on a branch in that project.

License

All of the articles in the series are licensed under the Creative Common Attribution-Share Alike 2.5/3.0 License.

Feedback

Many of you have provided feedback on specific articles or the series as a whole via comments on this blog, in person, or via email. Regardless of the method, feedback is welcome and encouraged.

Alfresco Developer Guide

The response to the Alfresco Developer Series was so positive, I decided to take it one step further. I used several of these tutorials as the starting point for a book which was published in 2008. Most of the material has been re-worked although there is some duplication. The actions and behaviors material changed the most. The book is called Alfresco Developer Guide and is available from Packt Publishing and other book stores. All of my blog posts related to the book are categorized under Alfresco Book. All resources related to the book have been centrally indexed on the Alfresco Developer Guide page.

The second editions of these tutorials and the 2014 updates were written after the book was published.

Archive

These are old versions of the tutorials and are no longer being actively maintained.

“Working with Custom Content Types”, June, 2007.

“Working with Custom Content Types, 2nd Edition”, January, 2012. Updated for Alfresco Share and CMIS.

“Developing custom actions”, January, 2007.

“Developing custom actions, 2nd Edition”, January, 2012. Updated for Alfresco Share.

“Implementing custom behaviors”, September, 2007.

“Intro to the Web Script Framework”, October, 2007.

“Advanced Workflows”, November, 2007. Covers jBPM and Alfresco Explorer

“Advanced Workflows, 2nd Edition”, February, 2012. Covers Activiti and Alfresco Share

If you are running the 2nd Edition Advanced Workflows tutorial against Alfresco Community Edition 4.x or higher, please use this code instead of what is linked in the PDF.

77 comments

  1. Abhinav says:

    Hi Jeff,
    I was trying to implement the advance search in Alfresco, I have gone through your blog:
    https://ecmarchitect.com/alfresco-developer-series-tutorials/content/tutorial/tutorial.html

    But search on custom properties are not working at all.

    I have done following steps:
    I downloaded the “Alfresco-Developer-Series” projects from https://github.com/jpotts/alfresco-developer-series
    I created the amp (content-tutorial-repo & content-tutorial-share) files and deployed to Alfresco and share. Content model is working fine.
    I am also able to see the Advance search options for SomeCo Whitepaper with Product, Version and IsActive fields.

    But when i am trying to search by providing some values to the above mentioned fields i am not getting any search result.

    I have updated the document properties with values for Product, Version and IsActive properties already.

    For example: Say i have updated Product and Version of a document property is “MyProduct” and “2.0.0”.

    When Searching with value “MyProduct” for Product field, i am getting 0 results.
    When Searching with value “2.0.0” for Verison field, i am getting 0 results.
    i.e. search on custom properties are not working at all.
    whereas when searching with Modifier,Created,Title (Properties of out-of-box content model) etc. i am getting results.

  2. B F says:

    I have found your articles to be quite good so I am asking a question but I apologize if this is not the correct place for this. I am very new to Alfresco (couple weeks). I have been playing around with a repository install and a web install to create an intranet for doc management as well as basic front web for knowledge/info. I am trying to construct a website that can be managed by a few people and some content created very easily by a few non technical users but viewable and usable to many employees. We currently have Community 5.0.d installed. The 5.0 version had a blog dashlet available but since we have gone to 5.0.d website version, I cannot figure out how a blog archive would work and be managed. The demo website scripting is set to show last three html files. How is a blog archive to be handled so someone can see all the blog entries? I cannot find any documentation or discussions referring to blogs in 5.0.d.

  3. Jeff Potts says:

    There used to be an integration between the blog component and an external blog server such as WordPress. The idea was that you could create your posts in Alfresco then post them to a full-blown blog server. But that feature was removed in Alfresco 5.

    So now you have the same options for publishing blogs as you do for any other piece of content in Alfresco which basically comes down to choosing one or more of the following:

    1. Push the content somewhere else, such as the file system, a database, or search server, then query that repository and display the content.
    2. Query Alfresco using the Public API (which includes CMIS) from code that you write and run elsewhere.
    3. Write custom Share dashlets or pages that use existing API calls to fetch and display the content.

  4. BF says:

    Thanks for responding to my question about the Blog component changing. I have started to work with the Quick Site to see how it works and how I might use different sites to layout an Intranet. I have created several Quick Sites under a single Alfresco install so that each can pull it’s own data but use the same components. When I try to use the Search box on one Quick Site, it will only return a result found in it’s own site and will not return the result if it exists in another site. The results will return for any site if I am in the repository/share instead. Both sites are Public. Can you give me an idea of what to look at that would explain why using the Quick Site search on one site would not return results from multiple sites? Thanks.

  5. AMOURI says:

    hi Jeff,
    i try to get the list of sites of our local Alfresco,
    the problem is, the eclipse doesn’t reconize the imports
    com.alfresco.api.exemple
    can you help me please to understand the origin of the problem

  6. Tim says:

    Do you have a similar tutorial for the initial installation and set up of Community Edition, interfacing it with AD and Exchange, etc.?

    Thanks!

  7. mt says:

    Hi Jeff,
    thank you for your tutorials.
    Regarding the one that is related to creating custom workflows (in the community edition), what is the way to add pop up messages after the user submits the form (e.g. Alfresco.util.PopupManager.displayMessage)? Thank you in advance.

  8. Abdoul Mounaf says:

    Hi Jeff,
    it a pleasir for me to learn your blog. it is very interesting for me as new new alfresco dev. it will be a pleasir if you can do a CRUD based on java-backed webscript. it will be very helpfull for me

  9. facebook_Fuentes Alejandro.1749198442035149 says:

    Hi Jeff,
    Thanks for yours tutorials.

    Im begining in alresco developer and in am studyng the tutorial “Working with Custom Content Types” but i have a problem when create the share-config-cutom.xml file, after to run rhe AMP project and the Share project i enter to http://localhost:8081/share, i can not watch anithyn referent to share-config-cutom.xml in the rules editor.

    I hope y that you give me some tips for review and fix this problem.

    Thank you for your time

  10. Jeff Potts says:

    Alejandro,

    Thanks for reading my tutorial. I hope it is useful to you.

    I am not clear on the problem you are seeing. Can you tell me the error message you are seeing? Or there is no error, what is the behavior you are seeing versus the expected behavior?

    Jeff

  11. Michal says:

    Guys, many many thanks. These tutorials are great. All of these tutorials show base principle to understand alfresco and little bit more. For me it was really helpful. Now I know which part is for which purpose, definitely I’m not lost like I was before I read your article. Thanks.

  12. Nikita says:

    Could you please check and correct “Working with Custom Content Types” Section? Read a couple paragraph before and after this one:

    “Now open your browser and point it to http://localhost:8081/share. Log in using admin/admin and let’s see what’s different.”

    Before this text there is an exlanation about running repo and share, but after there is a screenshot about rules. No word about what it is, no word about how and where “text1.txt” file should be created. It seems that some paragraphs were deleted during article edition. Could you please check this and add missed text?

    Also check please whole article, the next one – “Developing Custom Actions” tells that “isActive” property is used to mark whether model should be displayed, but in target article there is no word about this.

  13. Jeff Potts says:

    Nikita,

    The Alfresco Developer Series tutorials assume you are familiar with Alfresco from an end-user perspective. Regarding the “let’s see what’s different” section, it is comparing the user interface after the Share configuration has been applied to the UI before the configuration was applied. The “is sub-type” dialog is referred to in the previous section: “When a user configures a rule on a space and uses content types as a criteria, the custom types should be a choice in the list of possible content types.” The tutorial is not intended to teach how to configure a rule on a space–you should already know how to do that.

    Regarding the paragraph that contains, “Create a piece of test content” and shows the “test1.txt” file, it does not matter at all where you create it.

    Regarding isActive, it is covered in multiple places. Early in the tutorial it says, “In addition, there are two aspects. One, the sc:webable aspect, is used for content that is to be shown on the web site. It contains the sc:isActive flag and sc:published date. The “Queries across multiple aspects” talks about how to query for that flag. Remember that the use case is publishing a subset of documents to the web. That flag is what controls it.

    In the “Actions” tutorial, the flag is mentioned again: “Recall from the content types tutorial that the property that controls whether or not content should show up in the portal is a boolean named sc:isActive which is defined as part of an aspect named sc:webable.”

    So everything appears to be in order. Nothing is missing. Thanks for reading and let me know if you have further questions.

    Jeff

  14. Pete. says:

    Hi Jeff,
    I’ve done most of the tutorials and really enjoyed them. They are thorough and clear and a joy to work through.

    One thing: now I want to migrate my workflows from the development stack to my community installation. I can deploy the AMP file but the workflows don’t work.

    Is that because the community edition doesn’t support H2? If so, what configuration changes must be made to migrate modules from the development stack to the ‘real thing’?

    Thanks and Regards
    Peter

  15. Jeff Potts says:

    The Maven build should be producing installable AMPs. Put your repo AMP in $ALFRESCO_HOME/amps and your Share AMP in $ALFRESCO_HOME/amps_share then run $ALFRESCO_HOME/bin/apply_amps.sh. If there are no error messages running that script you should then be able to start up Alfresco. If you watch the log, you should see your modules being initialized. If all of that happens without error you should be able to deploy your workflows using the workflow console.

    So, the short answer is: No, there is nothing you need to do to change from development mode to production mode in terms of producing production-ready, installable AMPs.

  16. Heike says:

    Wow! Thank you so much for these tutorials, they really helped me a lot! I only started with them after your recent update. For “Localizing Strings for Custom Content Models” I took a slightly different approach: Instead of creating a new folder messages in $TUTORIAL_HOME/content-tutorial-share/src/main/amp/config/alfresco/module/content-tutorial-share (in order to do so I would have had to create all the folders from module on, which don’t exist), I used the already existing file $TUTORIAL_HOME/content-tutorial-share/src/main/amp/config/alfresco/web-extension/messages/content-tutorial-share.properties, which is even already registered with Spring in $TUTORIAL_HOME/content-tutorial-share/src/main/amp/config/alfresco/web-extensions/content-tutorial-share-slingshot-application-context.xml, so that steps 3 to 5 weren’t necessary. Everything works fine.

    When I try the same thing for the workflow tutorial though, it doesn’t work, that is, the property scwf:helloName shows in my form as exactly that, scwf:helloName, although I added the line

    prop.scwf_helloName=Name

    in the appropriate file as described above. I then tried to do everything exactly as you suggested (e.g. I created the directories module and workflow-tutorial-share and messages and then a properties file, which I registered in a new workflow-tutorial-share-context.xml file in the web-extension directory), but that didn’t work either. Do you have an idea how I could work this out?

  17. Heike says:

    I found the solution: I had to add

    label-id=”prop.scwf_helloName”

    in the start tag of the scwf:helloName field element in share-custom-config.xml

  18. Uday says:

    Can you please post an article drupal 8 and alfresco 5 integration. Searched all over the internet and didnt find one. All the available articles are for older version. Thanks in Advance.

  19. Jeff Potts says:

    I don’t have plans to post such an article. Interest in integrating Drupal and Alfresco never really got beyond a small handful of people. I will say that on the Alfresco side, the CMIS API’s haven’t changed since then. In Alfresco 5.2 there are some new native REST API’s available that might be more useful for doing such an integration.

  20. Ralf says:

    The link to the Alfresco Compatibility Matrix is not working any more. Can you fix this? I would like to look up this information. Thanks.

  21. Jerome says:

    Hi Mr. Potts,

    I would like to learn more about this topic, because were gonna use this program for our company. I have a question, if Alfresco can Run a Workflow, inside a smart folder? For example, I upload a file/doc into a smart folder, is it automatically run a workflow?

    Thank you for your answer.

Comments are closed.