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

Community Tip - Want the oppurtunity to discuss enhancements to PTC products? Join a working group! X

Java API to get folder.id from OIR

akosolapov-2
14-Alexandrite

Java API to get folder.id from OIR

Hi.

 

I need java api to get context-dependent "folder.id" from soft type OIR.

I have soft type id looking like "wt.doc.WTDocument|ru.pts.TechDoc|ru.pts.DesignDoc".

 

I found two methods:

   

    FolderContextHelper.getServerAssignedOIRFolder(typeInstance)
    FolderContextHelper.getPregeneratedOIRFolder(typeInstance)

 

but they require TypeInstance and i don't know how to get it without object.

 

There is posibility to get folder by PersistableAdapter, but the result is context-independent.

 

Thanks.

1 REPLY 1

Maybe a bit late, but I'd do it this way:

 

WTContainerReference containerRef; // container you want the OIR for
TypeIdentifier typeIdentifier = TypeHelper.getTypeIdentifier("wt.doc.WTDocument|ru.pts.TechDoc|ru.pts.DesignDoc");
Folder oirFolder = (Folder) new InitRuleFacade().getValue(RuleConstants.ATTR_FOLDER_ID, typeIdentifier, containerRef);

Top Tags