Added feature Upload to Zenodo

This commit is contained in:
Francesco Mangiacrapa 2020-01-21 17:12:29 +01:00
parent 7e64f191c3
commit 4ad00d7340
11 changed files with 29 additions and 23 deletions

View File

@ -5,6 +5,6 @@
<installed facet="wst.jsdt.web" version="1.0"/>
<installed facet="liferay.portlet" version="6.0"/>
<installed facet="com.gwtplugins.gwt.facet" version="1.0"/>
<installed facet="java" version="1.7"/>
<installed facet="jst.jaxrs" version="2.0"/>
<installed facet="java" version="1.7"/>
</faceted-project>

View File

@ -118,6 +118,7 @@
<groupId>org.gcube.portlets.widgets</groupId>
<artifactId>ckan2zenodo-publisher-widget</artifactId>
<version>[0.0.1-SNAPSHOT,1.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<!-- <dependency> -->

View File

@ -25,13 +25,13 @@
<inherits name='org.gcube.datacatalogue.grsf_manage_widget.GRSFManageWidget' />
<inherits name='org.gcube.datacatalogue.ckanutillibrary.CkanUtilLibrary' />
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
<inherits name='org.gcube.portlets.widgets.switchbutton.SwitchButton' />
<inherits name='org.gcube.portlets.widgets.ckan2zenodopublisher.CkanToZenodoPublisher' />
<!-- Specify the app entry point class. -->
<entry-point
class='org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog' />
<entry-point class='org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog' />
<!-- Specify the paths for translatable code -->
<source path='client' />

View File

@ -266,6 +266,7 @@ public class CkanEventHandlerManager {
CkanToZendoPublisherWidget publisherWidget = new CkanToZendoPublisherWidget();
CatalogueItem ci = new CatalogueItem(publishOnZenodoEvent.getUuidItem(), null, CatalogueItem.ITEM_TYPE.DATASET);
publisherWidget.publishOnZenodo(ci);
}
}

View File

@ -94,7 +94,7 @@ public class CkanGroupsPanel extends VerticalPanel{
role.setType(ButtonType.LINK);
role.setText("as " + org.getRole().toString().toLowerCase());
role.addStyleName("button-as-role-style");
role.getElement().getStyle().setProperty("pointer-events", "none");
role.getElement().getStyle().setProperty("pointerEvents", "none");
line.add(role);
ListItem item = new ListItem(line);
list.add(item);

View File

@ -68,7 +68,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
// other stuff
private Button shareLink = new Button("Share Link");
private Button publishOnZenodoLink = new Button("Publish on Zenodo");
private Button uploadToZenodo = new Button("Upload to Zenodo");
private Button insertMeta = new Button("Publish Item");
private Button editMeta = new Button("Edit Item");
private Button manageProduct = new Button("Manage Item");
@ -98,7 +98,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
statistics.setType(ButtonType.LINK);
shareLink.setType(ButtonType.LINK);
publishOnZenodoLink.setType(ButtonType.LINK);
uploadToZenodo.setType(ButtonType.LINK);
insertMeta.setType(ButtonType.LINK);
editMeta.setType(ButtonType.LINK);
manageProduct.setType(ButtonType.PRIMARY);
@ -111,7 +111,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
items.setIcon(IconType.SITEMAP);
types.setIcon(IconType.FILE_TEXT);
shareLink.setIcon(IconType.SHARE);
publishOnZenodoLink.setIcon(IconType.ANCHOR);
uploadToZenodo.setIcon(IconType.CIRCLE_ARROW_UP);
myDatasets.setIcon(IconType.SITEMAP);
myOrganizations.setIcon(IconType.BUILDING);
myGroups.setIcon(IconType.GROUP);
@ -122,7 +122,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
// hide edit and insert
shareLink.setEnabled(false);
publishOnZenodoLink.setEnabled(false);
uploadToZenodo.setEnabled(false);
editMeta.setVisible(false);
insertMeta.setVisible(false);
manageProduct.setVisible(false);
@ -149,7 +149,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
separatorAdminButtons.setVisible(true);
nav.add(separatorAdminButtons);
nav.add(shareLink);
nav.add(publishOnZenodoLink);
nav.add(uploadToZenodo);
nav.add(insertMeta);
nav.add(editMeta);
nav.add(manageProduct);
@ -295,7 +295,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
}
});
publishOnZenodoLink.addClickHandler(new ClickHandler() {
uploadToZenodo.addClickHandler(new ClickHandler() {
@Override
public void onClick(ClickEvent event) {
@ -360,7 +360,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
* @param value the value
*/
public void enablePublishOnZenodoButton(boolean value){
publishOnZenodoLink.setEnabled(value);
uploadToZenodo.setEnabled(value);
}
@ -372,7 +372,7 @@ public class CkanMetadataManagementPanel extends FlowPanel{
separatorMyInfo.setVisible(false);
separatorAdminButtons.setVisible(false);
shareLink.setVisible(false);
publishOnZenodoLink.setVisible(false);
uploadToZenodo.setVisible(false);
insertMeta.setVisible(false);
editMeta.setVisible(false);
myDatasets.setVisible(false);

View File

@ -94,7 +94,7 @@ public class CkanOrganizationsPanel extends VerticalPanel{
role.setType(ButtonType.LINK);
role.setText("as Catalogue-" + org.getRole().toString().toLowerCase());
role.addStyleName("button-as-role-style");
role.getElement().getStyle().setProperty("pointer-events", "none");
role.getElement().getStyle().setProperty("pointerEvents", "none");
line.add(role);
ListItem item = new ListItem(line);
list.add(item);

View File

@ -542,9 +542,12 @@ public class GcubeCkanDataCatalogServiceImpl extends RemoteServiceServlet implem
try{
if(!SessionUtil.isIntoPortal()){
enabled = true;
logger.warn("Enabling View per VRE in DEV mode");
return "/organization_vre/" + scopePerCurrentUrl.substring(scopePerCurrentUrl.lastIndexOf("/")+1,scopePerCurrentUrl.length()).toLowerCase(); //is the VRE name
enabled = false;
logger.warn("Enabling View per VRE in DEV mode? "+enabled);
if(enabled)
return "/organization_vre/" + scopePerCurrentUrl.substring(scopePerCurrentUrl.lastIndexOf("/")+1,scopePerCurrentUrl.length()).toLowerCase(); //is the VRE name
return null;
}
GroupManager gm = new LiferayGroupManager();

View File

@ -25,12 +25,13 @@
<inherits name='org.gcube.datacatalogue.grsf_manage_widget.GRSFManageWidget' />
<inherits name='org.gcube.datacatalogue.ckanutillibrary.CkanUtilLibrary' />
<inherits name='org.gcube.portlets.user.gcubewidgets.WidgetFactory' />
<inherits name='org.gcube.portlets.widgets.switchbutton.SwitchButton' />
<inherits name='org.gcube.portlets.widgets.ckan2zenodopublisher.CkanToZenodoPublisher' />
<!-- Specify the app entry point class. -->
<entry-point
class='org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog' />
<entry-point class='org.gcube.portlets.gcubeckan.gcubeckandatacatalog.client.GCubeCkanDataCatalog' />
<!-- Specify the paths for translatable code -->
<source path='client' />

View File

@ -26,8 +26,8 @@
<script type="text/javascript"
src="<%=request.getContextPath()%>/gCubeCkanDataCatalog/gCubeCkanDataCatalog.nocache.js"></script>
<script type="text/javascript"
src='<%=request.getContextPath()%>/js/jquery.min.js'></script>
<!-- <script type="text/javascript" -->
<%-- src='<%=request.getContextPath()%>/js/jquery.min.js'></script> --%>
<script type="text/javascript"
src='<%=request.getContextPath()%>/js/jquery.autosize.js'></script>

View File

@ -55,7 +55,7 @@
<servlet-class>org.gcube.portlets_widgets.catalogue_sharing_widget.server.ShareServicesImpl</servlet-class>
</servlet>
<!-- Servlets -->
<!-- Servlets -->
<servlet>
<servlet-name>ckanToZenodoServlet</servlet-name>
<servlet-class>org.gcube.portlets.widgets.ckan2zenodopublisher.server.CkanToZenodoPublisherServiceImpl</servlet-class>