We have defined a javascript which gets executed from a rule that we defined. document.mimetype gives us the mimetype of the document. Similarly how do we access object type id in the webscript?
I tried the following.
logger.error("document type is >> " + document.type);
logger.error("document type is >> " + document.typeId);
logger.error("document type is >> " + document.Id);
logger.error("document type is >> " + document.properties.type);
logger.error("document type is >> " + document.properties.typeId);
logger.error("document type is >> " + document.contentType);
None of the above gives the object type id.
Solved! Go to Solution.
Please check the ScriptNode API documentation. The node type can be retrieved via type/typeShort.
In alfresco every thing is stored as node, so something like type id does not exists.For each node , there is nodeId associated with it.It is called as NodeRef.
Another thing, alfresco share is nothing but the front end only, so if your webscript is on share side ,you need to call repository webscript from share and then you can get the details, of course there are few details which will be available , but it depends on scenario and other stuff.
If you have already developed repository webscript than document.nodeRef will do the trick
Please check the ScriptNode API documentation. The node type can be retrieved via type/typeShort.
Ask for and offer help to other Alfresco Content Services Users and members of the Alfresco team.
Related links:
By using this site, you are agreeing to allow us to collect and use cookies as outlined in Alfresco’s Cookie Statement and Terms of Use (and you have a legitimate interest in Alfresco and our products, authorizing us to contact you in such methods). If you are not ok with these terms, please do not use this website.