on 06-06-2007 5:40 PM
I have the following code :
//mainTable ID
TableId mainTableId = new TableId("T30");
FieldId[] fields = new FieldId[2];
//PDM Table
FieldId cat_Code = new FieldId("F49_71148");
FieldId cat_Name = new FieldId("F46_71147");
fields[0] = cat_Code;
fields[1] = cat_Name;
ResultDefinition rd = new ResultDefinition(mainTableId);
rd.setSelectFields(fields);
//Create constraint and dimension for key word search
KeywordSearchDimension keySearchDimension = new KeywordSearchDimension();
KeywordSearchConstraint keySearchConstraint = new KeywordSearchConstraint("rolamento", KeywordSearchConstraint.CONTAINS);
//Create the Search and add the key word constraint
Search search = new Search(mainTableId);
search.addSearchItem(keySearchDimension,keySearchConstraint);
RetrieveLimitedRecordsCommand retLim = new RetrieveLimitedRecordsCommand(conn);
retLim.setResultDefinition(rd);
retLim.setSearch(search);
retLim.setSession(session);
try {
retLim.execute();
RecordResultSet rs = retLim.getRecords();
for (int i = 0; i < rs.getCount(); i++) {
TableSchema tschema = rs.getRecord(i).getMetadata();
System.out.print(rs.getRecord(i).getDisplayValue());
}
} catch (CommandException e5) {
// TODO Auto-generated catch block
e5.printStackTrace();
}catch (NullPointerException e) {
e.printStackTrace();
}
}
This brings me back all of the records from the table PDM that matches the search query (in this case rolamento ) .
From the results what is the best way to get the hierarchy of the records (who is a parent and who is a child , or who has a child )
Or , is there a better way to get the hierarchy of the taxonomy table ?
I searched sdn css and the javadocs but I havent found a solution
Any help is great help.
Thanks in advance.
Guy
found it on my own . the best way to do this is use the RetriveLimitedHierTreeCommand with a search on the taxonomy table.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
83 | |
23 | |
11 | |
9 | |
8 | |
5 | |
5 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.