69 lines
1.8 KiB
Java
69 lines
1.8 KiB
Java
package org.gcube.portlets.widgets.ckancontentmoderator.client;
|
|
|
|
import org.gcube.datacatalogue.utillibrary.shared.ItemStatus;
|
|
import org.gcube.portlets.widgets.ckancontentmoderator.client.ui.table.ItemsTable.DISPLAY_FIELD;
|
|
|
|
import com.google.gwt.user.client.Command;
|
|
import com.google.gwt.user.client.ui.ComplexPanel;
|
|
import com.google.gwt.user.client.ui.Composite;
|
|
|
|
/**
|
|
* The Class CkanContentModeratorWidget.
|
|
*
|
|
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
|
*
|
|
* Jun 15, 2021
|
|
*/
|
|
public class CkanContentModeratorWidget {
|
|
|
|
CkanContentModeratorWidgetController cmsController;
|
|
|
|
/**
|
|
* Instantiates a new ckan content moderator widget.
|
|
*
|
|
* @param status the status
|
|
* @param displayFields the display fields
|
|
* @param sortByField the sort by field
|
|
*/
|
|
public CkanContentModeratorWidget(ItemStatus status, DISPLAY_FIELD[] displayFields, DISPLAY_FIELD sortByField) {
|
|
cmsController = new CkanContentModeratorWidgetController(status, displayFields, sortByField);
|
|
|
|
try {
|
|
cmsController.checkContentModeratorConfiguration(null);
|
|
} catch (Exception e) {
|
|
// TODO Auto-generated catch block
|
|
e.printStackTrace();
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Checks if is content moderator enabled.
|
|
*
|
|
* @return true, if is content moderator enabled
|
|
* @throws Exception the exception
|
|
*/
|
|
public boolean isContentModeratorEnabled() throws Exception {
|
|
return cmsController.isContentModeratorEnabled();
|
|
}
|
|
|
|
/**
|
|
* Check content moderator configuration.
|
|
*
|
|
* @param onSuccess the on success
|
|
* @throws Exception the exception
|
|
*/
|
|
public void checkContentModeratorConfiguration(final Command onSuccess) throws Exception {
|
|
cmsController.checkContentModeratorConfiguration(onSuccess);
|
|
|
|
}
|
|
|
|
/**
|
|
* Gets the panel.
|
|
*
|
|
* @return the panel
|
|
*/
|
|
public ComplexPanel getPanel() {
|
|
return cmsController.getMainPanel();
|
|
}
|
|
}
|