on 06-10-2010 4:42 AM
Retrieving properties of iViews:
To get iview properties pass the full PCD path of the iview retrieving from the method : getPCDContents();
This code will help you to retrieve the properties of PCD contents.
public void getProperties(IPortalComponentRequest request , String id) throws Exception{
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;
try {
iCtx = new InitialContext(env);
IiView result = (IiView) iCtx.lookup(id);
result.getAttribute("com.sap.portal.pcd.gl.CreatedAt");
result.getAttribute("CodeLink");
result.getAttribute("com.sap.portal.pcd.gl.LastChangedBy");
result.getAttribute("com.sap.portal.pcd.gl.LastChangedAt"); result.getAttribute("com.sap.portal.pcm.Title",request.getLocale());
} catch (Exception e) {
throw new Exception (e);
}
}
try {
//setting few attributes of the iview
//Setting Forced Request Language to German
iView.putAttribute("ForcedRequestLanguage","de");
iView.save();
} catch (ValidationException e1) {
response.write(e1.getMessage());
} catch (IOException e1) {
response.write(e1.getMessage());
}
Edited by: Saurabh Agarwal on Jun 10, 2010 10:04 AM
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi All,
I have a similar requirement as Anurag. The difference is that based on certain conditions, I need to maximize or minimize the iView Tray programmatically.
I have 2 iViews - A and B. In iView "A", I have 2 buttons - Maximize and Minimize.
On clicking "Maximize" button in A iView, the iView tray in "B" iView should be expanded.
On clicking "Minimize" button in A iView, the iView tray in "B" iView should be collapsed.
I have written the following code:
<code>
//Set the property for iView tray
if (strTraySetting.equalsIgnoreCase("Max"))
{
myIView.putAttribute("com.sap.portal.iview.ExpansionMode", "Open");
myIView.save();
}
else if (strTraySetting.equalsIgnoreCase("Min"))
{
myIView.putAttribute("com.sap.portal.iview.ExpansionMode", "Close");
myIView.save();
}
</code>
However, the iView property is not being set and the B iView is not responding to dynamic iView tray setting. Can you please let me know what is the issue?
Thank you for the help in advance.
Regards,
Pavithra
Not required anymore.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
User | Count |
---|---|
84 | |
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.