cancel
Showing results for 
Search instead for 
Did you mean: 

Custom Property Via Webdynpro

Former Member
0 Kudos

Hi All,

I have a custom property called "Read" (Under Miscellaneous Tab) for every documents under KM Content in Portal. How can i access the custom property via WebDynpro? Does anyone have sample codes regarding that?

Regards,

Divya

Accepted Solutions (0)

Answers (6)

Answers (6)

Former Member
0 Kudos

Hi,

I can't read a km custom property from webdynpro java.

This is mi source code:

IProperty prop = resource.getProperty(propName);

I have imported the library:

import com.sapportals.portal.prt.resource.IResource;

but I have this error:

"The method getProperty(IPropertyName) is undefined for the type IResource"

I don't know where is the problem...

Thanks and regards

Mónica

Former Member
0 Kudos

answered

Former Member
0 Kudos

Hi there

This post is quite old, anyway - here is some input which helps reading some properties.


  public String getProperty(IResource res, String name) { 
	  String value = null; 
	  
	 
	  IPropertyName propName = newPropertyName(IWcmConst.SAP_WCM_NAMESPACE + "/custom", name); 
	  IProperty prop = res.getProperty(propName); 
	  
	  value = prop.getStringValue(); 
  }

Best regards

Marco

Former Member
0 Kudos

To access KM from WebDynpro check the following link:

https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/documents/a1-8-4/using%20k...

Also check the following thread:

Regards.

Rajat

Former Member
0 Kudos

Hi Srinivas,

Could u pls tell me , how to get the "property location " in portal .

and also I need Property value .

IPropertyName propDelete= new PropertyName("propertylocationinportal", "propertyName");

say for example:

IPropertyName propDelete= new PropertyName("http://servername/xmlns/cm/...", "Delete");

Thanks in advance

Former Member
0 Kudos

HIii,

Any updates ?????

Thanks in advance

srinivas_sistu
Active Contributor
0 Kudos

Hi divya,

to read a docs property,

first

IPropertyName propDelete= new PropertyName("propertylocationinportal", "propertyName");

say for example:

IPropertyName propDelete= new PropertyName("http://servername/xmlns/cm/...", "Delete");

Now, using path RId and all, read the resource from the required location,

pathRID = RID.getRID("Path);

resourseFactory = ResourceFactory.getInstance();

ICollection collection = (ICollection) resourseFactory.getResource(pathRID, resourseContext);

resourceList = collection.getChildren();

resourceListIterator = resourceList.listIterator();

while (resourceListIterator.hasNext()) {

resource = resourceListIterator.next();

if (resource.isCollection())

continue;

IPropertyMap propMap = resource.getProperties();

IProperty deleteProp = propMap.get(propDelete);

String strdelProp = deleteProp .getStringValue();

Regards,

Srinivas

Former Member
0 Kudos

Hii Frnds,

I have the same requirement .

Someone has any solution .