简体   繁体   中英

OpenText content Web Services metadata

I have following code: have 7 different attributes for ReportDetails. But this code doesn't seem to work, and there is no error.

AttributeGroup DocTypeGrp = new AttributeGroup();
DocTypeGrp = docManClient.GetCategoryTemplate(ref otAuthentication, 12456);
StringValue doc = new StringValue();
doc.Values = new string[1];
doc.Values[0] = "Report";
DocTypeGrp.Values[0] = doc;

AttributeGroup rptDetailsGrp = docManClient.GetCategoryTemplate(ref otAuthentication, 45632);
StringValue rptGroup = new StringValue();
rptGroup.Values = new string[1];
rptGroup.Values[0] = string.Empty;
// rptGroup.Values[1] = "2012";
rptDetailsGrp.Values[0] = rptGroup;
rptGroup = new StringValue();
rptGroup.Values = new string[1];
rptGroup.Values[0] = "2012";
rptDetailsGrp.Values[1] = rptGroup;


Node existingNode = docManClient.GetNode(ref otAuthentication, reportFolder.ID); // Set Node
Metadata metadata = new Metadata(); //Create Metadata object
metadata.AttributeGroups = new AttributeGroup[] { DocTypeGrp , rptDetailsGrp };
existingNode.Metadata = metadata; // Set the Metadata objects back onto the node

docManClient.UpdateNode(ref otAuthentication, reportFolder);//Update Node

Would really apprecitate any help.

Since you are adding the category to existingNode object and while updating the node you are passing reportFolder which doesn't have the category.

Changing the code as below should resolve your issue

docManClient.UpdateNode(ref otAuthentication, existingNode);//Update Node

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM