replaced OrganizationBeanProfile with OrganizationBean

This commit is contained in:
Francesco Mangiacrapa 2024-02-15 17:31:54 +01:00
parent a5efc60c57
commit 1493d20bbe
2 changed files with 20 additions and 19 deletions

View File

@ -44,6 +44,7 @@
@ -111,6 +112,7 @@
@ -178,6 +180,7 @@
@ -245,6 +248,7 @@
@ -267,15 +271,10 @@
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<dependent-module archiveName="catalogue-util-library-1.4.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/catalogue-util-library/catalogue-util-library">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="metadata-profile-form-builder-widget-2.1.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/metadata-profile-form-builder-widget/metadata-profile-form-builder-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<dependent-module archiveName="ckan-metadata-publisher-widget-2.2.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/ckan-metadata-publisher-widget/ckan-metadata-publisher-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -388,6 +387,7 @@
@ -455,6 +455,7 @@
@ -522,6 +523,7 @@

View File

@ -30,7 +30,6 @@ import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.BeanUserInOrgGro
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanConnectorAccessPoint;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.ManageProductResponse;
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.OrganizationBean;
import org.gcube.portlets.widgets.mpformbuilder.shared.catalogue.OrganizationBeanProfile;
import org.gcube.vomanagement.usermanagement.GroupManager;
import org.gcube.vomanagement.usermanagement.impl.LiferayGroupManager;
@ -300,20 +299,20 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
* @param username the username
* @return the list
*/
private List<OrganizationBeanProfile> fetchUserGroups(String context, String username) {
private List<OrganizationBean> fetchUserGroups(String context, String username) {
List<OrganizationBeanProfile> toReturn = null;
List<OrganizationBean> toReturn = null;
logger.info("Preloading user's groups");
try{
DataCatalogue catalogue = getCatalogue(context);
toReturn = new ArrayList<OrganizationBeanProfile>();
toReturn = new ArrayList<OrganizationBean>();
Map<String, Map<CkanGroup, RolesCkanGroupOrOrg>> mapRoleGroup = catalogue.getUserRoleByGroup(username);
Set<Entry<String, Map<CkanGroup, RolesCkanGroupOrOrg>>> set = mapRoleGroup.entrySet();
for (Entry<String, Map<CkanGroup, RolesCkanGroupOrOrg>> entry : set) {
Set<Entry<CkanGroup, RolesCkanGroupOrOrg>> subSet = entry.getValue().entrySet();
for (Entry<CkanGroup, RolesCkanGroupOrOrg> subEntry : subSet) {
toReturn.add(new OrganizationBeanProfile(subEntry.getKey().getTitle(), subEntry.getKey().getName(), false));
toReturn.add(new OrganizationBean(subEntry.getKey().getTitle(), subEntry.getKey().getName(), false));
}
}