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.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;
|
||||
|
||||
|
|
|
@ -345,11 +345,13 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||
|
||||
|
||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||
aslSession.getUsername()));
|
||||
TabularDataService service = TabularDataServiceFactory.getService();
|
||||
|
||||
|
||||
logger.debug("getColumns():"+trId.toString());
|
||||
|
||||
Table table = service.getTable(new TableId(Long.valueOf(trId
|
||||
.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.tabular.TabularResource;
|
||||
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.TabularResourceMetadata;
|
||||
import org.gcube.portlets.user.td.gwtservice.shared.Constants;
|
||||
|
@ -42,7 +40,7 @@ public class TestMetadata {
|
|||
|
||||
@Test
|
||||
public void listTR() throws Exception {
|
||||
System.out.println("------------List TR--------------");
|
||||
System.out.println("################ List TR ####################");
|
||||
ScopeProvider.instance.set(Constants.DEFAULT_SCOPE);
|
||||
AuthorizationProvider.instance.set(new AuthorizationToken(Constants.DEFAULT_USER));
|
||||
TabularDataService service = TabularDataServiceFactory.getService();
|
||||
|
@ -52,27 +50,42 @@ public class TestMetadata {
|
|||
Table lastTable=null;
|
||||
for (TabularResource tr : trs) {
|
||||
lastTable=service.getLastTable(tr.getId());
|
||||
|
||||
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 {
|
||||
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();
|
||||
System.out.println("New TR [id="+tr.getId().getValue()+" date:"+sdf.format(tr.getCreationDate().getTime())+"]");
|
||||
tr.setMetadata(new NameMetadata("Sinatra"));
|
||||
tr.setMetadata(new DescriptionMetadata("Sinatra Collection"));
|
||||
tr.setMetadata(new RightsMetadata("Sinatra free"));
|
||||
ArrayList<TRMetadata> metas=showMetadata(tr);
|
||||
TabResource tabResource=new TabResource();
|
||||
updateTabResourceInformation(tabResource,metas);
|
||||
System.out.println("------");
|
||||
System.out.println(tabResource.toString());
|
||||
|
||||
//System.out.println("New TR [id="+tr.getId().getValue()+" date:"+sdf.format(tr.getCreationDate().getTime())+"]");
|
||||
//tr.setMetadata(new NameMetadata("Sinatra"));
|
||||
//tr.setMetadata(new DescriptionMetadata("Sinatra Collection"));
|
||||
//tr.setMetadata(new RightsMetadata("Sinatra free"));
|
||||
|
||||
//TabResource tabResource=new TabResource();
|
||||
//updateTabResourceInformation(tabResource,metas);
|
||||
//System.out.println("------");
|
||||
//System.out.println(tabResource.toString());
|
||||
|
||||
//showMoreInformation(service);
|
||||
|
||||
|
|
Loading…
Reference in New Issue