Integrated the Workflow Action Panel
This commit is contained in:
parent
e31c7138a4
commit
28277db942
|
@ -18,6 +18,10 @@ import com.google.gwt.core.client.GWT;
|
|||
* Aug 6, 2021
|
||||
*/
|
||||
public class ConstantsGeoPortalDataEntryApp {
|
||||
|
||||
public static final String DIV_PORTLET_ID = "geoportal-data-entry";
|
||||
|
||||
public static final String DIV_LOADERS_ID = "geoportal-loaders";
|
||||
|
||||
public static final String DATE_FORMAT = ConstantsMPFormBuilder.DATE_FORMAT;
|
||||
|
||||
|
|
|
@ -9,6 +9,7 @@ import java.util.TreeMap;
|
|||
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ConfigurationDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.card.GeoNaFormCardModel;
|
||||
|
||||
import com.google.gwt.core.client.GWT;
|
||||
|
@ -25,8 +26,10 @@ public class GeoPortalClientCaches {
|
|||
private TreeMap<String, List<GeoNaFormCardModel>> mapGcubeProfilePerItemType;
|
||||
|
||||
private Map<String, List<ConfigurationDV<?>>> mapHandlersConfigurationsForProfileId;
|
||||
|
||||
private Map<String, UseCaseDescriptorDV> mapUseCaseDescriptor;
|
||||
|
||||
private Map<String, CacheSearchingFilterParametersFromConfig> mapSearchingFitlerParametersorForProfileId;
|
||||
private Map<String, CacheSearchingFilterParametersFromConfig> mapSearchingFilterParametersForProfileId;
|
||||
|
||||
/**
|
||||
* Instantiates a new geo portal client caches.
|
||||
|
@ -34,7 +37,8 @@ public class GeoPortalClientCaches {
|
|||
public GeoPortalClientCaches() {
|
||||
mapGcubeProfilePerItemType = new TreeMap<String, List<GeoNaFormCardModel>>();
|
||||
mapHandlersConfigurationsForProfileId = new HashMap<String, List<ConfigurationDV<?>>>();
|
||||
mapSearchingFitlerParametersorForProfileId = new HashMap<String, GeoPortalClientCaches.CacheSearchingFilterParametersFromConfig>();
|
||||
mapSearchingFilterParametersForProfileId = new HashMap<String, GeoPortalClientCaches.CacheSearchingFilterParametersFromConfig>();
|
||||
mapUseCaseDescriptor = new HashMap<String, UseCaseDescriptorDV>();
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -47,6 +51,26 @@ public class GeoPortalClientCaches {
|
|||
mapHandlersConfigurationsForProfileId.put(profileId, lsitConfigurations);
|
||||
}
|
||||
|
||||
/**
|
||||
* Put UCD for profile id.
|
||||
*
|
||||
* @param profileID the profile ID
|
||||
* @param ucdDV the ucd DV
|
||||
*/
|
||||
public void putUCDForProfileId(String profileID, UseCaseDescriptorDV ucdDV) {
|
||||
mapUseCaseDescriptor.put(profileID, ucdDV);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the UCD for profile ID.
|
||||
*
|
||||
* @param profileID the profile ID
|
||||
* @return the UCD for profile ID
|
||||
*/
|
||||
public UseCaseDescriptorDV getUCDForProfileID(String profileID){
|
||||
return mapUseCaseDescriptor.get(profileID);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the handler configurations for profile id.
|
||||
*
|
||||
|
@ -77,10 +101,16 @@ public class GeoPortalClientCaches {
|
|||
return mapGcubeProfilePerItemType.get(itemType);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the filter parameters for profile id.
|
||||
*
|
||||
* @param profileID the profile ID
|
||||
* @return the filter parameters for profile id
|
||||
*/
|
||||
public CacheSearchingFilterParametersFromConfig getFilterParametersForProfileId(String profileID) {
|
||||
GWT.log("getFilterParametersForProfileId for: " + profileID);
|
||||
|
||||
CacheSearchingFilterParametersFromConfig searchingFilterParameters = mapSearchingFitlerParametersorForProfileId
|
||||
CacheSearchingFilterParametersFromConfig searchingFilterParameters = mapSearchingFilterParametersForProfileId
|
||||
.get(profileID);
|
||||
|
||||
if (searchingFilterParameters == null) {
|
||||
|
@ -121,12 +151,15 @@ public class GeoPortalClientCaches {
|
|||
}
|
||||
}
|
||||
|
||||
mapSearchingFitlerParametersorForProfileId.put(profileID, searchingFilterParameters);
|
||||
mapSearchingFilterParametersForProfileId.put(profileID, searchingFilterParameters);
|
||||
}
|
||||
|
||||
return searchingFilterParameters;
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the cache handler configurations.
|
||||
*/
|
||||
// DEBUGGING
|
||||
public void printCacheHandlerConfigurations() {
|
||||
GWT.log("print - mapHandlersConfigurationsForProfileId is:");
|
||||
|
@ -135,6 +168,9 @@ public class GeoPortalClientCaches {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Prints the cache gcube profile per item type.
|
||||
*/
|
||||
// DEBUGGING
|
||||
public void printCacheGcubeProfilePerItemType() {
|
||||
GWT.log("print - mapGcubeProfilePerItemType is:");
|
||||
|
@ -143,6 +179,13 @@ public class GeoPortalClientCaches {
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* The Class CacheSearchingFilterParametersFromConfig.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Sep 13, 2022
|
||||
*/
|
||||
public class CacheSearchingFilterParametersFromConfig {
|
||||
|
||||
List<ItemFieldDV> displayFields;
|
||||
|
@ -152,6 +195,9 @@ public class GeoPortalClientCaches {
|
|||
// The projection
|
||||
LinkedHashMap<String, Object> projection;
|
||||
|
||||
/**
|
||||
* Instantiates a new cache searching filter parameters from config.
|
||||
*/
|
||||
public CacheSearchingFilterParametersFromConfig() {
|
||||
displayFields = new ArrayList<ItemFieldDV>();
|
||||
searchByFields = new ArrayList<ItemFieldDV>();
|
||||
|
@ -159,34 +205,75 @@ public class GeoPortalClientCaches {
|
|||
projection = new LinkedHashMap<String, Object>();
|
||||
}
|
||||
|
||||
/**
|
||||
* Put mongo projection.
|
||||
*
|
||||
* @param keyField the key field
|
||||
* @param value the value
|
||||
*/
|
||||
public void putMongoProjection(String keyField, Object value) {
|
||||
projection.put(keyField, value);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the display field.
|
||||
*
|
||||
* @param itemField the item field
|
||||
*/
|
||||
public void addDisplayField(ItemFieldDV itemField) {
|
||||
displayFields.add(itemField);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the search by field.
|
||||
*
|
||||
* @param itemField the item field
|
||||
*/
|
||||
public void addSearchByField(ItemFieldDV itemField) {
|
||||
searchByFields.add(itemField);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds the order by field.
|
||||
*
|
||||
* @param itemField the item field
|
||||
*/
|
||||
public void addOrderByField(ItemFieldDV itemField) {
|
||||
orderByFields.add(itemField);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the display fields.
|
||||
*
|
||||
* @return the display fields
|
||||
*/
|
||||
public List<ItemFieldDV> getDisplayFields() {
|
||||
return displayFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the search by fields.
|
||||
*
|
||||
* @return the search by fields
|
||||
*/
|
||||
public List<ItemFieldDV> getSearchByFields() {
|
||||
return searchByFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the order by fields.
|
||||
*
|
||||
* @return the order by fields
|
||||
*/
|
||||
public List<ItemFieldDV> getOrderByFields() {
|
||||
return orderByFields;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the projection.
|
||||
*
|
||||
* @return the projection
|
||||
*/
|
||||
public LinkedHashMap<String, Object> getProjection() {
|
||||
return projection;
|
||||
}
|
||||
|
|
|
@ -19,13 +19,12 @@ import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
|||
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclarationDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_PERFORMED_ON_ITEM;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.RECORD_TYPE;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalClientCaches.CacheSearchingFilterParametersFromConfig;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.OperationPerformedOnItemEvent;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.OperationPerformedOnItemEventHandler;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.ClickItemEvent;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.ClickItemEventHandler;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.CreateNewProjectEvent;
|
||||
|
@ -34,10 +33,14 @@ import org.gcube.portlets.user.geoportaldataentry.client.events.GetListOfRecords
|
|||
import org.gcube.portlets.user.geoportaldataentry.client.events.GetListOfRecordsEventHandler;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.OperationOnItemEvent;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.OperationOnItemEventHandler;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.OperationPerformedOnItemEvent;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.OperationPerformedOnItemEventHandler;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.SaveGeonaDataFormsEvent;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.SaveGeonaDataFormsHandler;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.TreeItemEvent;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.TreeItemEventHandler;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.WorkflowActionOnSelectedItemEvent;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.WorkflowActionOnSelectedItemEventHandler;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.resource.Images;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaMainTabPanel;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.ui.GeonaRecordsPaginatedView;
|
||||
|
@ -100,8 +103,6 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
private static final String SERVER_ERROR = "An error occurred while "
|
||||
+ "attempting to contact the server. Please check your network " + "connection and try again.";
|
||||
|
||||
public static final String DIV_PORTLET_ID = "geoportal-data-entry";
|
||||
|
||||
public static final GeoportalDataEntryServiceAsync geoportalDataEntryService = GWT
|
||||
.create(GeoportalDataEntryService.class);
|
||||
|
||||
|
@ -178,13 +179,15 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
*/
|
||||
geoportalCaches = new GeoPortalClientCaches();
|
||||
|
||||
RootPanel.get(DIV_PORTLET_ID).add(loaderApplication);
|
||||
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).add(loaderApplication);
|
||||
|
||||
mainTabPanel = new GeonaMainTabPanel(appManagerBus);
|
||||
geoNaMainForm = new GeonaDataEntryMainForm(appManagerBus);
|
||||
mainTabPanel.addFormPanel(geoNaMainForm);
|
||||
|
||||
RootPanel.get(DIV_PORTLET_ID).add(mainTabPanel);
|
||||
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID).add(mainTabPanel);
|
||||
|
||||
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID).getElement().getStyle().setOpacity(0.4);
|
||||
|
||||
GeoportalDataEntryServiceAsync.Util.getInstance().getGeonaInitConfig(new AsyncCallback<GeonaISConfig>() {
|
||||
|
||||
|
@ -194,11 +197,11 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
||||
alert.setClose(false);
|
||||
try {
|
||||
RootPanel.get(DIV_PORTLET_ID).remove(loaderApplication);
|
||||
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).remove(loaderApplication);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
RootPanel.get(DIV_PORTLET_ID).add(alert);
|
||||
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID).add(alert);
|
||||
Window.alert(errorMsg);
|
||||
}
|
||||
|
||||
|
@ -224,11 +227,11 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
Alert alert = new Alert(errorMsg, AlertType.ERROR);
|
||||
alert.setClose(false);
|
||||
try {
|
||||
RootPanel.get(DIV_PORTLET_ID).remove(loaderApplication);
|
||||
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).remove(loaderApplication);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
RootPanel.get(DIV_PORTLET_ID).add(alert);
|
||||
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID).add(alert);
|
||||
Window.alert(errorMsg);
|
||||
|
||||
}
|
||||
|
@ -238,7 +241,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
GWT.log(GNADataEntryExtConfigProfile.class.getSimpleName() + " loaded: " + gNADataEntryConfig);
|
||||
|
||||
try {
|
||||
RootPanel.get(DIV_PORTLET_ID).remove(loaderApplication);
|
||||
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).remove(loaderApplication);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
@ -292,7 +295,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
GWT.log("loading GeoportalConfigsAndBuildCards in the scope: " + scope);
|
||||
// orderedCards = new ArrayList<GeoNaFormCardModel>();
|
||||
try {
|
||||
RootPanel.get(DIV_PORTLET_ID).insert(loaderConfigurations, 0);
|
||||
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).insert(loaderConfigurations, 0);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
@ -302,7 +305,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
try {
|
||||
RootPanel.get(DIV_PORTLET_ID).remove(loaderConfigurations);
|
||||
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).remove(loaderConfigurations);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
@ -323,7 +326,9 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
// After loading of UCD I can instance the "List of Project" view
|
||||
mainTabPanel.instanceAndShowListOfProjects();
|
||||
try {
|
||||
RootPanel.get(DIV_PORTLET_ID).remove(loaderConfigurations);
|
||||
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID).getElement().getStyle()
|
||||
.setOpacity(1);
|
||||
RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_LOADERS_ID).remove(loaderConfigurations);
|
||||
} catch (Exception e) {
|
||||
|
||||
}
|
||||
|
@ -352,6 +357,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
}
|
||||
|
||||
geoportalCaches.putHandlerConfigurationsForProfileId(ucdDV.getProfileID(), listConfigurations);
|
||||
geoportalCaches.putUCDForProfileId(ucdDV.getProfileID(), ucdDV);
|
||||
}
|
||||
|
||||
geoportalCaches.printCacheHandlerConfigurations();
|
||||
|
@ -364,7 +370,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
public void updateSize() {
|
||||
|
||||
try {
|
||||
RootPanel workspace = RootPanel.get(DIV_PORTLET_ID);
|
||||
RootPanel workspace = RootPanel.get(ConstantsGeoPortalDataEntryApp.DIV_PORTLET_ID);
|
||||
int topBorder = workspace.getAbsoluteTop();
|
||||
int footer = 85; // footer is bottombar + sponsor
|
||||
int headerSize = 90;
|
||||
|
@ -375,10 +381,8 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
GWT.log("New workspace dimension Height: " + rootHeight);
|
||||
mainTabPanel.setInternalHeight(rootHeight);
|
||||
} catch (Exception e) {
|
||||
// TODO: handle exception
|
||||
|
||||
}
|
||||
// appController.getMainPanel().setHeight(rootHeight);
|
||||
// appController.getMainPanel().setWidth(rootWidth);
|
||||
|
||||
}
|
||||
|
||||
|
@ -774,28 +778,134 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
|
||||
String profileID = getListOfRecordsEvent.getProfileID();
|
||||
if (profileID == null) {
|
||||
new DialogInform(null, "Error", "No user case descriptor selected").center();
|
||||
new DialogInform(null, "Error", "No Use Case Descriptor selected").center();
|
||||
return;
|
||||
}
|
||||
|
||||
grpw = new GeonaRecordsPaginatedView(appManagerBus, profileID, displayFields, searchingFilter);
|
||||
|
||||
mainTabPanel.showListOfConcessioniView(grpw);
|
||||
|
||||
//The Project Type is changed
|
||||
if(getListOfRecordsEvent.isReloadFilteringParameters()) {
|
||||
mainTabPanel.initActionListPanel(geoportalCaches.getUCDForProfileID(profileID));
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
appManagerBus.addHandler(ClickItemEvent.TYPE, new ClickItemEventHandler() {
|
||||
|
||||
@Override
|
||||
public <T> void onClick(ClickItemEvent<T> clickItemEvent) {
|
||||
|
||||
if (clickItemEvent.getSelectItems() != null) {
|
||||
mainTabPanel.showActionsOnSelected(clickItemEvent.getSelectItems());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
appManagerBus.addHandler(ClickItemEvent.TYPE, new ClickItemEventHandler() {
|
||||
|
||||
@Override
|
||||
public <T> void onClick(ClickItemEvent<T> clickItemEvent) {
|
||||
|
||||
if(clickItemEvent.getSelectItems()!=null) {
|
||||
mainTabPanel.showActionsOnSelected(clickItemEvent.getSelectItems());
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
appManagerBus.addHandler(WorkflowActionOnSelectedItemEvent.TYPE,
|
||||
new WorkflowActionOnSelectedItemEventHandler() {
|
||||
|
||||
@Override
|
||||
public <T extends DocumentDV> void onDoActionFired(
|
||||
final WorkflowActionOnSelectedItemEvent<T> wActionOnItem) {
|
||||
GWT.log("WorkflowActionOnSelectedItemEvent onDoActionFired item: " + wActionOnItem);
|
||||
|
||||
if (grpw.getSelectItems() == null || grpw.getSelectItems().size() == 0) {
|
||||
DialogInform di = new DialogInform(null, "No selection",
|
||||
"You must select a record in the table");
|
||||
di.center();
|
||||
return;
|
||||
}
|
||||
|
||||
DocumentDV item = grpw.getSelectItems().get(0);
|
||||
|
||||
if (item instanceof ResultDocumentDV) {
|
||||
|
||||
final ResultDocumentDV resultDocumentDV = (ResultDocumentDV) item;
|
||||
|
||||
String htmlMsg = "Going to perform the step/s <i><b>"
|
||||
+ wActionOnItem.getAction().getCallSteps() + "</b></i> on the project with:";
|
||||
htmlMsg += "<ul>";
|
||||
htmlMsg += "<li>id: " + resultDocumentDV.getId() + "</li>";
|
||||
htmlMsg += "<li>profile: " + resultDocumentDV.getProfileID() + "</li>";
|
||||
htmlMsg += "</ul>";
|
||||
htmlMsg += "<br>";
|
||||
htmlMsg += "Would you like to proceed?";
|
||||
|
||||
final ModalConfirm dialog = new ModalConfirm(null, "Step/s Confirm?", htmlMsg);
|
||||
dialog.addToCenterPanel(
|
||||
new ReportTemplateToHTML("Project", resultDocumentDV.getDocumentAsJSON(), false));
|
||||
|
||||
dialog.getYesButton().addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
dialog.hide();
|
||||
|
||||
final Modal modal = new Modal(true, true);
|
||||
modal.setCloseVisible(false);
|
||||
modal.setTitle("Perfoming Steps...");
|
||||
modal.hide(false);
|
||||
modal.setWidth(800);
|
||||
modal.setMaxHeigth("650px");
|
||||
final VerticalPanel modalContainerPanel = new VerticalPanel();
|
||||
final LoaderIcon loader = new LoaderIcon();
|
||||
loader.setText("Trying to perfom step/s " + wActionOnItem.getAction().getCallSteps()
|
||||
+ ", please wait...");
|
||||
modalContainerPanel.add(loader);
|
||||
modal.add(modalContainerPanel);
|
||||
|
||||
GeoportalDataEntryServiceAsync.Util.getInstance().performActionSteps(
|
||||
resultDocumentDV.getProfileID(), resultDocumentDV.getId(),
|
||||
wActionOnItem.getAction(), new AsyncCallback<ProjectDV>() {
|
||||
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
modal.setCloseVisible(true);
|
||||
try {
|
||||
modalContainerPanel.remove(loader);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
Alert alert = new Alert(caught.getMessage());
|
||||
alert.setType(AlertType.ERROR);
|
||||
alert.setClose(false);
|
||||
modal.add(alert);
|
||||
}
|
||||
|
||||
@Override
|
||||
public void onSuccess(ProjectDV result) {
|
||||
modal.setCloseVisible(true);
|
||||
try {
|
||||
modalContainerPanel.remove(loader);
|
||||
} catch (Exception e) {
|
||||
}
|
||||
Alert alert = new Alert(
|
||||
"Steps: " + wActionOnItem.getAction().getCallSteps()
|
||||
+ ", performed correclty");
|
||||
alert.setType(AlertType.INFO);
|
||||
alert.setClose(false);
|
||||
modal.add(alert);
|
||||
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false,
|
||||
resultDocumentDV.getProfileID(), mainTabPanel.getCurrentSearchingFilter(), true));
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
modal.show();
|
||||
|
||||
}
|
||||
|
||||
});
|
||||
|
||||
dialog.show();
|
||||
}
|
||||
|
||||
}
|
||||
});
|
||||
|
||||
appManagerBus.addHandler(OperationPerformedOnItemEvent.TYPE, new OperationPerformedOnItemEventHandler() {
|
||||
|
||||
|
@ -832,7 +942,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
// actionPerformedOnItemEvent.getProfileID(), null,
|
||||
// mainTabPanel.getCurrentSortFilter()));
|
||||
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, null, grpw.getProfileID(),
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, grpw.getProfileID(),
|
||||
mainTabPanel.getCurrentSearchingFilter(), false));
|
||||
break;
|
||||
}
|
||||
|
@ -1073,7 +1183,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
|
|||
alert.setClose(false);
|
||||
hp.add(alert);
|
||||
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, null,
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false,
|
||||
resultDocumentDV.getProfileID(),
|
||||
mainTabPanel.getCurrentSearchingFilter(), false));
|
||||
} else {
|
||||
|
|
|
@ -5,7 +5,9 @@ import java.util.List;
|
|||
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef;
|
||||
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
||||
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ActionDefinitionDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
||||
import org.gcube.application.geoportalcommon.shared.products.content.WorkspaceContentDV;
|
||||
|
@ -163,4 +165,15 @@ public interface GeoportalDataEntryService extends RemoteService {
|
|||
*/
|
||||
boolean deleteProject(String profileID, String projectID) throws Exception;
|
||||
|
||||
/**
|
||||
* Perform action steps.
|
||||
*
|
||||
* @param profileID the profile ID
|
||||
* @param projectID the project ID
|
||||
* @param action the action
|
||||
* @return the project DV
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
ProjectDV performActionSteps(String profileID, String projectID, ActionDefinitionDV action) throws Exception;
|
||||
|
||||
}
|
||||
|
|
|
@ -5,7 +5,9 @@ import java.util.List;
|
|||
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef;
|
||||
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
|
||||
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ActionDefinitionDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
||||
import org.gcube.application.geoportalcommon.shared.products.content.WorkspaceContentDV;
|
||||
|
@ -78,4 +80,7 @@ public interface GeoportalDataEntryServiceAsync {
|
|||
void getLifecycleInfoForProjectId(String profileID, String projectID,
|
||||
AsyncCallback<LifecycleInformationDV> callback);
|
||||
|
||||
void performActionSteps(String profileID, String projectID, ActionDefinitionDV action,
|
||||
AsyncCallback<ProjectDV> callback);
|
||||
|
||||
}
|
||||
|
|
|
@ -22,20 +22,18 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
|
|||
private boolean onApplicationInit = false;
|
||||
|
||||
/**
|
||||
* Instantiates a new cancel upload event.
|
||||
* Instantiates a new gets the list of records event.
|
||||
*
|
||||
* @param onApplicationInit the on application init
|
||||
* @param projectName the project name
|
||||
* @param profileID the profile ID
|
||||
* @param sortFilter the sort filter
|
||||
* @param reloadFilteringParameters the reload filtering parameters
|
||||
*/
|
||||
public GetListOfRecordsEvent(boolean onApplicationInit, String projectName, String profileID,
|
||||
SearchingFilter sortFilter, Boolean reloadFilteringParameters) {
|
||||
public GetListOfRecordsEvent(boolean onApplicationInit, String profileID, SearchingFilter sortFilter,
|
||||
Boolean reloadFilteringParameters) {
|
||||
this.onApplicationInit = onApplicationInit;
|
||||
this.sortFilter = sortFilter;
|
||||
this.profileID = profileID;
|
||||
this.projectName = projectName;
|
||||
this.reloadFilteringParameters = reloadFilteringParameters;
|
||||
}
|
||||
|
||||
|
@ -98,15 +96,6 @@ public class GetListOfRecordsEvent extends GwtEvent<GetListOfRecordsEventHandler
|
|||
return onApplicationInit;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the project name.
|
||||
*
|
||||
* @return the project name
|
||||
*/
|
||||
public String getProjectName() {
|
||||
return projectName;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the reload filtering parameters.
|
||||
*
|
||||
|
|
|
@ -0,0 +1,57 @@
|
|||
package org.gcube.portlets.user.geoportaldataentry.client.events;
|
||||
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ActionDefinitionDV;
|
||||
|
||||
import com.google.gwt.event.shared.GwtEvent;
|
||||
|
||||
public class WorkflowActionOnSelectedItemEvent<T extends DocumentDV> extends GwtEvent<WorkflowActionOnSelectedItemEventHandler> {
|
||||
public static Type<WorkflowActionOnSelectedItemEventHandler> TYPE = new Type<WorkflowActionOnSelectedItemEventHandler>();
|
||||
private ActionDefinitionDV action;
|
||||
|
||||
public WorkflowActionOnSelectedItemEvent(ActionDefinitionDV doAction) {
|
||||
this.action = doAction;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the associated type.
|
||||
*
|
||||
* @return the associated type
|
||||
*/
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see com.google.gwt.event.shared.GwtEvent#getAssociatedType()
|
||||
*/
|
||||
@Override
|
||||
public Type<WorkflowActionOnSelectedItemEventHandler> getAssociatedType() {
|
||||
return TYPE;
|
||||
}
|
||||
|
||||
/**
|
||||
* Dispatch.
|
||||
*
|
||||
* @param handler the handler
|
||||
*/
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
*
|
||||
* @see
|
||||
* com.google.gwt.event.shared.GwtEvent#dispatch(com.google.gwt.event.shared.
|
||||
* EventHandler)
|
||||
*/
|
||||
@Override
|
||||
protected void dispatch(WorkflowActionOnSelectedItemEventHandler handler) {
|
||||
handler.onDoActionFired(this);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the action.
|
||||
*
|
||||
* @return the action
|
||||
*/
|
||||
public ActionDefinitionDV getAction() {
|
||||
return action;
|
||||
}
|
||||
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
package org.gcube.portlets.user.geoportaldataentry.client.events;
|
||||
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||
|
||||
import com.google.gwt.event.shared.EventHandler;
|
||||
|
||||
/**
|
||||
* The Interface WorkflowActionOnSelectedItemEventHandler.
|
||||
*
|
||||
* @author Francesco Mangiacrapa at ISTI-CNR francesco.mangiacrapa@isti.cnr.it
|
||||
*
|
||||
* Sep 13, 2022
|
||||
*/
|
||||
public interface WorkflowActionOnSelectedItemEventHandler extends EventHandler {
|
||||
|
||||
/**
|
||||
* On do action fired.
|
||||
*
|
||||
* @param <T> the generic type
|
||||
* @param workflowActionOnItemEvent the workflow action on item event
|
||||
*/
|
||||
<T extends DocumentDV> void onDoActionFired(WorkflowActionOnSelectedItemEvent<T> workflowActionOnItemEvent);
|
||||
}
|
|
@ -106,7 +106,7 @@ public class GeonaMainTabPanel extends Composite {
|
|||
// NavLink buttCreateNewProject;
|
||||
|
||||
@UiField
|
||||
NavLink buttonReloadConcessioni;
|
||||
NavLink buttonReloadProjects;
|
||||
|
||||
@UiField
|
||||
TabPanel tabPanel;
|
||||
|
@ -262,7 +262,7 @@ public class GeonaMainTabPanel extends Composite {
|
|||
alertSortBy.setText(labelASC);
|
||||
UseCaseDescriptorDV singleUCD = getSelectProjectType();
|
||||
if (singleUCD != null) {
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, singleUCD.getName(),
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false,
|
||||
singleUCD.getProfileID(), getCurrentSearchingFilter(), false));
|
||||
}
|
||||
}
|
||||
|
@ -281,7 +281,7 @@ public class GeonaMainTabPanel extends Composite {
|
|||
alertSortBy.setText(labelDESC);
|
||||
UseCaseDescriptorDV singleUCD = getSelectProjectType();
|
||||
if (singleUCD != null) {
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, singleUCD.getName(),
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false,
|
||||
singleUCD.getProfileID(), getCurrentSearchingFilter(), false));
|
||||
}
|
||||
}
|
||||
|
@ -321,14 +321,14 @@ public class GeonaMainTabPanel extends Composite {
|
|||
*/
|
||||
private void bindEvents() {
|
||||
|
||||
buttonReloadConcessioni.addClickHandler(new ClickHandler() {
|
||||
buttonReloadProjects.addClickHandler(new ClickHandler() {
|
||||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
UseCaseDescriptorDV singleUCD = getSelectProjectType();
|
||||
if (singleUCD != null) {
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, singleUCD.getName(),
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false,
|
||||
singleUCD.getProfileID(), getCurrentSearchingFilter(), true));
|
||||
}
|
||||
|
||||
|
@ -421,7 +421,7 @@ public class GeonaMainTabPanel extends Composite {
|
|||
|
||||
UseCaseDescriptorDV singleUCD = getSelectProjectType();
|
||||
if (singleUCD != null) {
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, singleUCD.getName(),
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false,
|
||||
singleUCD.getProfileID(), getCurrentSearchingFilter(), false));
|
||||
}
|
||||
|
||||
|
@ -460,7 +460,7 @@ public class GeonaMainTabPanel extends Composite {
|
|||
|
||||
UseCaseDescriptorDV singleUCD = getSelectProjectType();
|
||||
if (singleUCD != null) {
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, singleUCD.getName(), singleUCD.getProfileID(),
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, singleUCD.getProfileID(),
|
||||
getCurrentSearchingFilter(), false));
|
||||
}
|
||||
}
|
||||
|
@ -617,7 +617,7 @@ public class GeonaMainTabPanel extends Composite {
|
|||
alertProjectType.setText(singleUCD.getName());
|
||||
// setFilteringParameters(displayFields, sortByFields, searchForFields,
|
||||
// currentSearchingFilter);
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(true, singleUCD.getName(), singleUCD.getProfileID(),
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(true, singleUCD.getProfileID(),
|
||||
getCurrentSearchingFilter(), true));
|
||||
}
|
||||
}
|
||||
|
@ -678,7 +678,7 @@ public class GeonaMainTabPanel extends Composite {
|
|||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, ucd.getName(), ucd.getProfileID(),
|
||||
appManagerBus.fireEvent(new GetListOfRecordsEvent(false, ucd.getProfileID(),
|
||||
getCurrentSearchingFilter(), true));
|
||||
}
|
||||
});
|
||||
|
@ -686,23 +686,9 @@ public class GeonaMainTabPanel extends Composite {
|
|||
ddProjectType.add(link);
|
||||
|
||||
}
|
||||
|
||||
initActionListPanel(ucd);
|
||||
|
||||
// Setting Project type having HANDLER WORKFLOW ACTION
|
||||
dataListHandler = UCD_Util.getHandlerDeclarationFor(ucd,
|
||||
GEOPORTAL_DATA_HANDLER.geoportal_workflow_action_list);
|
||||
|
||||
if (dataListHandler != null) {
|
||||
actionListMainPanel.setVisible(true);
|
||||
actionListMainPanel.clear();
|
||||
ConfigurationDV<?> config = dataListHandler.getConfiguration();
|
||||
List<ActionDefinitionDV> listActionDef = toListActionDefinition(config);
|
||||
actionListPanel = new ActionListPanel(ucd.getName(), ucd.getProfileID(), listActionDef);
|
||||
actionListMainPanel.add(actionListPanel);
|
||||
|
||||
}else {
|
||||
actionListMainPanel.clear();
|
||||
actionListMainPanel.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
// IF one type of document is available, fire
|
||||
|
@ -730,8 +716,25 @@ public class GeonaMainTabPanel extends Composite {
|
|||
}
|
||||
}
|
||||
|
||||
private void initActionListPanel() {
|
||||
public void initActionListPanel(UseCaseDescriptorDV ucd) {
|
||||
GWT.log("Init ActionListPanel for UCD: "+ucd);
|
||||
|
||||
// Setting Project type having HANDLER WORKFLOW ACTION
|
||||
HandlerDeclarationDV dataListHandler = UCD_Util.getHandlerDeclarationFor(ucd,
|
||||
GEOPORTAL_DATA_HANDLER.geoportal_workflow_action_list);
|
||||
|
||||
if (dataListHandler != null) {
|
||||
actionListMainPanel.setVisible(true);
|
||||
actionListMainPanel.clear();
|
||||
ConfigurationDV<?> config = dataListHandler.getConfiguration();
|
||||
List<ActionDefinitionDV> listActionDef = toListActionDefinition(config);
|
||||
actionListPanel = new ActionListPanel(appManagerBus, ucd.getName(), ucd.getProfileID(), listActionDef);
|
||||
actionListMainPanel.add(actionListPanel);
|
||||
|
||||
}else {
|
||||
actionListMainPanel.clear();
|
||||
actionListMainPanel.setVisible(false);
|
||||
}
|
||||
}
|
||||
|
||||
public <T> void showActionsOnSelected(List<T> selectItems) {
|
||||
|
|
|
@ -148,7 +148,7 @@
|
|||
addStyleNames="alert_box_nav"></b:Alert>
|
||||
</b:Nav>
|
||||
<b:Nav>
|
||||
<b:NavLink ui:field="buttonReloadConcessioni"
|
||||
<b:NavLink ui:field="buttonReloadProjects"
|
||||
title="Create a new Project" icon="ROTATE_RIGHT">Reload Projects</b:NavLink>
|
||||
</b:Nav>
|
||||
|
||||
|
|
|
@ -8,6 +8,7 @@ import java.util.Map;
|
|||
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ActionDefinitionDV;
|
||||
import org.gcube.portlets.user.geoportaldataentry.client.events.WorkflowActionOnSelectedItemEvent;
|
||||
|
||||
import com.github.gwtbootstrap.client.ui.Button;
|
||||
import com.github.gwtbootstrap.client.ui.ButtonGroup;
|
||||
|
@ -15,9 +16,9 @@ import com.github.gwtbootstrap.client.ui.constants.ButtonType;
|
|||
import com.google.gwt.core.client.GWT;
|
||||
import com.google.gwt.event.dom.client.ClickEvent;
|
||||
import com.google.gwt.event.dom.client.ClickHandler;
|
||||
import com.google.gwt.event.shared.HandlerManager;
|
||||
import com.google.gwt.uibinder.client.UiBinder;
|
||||
import com.google.gwt.uibinder.client.UiField;
|
||||
import com.google.gwt.user.client.Window;
|
||||
import com.google.gwt.user.client.ui.Composite;
|
||||
import com.google.gwt.user.client.ui.HTMLPanel;
|
||||
import com.google.gwt.user.client.ui.Widget;
|
||||
|
@ -32,14 +33,16 @@ public class ActionListPanel extends Composite {
|
|||
private String projectName;
|
||||
private String profileID;
|
||||
private List<ActionDefinitionDV> listActionDefinition;
|
||||
private HandlerManager appManagerBus;
|
||||
|
||||
public ActionListPanel(String projectName, String profileID, List<ActionDefinitionDV> listActionDef) {
|
||||
public ActionListPanel(HandlerManager appManagerBus,String projectName, String profileID, List<ActionDefinitionDV> listActionDef) {
|
||||
initWidget(uiBinder.createAndBindUi(this));
|
||||
GWT.log("Adding list of actions: " + listActionDef);
|
||||
this.appManagerBus = appManagerBus;
|
||||
this.projectName = projectName;
|
||||
this.profileID = profileID;
|
||||
this.listActionDefinition = listActionDef;
|
||||
initActions(listActionDef);
|
||||
initActions(listActionDefinition);
|
||||
actionListBasePanel.setVisible(false);
|
||||
}
|
||||
|
||||
|
@ -70,7 +73,8 @@ public class ActionListPanel extends Composite {
|
|||
|
||||
@Override
|
||||
public void onClick(ClickEvent event) {
|
||||
Window.alert("ACTION fired: " + actionDefinitionDV.getTitle());
|
||||
|
||||
appManagerBus.fireEvent(new WorkflowActionOnSelectedItemEvent<ResultDocumentDV>(actionDefinitionDV));
|
||||
|
||||
}
|
||||
});
|
||||
|
|
|
@ -37,7 +37,7 @@ public class UCD_Util {
|
|||
|
||||
for (HandlerDeclarationDV handler : useCaseDescriptor.getHandlers()) {
|
||||
GEOPORTAL_DATA_HANDLER dataHandlerType = handler.getDataHandlerType();
|
||||
|
||||
|
||||
if (dataHandlerType != null && dataHandlerType.equals(dataHandler)) {
|
||||
return handler;
|
||||
}
|
||||
|
|
|
@ -18,6 +18,7 @@ import org.gcube.application.geoportal.common.rest.MongoConcessioni;
|
|||
import org.gcube.application.geoportalcommon.ConvertToDataValueObjectModel;
|
||||
import org.gcube.application.geoportalcommon.ConvertToDataViewModel;
|
||||
import org.gcube.application.geoportalcommon.GeoportalCommon;
|
||||
import org.gcube.application.geoportalcommon.ProjectDVBuilder;
|
||||
import org.gcube.application.geoportalcommon.geoportal.GeoportalClientCaller;
|
||||
import org.gcube.application.geoportalcommon.geoportal.ProjectsCaller;
|
||||
import org.gcube.application.geoportalcommon.geoportal.UseCaseDescriptorCaller;
|
||||
|
@ -33,9 +34,11 @@ import org.gcube.application.geoportalcommon.shared.config.RoleRights.OPERATION_
|
|||
import org.gcube.application.geoportalcommon.shared.exception.GNAConfigException;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.ActionDefinitionDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.FilePathDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
|
||||
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
|
||||
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
|
||||
|
@ -816,61 +819,6 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
}
|
||||
}
|
||||
|
||||
// @Override
|
||||
// public List<DocumentConfigDV> getListDocumentConfigurationForId(String id) throws Exception {
|
||||
//// MockDocumentConfigurationReader mock = new MockDocumentConfigurationReader();
|
||||
//// return mock.getListDocumentConfig();
|
||||
//
|
||||
// UseCaseDescriptorCaller client = GeoportalClientCaller.useCaseDescriptors();
|
||||
//
|
||||
// //TODO ID MUST BE THE HANDLER ID
|
||||
// List<UseCaseDescriptor> useCaseDescriptor;
|
||||
// try {
|
||||
// List<String> handlersIds = Arrays.asList(GEOPORTAL_DATA_HANDLER.geoportal_data_entry.getId(), GEOPORTAL_DATA_HANDLER.geoportal_data_list.getId());
|
||||
// useCaseDescriptor = client.getListForHandlerIds(handlersIds);
|
||||
// } catch (Exception e1) {
|
||||
// throw new Exception("Error when contacting the Geoportal service. Refresh and try again or contact the support");
|
||||
// }
|
||||
//
|
||||
// List<UseCaseDescriptorDV> listUCD = new ArrayList<UseCaseDescriptorDV>(useCaseDescriptor.size());
|
||||
// for (UseCaseDescriptor ucd : useCaseDescriptor) {
|
||||
// listUCD.add(ConvertToDataValueObjectModel.toUseCaseDescriptorDV(ucd, null));
|
||||
// }
|
||||
//
|
||||
// List<DocumentConfigDV> listDocumentConfig = new ArrayList<DocumentConfigDV>();
|
||||
//
|
||||
// for (UseCaseDescriptorDV useCaseDescriptorDV : listUCD) {
|
||||
// DocumentConfigDV documentConfigDV = new DocumentConfigDV();
|
||||
// documentConfigDV.setId(useCaseDescriptorDV.getId());
|
||||
// documentConfigDV.setType(useCaseDescriptorDV.getName());
|
||||
// documentConfigDV.setItemType(useCaseDescriptorDV.getName());
|
||||
// ConfigHandlerDV config = new ConfigHandlerDV();
|
||||
// List<HandlerDeclarationDV> handlers = useCaseDescriptorDV.getHandlers();
|
||||
// List<GcubeProfileDV> gcubeProfiles = new ArrayList<GcubeProfileDV>();
|
||||
// for (HandlerDeclarationDV handler : handlers) {
|
||||
// ConfigurationDV<?> docConfig = handler.getConfiguration();
|
||||
// try {
|
||||
// List<GcubeProfileDV> theConfig = (List<GcubeProfileDV>) docConfig.getConfiguration();
|
||||
// if(theConfig!=null) {
|
||||
// gcubeProfiles.addAll(gcubeProfiles);
|
||||
// }
|
||||
// }catch (Exception e) {
|
||||
// LOG.warn("The configuration read for "+documentConfigDV.getId()+ " is not a List of "+GcubeProfileDV.class.getSimpleName()+", skipping it");
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// if(gcubeProfiles.size()>0) {
|
||||
// config.setGcubeProfiles(gcubeProfiles);
|
||||
// documentConfigDV.setConfiguration(config);
|
||||
// listDocumentConfig.add(documentConfigDV);
|
||||
// }
|
||||
// }
|
||||
//
|
||||
// return listDocumentConfig;
|
||||
//
|
||||
//
|
||||
// }
|
||||
|
||||
/**
|
||||
* Gets the list use case descriptors.
|
||||
*
|
||||
|
@ -956,7 +904,7 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
*/
|
||||
@Override
|
||||
public LifecycleInformationDV getLifecycleInfoForProjectId(String profileID, String projectID) throws Exception {
|
||||
LOG.info("getLifecycleInfoForProjectId called for profileID {}, projectID {} " + profileID, projectID);
|
||||
LOG.info("getLifecycleInfoForProjectId called for profileID {}, projectID {} ", profileID, projectID);
|
||||
|
||||
ProjectsCaller client = GeoportalClientCaller.projects();
|
||||
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
||||
|
@ -973,4 +921,44 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
|
|||
}
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Perform action steps.
|
||||
*
|
||||
* @param profileID the profile ID
|
||||
* @param projectID the project ID
|
||||
* @param action the action
|
||||
* @return the project DV
|
||||
* @throws Exception the exception
|
||||
*/
|
||||
@Override
|
||||
public ProjectDV performActionSteps(String profileID, String projectID, ActionDefinitionDV action)
|
||||
throws Exception {
|
||||
LOG.info("performActionSteps called for profileID {}, projectID {}, action: " + action, profileID, projectID);
|
||||
|
||||
ProjectsCaller client = GeoportalClientCaller.projects();
|
||||
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
|
||||
|
||||
if (action == null || action.getCallSteps() == null || action.getCallSteps().length == 0) {
|
||||
throw new Exception("Action called is invalid, no step defined");
|
||||
}
|
||||
|
||||
try {
|
||||
Project project = null;
|
||||
for (String stepID : action.getCallSteps()) {
|
||||
LOG.info("calling stepID {} on projectID {}", stepID, projectID);
|
||||
project = client.performStep(profileID, projectID, stepID, null);
|
||||
}
|
||||
|
||||
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
|
||||
ProjectDV theProject = ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder);
|
||||
LOG.info("performActionSteps returning theProject with ID {}", projectID);
|
||||
return theProject;
|
||||
} catch (Exception e) {
|
||||
String error = "Error occurred on performing the workflow step/s on the project id " + projectID;
|
||||
LOG.error(error, e);
|
||||
throw new Exception(error + ". Error: "+e.getMessage()+". Refresh and try again or contact the support");
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
|
|
@ -204,3 +204,8 @@ important
|
|||
position: sticky;
|
||||
top: 0;
|
||||
}
|
||||
|
||||
.move-sticky-no-back .gwt-Label {
|
||||
top: 0;
|
||||
margin: auto 0;
|
||||
}
|
||||
|
|
|
@ -64,6 +64,7 @@
|
|||
Your web browser must have JavaScript enabled in order for this
|
||||
application to display correctly.</div>
|
||||
</noscript>
|
||||
<div id="geoportal-loaders"></div>
|
||||
<div id="geoportal-data-entry"></div>
|
||||
</body>
|
||||
</html>
|
||||
|
|
|
@ -45,5 +45,5 @@
|
|||
<!-- <script type="text/javascript"
|
||||
src='<%=request.getContextPath()%>/js/jquery.autosize.js'></script> -->
|
||||
|
||||
|
||||
<div id="geoportal-loaders"></div>
|
||||
<div id="geoportal-data-entry"></div>
|
Loading…
Reference in New Issue