Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@90898 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
37fbd70b60
commit
d0b8e6b7d1
|
@ -30,7 +30,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.gwtservice.shared.tr.type.Dataset;
|
||||||
import org.gcube.portlets.user.td.widgetcommonevent.shared.TRId;
|
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.RemoteService;
|
||||||
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
import com.google.gwt.user.client.rpc.RemoteServiceRelativePath;
|
||||||
|
|
||||||
|
|
|
@ -345,11 +345,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
||||||
try {
|
try {
|
||||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||||
|
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||||
aslSession.getUsername()));
|
aslSession.getUsername()));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
|
||||||
|
logger.debug("getColumns():"+trId.toString());
|
||||||
|
|
||||||
Table table = service.getTable(new TableId(Long.valueOf(trId
|
Table table = service.getTable(new TableId(Long.valueOf(trId
|
||||||
.getTableId())));
|
.getTableId())));
|
||||||
|
|
||||||
|
|
|
@ -14,8 +14,6 @@ import org.gcube.data.analysis.tabulardata.service.TabularDataService;
|
||||||
import org.gcube.data.analysis.tabulardata.service.impl.TabularDataServiceFactory;
|
import org.gcube.data.analysis.tabulardata.service.impl.TabularDataServiceFactory;
|
||||||
import org.gcube.data.analysis.tabulardata.service.tabular.TabularResource;
|
import org.gcube.data.analysis.tabulardata.service.tabular.TabularResource;
|
||||||
import org.gcube.data.analysis.tabulardata.service.tabular.metadata.AgencyMetadata;
|
import org.gcube.data.analysis.tabulardata.service.tabular.metadata.AgencyMetadata;
|
||||||
import org.gcube.data.analysis.tabulardata.service.tabular.metadata.DescriptionMetadata;
|
|
||||||
import org.gcube.data.analysis.tabulardata.service.tabular.metadata.NameMetadata;
|
|
||||||
import org.gcube.data.analysis.tabulardata.service.tabular.metadata.RightsMetadata;
|
import org.gcube.data.analysis.tabulardata.service.tabular.metadata.RightsMetadata;
|
||||||
import org.gcube.data.analysis.tabulardata.service.tabular.metadata.TabularResourceMetadata;
|
import org.gcube.data.analysis.tabulardata.service.tabular.metadata.TabularResourceMetadata;
|
||||||
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
|
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
|
||||||
|
@ -42,7 +40,7 @@ public class TestMetadata {
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
public void listTR() throws Exception {
|
public void listTR() throws Exception {
|
||||||
System.out.println("------------List TR--------------");
|
System.out.println("################ List TR ####################");
|
||||||
ScopeProvider.instance.set(Constants.DEFAULT_SCOPE);
|
ScopeProvider.instance.set(Constants.DEFAULT_SCOPE);
|
||||||
AuthorizationProvider.instance.set(new AuthorizationToken(Constants.DEFAULT_USER));
|
AuthorizationProvider.instance.set(new AuthorizationToken(Constants.DEFAULT_USER));
|
||||||
TabularDataService service = TabularDataServiceFactory.getService();
|
TabularDataService service = TabularDataServiceFactory.getService();
|
||||||
|
@ -52,27 +50,42 @@ public class TestMetadata {
|
||||||
Table lastTable=null;
|
Table lastTable=null;
|
||||||
for (TabularResource tr : trs) {
|
for (TabularResource tr : trs) {
|
||||||
lastTable=service.getLastTable(tr.getId());
|
lastTable=service.getLastTable(tr.getId());
|
||||||
|
|
||||||
if(lastTable!=null){
|
if(lastTable!=null){
|
||||||
System.out.println("TabularResource: [" + tr.getId()+", lastTable: "+lastTable.getTableType().getName()+"]");
|
System.out.println("TabularResource: [" + tr.getId()+", lastTableId: "+lastTable.getId().getValue()+", lastTableType: "+lastTable.getTableType().getName()+"]");
|
||||||
|
System.out.println("--------Column:");
|
||||||
|
List<Column> cols = lastTable.getColumns();
|
||||||
|
for(Column c:cols){
|
||||||
|
System.out.println(c.toString());
|
||||||
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
System.out.println("TabularResource: [" + tr.getId()+", lastTable: "+lastTable+"]");
|
System.out.println("TabularResource: [" + tr.getId()+", lastTable: "+lastTable+"]");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
System.out.println("---------Metadata:");
|
||||||
|
|
||||||
|
ArrayList<TRMetadata> metas=showMetadata(tr);
|
||||||
|
for(TRMetadata meta:metas){
|
||||||
|
System.out.println(meta.toString());
|
||||||
|
}
|
||||||
|
System.out.println("############################################################");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
TabularResource tr=service.createTabularResource();
|
//TabularResource tr=service.createTabularResource();
|
||||||
// Date date = Calendar.getInstance().getTime();
|
// Date date = Calendar.getInstance().getTime();
|
||||||
System.out.println("New TR [id="+tr.getId().getValue()+" date:"+sdf.format(tr.getCreationDate().getTime())+"]");
|
|
||||||
tr.setMetadata(new NameMetadata("Sinatra"));
|
//System.out.println("New TR [id="+tr.getId().getValue()+" date:"+sdf.format(tr.getCreationDate().getTime())+"]");
|
||||||
tr.setMetadata(new DescriptionMetadata("Sinatra Collection"));
|
//tr.setMetadata(new NameMetadata("Sinatra"));
|
||||||
tr.setMetadata(new RightsMetadata("Sinatra free"));
|
//tr.setMetadata(new DescriptionMetadata("Sinatra Collection"));
|
||||||
ArrayList<TRMetadata> metas=showMetadata(tr);
|
//tr.setMetadata(new RightsMetadata("Sinatra free"));
|
||||||
TabResource tabResource=new TabResource();
|
|
||||||
updateTabResourceInformation(tabResource,metas);
|
//TabResource tabResource=new TabResource();
|
||||||
System.out.println("------");
|
//updateTabResourceInformation(tabResource,metas);
|
||||||
System.out.println(tabResource.toString());
|
//System.out.println("------");
|
||||||
|
//System.out.println(tabResource.toString());
|
||||||
|
|
||||||
//showMoreInformation(service);
|
//showMoreInformation(service);
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue