0 votes
in ProjectLink by (user.hidden) (690 points)

1 Answer

0 votes
by (user.hidden) (690 points)

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

below is a sample that can be used.

wt.inf.sharing.DataSharingHelper.service.createShares() 
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);
  objs.add(record);
  WTCollection share = DataSharingHelper.service.createShares(objs, projRef, null, ShareKind.OBJECT, null, false);
} catch(WTException e) { 
// TODO Auto-generated catch block                   
e.printStackTrace();            
}

 

Welcome to Windchill Guru, where you can ask questions and receive answers from other members of the community. I recommend everyone to Register

Categories

...