cancel
Showing results for 
Search instead for 
Did you mean: 

Check node type; inherited type?

lista
Star Contributor
Star Contributor
For example, I have 'apple', 'orange' and 'banana' types. They all extend the 'fruit' type.
How would I check is a certain node that's of type 'apple' also a 'fruit'?

Obviously, I know that if it's a 'orange', it's also a 'fruit'.
But I need to determine that it's a 'fruit' regardless of this, since new fruit can be added in the future, and I should not have any extra work to do after adding it.

Thanks,
Lista.
2 REPLIES 2

mikeh
Star Contributor
Star Contributor
If you're on HEAD (i.e from SVN or a recent nightly build), you can use the new isSubType() function on the node. See http://wiki.alfresco.com/wiki/3.2_JavaScript_API#Miscellanous_ScriptNode_API_Functions_and_Propertie...

Thanks,
Mike

lista
Star Contributor
Star Contributor
Hi MikeH,

thank for you your answer.
Nightly builds rock, since I was not able to find that yesterday Smiley Happy

Cheers,
Lista.