on 10-09-2008 8:03 PM
I customer of our company has defined a metadata property
with the following settings:
Property ID: * prop_created
Namespace Alias: *company_namespace
Type: *Timestamp
Key for Label:cm_created
Folder Validity Patterns (csv)/
Document Validity Patterns (csv)/
Property Renderer creationdate
In a project i need to change the value of about 1000 documents over api.
This should normaly be not a problem, but even when the property exists on an document and see the it in the flexible user interface,
it's not possible to read it over the api.
I also tried to iterate over all properties, but this one don't come up.
Any ideas?
Btw, i allready tried it over the IApplicationPropertiesService..Same results here...Property can not be looked up..
Regards,
Thomas
Hi Thomas,
If u want to change the property of 1000 documents, try this [Help|http://help.sap.com/saphelp_nw04s/helpdata/en/44/8d6f90d85c6572e10000000a11466f/frameset.htm]
Regards
BP
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
i can't see the whole property. but i can see this property exists on the resource with value in the km admin
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi,
I can't see a reason why this could happen. Try to access for the resource with the property value set (so you can see the value through detail iview) directly:
...
IPropertyName pName = PropertyName.getPN("property_namespace_you_can_see_when_hovering_in_detail_iview", "property_name_from_detail_iview");
response.write("<br>pName:"+pName);
prop = res.getProperty(propName);
response.write("<br>prop:"+prop);
...
what is the output?
Romano
Here is the code of the property viewer i created to see all the existing properties
public class PropertyViewerForResource {
public static void outputProperties(
IResource item,
IPortalComponentResponse response) {
IPropertyMap map;
try {
map = item.getProperties();
response.write(
"<font color=\"red\">------------------------Property Viewer MetadatyProperties----------------------<br>");
response.write(
"Displaying properties for the following resource:<br>");
response.write(item.getName() + "<br>");
if (map != null) {
IPropertyIterator itr = map.iterator();
while (itr.hasNext()) {
String multi = "No";
IProperty prop = itr.next();
if (prop.isMultivalued()) {
multi = "Yes";
}
response.write(
"Property Name:"
+ prop.getPropertyName().getName()
+ "<br>");
response.write(
"Property Namespace:"
+ prop.getPropertyName().getNamespace()
+ "<br>");
response.write("Property is multivalue: " + multi + "<br>");
response.write(
"Property Value: " + prop.getValueAsString() + "<br>");
}
}
response.write(
"----------------------------End of Output-------------<br></font>");
} catch (NotSupportedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (AccessDeniedException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (ResourceException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
try {
IApplicationPropertiesService apService =
GetApplicationPropertyServiceInstance
.getApplicstionPropertyService();
response.write(
"<font color=\"blue\">----------------------------Property Viewer Application Properties----------------<br>");
IAppPropertyMap mapapp = apService.getProperties(item);
IAppPropertyIterator itrapp = mapapp.iterator();
while (itrapp.hasNext()) {
String multi = "No";
IAppProperty propapp = itrapp.next();
if (propapp.isMultivalued()) {
multi = "Yes";
}
response.write(
"Property Name: " + propapp.getPropertyName() + "<br>");
response.write("Property is multivalue: " + multi + "<br>");
}
} catch (ResourceException e1) {
// TODO Auto-generated catch block
e1.printStackTrace();
} catch (WcmException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
}
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Okay, but that will not help in this case.
Cause the change is based on logic in an program.
My question was related to the fact, why i don't see this property over the api.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
6 | |
6 | |
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.