moved to factory ckan utils

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/user/gcube-ckan-datacatalog@130934 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-08-02 07:49:24 +00:00
parent 6418d1a510
commit 69fd3467c1
1 changed files with 3 additions and 2 deletions

View File

@ -22,6 +22,7 @@ import org.gcube.application.framework.core.session.SessionManager;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.datacatalogue.ckanutillibrary.CKanUtils;
import org.gcube.datacatalogue.ckanutillibrary.CKanUtilsImpl;
import org.gcube.datacatalogue.ckanutillibrary.CkanUtilsFactory;
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GcubeCkanDataCatalogService;
import org.gcube.portlets.gcubeckan.gcubeckandatacatalog.shared.CkanConnectorAccessPoint;
@ -83,11 +84,11 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
// session expired or, maybe, outside the portal
logger.warn("User is "+TEST_USER +" are we out from portal?");
logger.warn("I'm using root scope "+ CKanUtilsImpl.PRODUCTION_SCOPE_ROOT);
instance = new CKanUtilsImpl(CKanUtilsImpl.PRODUCTION_SCOPE_ROOT);
instance = CkanUtilsFactory.getFactory().getUtilsPerScope(CKanUtilsImpl.PRODUCTION_SCOPE_ROOT);
}else{
String scopeInWhichDiscover = (discoverScope != null && !discoverScope.isEmpty()) ? discoverScope : currentScope;
logger.debug("Discovering ckan utils library into scope " + scopeInWhichDiscover);
instance = new CKanUtilsImpl(scopeInWhichDiscover);
instance = CkanUtilsFactory.getFactory().getUtilsPerScope(scopeInWhichDiscover);
}
}catch(Exception e){
logger.error("Unable to retrieve ckan utils", e);