Rapid development of Alfresco repository extensions in Java. Deploy your code in seconds, not minutes. Life is too short for endless server restarts.
Switch branches/tags
Nothing to show
Pull request Compare This branch is 315 commits behind xenit-eu:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Dynamic Extensions for Alfresco

Rapid development of Alfresco repository extensions in Java. Deploy your code in seconds, not minutes. Life is too short for endless server restarts.

Dynamic Extensions adds an OSGi container to the Alfresco repository, enabling live deployment of Java code packaged as OSGi bundles. Alfresco itself is not "OSGi-fied" in any way; the OSGi container runs completely separate from the core Alfresco platform.

Latest release: Milestone 5

  • Gradle plugin for building your own repository extensions
  • @RunAs, @RunAsSystem annotations for running methods as a particular repository user
  • @Transactional annotation for running methods within a repository transaction.
  • @Before annotation for handling common Web Script preprocessing logic.
  • @ExceptionHandler annotation for generalizing exception handling in Web Scripts.
  • Bug fixes and fine-tunings throughout.

Many thanks to @laurentvdl for his contributions.

Installing Dynamic Extensions

Dynamic Extensions is distributed as an Alfresco Module Package (AMP).

Support for Alfresco Community

Dynamic Extensions is developed and tested against:

  • Alfresco Community 3.4
  • Alfresco Community 4.0
  • Alfresco Community 4.2

Support for Alfresco Enterprise

  • Alfresco Enterprise 4.0
  • Alfresco Enterprise 4.1

The Enterprise editions are not part of the development and testing environment, but Dynamic Extensions is known to work on them.

Example extension code

This example Web Script examines a node and passes information to a Freemarker template:

public ExampleWebScript {

  private NodeService nodeService;
  // Example: http://localhost/alfresco/service/show-node?nodeRef=workspace://SpacesStore/12345
  public Map<String, Object> displayNodeName(@RequestParam NodeRef nodeRef) {
    Map<String, Object> model = new HashMap<String, Object>();
    model.put("properties", nodeService.getProperties(nodeRef));    
    return model; // Model is passed to Freemarker template.

Note that this is an annotation Web Script. These types of Web Script are configured through Java annotations instead of *.desc.xml descriptors. Annotation Web Scripts are similar to Spring MVC's annotation-based controllers.

Here's the accompanying Freemarker template fragment:

  <#list properties?keys as name>    

This is all the code that is required; there's no need for Spring XML config or Web Script XML descriptors. Hot-reloading and reducing configuration overhead are not particularly novel concepts in the Java development world at large. Essentially, Dynamic Extensions modernizes the development of Alfresco repository extensions.

The example above may be trivial, but the point is that, behind the scenes, services are still wired together through Spring and handled by the Web Script framework. Conceptually there is no real difference between a Dynamic Extension and a regular Alfresco extension. There's just less overhead and more convenience.

Creating your own Alfresco extensions

The example Dynamic Extension provides a good starting point for creating your own extensions.

Clone the example repo and explore it. Here are some pointers to get you going:

See also: Gradle plugin for building your own repository extensions

More documentation on creating your own extensions will follow.

Milestone 6 (September 2013)

This milestone fine-tunes and wraps up all the work that went into Dynamic Extensions over the past two years.

issue list for milestone 6.