on 09-19-2008 4:37 PM
Hi!
Please help me to solve this problem!
I have got an IView with a Height of 200; now i have to modify this value with a Portal Application.
Here comes the code....:
if (request.getComponentContext().getProfile().isPersonalizableProperty("com.sap.portal.iview.Height")){
System.err.println("Original Value "+request.getComponentContext().getProfile().getProperty("com.sap.portal.iview.Height"));
System.err.println("Setting");
request.getComponentContext().getProfile().setProperty("com.sap.portal.iview.Height","100");
System.err.println("Checkpoint");
request.getComponentContext().getProfile().store();
System.err.println("New Value "+request.getComponentContext().getProfile().getProperty("com.sap.portal.iview.Height"));
}
}
Now:
1)Deploy
2)IView Preview
LOG :
Orignal Value 200
Setting
Checkpoint
New Value 200
The new value should be 100....not 200.....
Where is the mistake?!???!
Thanks.
Hello Fabio,
You need to include the related jar files so that you can define them. The required jars are:
com.sap.portal.pcm.admin.apiservice_api.jar
com.sap.portal.pcd.glservice_api.jar
Let me know if you want me to email you the jar fils.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello,
I have tried the code on my end and i was able to change the height property value.
Check this code here i have created a portal application project:
Hashtable env = new Hashtable();
env.put(Context.INITIAL_CONTEXT_FACTORY,
IPcdContext.PCD_INITIAL_CONTEXT_FACTORY);
env.put(Context.SECURITY_PRINCIPAL, request.getUser());
env.put(Constants.REQUESTED_ASPECT, PcmConstants.ASPECT_SEMANTICS);
InitialContext iCtx = null;
iCtx = new InitialContext(env);
IiView result;
result =(IiView) iCtx.lookup("pcd:portal_content/Test1/com.local.New1");
result.putAttribute("com.sap.portal.iview.Height","100");
result.save();
and also you have to include the references in the portalapp.xml
Let me know for more information.
Hope this helps you.
Thanks.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi Fabio,
> How did you define Constants and PcmConstants ?
These are:
- com.sap.portal.directory.Constants
- com.sap.portal.pcm.admin.PcmConstants
Use ClassLocator (if you don't know it, search on SDN for more info) to reference the corresponding JARs.
Hope it helps
Detlev
PS: Please consider rewarding points for helpful answers on SDN. Thanks in advance!
User | Count |
---|---|
86 | |
10 | |
10 | |
9 | |
7 | |
7 | |
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.