Minor updated

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-gwt-service@86482 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2013-12-03 11:22:07 +00:00
parent c3bd0793a1
commit 00fb558156
5 changed files with 119 additions and 133 deletions

View File

@ -86,10 +86,10 @@ import org.gcube.portlets.user.td.gwtservice.shared.tr.TabResource;
import org.gcube.portlets.user.td.gwtservice.shared.tr.TableData;
import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRAgencyMetadata;
import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRCreationDateMetadata;
import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRDescriptionsMetadata;
import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRDescriptionMetadata;
import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRLocalizedText;
import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRMetadata;
import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRNamesMetadata;
import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRNameMetadata;
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.table.metadata.TabDescriptionsMetadata;
@ -1278,41 +1278,16 @@ public class TDGWTServiceImpl extends RemoteServiceServlet implements
ArrayList<TRMetadata> listTRMetadata = new ArrayList<TRMetadata>();
for (TabularResourceMetadata trMetadata : trMetas) {
if (trMetadata instanceof DescriptionMetadata) {
TRDescriptionsMetadata trDescriptionsMetadata = new TRDescriptionsMetadata();
ArrayList<TRLocalizedText> listTRLocalizedText = new ArrayList<TRLocalizedText>();
List<LocalizedText> lLocalizedText = ((DescriptionsMetadata) trMetadata)
.getTexts();
int i = 0;
for (LocalizedText lt : lLocalizedText) {
TRLocalizedText trLocalizedText = new TRLocalizedText();
trLocalizedText.setId(i);
trLocalizedText.setValue(lt.getValue());
trLocalizedText.setLocaleCode(lt.getLocale());
listTRLocalizedText.add(trLocalizedText);
i++;
}
trDescriptionsMetadata
.setListTRLocalizedText(listTRLocalizedText);
listTRMetadata.add(trDescriptionsMetadata);
if (trMetadata instanceof org.gcube.data.analysis.tabulardata.service.tabular.metadata.DescriptionMetadata) {
TRDescriptionMetadata trDescriptionMetadata = new TRDescriptionMetadata();
trDescriptionMetadata.setValue(((org.gcube.data.analysis.tabulardata.service.tabular.metadata.DescriptionMetadata) trMetadata)
.getValue());
listTRMetadata.add(trDescriptionMetadata);
} else {
if (trMetadata instanceof NamesMetadata) {
TRNamesMetadata trNamesMetadata = new TRNamesMetadata();
ArrayList<TRLocalizedText> listTRLocalizedText = new ArrayList<TRLocalizedText>();
List<LocalizedText> lLocalizedText = ((NamesMetadata) trMetadata)
.getTexts();
int i = 0;
for (LocalizedText lt : lLocalizedText) {
TRLocalizedText trLocalizedText = new TRLocalizedText();
trLocalizedText.setId(i);
trLocalizedText.setValue(lt.getValue());
trLocalizedText.setLocaleCode(lt.getLocale());
listTRLocalizedText.add(trLocalizedText);
i++;
}
trNamesMetadata
.setListTRLocalizedText(listTRLocalizedText);
listTRMetadata.add(trNamesMetadata);
if (trMetadata instanceof org.gcube.data.analysis.tabulardata.service.tabular.metadata.NameMetadata) {
TRNameMetadata trNameMetadata = new TRNameMetadata();
trNameMetadata.setValue(((org.gcube.data.analysis.tabulardata.service.tabular.metadata.NameMetadata)trMetadata).getValue());
listTRMetadata.add(trNameMetadata);
} else {
if (trMetadata instanceof AgencyMetadata) {
TRAgencyMetadata trAgencyMetadata = new TRAgencyMetadata();

View File

@ -0,0 +1,53 @@
package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TRDescriptionMetadata implements TRMetadata {
private static final long serialVersionUID = -2663624208642658528L;
String id="DescriptionMetadata";
String title="Description";
String value;
@Override
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
public String toString() {
return "TRDescriptionMetadata [id=" + id + ", title=" + title
+ ", value=" + value + "]";
}
}

View File

@ -1,49 +0,0 @@
package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata;
import java.util.ArrayList;
import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRLocalizedText;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TRDescriptionsMetadata implements TRMetadata {
private static final long serialVersionUID = -2663624208642658528L;
String id="DescriptionsMetadata";
String title="Descriptions";
ArrayList<TRLocalizedText> listTRLocalizedText;
public ArrayList<TRLocalizedText> getListTRLocalizedText() {
return listTRLocalizedText;
}
public void setListTRLocalizedText(ArrayList<TRLocalizedText> listTRLocalizedText) {
this.listTRLocalizedText = listTRLocalizedText;
}
@Override
public String toString() {
return "TRDescriptionsMetadata [listTRLocalizedText=" + listTRLocalizedText
+ "]";
}
@Override
public String getId() {
return id;
}
@Override
public String getTitle() {
return title;
}
}

View File

@ -0,0 +1,55 @@
package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TRNameMetadata implements TRMetadata {
private static final long serialVersionUID = 7635332011036656032L;
String id="NameMetadata";
String title="Name";
String value;
@Override
public String getId() {
return id;
}
public void setId(String id) {
this.id = id;
}
@Override
public String getTitle() {
return title;
}
public void setTitle(String title) {
this.title = title;
}
public String getValue() {
return value;
}
public void setValue(String value) {
this.value = value;
}
@Override
public String toString() {
return "TRNameMetadata [id=" + id + ", title=" + title + ", value="
+ value + "]";
}
}

View File

@ -1,48 +0,0 @@
package org.gcube.portlets.user.td.gwtservice.shared.tr.metadata;
import java.util.ArrayList;
import org.gcube.portlets.user.td.gwtservice.shared.tr.metadata.TRLocalizedText;
/**
*
* @author "Giancarlo Panichi" <a
* href="mailto:g.panichi@isti.cnr.it">g.panichi@isti.cnr.it</a>
*
*/
public class TRNamesMetadata implements TRMetadata {
private static final long serialVersionUID = 7635332011036656032L;
String id="NamesMetadata";
String title="Names";
ArrayList<TRLocalizedText> listTRLocalizedText;
public ArrayList<TRLocalizedText> getListTRLocalizedText() {
return listTRLocalizedText;
}
public void setListTRLocalizedText(ArrayList<TRLocalizedText> listTRLocalizedText) {
this.listTRLocalizedText = listTRLocalizedText;
}
@Override
public String toString() {
return "TRNamesMetadata [listTRLocalizedText=" + listTRLocalizedText + "]";
}
@Override
public String getId() {
return id;
}
@Override
public String getTitle() {
return title;
}
}