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 java.util.Map;
import org.gcube.portlets.widgets.ckandatapublisherwidget.shared.ResourceElementBean; 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.explore.WorkspaceResourcesExplorerPanel;
import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener; import org.gcube.portlets.widgets.wsexplorer.client.notification.WorkspaceExplorerSelectNotification.WorskpaceExplorerSelectNotificationListener;
import org.gcube.portlets.widgets.wsexplorer.client.view.grid.ItemsTable.DISPLAY_FIELD; 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 //loads the WE only if the root is not null
if(wsFolderId!=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[] displayFields = new DISPLAY_FIELD[] { DISPLAY_FIELD.ICON, DISPLAY_FIELD.NAME,
DISPLAY_FIELD.OWNER, DISPLAY_FIELD.CREATION_DATE}; 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() { WorskpaceExplorerSelectNotificationListener wsResourceExplorerListener = new WorskpaceExplorerSelectNotificationListener() {
@Override @Override

View File

@ -51,8 +51,6 @@ import com.liferay.portal.kernel.log.LogFactoryUtil;
import com.liferay.portal.service.UserLocalServiceUtil; import com.liferay.portal.service.UserLocalServiceUtil;
/** /**
* Server side of the data publisher. * Server side of the data publisher.
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it) * @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
@ -193,6 +191,13 @@ public class CKANPublisherServicesImpl extends RemoteServiceServlet implements C
logger.info("Request for CKAN licenses for scope " + scope); logger.info("Request for CKAN licenses for scope " + scope);
String keyPerScope = CatalogueUtilMethods.concatenateSessionKeyScope(SessionCatalogueAttributes.CKAN_LICENSES_KEY, 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; List<LicenseBean> licensesBean = null;
if(httpSession.getAttribute(keyPerScope) != null){ if(httpSession.getAttribute(keyPerScope) != null){
licensesBean = (List<LicenseBean>)httpSession.getAttribute(keyPerScope); licensesBean = (List<LicenseBean>)httpSession.getAttribute(keyPerScope);

View File

@ -153,6 +153,7 @@ public class WorkspaceUtils {
}else { }else {
//it is a file, removing extension //it is a file, removing extension
int indexOfDot = title.lastIndexOf("."); int indexOfDot = title.lastIndexOf(".");
if(indexOfDot>=0) {
String suffix = title.substring(indexOfDot, title.length()); String suffix = title.substring(indexOfDot, title.length());
if(suffix.length()>=1 && suffix.length()<=4) { if(suffix.length()>=1 && suffix.length()<=4) {
//I'm considering last .suffix as an file extension so removing it. //I'm considering last .suffix as an file extension so removing it.
@ -160,6 +161,7 @@ public class WorkspaceUtils {
bean.setTitle(title); bean.setTitle(title);
} }
} }
}
//Replacing /Home/user.name with "" //Replacing /Home/user.name with ""
String fullPathBase = originalFolderOrFile.getPath(); String fullPathBase = originalFolderOrFile.getPath();