on 12-22-2006 9:04 AM
Hi
It's possible access to a km repository (and change file properties...) from a local application that runs on my pc? If yes can someone give me an example code?
Thanks!
Andrea
You can access KM Repository from local java application.
The following packages need to be used...
1. com.sapportals.wcm.util.*
2. com.sapportals.wcm.repository.*.
The following code may be helpful for retreiving a property..
String namespace = "your namespace";
String name = "your property";
IPropertyName propertyName = new PropertyName(namespace, name);
IProperty property = resource.getProperty(propertyName);
if( property != null ) {
// property exists
String value = property.getValueAsString();
} else {
// property is not set for this resource
}
For setting a property,
boolean value = true;
IProperty property = new Property(propertyName, value);
resource.setProperty(property);
For changing a property, use IMutableProperty..
IMutableProperty mutableProperty = property.getMutable();
mutableProperty.setBooleanValue(true);
resource.setProperty(property);
Hope, this sample code from SDN may be helpful to you....
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
85 | |
10 | |
10 | |
10 | |
7 | |
6 | |
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.