A simple URL shortener for Alfresco Share
Today we publish a training pill from one of our Alfresco trainings,
based in a previous recipe for creating a simple URL shortener for
Alfresco Share.
The original code shows instructions for enabling the component:
- deploying dynamically a simple content model which defines a
custom aspect and a custom property. - creating a content rule for executing some javascript code for
enabling the defined shortable aspect. - an additional Apache rewrite rule is necessary for the URL shortener.
With this exercise, we introduce in our trainings different concepts
such as content models and aspects, search and indexing properties,
content rules, and finally Alfresco Javascript API.
The next revision of this example includes:
- a bootstrap configuration for dwModel.xml including i18n properties
- a basic share form configuration
- a simple JS action for creating short URLs with the help of
content rules - a JS behaviour for generating a short URL when adding dw:shortable aspect
- a custom metadata template for documents and folders with
dw:shortable aspect applied - a custom indicator for documents and folders with dw:shortable
aspect applied
This makes possible to introduce other useful concepts such as
bootstrap (i18n) content models, actions, behaviours, metadata
templates, evaluators and indicators.
You can check the code and contribute in github