on 08-03-2006 2:37 PM
Hi All,
We are tring to update the custom Metadata properties using KM API from the Abstract Portal Component.
We have written the below code for updating the metadata.
We have checkbox called "Region" which has multiple option values like "Asia,America,Europe". I was able to update this property with single value. But when i try to update with multiple value it is not working. I tried with comma seperated but it didn't work.
Can somebody through light on this. How to update multiple values?
Code snippet
-
IUserManagementService service=(IUserManagementService)PortalRuntime.getRuntimeResources().getService(IUserManagementService.KEY);
com.sapportals.portal.security.usermanagement.IUser user =null;
user= service.getDefaultFactory().getEP5User(request.getUser());
IResourceContext context = new ResourceContext(user);
RID path = RID.getRID("/documents/src/ex1.doc");
IResource res = ResourceFactory.getInstance().getResource(path,context);
IPropertyName propName = new PropertyName("http://ars.com/xmlns/cm","Region");
IMutablePropertyMap map = new MutablePropertyMap();
IProperty property = new Property(propName,"Asia");//How to pass multiple Values?
map.put(property);
res.setProperty(property);
Helpful answer would be appreciated and Rewarded....
Regards,
Birla.
Hi Birla,
try this:
IResource res = ResourceFactory.getInstance().getResource(path,context);
IPropertyName propName = new PropertyName("http://ars.com/xmlns/cm","Region");
java.util.List values = new List();
values.add("Asia");
values.add("America");
values.add("Muenster, Germany");
IProperty property = new Property(propName, PropertyType.STRING, values);
res.setProperty(property);
Best regards,
Michael
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
have a look at the JavaDocs for the Property class and you'll find some constructors for creating multi-valued properties:
http://media.sdn.sap.com/html/submitted_docs/nw_kmc/javadoc/index.html
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
90 | |
10 | |
10 | |
10 | |
7 | |
7 | |
6 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.