Dipankar KumarGhosal

Greenhorn
+ Follow
since Nov 25, 2008
Merit badge: grant badges
For More
Cows and Likes
Cows
Total received
0
In last 30 days
0
Total given
0
Likes
Total received
0
Received in last 30 days
0
Total given
0
Given in last 30 days
0
Forums and Threads
Scavenger Hunt
expand Ranch Hand Scavenger Hunt
expand Greenhorn Scavenger Hunt

Recent posts by Dipankar KumarGhosal

No, you cannot use PUMA API to retrieve user info.

That is exactly where Servlets and Portlets differ.

Portlets provide us a way to retrieve the User info. Portal User Management Archictecture(PUMA) has been specifically there to provide you with features to access Logged in User Profile.

Here is an example :

private PumaUtil() {
try {
Context ctx = new InitialContext();
Object puma = ctx.lookup("portletservice/com.ibm.portal.um.portletservice.PumaHome");
pumaService = (PortletServiceHome)puma;
pumaHome = (PumaHome)pumaService.getPortletService(PumaHome.class);
pumalocator = pumaHome.getLocator();
} catch (NamingException e) {
// TODO Auto-generated catch block
e.printStackTrace();
} catch (PortletServiceUnavailableException e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
/**
* This method returns the PumaProfile
*
* @return a PumaProfile object.
*/
private PumaProfile getPumaProfile() {

return pumaHome.getProfile();
}

/**
* This method will return the PumaController Objects
* @return
*/
public PumaController getPumaController(){
return pumaHome.getController();
}

/**
* This method will return the list of user attributes.
* @return list of User attributes
*/
public List getLoggedInUserAttributes(){
List userAttr = new ArrayList();
try {
userAttr = getPumaProfile().getDefinedUserAttributeNames();
} catch (Exception e) {
logger.logError("Error while fetching the User Attribute Map from Portal Database:::" +
" Message:::" + e.getMessage());
}
return userAttr;
}

/**
* This method will return the Map of user attributes.
* This map can be modified to update the attribute values for the user
* @return list of User attributes
*/
public Map getLoggedInUserAttributeMap(){
Map userMap = new HashMap();
try {
userMap = getPumaProfile().getAttributes(getPumaProfile().getCurrentUser(), getLoggedInUserAttributes());
}catch (Exception e) {
logger.logError("Error while fetching the User from Portal Database:::" +
" Message:::" + e.getMessage());
}
return userMap;
}

15 years ago
Hi,

By default the pages are picked from cache and not directed from the initial action on subsequent clicks.

Add the following line at the end of the JSP pages , if you want to follow the same execution pattern everytime.

<% WpsStrutsUtil.removeCommand(renderRequest,renderResponse,"view"); %>

To use that you ahve to import the package like this :
<%@page import="com.ibm.wps.standard.struts.util.WpsStrutsUtil"%>
15 years ago
Well both Portlets and Servlets are loaded using the same classloader.So it's a plain fact that session can be made available in both the contexts.

As far as the portlets are concerned,
The PortletSession is namespaced :
1) PORTLET_SCOPE : Only available to the particular portlet.
2) APPLICATION_SCOPE: Available to all Portlets and also available in Servlets/JSP etc

So, if you really want to share sessions among Servlets and Portlets...
1) Define the scope of the session attributes as APPLICATION_SCOPE in Portlets....
2) Access the session attributes defined or set in servlets by specifying APPLICATION_SCOPE.. else you will get null.

As far as retrieving the PortletSession from HttpRequest is concerned.. You can get them via the APIs available..
For JSR168 Struts Portlets we have WpsStrutsUtil package that will return you the PortletSession...

Hope this makes something clear...
15 years ago
Hi Indu,

Just replace the default jars created in the RAD IDE by jars present in the InstalledApps folder.

Actually , the jars created by RAD 7.5 create issue when we deploy the webapp using the same.
Just replace the jars . You can get the jars by copying the same from any of the application peresent in InstalledApp folder.

Hope this help!
15 years ago
Does this solution sound somewhat more practical.
I did not find much success with any APIs.

1) Create a group in ldap for each artifcat: Like pages,portlets.This task will be done by Portal Admin at the time of deploying the application.
Example:
Page : MyHomePage
Portlets: MyProfilePortlet,MyPreferencesPortlet

Here the Portal Admin will create groups for each artifact.
Example: Group Name
MyHomePage
MyProfilePortlet
MyPreferencesPortlet

and assign access to the artifcats to the above created groups.
The Customer admin will have an interface showing the available Users and available groups (Mapping to Users and Artifcats respectively)

The customer Admin will select the user and check /Uncheck the groups (Read:Artifacts) he wishes to give/revoke access to.
15 years ago
Sorry that location was for Portal 6.0
In 6.1 you will find that properties file in :wp_profile\PortalServer\config

-Dipankar
15 years ago
Hi,

Did you try setting public.session=true ?
1.Enable anonymous session. In {WP_ROOT}\config\properties\Navigator service.properties, set
public.session = true

-Dipankar
15 years ago
Hi All,

I have a simple question for you guys...
Do we have Struts MVC support with JSR 286? Like one we have as Struts portlet for JSR168...

I understand that we can opt for JSF ..but just a confirmation if there exists struts(MVC) (not webFramework)support for JSR 286.

Ot put it other way, what design consideration should i take to design a Portlet web application (heavy on forms)using JSR 286 and Websphere 6.1?

Require immediate suggestions..
Thanks in advance,
Dipankar
15 years ago
Hi,
On a project, we are looking to perform a couple of
portal admin functionalities from a custom portlet. 1) Assign
portal page permissions & 2) Assign unique URLs to existing
portal pages. Is there a portal API(s) that will allow us to
do this from a custom portlet. The basic flow is as follows:

1. Site admin creates a new portal page.
2. A deployment person uses a custom portlet to register a
new company for access to the ABC portal.
3. The custom client registration portlet creates an LDAP
group to represent the new company.
4. The deployment person selects a portal page that the
company will use and the custom portlet assigns rights to
that page for the new company LDAP group.
5. Custom portlet then creates a unique URL for the selected
page branded for use by the company. Example:
www.abc.com/wps/myportal/COMPANY1

We can of course do this using the OOTB(Out of box) portlet but we are
trying to minimize the work the deployment role has to do
when setting up a new company for access to the abc portal.

Any info will be helpful

In a nutshell, we need to provide a friendly interface that provides a subset of Admin console features..(like assigning access for pages/portlets to groups)...
I am using WebSphere portal 6.1.
[ November 25, 2008: Message edited by: Dipankar KumarGhosal ]
15 years ago