in progress

This commit is contained in:
Francesco Mangiacrapa 2021-06-14 11:27:53 +02:00
parent 53df376b96
commit f99b5b9fb3
9 changed files with 125 additions and 174 deletions

View File

@ -2,7 +2,7 @@ package org.gcube.portlets.widgets.ckancontentmoderator.client;
import java.util.List;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CkanDataset;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CatalogueDataset;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.ItemStatus;
import com.google.gwt.user.client.rpc.RemoteService;
@ -18,7 +18,7 @@ public interface CkanContentModeratorService extends RemoteService {
public void setStatus(String itemId, ItemStatus theStatus);
public List<CkanDataset> getListItemsForStatus(ItemStatus theStatus);
public List<CatalogueDataset> getListItemsForStatus(ItemStatus theStatus);
public void approveItem(String itemId);

View File

@ -2,7 +2,7 @@ package org.gcube.portlets.widgets.ckancontentmoderator.client;
import java.util.List;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CkanDataset;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CatalogueDataset;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.ItemStatus;
import com.google.gwt.user.client.rpc.AsyncCallback;
@ -13,7 +13,7 @@ public interface CkanContentModeratorServiceAsync {
void approveItem(String itemId, AsyncCallback<Void> callback);
void getListItemsForStatus(ItemStatus theStatus, AsyncCallback<List<CkanDataset>> callback);
void getListItemsForStatus(ItemStatus theStatus, AsyncCallback<List<CatalogueDataset>> callback);
void permanentlyDelete(String itemId, AsyncCallback<Void> callback);

View File

@ -4,7 +4,7 @@ import java.util.List;
import org.gcube.portlets.widgets.ckancontentmoderator.client.material.table.CustomizedView;
import org.gcube.portlets.widgets.ckancontentmoderator.client.resources.DataTableClientBundle;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CkanDataset;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CatalogueDataset;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.ItemStatus;
import com.google.gwt.core.client.EntryPoint;
@ -45,10 +45,10 @@ public class CkanContentModeratorWidget implements EntryPoint {
RootPanel.get().add(cvTable);
// table.getView().refresh();
greetingService.getListItemsForStatus(ItemStatus.PENDING, new AsyncCallback<List<CkanDataset>>() {
greetingService.getListItemsForStatus(ItemStatus.PENDING, new AsyncCallback<List<CatalogueDataset>>() {
@Override
public void onSuccess(List<CkanDataset> result) {
public void onSuccess(List<CatalogueDataset> result) {
cvTable.setData(result);
}

View File

@ -2,7 +2,7 @@ package org.gcube.portlets.widgets.ckancontentmoderator.client.material.table;
import java.util.List;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CkanDataset;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CatalogueDataset;
import com.google.gwt.core.client.GWT;
import com.google.gwt.uibinder.client.UiBinder;
@ -21,10 +21,10 @@ public class CustomizedView extends Composite {
}
private static CustomizedViewUiBinder uiBinder = GWT.create(CustomizedViewUiBinder.class);
private List<CkanDataset> users;
private List<CatalogueDataset> users;
@UiField
MaterialDataTable<CkanDataset> table;
MaterialDataTable<CatalogueDataset> table;
public CustomizedView() {
@ -81,9 +81,9 @@ public class CustomizedView extends Composite {
// }
// });
table.addColumn("Title", new gwt.material.design.client.ui.table.cell.TextColumn<CkanDataset>() {
table.addColumn("Title", new gwt.material.design.client.ui.table.cell.TextColumn<CatalogueDataset>() {
@Override
public String getValue(CkanDataset object) {
public String getValue(CatalogueDataset object) {
return object.getTitle();
}
@ -104,9 +104,9 @@ public class CustomizedView extends Composite {
// }
// }).width(200);
table.addColumn("Author", new gwt.material.design.client.ui.table.cell.TextColumn<CkanDataset>() {
table.addColumn("Author", new gwt.material.design.client.ui.table.cell.TextColumn<CatalogueDataset>() {
@Override
public String getValue(CkanDataset object) {
public String getValue(CatalogueDataset object) {
return object.getAuthor();
}
@Override
@ -115,19 +115,19 @@ public class CustomizedView extends Composite {
}
});
table.addRowSelectHandler(new RowSelectHandler<CkanDataset>() {
table.addRowSelectHandler(new RowSelectHandler<CatalogueDataset>() {
@Override
public void onRowSelect(RowSelectEvent<CkanDataset> event) {
public void onRowSelect(RowSelectEvent<CatalogueDataset> event) {
log("RowSelectEvent", event.getModel().getName() + ": " + event.isSelected());
}
});
table.addColumnSortHandler(new ColumnSortHandler<CkanDataset>() {
table.addColumnSortHandler(new ColumnSortHandler<CatalogueDataset>() {
@Override
public void onColumnSort(gwt.material.design.client.data.events.ColumnSortEvent<CkanDataset> event) {
public void onColumnSort(gwt.material.design.client.data.events.ColumnSortEvent<CatalogueDataset> event) {
log("ColumnSortEvent",
"Sorted: " + event.getSortContext().getSortDir() + ", columnIndex: " + event.getColumnIndex());
table.getView().refresh();
@ -183,7 +183,7 @@ public class CustomizedView extends Composite {
}
public void setData(List<CkanDataset> users) {
public void setData(List<CatalogueDataset> users) {
this.users = users;
// Customized Table Scaffolding elements
table.getTableTitle().setText("Customers");

View File

@ -0,0 +1,42 @@
package org.gcube.portlets.widgets.ckancontentmoderator.server;
import java.util.function.Function;
import org.gcube.datacatalogue.utillibrary.shared.jackan.model.CkanDataset;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CatalogueDataset;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
public class CatalogueBeansConverter {
private static Logger LOG = LoggerFactory.getLogger(CatalogueBeansConverter.class);
/** The to S sync folder descriptor. */
public static Function<CkanDataset, CatalogueDataset> toCatalogueDataset = new Function<CkanDataset, CatalogueDataset>() {
public CatalogueDataset apply(CkanDataset t) {
CatalogueDataset myDataset = new CatalogueDataset();
if (t == null) {
LOG.info("Input " + CkanDataset.class.getSimpleName() + " is null, returning empty "
+ CkanDataset.class.getSimpleName());
return myDataset;
}
myDataset.setAuthor(t.getAuthor());
myDataset.setAuthorEmail(t.getAuthorEmail());
myDataset.setCkanDatasetURL(null);
myDataset.setId(t.getId());
myDataset.setLicenseId(t.getLicenseId());
myDataset.setMaintainer(t.getMaintainer());
myDataset.setMaintainerEmail(t.getMaintainerEmail());
myDataset.setName(t.getName());
myDataset.setNotes(t.getNotes());
myDataset.setOwnerOrg(t.getOwnerOrg());
myDataset.setTitle(t.getTitle());
myDataset.setType(t.getType());
myDataset.setUrl(t.getUrl());
return myDataset;
}
};
}

View File

@ -6,7 +6,7 @@ import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.scope.api.ScopeProvider;
import org.gcube.gcat.client.Item;
import org.gcube.portlets.widgets.ckancontentmoderator.client.CkanContentModeratorService;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CkanDataset;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CatalogueDataset;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.ItemStatus;
import org.gcube.vomanagement.usermanagement.model.GCubeUser;
import org.slf4j.Logger;
@ -18,10 +18,10 @@ import com.google.gwt.user.server.rpc.RemoteServiceServlet;
* The server side implementation of the RPC service.
*/
@SuppressWarnings("serial")
public class CkanContentModeratorServiceAImpl extends RemoteServiceServlet implements
public class CkanContentModeratorServiceImpl extends RemoteServiceServlet implements
CkanContentModeratorService, ContentModeratorSystem {
private static Logger LOG = LoggerFactory.getLogger(CkanContentModeratorServiceAImpl.class);
private static Logger LOG = LoggerFactory.getLogger(CkanContentModeratorServiceImpl.class);
@Override
public boolean isContentModeratorEnabled() {
@ -36,7 +36,7 @@ public class CkanContentModeratorServiceAImpl extends RemoteServiceServlet imple
}
@Override
public List<CkanDataset> getListItemsForStatus(ItemStatus theStatus) {
public List<CatalogueDataset> getListItemsForStatus(ItemStatus theStatus) {
LOG.info("Called getListItemsForStatus: "+theStatus);
try {

View File

@ -2,7 +2,7 @@ package org.gcube.portlets.widgets.ckancontentmoderator.server;
import java.util.List;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CkanDataset;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.CatalogueDataset;
import org.gcube.portlets.widgets.ckancontentmoderator.shared.ItemStatus;
/**
@ -36,7 +36,7 @@ public interface ContentModeratorSystem {
* @param theStatus the the status
* @return the list items for status
*/
List<CkanDataset> getListItemsForStatus(ItemStatus theStatus);
List<CatalogueDataset> getListItemsForStatus(ItemStatus theStatus);
/**
* Approve item.

View File

@ -4,14 +4,15 @@ import java.io.Serializable;
import com.google.gwt.user.client.rpc.IsSerializable;
// TODO: Auto-generated Javadoc
/**
* The Class CkanDataset.
* The Class CatalogueDataset.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jun 1, 2021
* Jun 14, 2021
*/
public class CkanDataset implements Serializable, IsSerializable{
public class CatalogueDataset implements Serializable, IsSerializable {
/**
*
@ -26,274 +27,174 @@ public class CkanDataset implements Serializable, IsSerializable{
private String name;
private String notes;
private String ownerOrg;
//private ItemStatus state;
private ItemStatus status;
private String title;
private String type;
private String url;
private String version;
private String ckanDatasetURL;
/**
* Instantiates a new ckan dataset base.
*/
public CkanDataset() {
public CatalogueDataset() {
}
/**
* Gets the author.
*
* @return the author
*/
public String getAuthor() {
return author;
}
/**
* Gets the author email.
*
* @return the author email
*/
public String getAuthorEmail() {
return authorEmail;
}
/**
* Gets the id.
*
* @return the id
*/
public String getId() {
return id;
}
/**
* Gets the license id.
*
* @return the license id
*/
public String getLicenseId() {
return licenseId;
}
/**
* Gets the maintainer.
*
* @return the maintainer
*/
public String getMaintainer() {
return maintainer;
}
/**
* Gets the maintainer email.
*
* @return the maintainer email
*/
public String getMaintainerEmail() {
return maintainerEmail;
}
/**
* Gets the name.
*
* @return the name
*/
public String getName() {
return name;
}
/**
* Gets the notes.
*
* @return the notes
*/
public String getNotes() {
return notes;
}
/**
* Gets the owner org.
*
* @return the owner org
*/
public String getOwnerOrg() {
return ownerOrg;
}
public ItemStatus getStatus() {
return status;
}
/**
* Gets the title.
*
* @return the title
*/
public String getTitle() {
return title;
}
/**
* Gets the type.
*
* @return the type
*/
public String getType() {
return type;
}
/**
* Gets the url.
*
* @return the url
*/
public String getUrl() {
return url;
}
/**
* Gets the version.
*
* @return the version
*/
public String getVersion() {
return version;
}
/**
* Gets the ckan dataset URL.
*
* @return the ckan dataset URL
*/
public String getCkanDatasetURL() {
return ckanDatasetURL;
}
/**
* Sets the author.
*
* @param author the new author
*/
public void setAuthor(String author) {
this.author = author;
}
/**
* Sets the author email.
*
* @param authorEmail the new author email
*/
public void setAuthorEmail(String authorEmail) {
this.authorEmail = authorEmail;
}
/**
* Sets the id.
*
* @param id the new id
*/
public void setId(String id) {
this.id = id;
}
/**
* Sets the license id.
*
* @param licenseId the new license id
*/
public void setLicenseId(String licenseId) {
this.licenseId = licenseId;
}
/**
* Sets the maintainer.
*
* @param maintainer the new maintainer
*/
public void setMaintainer(String maintainer) {
this.maintainer = maintainer;
}
/**
* Sets the maintainer email.
*
* @param maintainerEmail the new maintainer email
*/
public void setMaintainerEmail(String maintainerEmail) {
this.maintainerEmail = maintainerEmail;
}
/**
* Sets the name.
*
* @param name the new name
*/
public void setName(String name) {
this.name = name;
}
/**
* Sets the notes.
*
* @param notes the new notes
*/
public void setNotes(String notes) {
this.notes = notes;
}
/**
* Sets the owner org.
*
* @param ownerOrg the new owner org
*/
public void setOwnerOrg(String ownerOrg) {
this.ownerOrg = ownerOrg;
}
public void setStatus(ItemStatus status) {
this.status = status;
}
/**
* Sets the title.
*
* @param title the new title
*/
public void setTitle(String title) {
this.title = title;
}
/**
* Sets the type.
*
* @param type the new type
*/
public void setType(String type) {
this.type = type;
}
/**
* Sets the url.
*
* @param url the new url
*/
public void setUrl(String url) {
this.url = url;
}
/**
* Sets the version.
*
* @param version the new version
*/
public void setVersion(String version) {
this.version = version;
}
/**
* Sets the ckan dataset URL.
*
* @param ckanDatasetURL the new ckan dataset URL
*/
public void setCkanDatasetURL(String ckanDatasetURL) {
this.ckanDatasetURL = ckanDatasetURL;
}
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("CatalogueDataset [author=");
builder.append(author);
builder.append(", authorEmail=");
builder.append(authorEmail);
builder.append(", id=");
builder.append(id);
builder.append(", licenseId=");
builder.append(licenseId);
builder.append(", maintainer=");
builder.append(maintainer);
builder.append(", maintainerEmail=");
builder.append(maintainerEmail);
builder.append(", name=");
builder.append(name);
builder.append(", notes=");
builder.append(notes);
builder.append(", ownerOrg=");
builder.append(ownerOrg);
builder.append(", status=");
builder.append(status);
builder.append(", title=");
builder.append(title);
builder.append(", type=");
builder.append(type);
builder.append(", url=");
builder.append(url);
builder.append(", version=");
builder.append(version);
builder.append(", ckanDatasetURL=");
builder.append(ckanDatasetURL);
builder.append("]");
return builder.toString();
}
}

8
src/test/resources/.gitignore vendored Normal file
View File

@ -0,0 +1,8 @@
/devNext.gcubekey
/devVRE.gcubekey
/devsec.gcubekey
/gCubeApps.gcubekey
/gcube.gcubekey
/log4j.properties
/pred4s.gcubekey
/preprod.gcubekey