How to share Parts from PDMLink to ProjectLink using API’s ?

How to share Parts from PDMLink to ProjectLink using API’s ?

Add Comment
1 Answer(s)

There is no Supported API’s to perform Operations involving sharing objects to project link.

below is a sample that can be used.

public WTCollection createShares(WTCollection objsToShare, WTContainerRef to_container_ref, Folder to_folder, ShareKind kind, State state, boolean is_shortcut) throws WTException

Example Usage:

ObjectIdentifier oid = null;
try {
  oid = ObjectIdentifier.newObjectIdentifier("wt.part.WTPart:XXXXX");
  wt.part.WTPart record = (wt.part.WTPart) PersistenceHelper.manager.refresh(oid);
  oid = ObjectIdentifier.newObjectIdentifier("wt.projmgmt.admin.Project2:XXXX");
  WTContainerRef projRef = WTContainerRef.newWTContainerRef(oid);
  WTSet objs = new WTHashSet(1, CollectionsHelper.OBJECT_IDENTIFIER);
  WTCollection share = DataSharingHelper.service.createShares(objs, projRef, null, ShareKind.OBJECT, null, false);
} catch(WTException e) { 
// TODO Auto-generated catch block                   


Answered on February 12, 2019.
Add Comment

Your Answer

By posting your answer, you agree to the privacy policy and terms of service.