liferay move portlets in a page - liferay

I have the next requirement: every user can change position of portlet in a page but this change is only applied for this user no for all. I know that it is possible with layout and it works fine (the portlets are possible move ), but my main problem is when "x" user changes the position of a portlet because it is applied for all users. so you have any idea for how do I this?
I work with liferay 6.2 CE

From liferay 6.1 onwards,it provides for page customizations,where in admin can defined certain sections of the page layout as customizable allowing users to add/move/delete portlets,in specific sections.These changes will be specific to the particular user and will not be visible for others.The user has the option to anytime view the default page or to reset his customizations as well.
In order to enable this,Edit page->customization settings->Show Customizable settings and check the required sections.
Please refer the Liferay documentation for further details.

Related

Liferay: Page to portlet mapping

I have a requirement in liferay portal to allow user to add some specific portlets on a particular page. Same can be done in 2 ways:
This will require some custom code to be plugged in add panel code
create a custom portlet which will be present on left hand
side of page and allows portlet to be added and dragged on page.
On add of portlet it checks if the page can have this portlet and accordingly remove it
The question I have is which of these 2 approaches shall be used, and how?
Note: I was unable to find much about this on google as well
I believe Liferay permission system is strong enough to express what you need.
The portlet list shown in "Add more portlets" menu can be customized through a Regular Role. See How to customize which portlets to show in “Add more portlets” menu for detailed info.
To restrict the options for a single page (or several pages), modify its permissions, so that only the new Regular Role is be able to update it.
Based on your comment to Tomáš Piňos's answer, my suggestion would be to create a custom portlet that uses Liferay's API and enables you to do just this: On the page where it's available, use it to enable/disable the portlets you'd like to be there by use of Liferay's API. You'll find quite a lot of sample when you're looking for the old sevencogs example (that sadly does not compile any more, but in general the API has only changed marginally). The most up to date resources with further links to the ancient code are these 2 blog articles.
About your third option (as you ask in the comments): Yes, it's possible: You can override Liferay's Services as well as react to model changes. This means that you could add your own check on updates. However, I'd feel it inappropriate to offer the option to add any portlet only to prohibit it whenever a user indeed uses the offered option. That's why I didn't include this option in my initial answer.

How to add preference option to the liferay portlet

I want to create a portlet where the portlet allow access to the remote application. That is the content of the portlet should be dynamic so for the same reason I want to add one option "Preferences" in the portlet (Where the look and feel and configuration options exists). In that preference page If will give some http url (http://localhost:8080/Myapp/Mypage) then on click of save button, the URL page should display in the portlet. How can I do that? Note I am going to use same portlet in different pages with different URLs.
Liferay's "Preferences" link shows the portlet in JSR-286 "edit" mode. That's all there is: If you implement this mode, you'll automatically get the Preferences link.
Why are they named differently? IMHO Edit-Mode is rather misleading as you're editing the preferences rather than any data displayed in the portlet.
You can use Liferay Iframe Portlet which allow access to the remote application.
Refer following url for detail description of look and feel and configuration options : Iframe Portlet

Use a web content portlet

I am using web content portlet to develop a portal.
Each page has common theme (which includes header and footer) and we have many portlets placed on each page.
One of the portlet on right side is menu which is common on many pages.
I could have kept it as a part of theme but the menu can be subject to change in future and the end user who will be handling the portal is non-developer.
So if they want to change some data in that menu portlet, they will have to change it on every page which leads to duplication of effort.
Like I said, since end user is a non-developer, I cannot make that portlet part of the theme.
So is there any way where one web content portlet be created once and used on many pages?
You can embed web-content in theme as per link
Here articleId as in above link, you can set in theme-setting, refer to link
I have found a solution right now. If anyone has abetter solution than this..they are most welcome. I would like people to share alternate and better solutions
I am using Liferay 6.2
What I did was added a new web content display portlet which like I said created a new blank web content display portlet.
So my usual method was to add content to this portlet. THis was the method I followed. You can click on Select Web Content button and then select the already created portal from the list and you are done. NO need to create duplicate portlets

Different Message Board Portlet on different page in Liferay 5.2.3

Is it possible to implement different Message board portlet on different page in Liferay 5.2.3. But now if I am adding Message Board on two pages same posts are coming. I want these to be totally separate from each other. Can anyone help me in this regard.
I do not recall having scope content in 5.2.3 Liferay 6 does support page scoped content, so you can have different MB or blogs or wiki portlet on different pages of same community/org.
To check if scoping is supported in Liferay 5.2.3, Add MessageBoard portlet on a page. Click on Configuration(Its under look and feel icon of the portlet) and see if you have Scope tab. If you have Scope tab then, Liferay 5.2.3 supports scoping. Click on Scope tab. Select the current layout scope and click on save.
If you dont see Scope tab in Configuration option of the portlet, then it can confirmed that Liferay 5.2.3 does not support the feature you are looking for and you have to upgrade to Liferay 6

How to remove My Pages and My Submissions from Liferay Control panel

I'm currently working on a Liferay project and want to get rid of the My Pages and My Submissions menu items on the right side so that users of my site do not bother with them. Tried looking for the jsp that renders the left side menu, but could manage to remove the item from there. Any ideas how to proceed? Thanks!!!
You could add the following lines to your portal-ext.properties (usually found in webapps/ROOT/WEB-INF/classes under tomcat):
#deactivate Personal Community with *private* pages
layout.user.private.layouts.enabled=false
#deactivate Personal Community with *public* pages
layout.user.public.layouts.enabled=false
#hide Personal Community from my places
my.places.show.community.private.sites.with.no.layouts=false
and restart the server.
Recently I had the same task assigned. Fortunately removing this items from the menu is quite straightforward since the control panel is nothing more than a special layout for displaying portlets that are deployed in the portal server. You can read my blog post here to check the simple steps on how to customize the Control Panel and My Account portlet.
http://liferay.bdedov.eu/2012/02/clean-up-control-panel-from-unnecessary.html
You probably rather want to limit the permissions to people. Don't give out global administration roles, but create your own roles, "Define Permissions" for them as you need them and leave out the permissions that you don't want to provide to your users - e.g. "access in control panel" or the general permission to add a page.
Otherwise you'll miss other ways to use the interface and still allow them to add pages through other means (e.g. "Manage/Page").
Edit: The easiest way to get rid of "My Submissions" is to undeploy the workflow plugin (kaleo-web) - of course you can only do this if you don't need workflow.

Resources