fix due to update ckan library

git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@131388 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Costantino Perciante 2016-09-15 13:47:39 +00:00
parent 9ba562818a
commit 5ed0eeb3b0
2 changed files with 6 additions and 14 deletions

View File

@ -17,6 +17,7 @@ import org.gcube.common.homelibrary.home.workspace.folder.FolderItem;
import org.gcube.datacatalogue.ckanutillibrary.CKanUtils;
import org.gcube.datacatalogue.ckanutillibrary.CkanUtilsFactory;
import org.gcube.datacatalogue.ckanutillibrary.models.ResourceBean;
import org.gcube.datacatalogue.ckanutillibrary.utils.UtilMethods;
import org.gcube.portal.custom.scopemanager.scopehelper.ScopeHelper;
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.CKanPublisherService;
import org.gcube.portlets.widgets.ckandatapublisherwidget.server.utils.Utils;
@ -124,7 +125,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
String scopeInWhichDiscover = (scope != null && !scope.isEmpty()) ? scope : getASLSession().getScope();
// get the key per scope
String keyPerScope = Utils.concatenateSessionKeyScope(CKAN_TOKEN_KEY, scopeInWhichDiscover);
String keyPerScope = UtilMethods.concatenateSessionKeyScope(CKAN_TOKEN_KEY, scopeInWhichDiscover);
// check if session expired
if(username.equals(TEST_USER)){
@ -168,7 +169,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
HttpSession httpSession = getThreadLocalRequest().getSession();
// get key
String keyPerScope = Utils.concatenateSessionKeyScope(CKAN_ORGANIZATIONS_PUBLISH_KEY, scope);
String keyPerScope = UtilMethods.concatenateSessionKeyScope(CKAN_ORGANIZATIONS_PUBLISH_KEY, scope);
if(httpSession.getAttribute(keyPerScope) != null){
orgsName = (List<OrganizationBean>)httpSession.getAttribute(keyPerScope);
@ -221,7 +222,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
logger.info("Request for CKAN licenses for scope " + scope);
// get key per scope
String keyPerScope = Utils.concatenateSessionKeyScope(CKAN_LICENSES_KEY, scope);
String keyPerScope = UtilMethods.concatenateSessionKeyScope(CKAN_LICENSES_KEY, scope);
LicensesBean licensesBean = null;
if(httpSession.getAttribute(keyPerScope) != null){

View File

@ -16,6 +16,7 @@ import org.gcube.common.homelibrary.home.workspace.folder.items.GCubeItem;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.datacatalogue.ckanutillibrary.CKanUtils;
import org.gcube.datacatalogue.ckanutillibrary.models.RolesIntoOrganization;
import org.gcube.datacatalogue.ckanutillibrary.utils.UtilMethods;
import org.gcube.datacatalogue.metadatadiscovery.DataCalogueMetadataFormatReader;
import org.gcube.datacatalogue.metadatadiscovery.bean.MetadataType;
import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataField;
@ -53,16 +54,6 @@ public class Utils {
// Logger
private static final org.slf4j.Logger logger = LoggerFactory.getLogger(Utils.class);
/**
* Builds a string made of key + scope
* @param key
* @param scope
* @return
*/
public static String concatenateSessionKeyScope(String key, String scope){
return key.concat(scope);
}
/**
* Build up the resource beans.
* @param resourceIds
@ -329,7 +320,7 @@ public class Utils {
String scopeInWhichDiscover = (scope != null && !scope.isEmpty()) ? scope : aslSession.getScope();
// scope in which we need to discover
String keyPerScope = Utils.concatenateSessionKeyScope(profilesKey, scopeInWhichDiscover);
String keyPerScope = UtilMethods.concatenateSessionKeyScope(profilesKey, scopeInWhichDiscover);
if(httpSession.getAttribute(keyPerScope) != null){
beans = (List<MetaDataProfileBean>)httpSession.getAttribute(keyPerScope);