Minor Updated
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@92326 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
c3ae48eecf
commit
056ba9821a
|
@ -40,7 +40,6 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Codelist;
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Dataset;
|
||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
||||
|
||||
import com.google.gwt.user.client.rpc.AsyncCallback;
|
||||
import com.google.gwt.user.client.rpc.RemoteService;
|
||||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||
|
||||
|
|
|
@ -11,7 +11,6 @@ import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVExportSession;
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportMonitor;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVImportSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.csv.CSVRowError;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.exception.TDGWTServiceException;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.file.FileUploadMonitor;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.file.HeaderPresence;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.sdmx.SDMXExportMonitor;
|
||||
|
|
|
@ -30,7 +30,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.column.LabelColumnSession
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.type.ChangeColumnTypeMonitor;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.column.type.ChangeColumnTypeSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.open.TDOpenSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.Direction;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.OrderInfo;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.ChangeTableTypeMonitor;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.ChangeTableTypeSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.type.Agencies;
|
||||
|
@ -836,9 +836,10 @@ public class SessionUtil {
|
|||
httpSession.setAttribute(CODELISTS_PAGING_LOADED, listCodelists);
|
||||
}
|
||||
|
||||
public static Direction getCodelistsPagingLoadedDirection(
|
||||
public static ArrayList<OrderInfo> getCodelistsPagingLoadedDirection(
|
||||
HttpSession httpSession) {
|
||||
Direction direction = (Direction) httpSession
|
||||
@SuppressWarnings("unchecked")
|
||||
ArrayList<OrderInfo> direction = (ArrayList<OrderInfo> ) httpSession
|
||||
.getAttribute(CODELISTS_PAGING_LOADED_DIRECTION);
|
||||
if (direction == null) {
|
||||
logger.error("CODELISTS_PAGING_LOADED_DIRECTION was not acquired");
|
||||
|
@ -847,9 +848,10 @@ public class SessionUtil {
|
|||
}
|
||||
|
||||
public static void setCodelistsPagingLoadedDirection(
|
||||
HttpSession httpSession, Direction direction) {
|
||||
HttpSession httpSession, ArrayList<OrderInfo> direction) {
|
||||
|
||||
Direction dir = ((Direction) httpSession
|
||||
@SuppressWarnings("unchecked")
|
||||
ArrayList<OrderInfo> dir = ((ArrayList<OrderInfo>) httpSession
|
||||
.getAttribute(CODELISTS_PAGING_LOADED_DIRECTION));
|
||||
if (dir != null)
|
||||
httpSession.removeAttribute(CODELISTS_PAGING_LOADED_DIRECTION);
|
||||
|
|
|
@ -66,7 +66,6 @@ import org.gcube.data.analysis.tabulardata.service.tabular.metadata.TabularResou
|
|||
import org.gcube.datapublishing.sdmx.api.model.SDMXRegistryDescriptor;
|
||||
import org.gcube.datapublishing.sdmx.api.model.SDMXRegistryInterfaceType;
|
||||
import org.gcube.datapublishing.sdmx.impl.model.GCubeSDMXRegistryDescriptor;
|
||||
|
||||
import org.gcube.portlets.user.td.gwtservice.client.rpc.TDGWTService;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.file.FileUploadSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.server.file.FileUtil;
|
||||
|
@ -112,7 +111,7 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRRightsMetadata
|
|||
import org.gcube.portlets.user.td.gwtservice.shared.tr.open.TDOpenSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.CodelistPagingLoadConfig;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.CodelistPagingLoadResult;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.Direction;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.paging.OrderInfo;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.ChangeTableTypeMonitor;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.ChangeTableTypeSession;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.tr.table.metadata.TabDescriptionsMetadata;
|
||||
|
@ -758,7 +757,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
ArrayList<TabResource> ltr = SessionUtil
|
||||
.getCodelistsPagingLoaded(session);
|
||||
Direction direction = SessionUtil
|
||||
ArrayList<OrderInfo> listOrderInfo = SessionUtil
|
||||
.getCodelistsPagingLoadedDirection(session);
|
||||
String filter = SessionUtil.getCodelistsPagingLoadedFilter(session);
|
||||
|
||||
|
@ -768,7 +767,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
"Error no codelist present in session");
|
||||
}
|
||||
|
||||
if (direction == null) {
|
||||
if (listOrderInfo == null) {
|
||||
logger.error("Error no codelist direction present in session");
|
||||
throw new TDGWTServiceException(
|
||||
"Error no codelist direction present in session");
|
||||
|
@ -796,9 +795,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
}
|
||||
|
||||
if (direction!=plc.getDirection()) {
|
||||
|
||||
}
|
||||
//ordering
|
||||
|
||||
for (int i = plc.getOffset(); i < request_end; i++) {
|
||||
try {
|
||||
|
@ -817,7 +814,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
CodelistPagingLoadResult codelistPagingLoadResult = new CodelistPagingLoadResult();
|
||||
codelistPagingLoadResult.setFilter(plc.getFilter());
|
||||
codelistPagingLoadResult.setDirection(plc.getDirection());
|
||||
codelistPagingLoadResult.setListOrderInfo(plc.getListOrderInfo());
|
||||
codelistPagingLoadResult.setLimit(plc.getLimit());
|
||||
codelistPagingLoadResult.setOffset(plc.getOffset());
|
||||
codelistPagingLoadResult.setTotalLenght(ltr.size());
|
||||
|
|
|
@ -1,6 +1,7 @@
|
|||
package org.gcube.portlets.user.td.gwtservice.shared.tr.paging;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
/**
|
||||
*
|
||||
|
@ -14,19 +15,18 @@ public class CodelistPagingLoadConfig implements Serializable {
|
|||
|
||||
protected int offset;
|
||||
protected int limit;
|
||||
protected Direction direction;
|
||||
protected ArrayList<OrderInfo> listOrderInfo;
|
||||
protected String filter;
|
||||
|
||||
public CodelistPagingLoadConfig(){}
|
||||
|
||||
public CodelistPagingLoadConfig(int offset, int limit, Direction direction, String filter){
|
||||
public CodelistPagingLoadConfig(int offset, int limit, ArrayList<OrderInfo> listOrderInfo, String filter){
|
||||
this.offset=offset;
|
||||
this.limit=limit;
|
||||
this.direction=direction;
|
||||
this.listOrderInfo=listOrderInfo;
|
||||
this.filter=filter;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public int getOffset() {
|
||||
return offset;
|
||||
}
|
||||
|
@ -43,12 +43,12 @@ public class CodelistPagingLoadConfig implements Serializable {
|
|||
this.limit = limit;
|
||||
}
|
||||
|
||||
public Direction getDirection() {
|
||||
return direction;
|
||||
public ArrayList<OrderInfo> getListOrderInfo() {
|
||||
return listOrderInfo;
|
||||
}
|
||||
|
||||
public void setDirection(Direction direction) {
|
||||
this.direction = direction;
|
||||
public void setListOrderInfo(ArrayList<OrderInfo> listOrderInfo) {
|
||||
this.listOrderInfo = listOrderInfo;
|
||||
}
|
||||
|
||||
public String getFilter() {
|
||||
|
@ -62,8 +62,9 @@ public class CodelistPagingLoadConfig implements Serializable {
|
|||
@Override
|
||||
public String toString() {
|
||||
return "CodelistPagingLoadConfig [offset=" + offset + ", limit="
|
||||
+ limit + ", direction=" + direction + ", filter=" + filter
|
||||
+ "]";
|
||||
+ limit + ", listOrderInfo=" + listOrderInfo + ", filter="
|
||||
+ filter + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -19,7 +19,7 @@ public class CodelistPagingLoadResult implements Serializable {
|
|||
protected int limit;
|
||||
protected int totalLenght;
|
||||
protected ArrayList<TabResource> ltr;
|
||||
protected Direction direction;
|
||||
protected ArrayList<OrderInfo> listOrderInfo;
|
||||
protected String filter;
|
||||
|
||||
public int getOffset() {
|
||||
|
@ -54,12 +54,12 @@ public class CodelistPagingLoadResult implements Serializable {
|
|||
this.ltr = ltr;
|
||||
}
|
||||
|
||||
public Direction getDirection() {
|
||||
return direction;
|
||||
public ArrayList<OrderInfo> getListOrderInfo() {
|
||||
return listOrderInfo;
|
||||
}
|
||||
|
||||
public void setDirection(Direction direction) {
|
||||
this.direction = direction;
|
||||
public void setListOrderInfo(ArrayList<OrderInfo> listOrderInfo) {
|
||||
this.listOrderInfo = listOrderInfo;
|
||||
}
|
||||
|
||||
public String getFilter() {
|
||||
|
@ -74,7 +74,8 @@ public class CodelistPagingLoadResult implements Serializable {
|
|||
public String toString() {
|
||||
return "CodelistPagingLoadResult [offset=" + offset + ", limit="
|
||||
+ limit + ", totalLenght=" + totalLenght + ", ltr=" + ltr
|
||||
+ ", direction=" + direction + ", filter=" + filter + "]";
|
||||
+ ", listOrderInfo=" + listOrderInfo + ", filter=" + filter
|
||||
+ "]";
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
package org.gcube.portlets.user.td.gwtservice.shared.tr.paging;
|
||||
|
||||
public enum Direction {
|
||||
asc,
|
||||
desc;
|
||||
ASC,
|
||||
DESC;
|
||||
}
|
||||
|
|
|
@ -0,0 +1,48 @@
|
|||
package org.gcube.portlets.user.td.gwtservice.shared.tr.paging;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi" <a
|
||||
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class OrderInfo implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = 5217530496987635366L;
|
||||
protected Direction direction;
|
||||
protected String field;
|
||||
|
||||
public OrderInfo() {
|
||||
|
||||
}
|
||||
|
||||
public OrderInfo(Direction direction, String field) {
|
||||
this.direction = direction;
|
||||
this.field = field;
|
||||
|
||||
}
|
||||
|
||||
public Direction getDirection() {
|
||||
return direction;
|
||||
}
|
||||
|
||||
public void setDirection(Direction direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
|
||||
public String getField() {
|
||||
return field;
|
||||
}
|
||||
|
||||
public void setField(String field) {
|
||||
this.field = field;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderInfo [direction=" + direction + ", field=" + field + "]";
|
||||
}
|
||||
|
||||
}
|
|
@ -1,40 +0,0 @@
|
|||
package org.gcube.portlets.user.td.gwtservice.shared.util;
|
||||
|
||||
import java.io.Serializable;
|
||||
|
||||
|
||||
/**
|
||||
*
|
||||
* @author "Giancarlo Panichi"
|
||||
* <a href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
|
||||
*
|
||||
*/
|
||||
public class OrderInfo implements Serializable{
|
||||
|
||||
/**
|
||||
*
|
||||
*/
|
||||
private static final long serialVersionUID = 5217530496987635366L;
|
||||
protected String direction;
|
||||
protected String field;
|
||||
|
||||
public String getDirection() {
|
||||
return direction;
|
||||
}
|
||||
public void setDirection(String direction) {
|
||||
this.direction = direction;
|
||||
}
|
||||
public String getField() {
|
||||
return field;
|
||||
}
|
||||
public void setField(String field) {
|
||||
this.field = field;
|
||||
}
|
||||
@Override
|
||||
public String toString() {
|
||||
return "OrderInfo [direction=" + direction + ", field=" + field + "]";
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
Loading…
Reference in New Issue