cancel
Showing results for 
Search instead for 
Did you mean: 

How to add iView attributes using the PCD API?

Former Member
0 Kudos

Hi,

could someone please provide me with some details on how to add attributes to iViews using the PCD API.

I'm able to create a workset, a role folder within the workset and an iView within the role folder.

Currently I'm trying to add the SAP attribute "com.sap.portal.pcd.unit.IS_TEMPLATE" to the iView.

In the past I used IPcdContext.modifyAttributes(String arg0, int arg1, Attributes arg2) to set iView attributes. But this is not working anymore. When using this method to set attribute "com.sap.portal.pcd.unit.IS_TEMPLATE" I get the error message "Change to unit attributes not possible through plObject method; use IUnit.modifyUnitAttributes instead!".


To get the IUnit object I use IPcdContext.getUnit(). But the problem is that I don't get the IUnit object for my iView but for the workset.

As mentioned in http://help.sap.com/javadocs/NW73/SPS01/EP/com/sapportals/portal/pcd/gl/IPcdContext.html#getUnit%28j...:

"The unit of the object is determined by traversing the hierarchy up to the root and looking for a node that is marked as unit."

And as the iView is not marked as unit I never get the IUnit object for my iView. Which means I can't add attributes to my iView.

Instead the attribute "com.sap.portal.pcd.unit.IS_TEMPLATE" I want to add to my iView is always added to the workset as this is obviously marked as unit.


But when I manually add an iView based on a PCD template it automatically gets the attribute "com.sap.portal.pcd.unit.IS_TEMPLATE".

So what am I doing wrong when creating the iView using the PCD API?


Any help is appreciated.


Best regards,

Robert

Accepted Solutions (0)

Answers (1)

Answers (1)

Former Member
0 Kudos

As I found out today it's obviously related to this topic: Units - Portal - SAP Library.

It's not possible to add unit attributes to delta link objects.