How to get object type id from share webscript

cancel
Showing results for 
Search instead for 
Did you mean: 
Active Member

How to get object type id from share webscript

Jump to solution

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 Solution

Accepted Solutions
Master

Re: How to get object type id from share webscript

Jump to solution

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

View solution in original post

2 Replies
Senior Member II

Re: How to get object type id from share webscript

Jump to solution

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

Master

Re: How to get object type id from share webscript

Jump to solution

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

View solution in original post