on 12-16-2008 3:17 PM
Hi,
I found only RetrieveLimitedHierTreeCommand,RetrieveLimitedHierChildrenCommand in MDM API for hierarchical tables.
So how can we add a child or a sibling, delete a child or sibling to the nodes of the tree.
Can anyone please give me links or some documentation on how to proceed with this.
The other problem we are facing when retrieving the children using RetrieveLimitedHierTreeCommand
When we add a search on the command it does not retrieve the children. it says the children for the level one node are null but if i donto set search it retrieves the children for all the nodes.
Is there any specific setting that has to be done for using the search.
Please let me know
Thanks,
Padmaja
Hi Padmaja,
The CreateRecordCommand has a setParentRecordId record that can be used to specify where in the tree to put a new record. The DeleteRecordsCommand will work for a hierarchy table record, but I believe it must have no children before deletion.
It is hard to say why your search isn't working. I don't recall any setting you would need to use. Maybe the search is too constricting and it is filtering out the children.
Hope this helps,
Greg
Edited by: Greg Austin on Dec 16, 2008 10:47 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Greg,
I am adding the code snippet below. Can you please look into this and check if there are any problems
RetrieveLimitedHierTreeCommand hr=new RetrieveLimitedHierTreeCommand(conAccessor);
Search ser=new Search(repoSchemacmd.getRepositorySchema().getTable("New_Code").getId());
FieldId fldId =repoSchemacmd.getRepositorySchema().getTableSchema("New_Code").getField("New_Code").getId();
StringValue fldVal = new StringValue("G0440");
ser.addSearchItem(new FieldSearchDimension(fldId),new TextSearchConstraint(fldVal.getString(),TextSearchConstraint.EQUALS));
hr.setSearch(ser);
ResultDefinition rd=new ResultDefinition(repoSchemacmd.getRepositorySchema().getTable("New_Code").getId());
rd.setSelectFields(repoSchemacmd.getRepositorySchema().getTableSchema("New_Code").getFieldIds());
hr.setResultDefinition(rd);
hr.setSession(userSessionID);
try {
hr.execute();
} catch (CommandException e) {
e.printStackTrace();
}
When i execute this part of code and get the children. i get the children as null.
Thanks,
Padmaja
Hi Greg,
The tree Node has children.
For the second question of the search criteria, if the search criteria is wrong i should not be getting the record right. I get the record so i am assuming that my search criteria is right.
But i do not get the children alone.
Correct me if my assumption is wrong?
Thanks,
Padmaja
I believe the search will limit all records returned from MDM, not just the top level. So your parent and children must match the search criteria to show up. Try the search without any search criteria to confirm.
My first question had to do with how you know what record you are looking at when you ask for the children. Is their some unique field you are printing to know exactly which hierarchy record you are looking at?
-Greg
Hi Greg,
>> Try the search without any search criteria to confirm.
I tried this and i get all the records in the table along with the children.
>>Is their some unique field you are printing to know exactly which hierarchy record you are looking at?
I am printing the displayValue to check if i am getting the record i am looking out for.
I get the exact record but it does not return the children.
My search criteria matches only the parent record and does not match the child record.
How can i have a search criteria which matches all the child and parent records?
Which is difficult in my case as the parent and child records are unique.
Please let me know if there is any way that this can be done?
Thanks,
Padmaja
User | Count |
---|---|
101 | |
13 | |
13 | |
11 | |
11 | |
7 | |
6 | |
5 | |
4 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.