ckan-content-moderator-widget/src/main/java/org/gcube/portlets/widgets/ckancontentmoderator/client/CkanContentModeratorWidget....

69 lines
1.8 KiB
Java
Raw Normal View History

2021-05-06 17:48:18 +02:00
package org.gcube.portlets.widgets.ckancontentmoderator.client;
2021-06-14 17:39:44 +02:00
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.table.ItemsTable.DISPLAY_FIELD;
2021-06-01 13:24:09 +02:00
2021-06-15 16:52:27 +02:00
import com.google.gwt.user.client.Command;
2021-06-21 15:35:47 +02:00
import com.google.gwt.user.client.ui.ComplexPanel;
2021-06-16 11:25:49 +02:00
import com.google.gwt.user.client.ui.Composite;
2021-06-01 13:24:09 +02:00
2021-05-06 17:48:18 +02:00
/**
2021-06-15 16:52:27 +02:00
* The Class CkanContentModeratorWidget.
*
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
*
* Jun 15, 2021
2021-05-06 17:48:18 +02:00
*/
public class CkanContentModeratorWidget {
2021-06-18 12:10:49 +02:00
CkanContentModeratorWidgetController cmsController;
2021-06-15 16:52:27 +02:00
/**
* Instantiates a new ckan content moderator widget.
*
2021-06-18 12:10:49 +02:00
* @param status the status
2021-06-15 16:52:27 +02:00
* @param displayFields the display fields
* @param sortByField the sort by field
*/
public CkanContentModeratorWidget(ItemStatus status, DISPLAY_FIELD[] displayFields, DISPLAY_FIELD sortByField) {
2021-06-18 12:10:49 +02:00
cmsController = new CkanContentModeratorWidgetController(status, displayFields, sortByField);
2021-06-15 16:52:27 +02:00
2021-06-18 12:10:49 +02:00
try {
cmsController.checkContentModeratorConfiguration(null);
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
}
2021-06-15 16:52:27 +02:00
/**
* Checks if is content moderator enabled.
*
2021-06-18 12:10:49 +02:00
* @return true, if is content moderator enabled
* @throws Exception the exception
2021-06-15 16:52:27 +02:00
*/
2021-06-18 12:10:49 +02:00
public boolean isContentModeratorEnabled() throws Exception {
return cmsController.isContentModeratorEnabled();
}
2021-06-15 16:52:27 +02:00
2021-06-18 12:10:49 +02:00
/**
* Check content moderator configuration.
*
* @param onSuccess the on success
* @throws Exception the exception
*/
public void checkContentModeratorConfiguration(final Command onSuccess) throws Exception {
cmsController.checkContentModeratorConfiguration(onSuccess);
2021-06-15 16:52:27 +02:00
}
2021-06-15 18:36:28 +02:00
2021-06-18 12:10:49 +02:00
/**
* Gets the panel.
*
* @return the panel
*/
2021-06-21 15:35:47 +02:00
public ComplexPanel getPanel() {
2021-06-18 12:10:49 +02:00
return cmsController.getMainPanel();
2021-05-26 17:58:12 +02:00
}
2021-05-06 17:48:18 +02:00
}