sergiogonzalez/liferay-portal — pull request #446 by epgarcia (2012-11-14 10:43:15+00:00)
Title: LPS-30286 Display the organization the site belongs to in the site detail

Scenario:

* Site "Site1" is the site of the organization "Org1".
* Organizations "Org2" and "Org3" are members of "Site1".
* "Org2" and "Org3" are explicit members of "Site1" (through Groups_Orgs table) while "Org1" is an implicit member of "Site1".

Previous situation:

* A search for all the organizations which are members of "Site1" (using the param "organizationsGroups" set to the groupId of Site1) returned only "Org2" and "Org3".
* In order to provide information about the implicit membership of "Org1", we just increased the count result (see site_columns.jspf)

Current situation:

* A search for all the organizations which are members of "Site1" (using the param "organizationsGroups" set to the groupId) will also return the organization the site belongs to ("Org1") if the param "groupOrganization" set to the groupId is added to the params map of the search method in the OrganizationFinder.
* This improvement has been used to add/refactor some views containing information about sites and their related organizations.

Technicals remarks

* The UNION logic is similar to the one used in GroupFinderImpl or DLFolderFinderImpl.
* UNION ALL is used instead of UNION for a better performance, since we're already including the DISTINCT clause in the subselects.

@juliocamarero
@JorgeFerrer