How to update user Display Profile from any application out of Portal ?
I would like to know if there is any way to manage the user display profile from a web application which is not Portal Server ?
For example :
- Add a channel to the desktop user from the application which provides the content channel (channel would have been created before).
- List the available tabs for the user
one way I think about is to create a piece of display profile (xml file) and load it with the amadmin command (by CGI script for example). But the question is what should be the content of the file ?
Any idea ?
Thanks :)
Message was edited by:
pascal25
[623 byte] By [
pascal25] at [2007-11-26 9:44:50]

# 1
hi,
the DTD for for the display profile is public. you can find it at /etc/opt/SUNWportal/psdp.dtd. you could use JAXP to parse the DP and modify it programmatically. as for understanding the format, the best thing is probably to download some of the sample DPs and take a look.
for example, to add a channel, you'd need to add a new <Channel name ... /> entry for the channel, and then add that channel to a <Container name=.../> entry's <Available .../> and <Selected .../> tags.
to list the tabs for a user, you'd need to know the name of the tab containter. you'd fetch the XML for that container, then look at the entries in the <Selected ../> entry.
you can get the DP programmatically using AM SDK calls, but it's probably easier to use psadmin.
# 2
I think that the process would be more complex than what you have laid out here. Remember that the user's DP is calculated base on the orgs, roles, and global DP. In order to determine how to modify a user's DP, first you need to determine what the current DP has. This can only be done by merging all of the other DP's. As far as I know, that logic is not available through any APIs.
For example, to get the list of tabs for a user, you would need to merge the DP from global, org, and roles in order to determine the complete list. The same pertains to the list of available and selected channels.
I would suggest a possible alternative:
1) Create a database table containing users and channel selections from external web applications
2) Modify the external applications to insert a record in the DB whenever a user wants to add a channel to their desktop
3) Create a new container and override the getSelectedChannels method so that it takes the channels defined in the DP and adds the ones defined in the Database table.
A user's desktop would then contain some channels that are from the available and selected properties of the DP, plus any additional channels that are listed in the database table.
There are other ways to skin this cat, but I think the important thing is to not "break" the inheritance mechanism that portal brings to the table.
- Jim
# 3
You're right, the first task we tried to do is to get the user selected tabs and channels. But outside the portal we didn't success.
The second idea is to add the channel always in a specific tab. We will be sure that the tab is available and selected. So now the problem is to produce the right xml file to add to the user's display profile using psadmin command.
I tried with this xml file :
<!DOCTYPE DisplayProfile SYSTEM "jar://resources/psdp.dtd">
<Container advanced="false" lock="false" merge="fuse" name="JSPTabContainer/Bureau" provider="JSPTableContainerProvider">
<Selected advanced="false" lock="false" merge="fuse">
<Reference advanced="false" lock="false" merge="replace" propagate="true" value="JSPTabContainer/Bureau/JSP"/>
</Selected>
</Container>
The tab should be "JSPTabContainer/Bureau" and channel is "JSPTabContainer/Bureau/JSP".
The command i used is :
psadmin modify-dp with uid=userid,ou=people,o=org,dc=xxxxxx,dc=com
But it doesn't work.
# 4
According to the DTD, the DisplayProfile element requires Properties, Channles, and Providers elements. I would try adding some elements to the XML so that it's valid. Try this:
<!DOCTYPE DisplayProfile SYSTEM "jar://resources/psdp.dtd">
<DisplayProfile>
<Properties></Properties>
<Channels>
<Container advanced="false" lock="false" merge="fuse" name="JSPTabContainer/Bureau" provider="JSPTableContainerProvider">
<Properties></Properties>
<Available></Available>
<Selected advanced="false" lock="false" merge="fuse">
<Reference advanced="false" lock="false" merge="replace" propagate="true" value="JSPTabContainer/Bureau/JSP"/>
</Selected>
<Channels></Channels>
</Container>
</Channels>
<Providers></Providers>
</DisplayProfile>