Minor Update
git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@93051 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
9268dcdfae
commit
f26ed57905
|
@ -254,7 +254,7 @@ public interface TDGWTService extends RemoteService {
|
|||
*/
|
||||
public ArrayList<ColumnData> getColumns(TRId trId)
|
||||
throws TDGWTServiceException;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Retrieves the list of columns in the table provided by trId
|
||||
|
|
|
@ -88,6 +88,7 @@ public interface TDGWTServiceAsync {
|
|||
|
||||
void getColumns(TRId trId, AsyncCallback<ArrayList<ColumnData>> callback);
|
||||
|
||||
|
||||
void getColumnsForDimension(TRId trId, AsyncCallback<ArrayList<ColumnData>> callback);
|
||||
|
||||
void getColumn(TRId trId, String columnName, AsyncCallback<ColumnData> callback);
|
||||
|
|
|
@ -47,6 +47,7 @@ import org.gcube.data.analysis.tabulardata.model.column.ColumnType;
|
|||
import org.gcube.data.analysis.tabulardata.model.column.type.CodeColumnType;
|
||||
import org.gcube.data.analysis.tabulardata.model.column.type.CodeNameColumnType;
|
||||
import org.gcube.data.analysis.tabulardata.model.column.type.IdColumnType;
|
||||
import org.gcube.data.analysis.tabulardata.model.column.type.ValidationColumnType;
|
||||
import org.gcube.data.analysis.tabulardata.model.metadata.common.DescriptionsMetadata;
|
||||
import org.gcube.data.analysis.tabulardata.model.metadata.common.LocalizedText;
|
||||
import org.gcube.data.analysis.tabulardata.model.metadata.common.NamesMetadata;
|
||||
|
@ -412,38 +413,44 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
if (c.getColumnType() instanceof IdColumnType) {
|
||||
|
||||
} else {
|
||||
ColumnData cData = new ColumnData();
|
||||
cData.setId(Integer.toString(i));
|
||||
cData.setColumnId(c.getLocalId().getValue());
|
||||
cData.setName(c.getName());
|
||||
cData.setTypeCode(c.getColumnType().getCode());
|
||||
cData.setTypeName(c.getColumnType().getName());
|
||||
cData.setDataTypeName(c.getDataType().getName());
|
||||
NamesMetadata labelsMetadata = null;
|
||||
try {
|
||||
labelsMetadata = c.getMetadata(NamesMetadata.class);
|
||||
} catch (NoSuchMetadataException e) {
|
||||
logger.debug("labelMetadata: NoSuchMetadataException "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
if (c.getColumnType() instanceof ValidationColumnType) {
|
||||
|
||||
if (labelsMetadata == null) {
|
||||
cData.setLabel("nolabel");
|
||||
logger.debug("LabelsMetadata no labels");
|
||||
} else {
|
||||
LocalizedText cl = null;
|
||||
cl = labelsMetadata.getTextWithLocale("en");
|
||||
if (cl == null) {
|
||||
cData.setLabel("nolabel");
|
||||
logger.debug("ColumnLabel no label in en");
|
||||
} else {
|
||||
cData.setLabel(cl.getValue());
|
||||
logger.debug("Column Set Label: " + cl.getValue());
|
||||
ColumnData cData = new ColumnData();
|
||||
cData.setId(Integer.toString(i));
|
||||
cData.setColumnId(c.getLocalId().getValue());
|
||||
cData.setName(c.getName());
|
||||
cData.setTypeCode(c.getColumnType().getCode());
|
||||
cData.setTypeName(c.getColumnType().getName());
|
||||
cData.setDataTypeName(c.getDataType().getName());
|
||||
NamesMetadata labelsMetadata = null;
|
||||
try {
|
||||
labelsMetadata = c.getMetadata(NamesMetadata.class);
|
||||
} catch (NoSuchMetadataException e) {
|
||||
logger.debug("labelMetadata: NoSuchMetadataException "
|
||||
+ e.getLocalizedMessage());
|
||||
}
|
||||
|
||||
if (labelsMetadata == null) {
|
||||
cData.setLabel("nolabel");
|
||||
logger.debug("LabelsMetadata no labels");
|
||||
} else {
|
||||
LocalizedText cl = null;
|
||||
cl = labelsMetadata.getTextWithLocale("en");
|
||||
if (cl == null) {
|
||||
cData.setLabel("nolabel");
|
||||
logger.debug("ColumnLabel no label in en");
|
||||
} else {
|
||||
cData.setLabel(cl.getValue());
|
||||
logger.debug("Column Set Label: "
|
||||
+ cl.getValue());
|
||||
}
|
||||
}
|
||||
cData.setTrId(trId);
|
||||
columns.add(cData);
|
||||
i++;
|
||||
|
||||
}
|
||||
cData.setTrId(trId);
|
||||
columns.add(cData);
|
||||
i++;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -3875,7 +3882,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
|
||||
TabularResource tr = service.getTabularResource(serviceTR);
|
||||
List<String> sharedWith = tr.getSharedWithUsers();
|
||||
logger.debug("Shared with Users: "+sharedWith);
|
||||
logger.debug("Shared with Users: " + sharedWith);
|
||||
ArrayList<Contacts> contacts = new ArrayList<Contacts>();
|
||||
for (String user : sharedWith) {
|
||||
Contacts cont = new Contacts(null, user, false);
|
||||
|
@ -3896,7 +3903,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
try {
|
||||
HttpSession session = this.getThreadLocalRequest().getSession();
|
||||
ASLSession aslSession = SessionUtil.getAslSession(session);
|
||||
logger.debug("ShareInfo: "+shareInfo);
|
||||
logger.debug("ShareInfo: " + shareInfo);
|
||||
AuthorizationProvider.instance.set(new AuthorizationToken(
|
||||
aslSession.getUsername()));
|
||||
TabularDataService service = TabularDataServiceFactory.getService();
|
||||
|
@ -3907,10 +3914,10 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
List<String> users = new ArrayList<String>();
|
||||
for (Contacts cont : shareInfo.getContacts()) {
|
||||
String user = cont.getLogin();
|
||||
users.add(user);
|
||||
users.add(user);
|
||||
}
|
||||
String[] usersArray = users.toArray(new String[0]);
|
||||
logger.debug("Share with Users: "+users);
|
||||
logger.debug("Share with Users: " + users);
|
||||
service.share(serviceTR, usersArray);
|
||||
|
||||
} catch (Exception e) {
|
||||
|
@ -3924,7 +3931,7 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
|
|||
public void setTabResourceInformation(TabResource tabResource)
|
||||
throws TDGWTServiceException {
|
||||
// TODO Auto-generated method stub
|
||||
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue