cancel
Showing results for 
Search instead for 
Did you mean: 

Récupérer le type d'un document (Article, contenu, ...)

jgautier
Champ in-the-making
Champ in-the-making
Bonjour,

je voudrais savoir s'il était possible de récupérer le type d'un document ?

Je voudrais ainsi faire des tests du genre :
SI mon document est un article ALORS
SINON SI mon document est un contenu ALORS


Cela est-il possible et comment ?

Merci de votre aide.
2 REPLIES 2

bertrandf
Champ on-the-rise
Champ on-the-rise
Bonjour,

Il serait intéressant de préciser dans quel cadre vous voulez récupérer le type d'un nœud ?

Dans un webscript, script, … ?
En freemarker, JavaScript, Java, … ?


Il facile de récupérer le type d'un nœud avec l'ensemble des APis Alfresco :
http://wiki.alfresco.com/wiki/3.4_JavaScript_API#ScriptNode_API
http://wiki.alfresco.com/wiki/Template_Guide#Default_Model
http://wiki.alfresco.com/wiki/NodeRef_cookbook#Reading_a_property_of_a_node

En JavaScript / Freemarker
type : Fully qualified QName type of the node.
typeShort : Prefix string, or "short" QName type of the node.

node.type; // {http://www.alfresco.org/model/content/1.0}content
node.typeShort; // cm:content

jgautier
Champ in-the-making
Champ in-the-making
Bonjour BertrandF,

décolé je n'ai pas précisé, je veux le faire dans un Freemarker.

Merci pour votre code, cela fonctionne très bien.

Sujet résolu !
Getting started

Tags


Find what you came for

We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.