01-24-2018 12:41 PM
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.
01-25-2018 08:50 AM
Please check the ScriptNode API documentation. The node type can be retrieved via type/typeShort.
01-25-2018 03:13 AM
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
01-25-2018 08:50 AM
Please check the ScriptNode API documentation. The node type can be retrieved via type/typeShort.
Explore our Alfresco products with the links below. Use labels to filter content by product module.