refactored

This commit is contained in:
Francesco Mangiacrapa 2022-10-18 16:38:48 +02:00
parent c34faa9f68
commit a3cc2aeaa9
6 changed files with 23 additions and 18 deletions

View File

@ -7,7 +7,7 @@ import java.util.LinkedHashMap;
import java.util.List; import java.util.List;
import java.util.TreeMap; import java.util.TreeMap;
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef; import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.SearchingFilter; import org.gcube.application.geoportalcommon.shared.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.config.GcubeUserRole; import org.gcube.application.geoportalcommon.shared.config.GcubeUserRole;
import org.gcube.application.geoportalcommon.shared.config.OPERATION_ON_ITEM; import org.gcube.application.geoportalcommon.shared.config.OPERATION_ON_ITEM;
@ -1413,7 +1413,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
final NewBrowserWindow newBrowserWindow = NewBrowserWindow.open("", "_blank", ""); final NewBrowserWindow newBrowserWindow = NewBrowserWindow.open("", "_blank", "");
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(), GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(resultDocumentDV.getId(),
resultDocumentDV.getProfileID(), new AsyncCallback<GeoNaItemRef>() { resultDocumentDV.getProfileID(), new AsyncCallback<GeoportalItemReferences>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
hpGetLink.clear(); hpGetLink.clear();
@ -1424,7 +1424,7 @@ public class GeoPortalDataEntryApp implements EntryPoint {
} }
@Override @Override
public void onSuccess(GeoNaItemRef result) { public void onSuccess(GeoportalItemReferences result) {
String theURL = result.getRestrictedLink().getShortURL() != null String theURL = result.getRestrictedLink().getShortURL() != null
? result.getRestrictedLink().getShortURL() ? result.getRestrictedLink().getShortURL()
: result.getRestrictedLink().getCompleteURL(); : result.getRestrictedLink().getCompleteURL();

View File

@ -2,7 +2,7 @@ package org.gcube.portlets.user.geoportaldataentry.client;
import java.util.List; import java.util.List;
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef; import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData; import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
import org.gcube.application.geoportalcommon.shared.SearchingFilter; import org.gcube.application.geoportalcommon.shared.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV; import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
@ -52,7 +52,7 @@ public interface GeoportalDataEntryService extends RemoteService {
* @return the links for * @return the links for
* @throws Exception the exception * @throws Exception the exception
*/ */
GeoNaItemRef getLinksFor(String itemId, String profileID) throws Exception; GeoportalItemReferences getLinksFor(String itemId, String profileID) throws Exception;
/** /**
* Gets the list projects. * Gets the list projects.

View File

@ -2,7 +2,7 @@ package org.gcube.portlets.user.geoportaldataentry.client;
import java.util.List; import java.util.List;
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef; import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData; import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
import org.gcube.application.geoportalcommon.shared.SearchingFilter; import org.gcube.application.geoportalcommon.shared.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV; import org.gcube.application.geoportalcommon.shared.geoportal.ResultDocumentDV;
@ -56,7 +56,7 @@ public interface GeoportalDataEntryServiceAsync {
void getGeonaInitConfig(AsyncCallback<GeoportalISConfig> callback); void getGeonaInitConfig(AsyncCallback<GeoportalISConfig> callback);
void getLinksFor(String itemId, String profileID, AsyncCallback<GeoNaItemRef> callback); void getLinksFor(String itemId, String profileID, AsyncCallback<GeoportalItemReferences> callback);
void getListProjects(String theProfileID, Integer start, Integer limit, SearchingFilter filter, void getListProjects(String theProfileID, Integer start, Integer limit, SearchingFilter filter,
boolean reloadFromService, AsyncCallback<ResultSetPaginatedData> callback); boolean reloadFromService, AsyncCallback<ResultSetPaginatedData> callback);

View File

@ -97,11 +97,16 @@ public class ViewRelationshipPanel extends Composite {
Modal mw = new Modal(true, true); Modal mw = new Modal(true, true);
mw.setTitle("Relationships"); mw.setTitle("Relationships");
int width = Window.getClientWidth(); int width = 0;
if(width > 1024) { try {
width = 1024; width = Window.getClientWidth() * 75 / 100;
mw.setWidth(width); } catch (Exception e) {
// TODO: handle exception
} }
if (width > 500)
mw.setWidth(width);
mw.add(new ViewRelationshipPanel(appManagerBus, fromProject, false)); mw.add(new ViewRelationshipPanel(appManagerBus, fromProject, false));
mw.show(); mw.show();

View File

@ -1,6 +1,6 @@
package org.gcube.portlets.user.geoportaldataentry.client.ui.report; package org.gcube.portlets.user.geoportaldataentry.client.ui.report;
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef; import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV; import org.gcube.application.geoportalcommon.shared.geoportal.project.LifecycleInformationDV;
import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServiceAsync; import org.gcube.portlets.user.geoportaldataentry.client.GeoportalDataEntryServiceAsync;
import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil; import org.gcube.portlets.user.geoportaldataentry.client.ui.utils.HTMLUtil;
@ -79,7 +79,7 @@ public class LifecycleInformationPanel extends FlowPanel {
hpGetLink.add(lc); hpGetLink.add(lc);
add(hpGetLink); add(hpGetLink);
GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(projectID, profileID, GeoportalDataEntryServiceAsync.Util.getInstance().getLinksFor(projectID, profileID,
new AsyncCallback<GeoNaItemRef>() { new AsyncCallback<GeoportalItemReferences>() {
@Override @Override
public void onFailure(Throwable caught) { public void onFailure(Throwable caught) {
@ -88,7 +88,7 @@ public class LifecycleInformationPanel extends FlowPanel {
} }
@Override @Override
public void onSuccess(GeoNaItemRef result) { public void onSuccess(GeoportalItemReferences result) {
hpGetLink.clear(); hpGetLink.clear();
String theURL = result.getRestrictedLink().getShortURL() != null String theURL = result.getRestrictedLink().getShortURL() != null
? result.getRestrictedLink().getShortURL() ? result.getRestrictedLink().getShortURL()

View File

@ -23,7 +23,7 @@ import org.gcube.application.geoportalcommon.geoportal.ProjectsCaller;
import org.gcube.application.geoportalcommon.geoportal.UseCaseDescriptorCaller; import org.gcube.application.geoportalcommon.geoportal.UseCaseDescriptorCaller;
import org.gcube.application.geoportalcommon.shared.GNADataEntryConfigProfile; import org.gcube.application.geoportalcommon.shared.GNADataEntryConfigProfile;
import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile; import org.gcube.application.geoportalcommon.shared.GNADataViewerConfigProfile;
import org.gcube.application.geoportalcommon.shared.GeoNaItemRef; import org.gcube.application.geoportalcommon.shared.GeoportalItemReferences;
import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData; import org.gcube.application.geoportalcommon.shared.ResultSetPaginatedData;
import org.gcube.application.geoportalcommon.shared.SearchingFilter; import org.gcube.application.geoportalcommon.shared.SearchingFilter;
import org.gcube.application.geoportalcommon.shared.config.GcubeUserRole; import org.gcube.application.geoportalcommon.shared.config.GcubeUserRole;
@ -366,14 +366,14 @@ public class GeoportalDataEntryServiceImpl extends RemoteServiceServlet implemen
* @throws Exception the exception * @throws Exception the exception
*/ */
@Override @Override
public GeoNaItemRef getLinksFor(String itemId, String profileID) throws Exception { public GeoportalItemReferences getLinksFor(String itemId, String profileID) throws Exception {
LOG.info("getLinksFor called"); LOG.info("getLinksFor called");
SessionUtil.getCurrentContext(this.getThreadLocalRequest(), true); SessionUtil.getCurrentContext(this.getThreadLocalRequest(), true);
GNADataViewerConfigProfile grViewerProfile = SessionUtil GNADataViewerConfigProfile grViewerProfile = SessionUtil
.getGeportalViewerResourceProfile(getThreadLocalRequest()); .getGeportalViewerResourceProfile(getThreadLocalRequest());
GeoportalCommon gc = new GeoportalCommon(grViewerProfile); GeoportalCommon gc = new GeoportalCommon(grViewerProfile);
GeoNaItemRef item = new GeoNaItemRef(itemId, profileID); GeoportalItemReferences item = new GeoportalItemReferences(itemId, profileID);
item = gc.getPublicLinksFor(item, false); item = gc.getPublicLinksFor(item, false);
LOG.info("Returning: " + item); LOG.info("Returning: " + item);
return item; return item;