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="wst.jsdt.web" version="1.0"/>
<installed facet="liferay.portlet" version="6.0"/> <installed facet="liferay.portlet" version="6.0"/>
<installed facet="com.gwtplugins.gwt.facet" version="1.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="jst.jaxrs" version="2.0"/>
<installed facet="java" version="1.7"/>
</faceted-project> </faceted-project>

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -26,8 +26,8 @@
<script type="text/javascript" <script type="text/javascript"
src="<%=request.getContextPath()%>/gCubeCkanDataCatalog/gCubeCkanDataCatalog.nocache.js"></script> src="<%=request.getContextPath()%>/gCubeCkanDataCatalog/gCubeCkanDataCatalog.nocache.js"></script>
<script type="text/javascript" <!-- <script type="text/javascript" -->
src='<%=request.getContextPath()%>/js/jquery.min.js'></script> <%-- src='<%=request.getContextPath()%>/js/jquery.min.js'></script> --%>
<script type="text/javascript" <script type="text/javascript"
src='<%=request.getContextPath()%>/js/jquery.autosize.js'></script> 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-class>org.gcube.portlets_widgets.catalogue_sharing_widget.server.ShareServicesImpl</servlet-class>
</servlet> </servlet>
<!-- Servlets --> <!-- Servlets -->
<servlet> <servlet>
<servlet-name>ckanToZenodoServlet</servlet-name> <servlet-name>ckanToZenodoServlet</servlet-name>
<servlet-class>org.gcube.portlets.widgets.ckan2zenodopublisher.server.CkanToZenodoPublisherServiceImpl</servlet-class> <servlet-class>org.gcube.portlets.widgets.ckan2zenodopublisher.server.CkanToZenodoPublisherServiceImpl</servlet-class>