minor fix
git-svn-id: http://svn.d4science-ii.research-infrastructures.eu/gcube/trunk/portlets/widgets/ckan-metadata-publisher-widget@164563 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
13efc7d3a8
commit
232be5c370
|
@ -17,7 +17,7 @@ import javax.servlet.http.HttpSession;
|
|||
import org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogueFactory;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.server.utils.SessionCatalogueAttributes;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.server.utils.UtilMethods;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.server.utils.CatalogueUtilMethods;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.shared.ResourceBean;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.client.CKanPublisherService;
|
||||
|
@ -101,7 +101,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
List<OrganizationBean> orgsName = new ArrayList<OrganizationBean>();
|
||||
|
||||
HttpSession httpSession = getThreadLocalRequest().getSession();
|
||||
String keyPerScope = UtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_ORGANIZATIONS_PUBLISH_KEY, scope);
|
||||
String keyPerScope = CatalogueUtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_ORGANIZATIONS_PUBLISH_KEY, scope);
|
||||
|
||||
if(httpSession.getAttribute(keyPerScope) != null){
|
||||
orgsName = (List<OrganizationBean>)httpSession.getAttribute(keyPerScope);
|
||||
|
@ -151,7 +151,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
HttpSession httpSession = getThreadLocalRequest().getSession();
|
||||
String scope = GenericUtils.getScopeFromClientUrl(getThreadLocalRequest());
|
||||
logger.info("Request for CKAN licenses for scope " + scope);
|
||||
String keyPerScope = UtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_LICENSES_KEY, scope);
|
||||
String keyPerScope = CatalogueUtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_LICENSES_KEY, scope);
|
||||
|
||||
List<LicenseBean> licensesBean = null;
|
||||
if(httpSession.getAttribute(keyPerScope) != null){
|
||||
|
@ -264,7 +264,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
private List<String> discoverTagsVocabulary(String context){
|
||||
|
||||
logger.debug("Looking for vocabulary of tags in this context " + context);
|
||||
String keyPerVocabulary = UtilMethods.concatenateSessionKeyScope(TAGS_VOCABULARY_KEY, context);
|
||||
String keyPerVocabulary = CatalogueUtilMethods.concatenateSessionKeyScope(TAGS_VOCABULARY_KEY, context);
|
||||
|
||||
List<String> vocabulary = (List<String>) getThreadLocalRequest().getSession().getAttribute(keyPerVocabulary);
|
||||
if(vocabulary == null){
|
||||
|
@ -483,7 +483,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
return true; // it's an error somehow
|
||||
try{
|
||||
String scopeFromOrgName = getScopeFromOrgName(orgName);
|
||||
String idFromTitle = UtilMethods.fromProductTitleToName(title);
|
||||
String idFromTitle = CatalogueUtilMethods.fromProductTitleToName(title);
|
||||
logger.debug("Evaluating if dataset with id " + title + " in context " + scopeFromOrgName + " already exists");
|
||||
return getCatalogue(scopeFromOrgName).existProductWithNameOrId(idFromTitle);
|
||||
}catch(Exception e){
|
||||
|
@ -539,7 +539,7 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
String scope = orgName != null ? getScopeFromOrgName(orgName) : GenericUtils.getScopeFromClientUrl(getThreadLocalRequest());
|
||||
|
||||
// check if they are in session
|
||||
String keyPerScopeGroups = UtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_GROUPS_MEMBER, scope);
|
||||
String keyPerScopeGroups = CatalogueUtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_GROUPS_MEMBER, scope);
|
||||
|
||||
if(httpSession.getAttribute(keyPerScopeGroups) != null){
|
||||
toReturn = (List<OrganizationBean>)httpSession.getAttribute(keyPerScopeGroups);
|
||||
|
@ -585,9 +585,9 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
|
|||
String scopePerCurrentUrl = GenericUtils.getScopeFromClientUrl(getThreadLocalRequest());
|
||||
|
||||
// get key per scope
|
||||
String keyPerScopeRole = UtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_HIGHEST_ROLE, scopePerCurrentUrl);
|
||||
String keyPerScopeOrganizations = UtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_ORGANIZATIONS_PUBLISH_KEY, scopePerCurrentUrl);
|
||||
String keyPerScopeGroups = UtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_GROUPS_MEMBER, scopePerCurrentUrl);
|
||||
String keyPerScopeRole = CatalogueUtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_HIGHEST_ROLE, scopePerCurrentUrl);
|
||||
String keyPerScopeOrganizations = CatalogueUtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_ORGANIZATIONS_PUBLISH_KEY, scopePerCurrentUrl);
|
||||
String keyPerScopeGroups = CatalogueUtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_GROUPS_MEMBER, scopePerCurrentUrl);
|
||||
|
||||
// check if this information was already into session(true means the user has at least in one org
|
||||
// the role editor), false that he is just a member so he cannot publish
|
||||
|
|
|
@ -9,7 +9,7 @@ import javax.servlet.http.HttpServletRequest;
|
|||
|
||||
import org.gcube.common.portal.mailing.EmailNotification;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.server.DataCatalogue;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.server.utils.UtilMethods;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.server.utils.CatalogueUtilMethods;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.shared.RolesCkanGroupOrOrg;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.OrganizationBean;
|
||||
import org.gcube.vomanagement.usermanagement.UserManager;
|
||||
|
@ -118,7 +118,7 @@ public class AssociationToGroupAndNotifyThread extends Thread {
|
|||
List<String> adminsEmails = new ArrayList<String>();
|
||||
|
||||
for(int i = 0; i < admins.size(); i++){
|
||||
String convertedName = UtilMethods.fromCKanUsernameToUsername(admins.get(i));
|
||||
String convertedName = CatalogueUtilMethods.fromCKanUsernameToUsername(admins.get(i));
|
||||
admins.set(i, convertedName);
|
||||
}
|
||||
|
||||
|
|
|
@ -11,7 +11,7 @@ import javax.servlet.http.HttpSession;
|
|||
|
||||
import org.gcube.common.scope.api.ScopeProvider;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.server.utils.SessionCatalogueAttributes;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.server.utils.UtilMethods;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.server.utils.CatalogueUtilMethods;
|
||||
import org.gcube.datacatalogue.metadatadiscovery.DataCalogueMetadataFormatReader;
|
||||
import org.gcube.datacatalogue.metadatadiscovery.bean.MetadataProfile;
|
||||
import org.gcube.datacatalogue.metadatadiscovery.bean.jaxb.MetadataField;
|
||||
|
@ -125,7 +125,7 @@ public class MetadataDiscovery {
|
|||
logger.debug("Discovering into scope " + scopeInWhichDiscover);
|
||||
|
||||
// scope in which we need to discover
|
||||
String keyPerScope = UtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_PROFILES_KEY, scopeInWhichDiscover);
|
||||
String keyPerScope = CatalogueUtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_PROFILES_KEY, scopeInWhichDiscover);
|
||||
|
||||
HttpSession httpSession = request.getSession();
|
||||
|
||||
|
|
|
@ -18,7 +18,7 @@ import org.gcube.common.homelibrary.home.workspace.catalogue.WorkspaceCatalogue;
|
|||
import org.gcube.common.homelibrary.home.workspace.folder.FolderItem;
|
||||
import org.gcube.common.homelibrary.home.workspace.folder.items.ExternalUrl;
|
||||
import org.gcube.common.homelibrary.home.workspace.folder.items.GCubeItem;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.server.utils.UtilMethods;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.server.utils.CatalogueUtilMethods;
|
||||
import org.gcube.datacatalogue.ckanutillibrary.shared.ResourceBean;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.DatasetBean;
|
||||
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.ResourceElementBean;
|
||||
|
@ -233,10 +233,10 @@ public class WorkspaceUtils {
|
|||
if(originalItem.isFolder()){
|
||||
copiedFolder = userCatalogue.addWorkspaceItem(folderOrFileId, userCatalogue.getId()); // add to .catalogue root area
|
||||
copiedFolder.setDescription(bean.getDescription());
|
||||
((WorkspaceFolder)copiedFolder).rename(UtilMethods.fromProductTitleToName(bean.getTitle()) + "_" + referenceTime);
|
||||
((WorkspaceFolder)copiedFolder).rename(CatalogueUtilMethods.fromProductTitleToName(bean.getTitle()) + "_" + referenceTime);
|
||||
}
|
||||
else{
|
||||
copiedFolder = userCatalogue.createFolder(UtilMethods.fromProductTitleToName(bean.getTitle()) + "_" + referenceTime, bean.getDescription());
|
||||
copiedFolder = userCatalogue.createFolder(CatalogueUtilMethods.fromProductTitleToName(bean.getTitle()) + "_" + referenceTime, bean.getDescription());
|
||||
}
|
||||
|
||||
// retrieve the children
|
||||
|
|
Loading…
Reference in New Issue