minor fixes

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@129810 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-07-02 22:01:07 +00:00
parent cd7ea087bf
commit c57d8896ee
2 changed files with 8 additions and 7 deletions

View File

@ -20,6 +20,7 @@ import org.apache.http.HttpStatus;
import org.gcube.application.framework.core.session.ASLSession; import org.gcube.application.framework.core.session.ASLSession;
import org.gcube.application.framework.core.session.SessionManager; import org.gcube.application.framework.core.session.SessionManager;
import org.gcube.common.scope.api.ScopeProvider; import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.datacatalogue.ckanutillibrary.CKanUtils;
import org.gcube.datacatalogue.ckanutillibrary.CKanUtilsImpl; import org.gcube.datacatalogue.ckanutillibrary.CKanUtilsImpl;
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper; import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GcubeCkanDataCatalogService; import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GcubeCkanDataCatalogService;
@ -73,7 +74,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
* Since it needs the scope, we need to check if it is null or not * Since it needs the scope, we need to check if it is null or not
* @return * @return
*/ */
private CKanUtilsImpl getCkanUtilsObj(){ private CKanUtils getCkanUtilsObj(){
if(instance == null){ if(instance == null){
synchronized(LOCK){ synchronized(LOCK){
@ -282,7 +283,7 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
}else{ }else{
CKanUtilsImpl ckanUtils = getCkanUtilsObj(); CKanUtils ckanUtils = getCkanUtilsObj();
// first of all, check if the user is a sysadmin in the catalog (in this case he can do everything) // first of all, check if the user is a sysadmin in the catalog (in this case he can do everything)
boolean isSysAdmin = ckanUtils.isSysAdmin(username, getUserCKanTokenFromSession()); boolean isSysAdmin = ckanUtils.isSysAdmin(username, getUserCKanTokenFromSession());

View File

@ -10,7 +10,7 @@ import java.util.Map;
import java.util.Map.Entry; import java.util.Map.Entry;
import org.gcube.application.framework.core.session.ASLSession; import org.gcube.application.framework.core.session.ASLSession;
import org.gcube.datacatalogue.ckanutillibrary.CKanUtilsImpl; import org.gcube.datacatalogue.ckanutillibrary.CKanUtils;
import org.gcube.datacatalogue.ckanutillibrary.models.RolesIntoOrganization; import org.gcube.datacatalogue.ckanutillibrary.models.RolesIntoOrganization;
import org.gcube.datacatalogue.metadatadiscovery.DataCalogueMetadataFormatReader; import org.gcube.datacatalogue.metadatadiscovery.DataCalogueMetadataFormatReader;
import org.gcube.datacatalogue.metadatadiscovery.bean.MetadataType; import org.gcube.datacatalogue.metadatadiscovery.bean.MetadataType;
@ -89,7 +89,7 @@ public class UserUtil {
* @param groupName the current groupName * @param groupName the current groupName
* @param ckanUtils ckanUtils * @param ckanUtils ckanUtils
*/ */
public static CkanRole getHighestRole(String currentScope, String username, String groupName, CKanUtilsImpl ckanUtils){ public static CkanRole getHighestRole(String currentScope, String username, String groupName, CKanUtils ckanUtils){
// base role as default value // base role as default value
CkanRole toReturn = CkanRole.MEMBER; CkanRole toReturn = CkanRole.MEMBER;
@ -288,7 +288,7 @@ public class UserUtil {
* @param ckanLicensesKey * @param ckanLicensesKey
* @param ckanUtils * @param ckanUtils
*/ */
public static void getLicenses(ASLSession session, String ckanLicensesKey, CKanUtilsImpl ckanUtils) { public static void getLicenses(ASLSession session, String ckanLicensesKey, CKanUtils ckanUtils) {
try{ try{
String username = session.getUsername(); String username = session.getUsername();
@ -312,7 +312,7 @@ public class UserUtil {
* @param ckanUtils * @param ckanUtils
*/ */
public static void getUserOrganizationsList(ASLSession session, public static void getUserOrganizationsList(ASLSession session,
String ckanOrganizationsPublishKey, CKanUtilsImpl ckanUtils, String token) { String ckanOrganizationsPublishKey, CKanUtils ckanUtils, String token) {
try{ try{
@ -359,7 +359,7 @@ public class UserUtil {
* @param ckanUtils * @param ckanUtils
*/ */
public static void getMetadataProfilesList(ASLSession session, public static void getMetadataProfilesList(ASLSession session,
String ckanProfilesKey, CKanUtilsImpl ckanUtils) { String ckanProfilesKey, CKanUtils ckanUtils) {
try{ try{