Dynamic Extensions is a part of the Xenit Open Source Tooling around Alfresco. Xenit is company with a deep expertise and a strong team around Alfresco. If you'd like to learn more about our tools, services and products, please visit our website.
Add OSGi based hot-deploy functionality and Spring annotation based configuration to 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, with no need to restart the server. Alfresco itself is not "OSGi-fied" in any way; the OSGi container runs on top of the core Alfresco platform.
Standard Alfresco Platform Extensions use Spring XML based configuration. With Dynamic Extensions, developers have the ability to create Alfresco Platform Extensions using Spring's annotations based configuration.
Dynamic Extensions (DE) is distributed as an Alfresco Module Package (AMP) extension that can be installed in Alfresco.
To support multiple Alfresco versions, different AMPs for each minor Alfresco version update are
build and distributed.
E.g. if you are working with Alfresco 6.0.7-ga, you should
use the alfresco-dynamic-extensions-repo-60
artifact.
All required artifacts, including the AMP to be installed in Alfresco, are available in Maven Central.
<dependency>
<groupId>eu.xenit</groupId>
<artifactId>alfresco-dynamic-extensions-repo-${alfresco-version}</artifactId>
<version>${latest-dynamic-extensions-version}</version>
<type>amp</type>
</dependency>
alfrescoAmp "eu.xenit:alfresco-dynamic-extensions-repo-${alfrescoVersion}:${dynamicExtensionsVersion}@amp"
These artifacts can be used to automatically install Dynamic Extensions in Alfresco using e.g. the Alfresco Maven SDK or the Alfresco Docker Gradle Plugins
Dynamic Extensions is systematically integration-tested against:
Integration tests are currently only executed on our private Jenkins build server.
This example Web Script examines a node and passes information to a Freemarker template:
@Component
@WebScript
public ExampleWebScript {
@Autowired
private NodeService nodeService;
@Uri("/show-node")
// 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:
<table>
<#list properties?keys as name>
<tr>
<th>${name}</th>
<td>${properties[name]!''}</td>
</tr>
</#list>
</table>
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.
Please checkout the documentation for further instructions.
This project is licensed under the Apache V2 License - see the LICENSE file for details.