How to get Soft Type List in Windchill

public static String getTypeList(String type) throws Exception{
        QuerySpec qs = new QuerySpec(WTTypeDefinitionMaster.class);
        qs.appendSearchCondition(new SearchCondition(WTTypeDefinitionMaster.class, "intHid", SearchCondition.LIKE, "wt.doc.WTDocument|%", false ));
        QueryResult qr = PersistenceHelper.manager.find(qs);
        Vector typeVector = new Vector();
        String typeUpdateTable = "< " + "select name='typeName' onChange='reloadPages(this.options[this.options.selectedIndex].value)'>";
        typeUpdateTable = typeUpdateTable + "";
        String selected = "";
        while(qr.hasMoreElements()){
            WTTypeDefinitionMaster master = (WTTypeDefinitionMaster) qr.nextElement();
            WTTypeDefinition definition = (WTTypeDefinition) VersionControlHelper.service.allIterationsOf(master).nextElement();
            if(type != null && type.equalsIgnoreCase(master.getIntHid())){ selected = "selected"; }
            typeUpdateTable = typeUpdateTable + "<" + "option value='" + master.getIntHid() + "' " + selected + " >" + master.getDisplayNameKey() + "";
            selected = "";
        }
        typeUpdateTable = typeUpdateTable + "";
        return typeUpdateTable;
    }

你可能感兴趣的:(How to get Soft Type List in Windchill)