adapted to the new identifier for dialogs

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@86681 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-12-06 15:57:55 +00:00
parent c59e783d75
commit ebe705fd16
5 changed files with 12 additions and 117 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/reports-4.6.12-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/reports-4.6.13-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -31,5 +31,5 @@
</attributes>
</classpathentry>
<classpathentry kind="con" path="com.google.gwt.eclipse.core.GWT_CONTAINER"/>
<classpathentry kind="output" path="target/reports-4.6.12-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/reports-4.6.13-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -2,6 +2,6 @@
<<<<<<<=.mine
>>>>>>>=.r71295
eclipse.preferences.version=1
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.6.12-SNAPSHOT
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.6.13-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -12,7 +12,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>reports</artifactId>
<packaging>war</packaging>
<version>4.6.12-SNAPSHOT</version>
<version>4.6.13-SNAPSHOT</version>
<name>gCube Reports Manager</name>
<description>
gCube Reports Portlet.

View File

@ -68,7 +68,7 @@ public class ImportVMEReportDialog extends Window {
return false;
}
};
filter.setEmptyText("Filter by Name");
filter.setEmptyText("Filter by Title");
filter.setWidth("250px");
hp.add(filter);
hp.setPixelSize(250, 20);
@ -197,13 +197,13 @@ public class ImportVMEReportDialog extends Window {
ColumnConfig column = new ColumnConfig();
column.setId("rfmo");
column.setHeader("RFMO");
column.setHeader("Owner");
column.setWidth(50);
configs.add(column);
column = new ColumnConfig();
column.setId("name");
column.setHeader("Name");
column.setHeader("VME Title");
column.setWidth(150);
configs.add(column);

View File

@ -14,11 +14,9 @@ import java.util.ArrayList;
import java.util.Calendar;
import java.util.Date;
import java.util.List;
import java.util.Random;
import java.util.UUID;
import java.util.Vector;
import javax.inject.Inject;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpSession;
import javax.xml.bind.DatatypeConverter;
@ -32,24 +30,11 @@ import org.apache.commons.io.IOUtils;
import org.gcube.application.framework.accesslogger.library.impl.AccessLogger;
import org.gcube.application.framework.core.session.ASLSession;
import org.gcube.application.framework.core.session.SessionManager;
import org.gcube.application.reporting.Property;
import org.gcube.application.reporting.ReportsModeler;
import org.gcube.application.reporting.component.Heading;
import org.gcube.application.reporting.component.Instruction;
import org.gcube.application.reporting.component.ReportSequence;
import org.gcube.application.reporting.component.TextInput;
import org.gcube.application.reporting.component.Title;
import org.gcube.application.reporting.component.interfaces.ReportComponent;
import org.gcube.application.reporting.reference.Column;
import org.gcube.application.reporting.reference.DBTableRow;
import org.gcube.application.reporting.reference.ReferenceReport;
import org.gcube.application.reporting.reference.ReferenceReportType;
import org.gcube.application.rsg.client.RsgClient;
import org.gcube.application.rsg.service.RsgService;
import org.gcube.application.rsg.service.dto.NameValue;
import org.gcube.application.rsg.service.dto.ReportEntry;
import org.gcube.application.rsg.service.dto.ReportType;
import org.gcube.application.rsg.support.builder.annotations.Builder;
import org.gcube.application.rsg.support.builder.exceptions.ReportBuilderException;
import org.gcube.application.rsg.support.builder.impl.ReportManagerReportBuilder;
import org.gcube.application.rsg.support.model.components.impl.CompiledReport;
@ -1494,14 +1479,8 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
RsgService rsgClient = new RsgClient();
for (ReportEntry re : rsgClient.listReports(type)) {
String rfmo = "unknown RFMO";
String name = "unknown name";
for (NameValue nv : re.getNameValueList()) {
if (nv.getName().equals("RFMO"))
rfmo = nv.getValue();
if (nv.getName().equals("Name"))
name = nv.getValue();
}
String rfmo = re.getOwner();
String name = re.getIdentifier();
toReturn.add(new VMEReportBean(""+re.getId(), rfmo, name));
}
@ -1522,43 +1501,9 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
RsgService rsgClient = new RsgClient();
for (ReportEntry re :rsgClient.listReports(new ReportType(refType.getId()))) {
String name = "unknown identifier";
switch (refType) {
case InformationSource:
for (NameValue nv : re.getNameValueList()) {
if (nv.getName().equals("Citation")) {
name = nv.getValue();
break;
}
}
break;
case GeneralMeasure:
for (NameValue nv : re.getNameValueList()) {
if (nv.getName().equals("Rfmo")) {
name = nv.getValue();
break;
}
}
case Rfmo:
for (NameValue nv : re.getNameValueList()) {
if (nv.getName().equals("Name")) {
name = nv.getValue();
break;
}
}
case FisheryAreasHistory:
case VMEsHistory:
for (NameValue nv : re.getNameValueList()) {
if (nv.getName().equals("Year")) {
name = nv.getValue();
break;
}
}
default:
break;
}
toReturn.add(new VMEReportBean(""+re.getId(), "", name));
String rfmo = re.getOwner();
String name = re.getIdentifier();
toReturn.add(new VMEReportBean(""+re.getId(), rfmo, name));
}
return toReturn;
}
@ -1604,54 +1549,4 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
}
return model;
}
private ReportsModeler addSection2(ReportsModeler rm) {
rm.add(new Heading(1, "Specific Measure"));
ReportSequence seq = new ReportSequence(UUID.randomUUID().toString());
seq.add(new Heading(2, "Year"));
seq.add(new TextInput());
seq.add(new Heading(2, "Validity Period - Start"));
seq.add(new TextInput());
seq.add(new Heading(2, "Validity Period - End"));
seq.add(new TextInput());
seq.add(getTestReference(ReferenceReportType.InformationSource, true));
rm.add(seq);
return rm;
}
/**
* TODO: remove
* @return
*/
private ReferenceReport getTestReference(ReferenceReportType type, boolean single) {
//construct the options (the references)
ArrayList<DBTableRow> dBTableRows = new ArrayList<DBTableRow>();
ArrayList<Column> md = new ArrayList<Column>();
Random generator = new Random();
int year = generator.nextInt(15) + 2000;
//construct the references
md.add(new Column("Meeting Date", ""+year));
md.add(new Column("Report Summary", "Aenean vulputate ac dui eu interdum. Nullam tincidunt hendrerit sollicitudin."));
md.add(new Column("Committee", "Lorem ipsum dolor sit amet, consectetur adipiscing elit"));
md.add(new Column("URL", "http://archive.nafo.int/open/fc/2012/fcdoc12-01.pdf"));
md.add(new Column("Citation", "(Rossi et Al) adipiscing elit oekfha lfkahjf lakjfha lkfahjf alkjdfh "));
md.add(new Column("Type", "The type"));
dBTableRows.add(new DBTableRow("primaryKey", md));
return new ReferenceReport(type, dBTableRows, single);
}
/**
* TODO: remove once you get real names
* @return
*/
private static String generateRandomWord() {
Random random = new Random();
char[] word = new char[random.nextInt(7)+5]; // words of length 5 through 12
for(int j = 0; j < word.length; j++) {
word[j] = (char)('a' + random.nextInt(26));
}
return new String(word);
}
}