cancel
Showing results for 
Search instead for 
Did you mean: 

Dynamic Spaces extension

kronzucker
Champ in-the-making
Champ in-the-making
Hello,

i have dived deeper into alfresco and have now the need for a feature which can be described as "dynamic spaces"
(See http://wiki.alfresco.com/wiki/Dynamic_Spaces). It seems that there is nothing like dynamic spaces yet in Alfresco,
so I want to develop it myself. As a first implementation I want to have a node that displays all documents with a certain aspect.

For that I thought of manipulating the query for children of a certain node to query the database for nodes with a certain aspect
and return this list as the children of the node.

As a possible solution, I have identified that the methods selectChildAssoc in the class NodeDAOImpl are responsible for
retrieving children to a certain node. Now I want to inject a new implementation of the NodeDAOImpl which extends this class
and overwrite the selectChildAssocs methods to implement the behaviour.

Is anybody here who sees a better way of implementing this, or has any ideas on that topic?

Kind regards,
Georg Fleischer
3 REPLIES 3

kronzucker
Champ in-the-making
Champ in-the-making
After prototyping the solution, I found that the DAO layer is not suitable for implementing the dynamic spaces feature,
so I moved up a layer. No my plan is to overwrite the methods getChildAssocs in the class DbNodeServiceImpl.
Let's see where it leeds 🙂

kronzucker
Champ in-the-making
Champ in-the-making
I have moved down to the DAO layer again, after noticing that the nodeDAO has a dictionary service for querying the custom models.
The result is: it works!

Dynamic spaces were quite easy to implement, when you know where you can tweak the system.
I have now folders that show all documents with a configurable given aspect.
That was accomplished by adding a custom content model and overwriting the following method in class NodeDAOImpl

   protected void selectChildAssocsByChildTypes(Long parentNodeId,
         Set<QName> childNodeTypeQNames,
         ChildAssocRefQueryCallback resultsCallback) {

In order to use the new created class, I changed the spring configuration file /alfresco/WEB-INF/classes/alfresco/dao/dao-context.xml
and replaced the nodeDao property with my own implementation class.

Now I will go for dynamic folders for a certain property in an aspect to have a dynamic classification feature.
When I have finished that and I am sure that it will not have performance issues I will post how you can
use this nice feature, too 🙂

Kind regards,
Georg Fleischer

kronzucker
Champ in-the-making
Champ in-the-making
Unfortunately I have bad news. The feature of dynamic spaces works well in the explorer, but not in the share application.
After an analysis of the functionality I encountered that the share application works with XPAth queries which do not work,
if the associactions do not exist in the repository.

Perhaps I get it managed in another way, but for now the dynamic feature is dead :-(.