Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.

Slideshare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.

Alfresco - You probably didn't know that

1.
You probably didn’t know that…
(small hidden features in Alfresco)
David Ciamberlano

2.
Learn. Connect. Collaborate.
Are you a curious person?
Alfresco hides many small less known features that maybe you’ll never need to
use… but that might prove useful on more than one occasion. So…
you probably didn’t know that…

3.
Learn. Connect. Collaborate.
You can change the unchangeable
In Alfresco there are a few properties that cannot be changed
(… for a good reason!):
• creator of a node (cm:creator)
• creation date (cm:created)
• modifier (cm:modifier)
• modification date (cm:modified)
• […]

4.
Learn. Connect. Collaborate.
these properties belongs to the cm:auditable aspect (in contentModel.xml).
In a ideal world we wouldn’t need to change them…
… but unfortunately we don’t live in a ideal world.
The "good news" is that there is a way to change these values…
And it’s (relatively) simple!
You can change the unchangeable

5.
Learn. Connect. Collaborate.
1
A behavior prevents these metadata from being changed.
All we need is to disable that behavior before the update.
We can disable the
auditable behavior
for a specific node
immediately before
the setProperty()…
You can change the unchangeable

6.
Learn. Connect. Collaborate.
…and re-enable it soon after (note the finally block)!
A behavior prevents these metadata from being changed.
All we need is to disable that behavior before the update.
We can disable the
auditable behavior
for a specific node
immediately before
the setProperty()…
You can change the unchangeable

7.
Learn. Connect. Collaborate.
Import an acp preserving the uuid of the nodes
To rely on the uuid to retrieve a document from an external application is not
a best-practice…
but it happens often!
There’s a way to preserve the original uuid when we need to import an acp.

8.
Learn. Connect. Collaborate.
Import an acp preserving the uuid of the nodes
we can create a new action, extending the
OOTB importer class
(ImporterActionExecuter)…
… and override its executeImpl
method…

9.
Learn. Connect. Collaborate.
2
Import an acp preserving the uuid of the nodes
we can create a new action, extending the
OOTB importer class
(ImporterActionExecuter)…
…in which we find the
importservice.importView() call.
To preserve the uuid, we have to use a
custom modified ImporterBinding
… and override its executeImpl
method…
* to see the complete code: https://gist.github.com/david-ciamberlano

10.
Learn. Connect. Collaborate.
For example, we can unzip an acp, open its xml descriptor and modify the
uuid of one of its nodes…
Import an acp preserving the uuid of the nodes
acp xml descriptor

11.
Learn. Connect. Collaborate.
After the import of the acp,
we will find a node in
Alfresco with the previously
modified uuid
Import an acp preserving the uuid of the nodes
Residual?
what’s that
column for?

12.
Learn. Connect. Collaborate.
Residual properties
In Alfresco, properties may exist that do not belong to any registered model.
They are called residual properties and are useful, for example, to handle the case of a
property removed from a type or an aspect.
Suppose we have an aspect with a property called acme:test-residual applied to a certain
node:
what if we remove that property from the aspect?

13.
Learn. Connect. Collaborate.
3
Residual properties
The property continue to exists for the node… but is marked as residual.
what if we remove that property from the aspect?
In Alfresco, properties may exist that do not belong to any registered model.
They are called residual properties and are useful, for example, to handle the case of a
property removed from a type or an aspect.
Suppose we have an aspect with a property called acme:test-residual applied to a certain
node:

14.
Learn. Connect. Collaborate.
Residual properties
You can also create a "residual property" programmatically,
as if it were any other property…
*
* "whoami" does not belongs to any model

15.
Learn. Connect. Collaborate.
Less known aspects - cm:indexControl
You can control the indexing of contents in Alfresco applying the aspect
cm:indexControl to a node.
The aspect exposes 2 properties:
• cm:indexed (controls whether or not the node is indexed)
• cm:isContentIndexed (controls the full-text indexing of the node)

17.
Learn. Connect. Collaborate.
Less known aspects - sys:hidden
The sys:hidden aspect (defined in systemModel.xml) allows you to hide a node from a
client or service (such as share, webdav, cifs, …).
4

18.
Learn. Connect. Collaborate.
Less known aspects - sys:hidden
sys:hidden has 5 properties
(clientVisibility, hiddenFlag, cascadeHidden, CascadeIndexControl, clientController)
with which we can modify its behavior.

19.
Learn. Connect. Collaborate.
Less known webscripts - export a site
It’s possible to export the whole content of an Alfresco Site with one command:
GET: /alfresco/service/api/sites/{site-shortname}/export

20.
Learn. Connect. Collaborate.
Less known webscripts - export a site
It’s possible to export the whole content of an Alfresco Site with one command:
GET: /alfresco/service/api/sites/{site-shortname}/export

21.
Learn. Connect. Collaborate.
To check quickly if a custom model has been correctly installed we can use (guess?) a
webscript:
GET /alfresco/service/api/dictionary
GET /alfresco/service/api/classes/{type-name}
Less known webscripts - dictionary & classes