cancel
Showing results for 
Search instead for 
Did you mean: 

How to get object type id from share webscript

udayakumar_p
Confirmed Champ
Confirmed Champ

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.

1 ACCEPTED ANSWER

afaust
Legendary Innovator
Legendary Innovator

Please check the ScriptNode API documentation. The node type can be retrieved via type/typeShort.

View answer in original post

2 REPLIES 2

krutik_jayswal
Elite Collaborator
Elite Collaborator

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 Smiley Happy

afaust
Legendary Innovator
Legendary Innovator

Please check the ScriptNode API documentation. The node type can be retrieved via type/typeShort.