bug fixes. Starting integration with new Workspace Explorer constructor

This commit is contained in:
Francesco Mangiacrapa 2021-03-25 17:59:49 +01:00
parent 41a287ee1f
commit 0dbd890dda
3 changed files with 17 additions and 9 deletions

View File

@ -6,6 +6,7 @@ import java.util.List;
import java.util.Map;
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.ResourceElementBean;
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesEnhancedExplorerPanel;
import org.gcube.portlets.widgets.wsexplorer.client.explore.WorkspaceResourcesExplorerPanel;
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
import org.gcube.portlets.widgets.wsexplorer.client.view.grid.ItemsTable.DISPLAY_FIELD;
@ -107,7 +108,7 @@ public class SelectResourceByWEMainPanel extends Composite {
}
}
wsFolderId = initialBean.getRootIdInWorkspace()!=null?initialBean.getRootIdInWorkspace():wsFolderId;
//wsFolderId = initialBean.getRootIdInWorkspace()!=null?initialBean.getRootIdInWorkspace():wsFolderId;
//loads the WE only if the root is not null
if(wsFolderId!=null) {
@ -115,7 +116,7 @@ public class SelectResourceByWEMainPanel extends Composite {
DISPLAY_FIELD[] displayFields = new DISPLAY_FIELD[] { DISPLAY_FIELD.ICON, DISPLAY_FIELD.NAME,
DISPLAY_FIELD.OWNER, DISPLAY_FIELD.CREATION_DATE};
WorkspaceResourcesExplorerPanel workspaceExplorerPanel = new WorkspaceResourcesExplorerPanel(wsFolderId,false,null, null,false,null,displayFields);
WorkspaceResourcesEnhancedExplorerPanel workspaceExplorerPanel = new WorkspaceResourcesEnhancedExplorerPanel(wsFolderId,false,null, null,false,null,displayFields);
WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
@Override

View File

@ -51,8 +51,6 @@ import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.service.UserLocalServiceUtil;
/**
* Server side of the data publisher.
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
@ -192,6 +190,13 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
String scope = GenericUtils.getScopeFromClientUrl(getThreadLocalRequest());
logger.info("Request for CKAN licenses for scope " + scope);
String keyPerScope = CatalogueUtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_LICENSES_KEY, scope);
// if(!isWithinPortal()){
// logger.info("DEV MODE returning funny licenses...");
// List<LicenseBean> licenses = new ArrayList<LicenseBean>();
// licenses.add(new LicenseBean("AFL-3.0", "https://opensource.org/licenses/AFL-3.0"));
// return licenses;
// }
List<LicenseBean> licensesBean = null;
if(httpSession.getAttribute(keyPerScope) != null){

View File

@ -153,11 +153,13 @@ public class WorkspaceUtils {
}else {
//it is a file, removing extension
int indexOfDot = title.lastIndexOf(".");
String suffix = title.substring(indexOfDot, title.length());
if(suffix.length()>=1 && suffix.length()<=4) {
//I'm considering last .suffix as an file extension so removing it.
title = title.substring(0,indexOfDot);
bean.setTitle(title);
if(indexOfDot>=0) {
String suffix = title.substring(indexOfDot, title.length());
if(suffix.length()>=1 && suffix.length()<=4) {
//I'm considering last .suffix as an file extension so removing it.
title = title.substring(0,indexOfDot);
bean.setTitle(title);
}
}
}