掲示板

How to redirect One Portlet To Another

thumbnail
9年前 に Vishal Srivastava によって更新されました。

How to redirect One Portlet To Another

Junior Member 投稿: 26 参加年月日: 14/07/07 最新の投稿
Hi Friends,

I have one requirement in my project where i want to redirect user from One Version
of my Portlet to another version.

For Ex- I have one alpha release of my Portlet and one beta. After user login to my portal i want to ask user is he willing to migrate himself on new version.

How can we achieve this any idea?

Help will really be appriciated.

Thanks,
Vishal
thumbnail
9年前 に Diego Morales によって更新されました。

RE: How to redirect One Portlet To Another

Junior Member 投稿: 50 参加年月日: 13/11/26 最新の投稿
Tricky question.

Where do you plan to deploy this portlet? Is it the user's private or public layouts by any chance? that would make it much easier. You can just change the Layout (typeSettings column) for each user who chooses to migrate to the new version,.

If the portlet is deployed to a page in the portal, then you can keep two pages, each one with a portlet version. And then redirect the user to the appropriate page. If you don't want the users seeing the other version, you can have two roles, one for each version. And prevent the other users from seeing that portlet.
thumbnail
9年前 に Vishal Srivastava によって更新されました。

RE: How to redirect One Portlet To Another

Junior Member 投稿: 26 参加年月日: 14/07/07 最新の投稿
Thanks for your Response,

I want to deploy it on Tomcat Server. Its user Private Page.
Can you please give me any help tutorial link or any reference site.
thumbnail
9年前 に Jitendra Rajput によって更新されました。

RE: How to redirect One Portlet To Another

Liferay Master 投稿: 875 参加年月日: 11/01/07 最新の投稿
Simple way is to create 2 separate user private pages. On page 1 place alpha version of your portlet and on second page place beta version.

From alpha version you can redirect to beta version page by simply constructing url in below format

String path = "/web/" + screenName + "/betapage";
thumbnail
9年前 に Vishal Srivastava によって更新されました。

RE: How to redirect One Portlet To Another

Junior Member 投稿: 26 参加年月日: 14/07/07 最新の投稿
Thanks Jitendra,

In case if i dont want to create two pages than.
thumbnail
9年前 に Andew Jardine によって更新されました。

RE: How to redirect One Portlet To Another

Liferay Legend 投稿: 2416 参加年月日: 10/12/22 最新の投稿
If you want to do it on a single page then you could probably pass a variable (probably want to store it in the session if its applicable for the entire user session) that will hide / show a div of HTML that the portlet is in. You could then create a custom Layout that has both portlets embedded in it, each wrapped with their own div -- something like


<div class="beta-version">
    <!-- embed your beta portlet here -->
</div>
<div class="alpha-version">
    <!-- embed your alpha portlet here -->
</div>


.. and then just use JS when the page is loaded to show whichever one the user has agreed to?
thumbnail
9年前 に Olaf Kock によって更新されました。

RE: How to redirect One Portlet To Another

Liferay Legend 投稿: 6403 参加年月日: 08/09/23 最新の投稿
Another alternative, not yet discussed here, is to have both portlets on a page and just provide VIEW (and other) permissions for only one portlet at a time. Thus, when you show the page, one portlet is accessible, the other one is automatically hidden. Your Alpha/Beta switcher would grant VIEW permissions for one and revoke them for the other