Aligned with geoportal-common refactored

This commit is contained in:
Francesco Mangiacrapa 2022-08-11 12:07:07 +02:00
parent 19448bd349
commit ca4e0bf2d0
16 changed files with 159 additions and 128 deletions

View File

@ -1,5 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?><project-modules id="moduleCoreId" project-version="1.5.0">
@ -45,7 +46,8 @@
<wb-module deploy-name="geoportal-data-entry-app-3.0.0-SNAPSHOT">
@ -91,7 +93,8 @@
<wb-resource deploy-path="/" source-path="/target/m2e-wtp/web-resources"/>
@ -137,7 +140,8 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
@ -192,7 +196,8 @@
<dependent-module archiveName="geoportal-data-common-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/geoportal-data-common/geoportal-data-common">
<dependency-type>uses</dependency-type>
</dependent-module>
@ -238,7 +243,8 @@
<property name="context-root" value="geoportal-data-entry-app"/>
@ -284,7 +290,8 @@
<property name="java-output-path" value="/geoportal-data-entry-app/target/geoportal-data-entry-app-2.0.0-SNAPSHOT/WEB-INF/classes"/>
@ -330,7 +337,8 @@
</wb-module>

View File

@ -3,7 +3,7 @@ package org.gcube.portlets.user.geoportaldataentry.client;
import java.util.Arrays;
import java.util.List;
import org.gcube.application.geoportalcommon.shared.geoportal.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
import org.gcube.portlets.widgets.mpformbuilder.client.ConstantsMPFormBuilder;
/**

View File

@ -18,11 +18,12 @@ import org.gcube.application.geoportalcommon.shared.config.RoleRights;
import org.gcube.application.geoportalcommon.shared.config.RoleRights.OPERATION_TYPE;
import org.gcube.application.geoportalcommon.shared.geoportal.ConfigurationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
import org.gcube.application.geoportalcommon.shared.geoportal.HandlerDeclarationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.LifecycleInformationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
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.ucd.HandlerDeclarationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
import org.gcube.portlets.user.geoportaldataentry.client.ConstantsGeoPortalDataEntryApp.ACTION_PERFORMED_ON_ITEM;
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionOnItemEvent;
@ -898,7 +899,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
List<ItemFieldDV> listItemFields = (List<ItemFieldDV>) configurationDV.getConfiguration();
// The projection
Map<String, Object> projection = new HashMap<String, Object>();
LinkedHashMap<String, Object> projection = new LinkedHashMap<String, Object>();
for (ItemFieldDV itemField : listItemFields) {
if (itemField.isDisplayAsResult()) {

View File

@ -5,7 +5,7 @@ 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.UseCaseDescriptorDV;
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;
import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV;

View File

@ -5,7 +5,7 @@ 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.UseCaseDescriptorDV;
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;
import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV;

View File

@ -2,8 +2,8 @@ package org.gcube.portlets.user.geoportaldataentry.client.events;
import java.util.List;
import org.gcube.application.geoportalcommon.shared.geoportal.HandlerDeclarationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.GcubeProfileDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclarationDV;
import com.google.gwt.event.shared.GwtEvent;

View File

@ -11,11 +11,11 @@ import org.gcube.application.geoportalcommon.shared.SearchingFilter.ORDER;
import org.gcube.application.geoportalcommon.shared.WhereClause;
import org.gcube.application.geoportalcommon.shared.geoportal.ConfigurationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
import org.gcube.application.geoportalcommon.shared.geoportal.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.HandlerDeclarationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
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.ucd.GEOPORTAL_DATA_HANDLER;
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.events.CreateNewProjectEvent;
import org.gcube.portlets.user.geoportaldataentry.client.events.GetListOfRecordsEvent;
import org.gcube.portlets.user.geoportaldataentry.client.ui.form.GeonaDataEntryMainForm;

View File

@ -6,8 +6,8 @@ import java.util.List;
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
import org.gcube.application.geoportalcommon.shared.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ProjectDV;
import org.gcube.application.geoportalcommon.shared.geoportal.config.ItemFieldDV;
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
import org.gcube.portlets.user.geoportaldataentry.client.GeoPortalDataEntryApp;
import org.gcube.portlets.user.geoportaldataentry.client.ui.table.ItemsTable;
import org.gcube.portlets.user.geoportaldataentry.client.ui.table.SortedCellTable;
@ -163,17 +163,17 @@ public class GeonaRecordsPaginatedView {
SelectionModel<? super DocumentDV> sm = getCellTable().getSelectionModel();
if (sm instanceof SingleSelectionModel) {
SingleSelectionModel<DocumentDV> ssm = (SingleSelectionModel<DocumentDV>) sm;
SingleSelectionModel<? super DocumentDV> ssm = (SingleSelectionModel<DocumentDV>) sm;
ssm.clear();
} else if (sm instanceof MultiSelectionModel) {
MultiSelectionModel<DocumentDV> msm = (MultiSelectionModel<DocumentDV>) sm;
MultiSelectionModel<? super DocumentDV> msm = (MultiSelectionModel<DocumentDV>) sm;
msm.clear();
}
getTableDataProvider().updateRowCount((int) result.getTotalItems(), true);
// TODO MUST USE PROJECT
getTableDataProvider().updateRowData(result.getClientStartIndex(), toListDocumentDV(result.getData()));
getTableDataProvider().updateRowData(result.getClientStartIndex(),(List<DocumentDV>) result.getData());
if (result.getData().size() == 0) {
getCellTable().setLoadingIndicator(new Label("No data"));

View File

@ -1,18 +1,11 @@
package org.gcube.portlets.user.geoportaldataentry.client.ui.edit;
import java.util.List;
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
import org.gcube.application.geoportalcommon.shared.products.BaseConcessioneDV;
import org.gcube.application.geoportalcommon.shared.products.ConcessioneDV;
import org.gcube.application.geoportalcommon.shared.products.model.RecordDV;
import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV;
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.GeoPortalDataEntryApp;
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionPerformedOnItemEvent;
import org.gcube.portlets.user.geoportaldataentry.client.events.ActionPerformedOnItemEventHandler;
import org.gcube.portlets.user.geoportaldataentry.client.ui.edit.jseditor.JSONEditorWrapper;
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.DialogInform;
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.LoaderIcon;
import com.github.gwtbootstrap.client.ui.Button;
@ -24,9 +17,7 @@ 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.Random;
import com.google.gwt.user.client.Timer;
import com.google.gwt.user.client.Window;
import com.google.gwt.user.client.rpc.AsyncCallback;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.FlowPanel;
import com.google.gwt.user.client.ui.HTMLPanel;
@ -99,6 +90,9 @@ public class EditModeRecord extends Composite {
}
private void instanceUpdateFilesetEditor() {
Window.alert("instanceJSONEditor must be revisited");
/*
GeoPortalDataEntryApp.geoportalDataEntryService.readFileSetPaths(new AsyncCallback<FileSetPathsDV>() {
@Override
@ -113,7 +107,7 @@ public class EditModeRecord extends Composite {
fileSetPaths.getFileSetPaths());
filesUpdatePanel.add(updateFileset);
}
});
});*/
}
@ -124,7 +118,10 @@ public class EditModeRecord extends Composite {
fp.getElement().setId("jsoneditor" + Random.nextInt());
fp.setHeight("410px");
rawUpdatePanel.add(fp);
Window.alert("instanceJSONEditor must be revisited");
/*
GeoPortalDataEntryApp.geoportalDataEntryService.getJSONRecord(selectedConcessione.getItemId(), recordType,
new AsyncCallback<String>() {
@ -151,7 +148,7 @@ public class EditModeRecord extends Composite {
Window.alert(caught.getMessage());
}
});
});*/
}
/**
@ -167,6 +164,9 @@ public class EditModeRecord extends Composite {
buttonJSONUpdate.setEnabled(false);
final LoaderIcon loader = new LoaderIcon("Updating the project...");
tabRawUpdate.add(loader);
Window.alert("buttonJSONUpdate addClickHandler must be revisited");
/*
GeoPortalDataEntryApp.geoportalDataEntryService.updateRecord(selectedConcessione.getItemId(),
jsEditor.getText(), recordType, new AsyncCallback<ConcessioneDV>() {
@ -181,10 +181,11 @@ public class EditModeRecord extends Composite {
}
Window.alert("buttonJSONUpdate must be revisited");
/*
editorManagerBus.fireEvent(new ActionPerformedOnItemEvent<ConcessioneDV>(null,
ACTION_PERFORMED_ON_ITEM.UPDATED_PROJECT));
*/
editorManagerBus.fireEvent(new
ActionPerformedOnItemEvent<ConcessioneDV>(null,
ACTION_PERFORMED_ON_ITEM.UPDATED_PROJECT));
}
@ -202,14 +203,14 @@ public class EditModeRecord extends Composite {
"Project '" + result.getNome() + "' updated correctly");
di.setZIndex(100000);
di.center();
Window.alert("buttonJSONUpdate ConcessioneDV must be revisited");
/*
editorManagerBus.fireEvent(new ActionPerformedOnItemEvent<ConcessioneDV>(
Arrays.asList(result), ACTION_PERFORMED_ON_ITEM.UPDATED_PROJECT));
*/
editorManagerBus.fireEvent(new ActionPerformedOnItemEvent<ConcessioneDV>(
Arrays.asList(result), ACTION_PERFORMED_ON_ITEM.UPDATED_PROJECT));
}
});
});*/
}
});
@ -217,25 +218,30 @@ public class EditModeRecord extends Composite {
editorManagerBus.addHandler(ActionPerformedOnItemEvent.TYPE, new ActionPerformedOnItemEventHandler() {
@Override
public <T extends RecordDV> void onDoActionPerformedFired(
public <T extends DocumentDV> void onDoActionPerformedFired(
ActionPerformedOnItemEvent<T> actionPerformedOnItemEvent) {
ACTION_PERFORMED_ON_ITEM action = actionPerformedOnItemEvent.getAction();
List<T> items = actionPerformedOnItemEvent.getSelectItems();
if (items != null) {
selectedConcessione = (BaseConcessioneDV) items.get(0);
instanceJSONEditor();
Window.alert("ActionPerformedOnItemEvent must be revisited");
if (action.equals(ACTION_PERFORMED_ON_ITEM.UPDATED_PROJECT)) {
Window.alert("ACTION_PERFORMED_ON_ITEM.UPDATED_PROJECT ConcessioneDV must be revisited");
/*
appManagerBus.fireEvent(new ActionPerformedOnItemEvent<ConcessioneDV>(
(List<ConcessioneDV>) items, ACTION_PERFORMED_ON_ITEM.UPDATED_PROJECT));
*/
}
}
/*
* ACTION_PERFORMED_ON_ITEM action = actionPerformedOnItemEvent.getAction();
* List<T> items = actionPerformedOnItemEvent.getSelectItems();
*
* if (items != null) { selectedConcessione = (BaseConcessioneDV) items.get(0);
* instanceJSONEditor();
*
* if (action.equals(ACTION_PERFORMED_ON_ITEM.UPDATED_PROJECT)) {
*
* Window.
* alert("ACTION_PERFORMED_ON_ITEM.UPDATED_PROJECT ConcessioneDV must be revisited"
* );
*
*
* appManagerBus.fireEvent(new ActionPerformedOnItemEvent<ConcessioneDV>(
* (List<ConcessioneDV>) items, ACTION_PERFORMED_ON_ITEM.UPDATED_PROJECT));
*
* } }
*/
}
});

View File

@ -16,7 +16,6 @@ import org.gcube.application.geoportalcommon.shared.products.model.ValidationRep
import com.github.gwtbootstrap.client.ui.ButtonCell;
import com.github.gwtbootstrap.client.ui.Pagination;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.event.shared.HandlerManager;
import com.google.gwt.i18n.client.DateTimeFormat;
import com.google.gwt.safehtml.shared.SafeHtml;
@ -190,17 +189,17 @@ public class ItemsTable<T extends DocumentDV> extends AbstractItemsCellTable<T>
};
};
if(i==0) {
//name
sortedCellTable.setColumnWidth(col, 20, Unit.PCT);
}else if (i == 1) {
// intro
sortedCellTable.setColumnWidth(col, 30, Unit.PCT);
} else if (i == 2) {
sortedCellTable.setColumnWidth(col, 15, Unit.PCT);
}else if(i==displayFields.size()-1) {
sortedCellTable.setColumnWidth(col, 120, Unit.PX);
}
// if(i==0) {
// //name
// sortedCellTable.setColumnWidth(col, 20, Unit.PCT);
// }else if (i == 1) {
// // intro
// sortedCellTable.setColumnWidth(col, 30, Unit.PCT);
// } else if (i == 2) {
// sortedCellTable.setColumnWidth(col, 15, Unit.PCT);
// }else if(i==displayFields.size()-1) {
// sortedCellTable.setColumnWidth(col, 120, Unit.PX);
// }
sortedCellTable.addColumn(col, itemField.getDisplayName(), true);

View File

@ -2,9 +2,9 @@ package org.gcube.portlets.user.geoportaldataentry.client.ui.utils;
import java.util.List;
import org.gcube.application.geoportalcommon.shared.geoportal.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.HandlerDeclarationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.HandlerDeclarationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
public class UCD_Util {

View File

@ -4,6 +4,7 @@ import java.io.File;
import java.util.ArrayList;
import java.util.Arrays;
import java.util.HashMap;
import java.util.Iterator;
import java.util.List;
import java.util.Map;
@ -17,7 +18,6 @@ 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;
@ -31,12 +31,13 @@ import org.gcube.application.geoportalcommon.shared.config.GcubeUserRole;
import org.gcube.application.geoportalcommon.shared.config.RoleRights;
import org.gcube.application.geoportalcommon.shared.config.RoleRights.OPERATION_TYPE;
import org.gcube.application.geoportalcommon.shared.exception.GNAConfigException;
import org.gcube.application.geoportalcommon.shared.geoportal.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.LifecycleInformationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ProjectDV;
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
import org.gcube.application.geoportalcommon.shared.geoportal.DocumentDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
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.ucd.GEOPORTAL_DATA_HANDLER;
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;
import org.gcube.application.geoportalcommon.shared.products.paths.FileSetPathsDV;
@ -380,54 +381,39 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
ProjectsCaller client = GeoportalClientCaller.projects();
SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
List<ProjectDV> listProjectDV = SessionUtil.getListOfProjectsForProfileID(getThreadLocalRequest(),
Integer totalProjectForProfile = SessionUtil.getTotalDocumentForProfileID(getThreadLocalRequest(),
theProfileID);
ProjectDVBuilder projectBuilder = ProjectDVBuilder.newBuilder().fullDocumentMap(true);
//TODO Must be completed. Waiting for https://support.d4science.org/issues/22487
/*
if (reloadFromService || listProjectDV == null) {
List<Project> listProject = client.getListForProfileID(theProfileID);
listProjectDV = new ArrayList<ProjectDV>(listProject.size());
for (Project project : listProject) {
listProjectDV.add(ConvertToDataValueObjectModel.toProjectDV(project, projectBuilder));
}
SessionUtil.setListOfProjectsForProfileID(getThreadLocalRequest(), theProfileID, listProjectDV);
if (totalProjectForProfile == null) {
totalProjectForProfile = client.getTotalDocument(theProfileID);
SessionUtil.setTotalDocumentForProfileID(getThreadLocalRequest(), theProfileID, totalProjectForProfile);
}
int listProjectSize = listProjectDV.size();
*/
LOG.info("Total Docs read from config: " + totalProjectForProfile);
int listProjectSize = 50;
LOG.info("WARN HARD_CODING COUNT: "+listProjectSize);
Iterator<Project> projects = client.queryOnMongo(theProfileID, totalProjectForProfile, start, limit,
filter);
ResultSetPaginatedData searchedData = client.queryOnMongo(theProfileID, listProjectSize, start, limit,
filter, projectBuilder);
ResultSetPaginatedData searchedData = new ResultSetPaginatedData(start, limit, false);
searchedData.setTotalItems(totalProjectForProfile);
// public ResultSetPaginatedData queryOnMongo(String profileID, Integer totalItems, Integer offset, Integer limit,
// SearchingFilter filter, String recordType, ProjectDVBuilder projectDVBuilder) throws Exception {
List<ResultDocumentDV> toReturnList = ConvertToDataValueObjectModel.toListResultDocument(projects);
/*
* SessionUtil.getCurrentContext(getThreadLocalRequest(), true);
* MongoServiceCommon serviceCommon = new MongoServiceCommon();
*
* // TODO MUST BE REPLACED BY COUNT List<Concessione> listOfConcessioni =
* SessionUtil.getListOfConcessioni(getThreadLocalRequest(), reloadFromService);
* int listConcessioniSize = listOfConcessioni.size();
*
* ResultSetPaginatedData searchedData =
* serviceCommon.queryOnMongo(listConcessioniSize, start, limit, filter,
* "concessione"); return searchedData;
*/
searchedData.setData(toReturnList);
if (totalProjectForProfile == limit || totalProjectForProfile == 0) {
LOG.debug("Page completed returning " + totalProjectForProfile + " projects");
int newOffset = start + limit;
searchedData.setServerSearchFinished(newOffset > totalProjectForProfile || totalProjectForProfile == 0);
LOG.debug("is Search finished: " + searchedData.isServerSearchFinished());
}
if (LOG.isDebugEnabled()) {
LOG.debug("returning {}", searchedData.getData());
}
List<ProjectDV> data = searchedData.getData();
List<? extends DocumentDV> data = searchedData.getData();
if (data != null) {
LOG.info("returning {} project/s", data.size());
}
@ -897,8 +883,8 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
handlersIds = Arrays.asList(GEOPORTAL_DATA_HANDLER.geoportal_data_entry.getId());
LOG.info("handlersIds is null, so using default: " + handlersIds);
}
//TODO MUST BE USED THE FOLLOWING ONE
// TODO MUST BE USED THE FOLLOWING ONE
// listUseCaseDescriptor = client.getListForHandlerIds(handlersIds);
listUseCaseDescriptor = client.getList();

View File

@ -69,7 +69,8 @@ public class MongoServiceUtil {
}
public void registerFileSet(String profileID, Project project, String parentPath, String fieldName,
String fieldDefinition, File... files) throws RemoteException, FileNotFoundException, JsonProcessingException, InvalidRequestException {
String fieldDefinition, File... files)
throws RemoteException, FileNotFoundException, JsonProcessingException, InvalidRequestException {
LOG.debug("registerFileSet called for profileID: " + profileID);
Projects<Project> client = getProjectsClient(profileID);
@ -81,6 +82,7 @@ public class MongoServiceUtil {
LOG.debug("Resulting Project as JSON: " + Serialization.write(project));
}
/**
* Gets the instance mongo concessioni.
*

View File

@ -15,7 +15,7 @@ import org.gcube.application.geoportal.common.rest.MongoConcessioni;
import org.gcube.application.geoportalcommon.GeoportalCommon;
import org.gcube.application.geoportalcommon.shared.GNADataEntryConfigProfile;
import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile;
import org.gcube.application.geoportalcommon.shared.geoportal.ProjectDV;
import org.gcube.application.geoportalcommon.shared.geoportal.project.ProjectDV;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.portal.PortalContext;
import org.gcube.common.scope.api.ScopeProvider;
@ -46,6 +46,7 @@ public class SessionUtil {
private static final String LIST_OF_CONCESSIONI = "LIST_OF_CONCESSIONI";
private static final String LIST_OF_PROJECTS = "LIST_OF_PROJECTS";
private static final String COUNT_DOCS_FOR_PROFILE_ID = "COUNT_DOCS_FOR_PROFILE_ID";
/** The log. */
private static Logger LOG = LoggerFactory.getLogger(SessionUtil.class);
@ -134,7 +135,7 @@ public class SessionUtil {
* Gets the list of projects for profile ID.
*
* @param httpServletRequest the http servlet request
* @param profileID the profile ID
* @param profileID the profile ID
* @return the list of projects for profile ID
* @throws Exception the exception
*/
@ -144,16 +145,43 @@ public class SessionUtil {
return (List<ProjectDV>) session.getAttribute(LIST_OF_PROJECTS + profileID);
}
/**
* Gets the total document for profile ID.
*
* @param httpServletRequest the http servlet request
* @param theProfileID the the profile ID
* @return the total document for profile ID
*/
public static Integer getTotalDocumentForProfileID(HttpServletRequest httpServletRequest, String theProfileID) {
HttpSession session = httpServletRequest.getSession();
return (Integer) session.getAttribute(COUNT_DOCS_FOR_PROFILE_ID + theProfileID);
}
/**
* Sets the total document for profile ID.
*
* @param httpServletRequest the http servlet request
* @param theProfileID the the profile ID
* @param countForProfileId the count for profile id
*/
public static void setTotalDocumentForProfileID(HttpServletRequest httpServletRequest, String theProfileID,
Integer countForProfileId) {
HttpSession session = httpServletRequest.getSession();
session.setAttribute(COUNT_DOCS_FOR_PROFILE_ID + theProfileID, countForProfileId);
}
/**
* Sets the list of projects for profile ID.
*
* @param httpServletRequest the http servlet request
* @param profileID the profile ID
* @param listOfProjects the list of projects
* @param profileID the profile ID
* @param listOfProjects the list of projects
* @throws Exception the exception
*/
public static void setListOfProjectsForProfileID(HttpServletRequest httpServletRequest,
String profileID, List<ProjectDV> listOfProjects) throws Exception {
public static void setListOfProjectsForProfileID(HttpServletRequest httpServletRequest, String profileID,
List<ProjectDV> listOfProjects) throws Exception {
HttpSession session = httpServletRequest.getSession();
session.setAttribute(LIST_OF_PROJECTS + profileID, listOfProjects);
}
@ -268,4 +296,5 @@ public class SessionUtil {
HttpSession session = httpServletRequest.getSession();
session.setAttribute(GNA_DATAENTRY_CONFIG_PROFILE, gNADEConfigProfile);
}
}

View File

@ -2,7 +2,7 @@ package org.gcube.portlets.user.geoportaldataentry.shared;
import java.io.Serializable;
import org.gcube.application.geoportalcommon.shared.geoportal.LifecycleInformationDV;
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
/**
* The Class CommitReport.

View File

@ -8,8 +8,8 @@ import org.gcube.application.geoportal.common.model.useCaseDescriptor.UseCaseDes
import org.gcube.application.geoportalcommon.ConvertToDataValueObjectModel;
import org.gcube.application.geoportalcommon.geoportal.GeoportalClientCaller;
import org.gcube.application.geoportalcommon.geoportal.UseCaseDescriptorCaller;
import org.gcube.application.geoportalcommon.shared.geoportal.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.UseCaseDescriptorDV;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.GEOPORTAL_DATA_HANDLER;
import org.gcube.application.geoportalcommon.shared.geoportal.ucd.UseCaseDescriptorDV;
import org.gcube.common.authorization.library.provider.SecurityTokenProvider;
import org.gcube.common.scope.api.ScopeProvider;
import org.junit.Before;