Hi Guys,
Is it possible to set values for 'additional node attributes' (global to all objects) using the Content Web Services?
Regards,
Keiran.
Hi Keiran, I believe support for Additional Node Attributes was added in Content Web Services 10. If you have obtained a Node object through a DocumentManagementService call, the Node object has a property called Metadata. This Metadata property will have an AttributeGroups property which, if not null, will contain additional node attribute information for the node. The AttributeGroups property is an array of AttributeGroup objects which have an associated Type property. "System Attributes" (Additional Node Attributes) have the Type value of "SystemAtt". The Values property will contain an array of size one with the value of the attribute.
You can set values by updating the Node object and then using the UpdateNode method to push the new values back to the server. It looks like the documentation on OTDN hasn't been updated yet. I'll be speaking with the PM to see if we can get this information into the docs.
Cheers, Kyle
Has anyone got this to work? I tried this approach and though I could see the appropriate attribute group with its data being set on the Metadata object, it didn't stick. I did notice that the DocManService.GetAttributeGroupDefinition() and GetAttributeGroupTemplate() functions both return a null object for the case of "SystemAtt". When I investigated this, I noticed that the handler for the system attribute ($DocManService.AttributeHandler.SystemAttrHandler has empty methods (not overridden from the parent).
Although the workaround is to fetch the attribute group from the parent metadata object, I would suggest that the SysAttrHandler object be removed from the registry or built out.
On the upside, the code to update system attributes is present but so far I haven't seen it actually update yet. That's why I would like it if someone could confirm that it works.
-Hugh
I'll get it to you once one of the other developers checks his changes into the code....I'm waiting for the repository to get re-synced.
I think I found the problem. For the case of UpdateAttributes as called from UpdateNode() call in doc man service, the systemAttributes attribute handler object does in fact have code to process System Attributes. However, if you are setting attributes in a Create call, the SystemAttributes attribute handler object has no code behind its PrepareAttributesForCreate() function. It is this function that sets up the attribute data within the createInfo Assoc that gets passed into LLNode.NodeCreate() so that metadata is applied. So in short, UpdateNode does handle System attributes but Create() does not.