on 11-05-2007 8:13 AM
Hi,
I transfered a KM folder from one portal to another.
How can I set propety metadata from one namespace to another by code?
For example I have a metadata called "Name" under namespace "http://mydomain1".
The documents I transfered have metadata called "Name" under namespace "http://mydomain2".
How can I copy the metadata from the first namespace to the second by code?
Hi,
I guess getPN is from a newer version.
Use the deprecated constructor then:
IPropertyName PropNameOld = new PropertyName("http://mydomain1", "Name");
IPropertyName PropNameNew = new PropertyName("http://mydomain2", "Name");
Best Regards,
Avishai Zamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Thanks for your answer, but there is no method "getPN" in "PropertyName".
I have only "create... " methods.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
Try something like this:
IPropertyName PropNameOld = PropertyName.getPN("http://mydomain1", "Name");
IPropertyName PropNameNew = PropertyName.getPN("http://mydomain2", "Name");
IProperty PropOld = resource.getProperty(PropNameOld);
IProperty PropNew = new Property(PropNameNew, PropOld.getStringValue());
if (resource.isVersioned()) {
IMutablePropertyMap mutPropMap =
resource.getProperties().getMutable();
mutPropMap.put(PropNew);
IContent res_content = resource.getContent();
if (!resource.isCheckedOut()) {
resource.checkOut();
}
resource.checkIn(res_content, mutPropMap, true);
} else {
resource.setProperty(PropNew);
}
Best Regards,
Avishai Zamir
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
76 | |
9 | |
8 | |
7 | |
6 | |
5 | |
5 | |
5 | |
5 | |
5 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.