juliocamarero/liferay-portal — pull request #600 by KocsisDaniel (2012-10-15 11:58:01+00:00)
Title: LPS-28982

Hey Julio,

I moved the method to groupImpl and renamed as you requested. As You said the only difference between this and group.isStagedPortlet is here the group must be the staging group. However kept to force to use the livegroup , because currently isStagedPortlet logic requires the livegroup as it checks the typesetting which is stored there. I also checked the method usages, and currently we use the livegroup everywhere when we call this method. Of course here we can't do that because it needs to return true only when the group is the stagingoup.

I also changed the DDLImpl code, it means I removed this part of the commit. The original idea was to check the same conditions on server side what we have on the jsp's, but I reviewed it again and I realized we have several different if statements on the different jsp's whether to show the edit/add buttons or not and we should include all the conditions in the business logic to make it consistent. This code was not that and we don't have anything like this in the portlet for the current conditions, so I removed. To keep this at all was a questionable part for Jorge and me as well.

For the usage of showAddRecordsButton. The original idea was to use the editable flag, but after Jorge pointed we should keep the option to setup the editable flag in the preferences - because it is something the admin wants to setup for the live - then I wanted to separate it on the code level as well. I found we use this new variable in the view_records.jsp so I started to use this to do the hide logic. After your comment I reviewed this solution and I think it is better to handle the edit/add buttons together and to do that we should use the editable flag instead.

Please let me know your opinion!
Daniel