Community Tip - You can change your system assigned username to something more personal in your community settings. X
Step One
Copy the codes below:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 | package ext; import java.util.Vector; import wt.folder.SubFolder; import wt.inf.container.WTContainerHelper; import wt.inf.container.WTContainerRef; public class MyWindchillUtility {
//Get a text list of folder names in a product container public static WTContainerRef getContainerRef(String orgName, String productName) { WTContainerRef containerRef = null; try { if (productName != null && !"".equals(productName)) containerRef = WTContainerHelper.service.getByPath("/wt.inf.container.OrgContainer=" + orgName + "/wt.pdmlink.PDMLinkProduct=" + productName); else containerRef = WTContainerHelper.service.getByPath("/wt.inf.container.OrgContainer=" + orgName); } catch (Exception e) { e.printStackTrace(); } return containerRef; }
public static void folderDriver() {
WTContainerRef wtcontainerref = DGUtil.getContainerRef("LIGADP", "Test1"); //<Organization Container Name>, <Product Container Name> String oid = DGUtil.getStringOid(wtcontainerref.getContainer()); Vector v = (Vector)DGUtil.getSubFolderWithContainer(oid); for(int i=0;i<v.size();i++){ SubFolder sf = (SubFolder)v.get(i); System.out.println(sf.getFolderPath()); } }
public static void main(String[] args) { MyWindchillUtility.folderDriver(); } } | cs |
Step Two
Execute MyWindchillUtility on Windchill Shell: windchill ext.MyWindchillUtility
What's the definition of DGUtil? Is it a custom class where you are manually retrieving the information?