integration started
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@86578 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
1c18910a01
commit
2679e47978
|
@ -1,6 +1,6 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<classpath>
|
||||
<classpathentry kind="src" output="target/reports-4.6.8-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
||||
<classpathentry kind="src" output="target/reports-4.6.9-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.8-SNAPSHOT/WEB-INF/classes"/>
|
||||
<classpathentry kind="output" path="target/reports-4.6.9-SNAPSHOT/WEB-INF/classes"/>
|
||||
</classpath>
|
||||
|
|
|
@ -2,6 +2,6 @@
|
|||
<<<<<<<=.mine
|
||||
>>>>>>>=.r71295
|
||||
eclipse.preferences.version=1
|
||||
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.6.8-SNAPSHOT
|
||||
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.6.9-SNAPSHOT
|
||||
warSrcDir=src/main/webapp
|
||||
warSrcDirIsOutput=false
|
||||
|
|
|
@ -8,6 +8,27 @@
|
|||
<dependent-module archiveName="gcube-reporting-modeler-1.1.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/gcube-reporting-modeler/gcube-reporting-modeler">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="reports-store-gateway-client-0.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-client/reports-store-gateway-client">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="reports-store-gateway-support-model-0.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-support-model/reports-store-gateway-support-model">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="reports-store-gateway-interface-dto-0.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-interface-dto/reports-store-gateway-interface-dto">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="reports-store-gateway-web-base-0.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-web-base/reports-store-gateway-web-base">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="reports-store-gateway-support-compiler-0.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-support-compiler/reports-store-gateway-support-compiler">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="reports-store-gateway-support-compiler-bridge-0.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-support-compiler-bridge/reports-store-gateway-support-compiler-bridge">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="reports-store-gateway-support-builder-0.0.3-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-support-builder/reports-store-gateway-support-builder">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
<dependent-module archiveName="document-workflow-library-1.4.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/document-workflow-library/document-workflow-library">
|
||||
<dependency-type>uses</dependency-type>
|
||||
</dependent-module>
|
||||
|
|
12
pom.xml
12
pom.xml
|
@ -12,7 +12,7 @@
|
|||
<groupId>org.gcube.portlets.user</groupId>
|
||||
<artifactId>reports</artifactId>
|
||||
<packaging>war</packaging>
|
||||
<version>4.6.8-SNAPSHOT</version>
|
||||
<version>4.6.9-SNAPSHOT</version>
|
||||
<name>gCube Reports Manager</name>
|
||||
<description>
|
||||
gCube Reports Portlet.
|
||||
|
@ -119,7 +119,7 @@
|
|||
<dependency>
|
||||
<groupId>com.allen-sauer.gwt.log</groupId>
|
||||
<artifactId>gwt-log</artifactId>
|
||||
</dependency>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.application</groupId>
|
||||
<artifactId>gcube-reporting-modeler</artifactId>
|
||||
|
@ -128,7 +128,13 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.application.rsg</groupId>
|
||||
<artifactId>reports-store-gateway-client</artifactId>
|
||||
<version>[0.0.1-SNAPSHOT,)</version>
|
||||
<version>[0.0.3-SNAPSHOT, 1.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.jboss.spec.javax.el</groupId>
|
||||
<artifactId>jboss-el-api_3.0_spec</artifactId>
|
||||
<version>[0.0.1-SNAPSHOT, )</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
|
|
|
@ -149,7 +149,7 @@ public class Presenter {
|
|||
}
|
||||
}
|
||||
else {
|
||||
importVMEReport(event.getId(), event.getType());
|
||||
importVMEReport(event.getId(), event.getName(), event.getType());
|
||||
}
|
||||
}
|
||||
});
|
||||
|
@ -1198,9 +1198,9 @@ public class Presenter {
|
|||
dlg.show();
|
||||
}
|
||||
|
||||
private void importVMEReport(String reportId, final VMETypeIdentifier type) {
|
||||
private void importVMEReport(String reportId, String name, final VMETypeIdentifier type) {
|
||||
showLoading();
|
||||
reportService.importVMEReport(reportId, type, new AsyncCallback<Model>() {
|
||||
reportService.importVMEReport(reportId, name, type, new AsyncCallback<Model>() {
|
||||
@Override
|
||||
public void onFailure(Throwable caught) {
|
||||
Window.alert("Could not Load Report Model, error on server.: " + caught.getMessage());
|
||||
|
|
|
@ -25,7 +25,7 @@ public interface ReportService extends RemoteService{
|
|||
|
||||
ArrayList<VMEReportBean> listVMEReportRefByType(VMETypeIdentifier refType);
|
||||
|
||||
Model importVMEReport(String id, VMETypeIdentifier refType);
|
||||
Model importVMEReport(String id, String name, VMETypeIdentifier refType);
|
||||
|
||||
Model getVMEReportRef2Associate(String id, VMETypeIdentifier refType);
|
||||
|
||||
|
|
|
@ -77,7 +77,7 @@ public interface ReportServiceAsync {
|
|||
|
||||
void listVMEReports(AsyncCallback<ArrayList<VMEReportBean>> callback);
|
||||
|
||||
void importVMEReport(String id, VMETypeIdentifier refType,
|
||||
void importVMEReport(String id, String name, VMETypeIdentifier refType,
|
||||
AsyncCallback<Model> callback);
|
||||
|
||||
void listVMEReportRefByType(VMETypeIdentifier refType,
|
||||
|
|
|
@ -15,7 +15,6 @@ import com.extjs.gxt.ui.client.store.GroupingStore;
|
|||
import com.extjs.gxt.ui.client.store.ListStore;
|
||||
import com.extjs.gxt.ui.client.store.Store;
|
||||
import com.extjs.gxt.ui.client.widget.ContentPanel;
|
||||
import com.extjs.gxt.ui.client.widget.Html;
|
||||
import com.extjs.gxt.ui.client.widget.Window;
|
||||
import com.extjs.gxt.ui.client.widget.button.Button;
|
||||
import com.extjs.gxt.ui.client.widget.form.StoreFilterField;
|
||||
|
@ -128,7 +127,7 @@ public class ImportVMEReportDialog extends Window {
|
|||
|
||||
column = new ColumnConfig();
|
||||
column.setId("name");
|
||||
column.setHeader("Name");
|
||||
column.setHeader("Indentifier");
|
||||
column.setWidth(150);
|
||||
configs.add(column);
|
||||
|
||||
|
@ -141,7 +140,8 @@ public class ImportVMEReportDialog extends Window {
|
|||
store.add(reports);
|
||||
|
||||
filter.bind(store);
|
||||
|
||||
filter.setEmptyText("Filter by Identifier");
|
||||
|
||||
final Grid<VMEReportBean> grid = new Grid<VMEReportBean>(store, cm);
|
||||
|
||||
grid.getElement().getStyle().setBorderWidth(0, Unit.PX);
|
||||
|
@ -167,7 +167,7 @@ public class ImportVMEReportDialog extends Window {
|
|||
@Override
|
||||
public void componentSelected(ButtonEvent ce) {
|
||||
hide();
|
||||
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), type, true));
|
||||
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), grid.getSelectionModel().getSelectedItem().getName(), type, true));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
@ -176,7 +176,7 @@ public class ImportVMEReportDialog extends Window {
|
|||
@Override
|
||||
public void componentSelected(ButtonEvent ce) {
|
||||
hide();
|
||||
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), type, false));
|
||||
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), grid.getSelectionModel().getSelectedItem().getName(), type, false));
|
||||
}
|
||||
}));
|
||||
}
|
||||
|
@ -195,17 +195,10 @@ public class ImportVMEReportDialog extends Window {
|
|||
|
||||
|
||||
ColumnConfig column = new ColumnConfig();
|
||||
column.setId("id");
|
||||
column.setHeader("ID");
|
||||
column.setHidden(true);
|
||||
column.setWidth(50);
|
||||
column.setRowHeader(true);
|
||||
configs.add(column);
|
||||
|
||||
column = new ColumnConfig();
|
||||
|
||||
column.setId("rfmo");
|
||||
column.setHeader("RFMO");
|
||||
column.setWidth(150);
|
||||
column.setWidth(50);
|
||||
configs.add(column);
|
||||
|
||||
column = new ColumnConfig();
|
||||
|
@ -215,11 +208,10 @@ public class ImportVMEReportDialog extends Window {
|
|||
configs.add(column);
|
||||
|
||||
column = new ColumnConfig();
|
||||
column.setId("year");
|
||||
column.setHeader("Year");
|
||||
column.setWidth(50);
|
||||
column.setId("id");
|
||||
column.setHeader("ID");
|
||||
column.setWidth(30);
|
||||
configs.add(column);
|
||||
|
||||
cm = new ColumnModel(configs);
|
||||
|
||||
/**
|
||||
|
@ -228,6 +220,8 @@ public class ImportVMEReportDialog extends Window {
|
|||
GroupingStore<VMEReportBean> store = new GroupingStore<VMEReportBean>();
|
||||
store.add(reports);
|
||||
store.groupBy("rfmo");
|
||||
|
||||
|
||||
|
||||
filter.bind(store);
|
||||
|
||||
|
@ -240,7 +234,8 @@ public class ImportVMEReportDialog extends Window {
|
|||
|
||||
|
||||
GroupingView view = new GroupingView();
|
||||
view.setShowGroupedColumn(false);
|
||||
view.setShowGroupedColumn(true);
|
||||
view.setStartCollapsed(true);
|
||||
grid.setView(view);
|
||||
view.setForceFit(true);
|
||||
ContentPanel gridPanel = new ContentPanel(new FitLayout());
|
||||
|
@ -260,7 +255,7 @@ public class ImportVMEReportDialog extends Window {
|
|||
@Override
|
||||
public void componentSelected(ButtonEvent ce) {
|
||||
hide();
|
||||
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), VMETypeIdentifier.Vme, false));
|
||||
eventBus.fireEvent(new SelectedReportEvent(grid.getSelectionModel().getSelectedItem().getId(), grid.getSelectionModel().getSelectedItem().getName(), VMETypeIdentifier.Vme, false));
|
||||
}
|
||||
}));
|
||||
mainPanel.add(gridPanel);
|
||||
|
|
|
@ -7,12 +7,14 @@ import com.google.gwt.event.shared.GwtEvent;
|
|||
public class SelectedReportEvent extends GwtEvent<SelectedReportEventHandler>{
|
||||
public static Type<SelectedReportEventHandler> TYPE = new Type<SelectedReportEventHandler>();
|
||||
private final String id;
|
||||
private final String name;
|
||||
private final VMETypeIdentifier type;
|
||||
private final boolean isAssociation;
|
||||
|
||||
public SelectedReportEvent(String id, VMETypeIdentifier type, boolean isAssociation) {
|
||||
public SelectedReportEvent(String id, String name, VMETypeIdentifier type, boolean isAssociation) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.type = type;
|
||||
this.isAssociation = isAssociation;
|
||||
}
|
||||
|
@ -21,6 +23,10 @@ public class SelectedReportEvent extends GwtEvent<SelectedReportEventHandler>{
|
|||
return id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public VMETypeIdentifier getType() {
|
||||
return type;
|
||||
}
|
||||
|
|
|
@ -169,7 +169,7 @@ public class TemplateComponent {
|
|||
this.doubleColLayout = sc.isDoubleColLayout();
|
||||
this.locked = sc.isLocked();
|
||||
this.metadata = sc.getMetadata();
|
||||
|
||||
|
||||
//Log.debug("TemplateComponent found type: " + sc.getType());
|
||||
|
||||
switch (sc.getType()) {
|
||||
|
@ -207,7 +207,8 @@ public class TemplateComponent {
|
|||
//area.addStyleName(getStyle(sc.getType()));
|
||||
area.getElement().getStyle().setMarginTop(5, Unit.PX);
|
||||
area.setWidth(width+"px");
|
||||
area.setText((String) sc.getPossibleContent());
|
||||
String content = (String) sc.getPossibleContent();
|
||||
area.setText(preserveLineBreaks(content));
|
||||
this.content = area;
|
||||
}
|
||||
else {
|
||||
|
@ -302,30 +303,25 @@ public class TemplateComponent {
|
|||
}
|
||||
this.content = atu;
|
||||
break;
|
||||
case COMMENT:
|
||||
case COMMENT: {
|
||||
HTML comment = new HTML();
|
||||
comment.setStyleName("commentArea");
|
||||
String contentC = (String) sc.getPossibleContent();
|
||||
if (contentC == null) {
|
||||
contentC = "Empty Comment";
|
||||
String content = (String) sc.getPossibleContent();
|
||||
if (content == null) {
|
||||
content = "Empty Comment";
|
||||
}
|
||||
// replace all the line braks by <br/>, and all the double spaces by the html version
|
||||
String htmlPreservedLineBreaks2 = contentC.replaceAll("(\r\n|\n)","<br />");
|
||||
htmlPreservedLineBreaks2 = htmlPreservedLineBreaks2.replaceAll("\\s\\s"," ");
|
||||
comment.setHTML(htmlPreservedLineBreaks2);
|
||||
comment.setHTML(preserveLineBreaks(content));
|
||||
this.content = comment;
|
||||
break;
|
||||
}
|
||||
case INSTRUCTION:
|
||||
String content = (String) sc.getPossibleContent();
|
||||
if (content == null) {
|
||||
content = "Empty Instruction";
|
||||
}
|
||||
// replace all the line braks by <br/>, and all the double spaces by the html version
|
||||
String htmlPreservedLineBreaks = content.replaceAll("(\r\n|\n)","<br />");
|
||||
htmlPreservedLineBreaks = htmlPreservedLineBreaks.replaceAll("\\s\\s"," ");
|
||||
HTML instr = new HTML();
|
||||
instr.setStyleName("instructionArea");
|
||||
instr.setHTML(htmlPreservedLineBreaks);
|
||||
instr.setHTML(preserveLineBreaks(content));
|
||||
this.content = instr;
|
||||
|
||||
break;
|
||||
|
@ -408,6 +404,19 @@ public class TemplateComponent {
|
|||
return "";
|
||||
}
|
||||
}
|
||||
/**
|
||||
* replace all the line braks by <br/>, and all the double spaces by the html version  
|
||||
* @param toPreserve
|
||||
* @return an HTML with preserved line breaks and spaces
|
||||
*/
|
||||
private String preserveLineBreaks(String toPreserve) {
|
||||
if (toPreserve != null) {
|
||||
String htmlPreservedLineBreaks = toPreserve.replaceAll("(\r\n|\n)","<br />"); //line breaks
|
||||
htmlPreservedLineBreaks = htmlPreservedLineBreaks.replaceAll("\\s\\s"," "); //spaces
|
||||
return htmlPreservedLineBreaks;
|
||||
}
|
||||
return toPreserve;
|
||||
}
|
||||
/**
|
||||
* return a template Component which is serializable
|
||||
* @return .
|
||||
|
@ -459,7 +468,7 @@ public class TemplateComponent {
|
|||
content = ((BasicTextArea) this.content).getText();
|
||||
id = ((BasicTextArea) this.content).getId();
|
||||
metas = ((BasicTextArea) this.content).getMetadata();
|
||||
|
||||
|
||||
}
|
||||
break;
|
||||
case TIME_SERIES:
|
||||
|
|
|
@ -143,12 +143,14 @@ public class SequenceWidget extends Composite {
|
|||
bc.setMetadata(new ArrayList<Metadata>());
|
||||
}
|
||||
}
|
||||
|
||||
//in the VIEW
|
||||
for (TemplateComponent tc : seqGroupedComponents) {
|
||||
if (tc.getType() == ComponentType.BODY_NOT_FORMATTED) {
|
||||
((HTML) tc.getContent()).setText("");
|
||||
}
|
||||
if (tc.getType() == ComponentType.BODY_NOT_FORMATTED || tc.getType() == ComponentType.HEADING_2) {
|
||||
myPanel.remove(tc.getContent());
|
||||
}
|
||||
}
|
||||
|
||||
buttonsWrapperPanel.clear();
|
||||
selectNewB.getElement().getStyle().setWidth(130, Unit.PX);
|
||||
selectNewB.getElement().getStyle().setMargin(10, Unit.PX);
|
||||
|
|
|
@ -18,6 +18,7 @@ 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;
|
||||
|
@ -43,9 +44,15 @@ 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;
|
||||
import org.gcube.applicationsupportlayer.social.ApplicationNotificationsManager;
|
||||
import org.gcube.applicationsupportlayer.social.NotificationsManager;
|
||||
import org.gcube.common.homelibrary.home.HomeLibrary;
|
||||
|
@ -1484,11 +1491,18 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
|||
ReportType type = new ReportType();
|
||||
type.setTypeIdentifier("Vme");
|
||||
|
||||
for (ReportEntry re : getFakeReports(type)) {
|
||||
String rfmo = re.getNameValueList().get(0).getValue();
|
||||
String name = re.getNameValueList().get(1).getValue();
|
||||
int year = Integer.parseInt(re.getNameValueList().get(2).getValue());
|
||||
toReturn.add(new VMEReportBean(""+re.getId(), rfmo, name, year));
|
||||
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();
|
||||
}
|
||||
toReturn.add(new VMEReportBean(""+re.getId(), rfmo, name));
|
||||
}
|
||||
|
||||
return toReturn;
|
||||
|
@ -1505,158 +1519,94 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
|
|||
ArrayList<VMEReportBean> toReturn = new ArrayList<VMEReportBean>();
|
||||
ReportType type = new ReportType();
|
||||
type.setTypeIdentifier(refType.toString());
|
||||
|
||||
for (ReportEntry re : getFakeReports(type)) {
|
||||
String name = re.getNameValueList().get(0).getValue();
|
||||
toReturn.add(new VMEReportBean(""+re.getId(), "", name, -1));
|
||||
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));
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
|
||||
private List<ReportEntry> getFakeReports(ReportType type, NameValue... filters) {
|
||||
Random generator = new Random();
|
||||
int n = generator.nextInt(15) + 5;
|
||||
ArrayList<ReportEntry> toReturn = new ArrayList<ReportEntry>();
|
||||
if (type.getTypeIdentifier().equals("Vme")) {
|
||||
ReportEntry re = new ReportEntry();
|
||||
for (int i = 0; i < n; i++) {
|
||||
re = new ReportEntry();
|
||||
re.setId(i);
|
||||
|
||||
NameValue rfmo = new NameValue();
|
||||
rfmo.setName("Rfmo");
|
||||
rfmo.setValue(i % 2 == 0 ? "NAFO" : "NEAFC");
|
||||
NameValue name = new NameValue();
|
||||
name.setName("Vme");
|
||||
name.setValue("VME " + generateRandomWord());
|
||||
NameValue year = new NameValue();
|
||||
year.setName("Year");
|
||||
year.setValue(""+(2000+generator.nextInt(15)));
|
||||
List<NameValue> namesValues = new ArrayList<NameValue>();
|
||||
namesValues.add(rfmo);
|
||||
namesValues.add(name);
|
||||
namesValues.add(year);
|
||||
|
||||
re.setNameValueList(namesValues);
|
||||
toReturn.add(re);
|
||||
}
|
||||
} else {
|
||||
ReportEntry re = new ReportEntry();
|
||||
for (int i = 0; i < n; i++) {
|
||||
re = new ReportEntry();
|
||||
re.setId(i);
|
||||
List<NameValue> namesValues = new ArrayList<NameValue>();
|
||||
NameValue name = new NameValue();
|
||||
name.setName(type.getTypeIdentifier() + "-" + i);
|
||||
name.setValue(type.getTypeIdentifier() + "-" + generateRandomWord());
|
||||
namesValues.add(name);
|
||||
re.setNameValueList(namesValues);
|
||||
toReturn.add(re);
|
||||
}
|
||||
}
|
||||
return toReturn;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Model importVMEReport(String id, VMETypeIdentifier refType) {
|
||||
ReportsModeler rm = null;
|
||||
public Model importVMEReport(String id, String name, VMETypeIdentifier refType) {
|
||||
RsgService rsgClient = new RsgClient();
|
||||
|
||||
CompiledReport cr = null;
|
||||
if (refType == VMETypeIdentifier.Vme) {
|
||||
String reportName = "Sample VME Report imported with id: " + id;
|
||||
rm = new ReportsModeler(
|
||||
UUID.randomUUID().toString(),
|
||||
reportName,
|
||||
getASLSession().getUsername(),
|
||||
new Date(),
|
||||
new Date(),
|
||||
getASLSession().getUsername()
|
||||
);
|
||||
rm.add(new Instruction(null));
|
||||
rm.add(new Title("Name for id " + id, false));
|
||||
rm.add(new Heading(1, "VME Name (Non Editable) "));
|
||||
rm.add(new TextInput("Corner Rise Seamounts"));
|
||||
rm.add(new Heading(2, "This is a Heading of Level 2 that is editable"));
|
||||
rm.add(new TextInput("Corner Rise Seamounts again"));
|
||||
rm.add(new TextInput());
|
||||
rm.nextSection();
|
||||
rm = addSection2(rm);
|
||||
rm.nextSection();
|
||||
ReportComponent rp = new TextInput("With props and id");
|
||||
rp.setId(UUID.randomUUID().toString());
|
||||
rp.setProperties(new Property("theId", "theValue"));
|
||||
rm.add(rp);
|
||||
|
||||
rp = new Heading(1, "Ciao!");
|
||||
rp.setId(UUID.randomUUID().toString());
|
||||
rp.setProperties(new Property("theId", "theValue"));
|
||||
rm.add(rp);
|
||||
}
|
||||
_log.info("Importing VME id=" + id + " name=" + name);
|
||||
cr = rsgClient.getReportById(new ReportType(refType.getId()), id);
|
||||
}
|
||||
else {
|
||||
String reportName = refType.getId() + " VME Reference Report with id: " + id;
|
||||
rm = new ReportsModeler(
|
||||
UUID.randomUUID().toString(),
|
||||
reportName,
|
||||
getASLSession().getUsername(),
|
||||
new Date(),
|
||||
new Date(),
|
||||
getASLSession().getUsername()
|
||||
);
|
||||
rm.add(new Title("Test" + refType.getId()));
|
||||
rm.add(new Heading(2, "Year"));
|
||||
rm.add(new TextInput());
|
||||
rm.add(new Heading(2, "Validity Period - Start"));
|
||||
rm.add(new TextInput());
|
||||
rm.add(new Heading(2, "Validity Period - End"));
|
||||
rm.add(new TextInput());
|
||||
rm.add(getTestReference(ReferenceReportType.InformationSource, false));
|
||||
rm.add(new Heading(1, "Ciao!"));
|
||||
_log.info("Importing Ref type= " + refType.getId() + " id=" + id + " name=" + name);
|
||||
cr = rsgClient.getReferenceReportById(new ReportType(refType.getId()), id);
|
||||
|
||||
}
|
||||
Model model = null;
|
||||
try {
|
||||
return rm.getReportInstance();
|
||||
model = new ReportManagerReportBuilder().buildReport(cr, id, name, "unknown author", new Date(), new Date(), "uknown last editor").getReportInstance();
|
||||
} catch (ReportBuilderException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public Model getVMEReportRef2Associate(String id, VMETypeIdentifier refType) {
|
||||
String reportName = "Sample Reference Report: " + id;
|
||||
ReportsModeler rm = new ReportsModeler(
|
||||
UUID.randomUUID().toString(),
|
||||
reportName,
|
||||
getASLSession().getUsername(),
|
||||
new Date(),
|
||||
new Date(),
|
||||
getASLSession().getUsername()
|
||||
);
|
||||
//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));
|
||||
rm.add(new ReferenceReport(ReferenceReportType.InformationSource, dBTableRows));
|
||||
RsgService rsgClient = new RsgClient();
|
||||
_log.info("Importing Ref type= " + refType.getId() + " id=" + id);
|
||||
CompiledReport cr = rsgClient.getReferenceReportById(new ReportType(refType.getId()), id);
|
||||
Model model = null;
|
||||
try {
|
||||
Model toReturn = rm.getReportInstance();
|
||||
//ReportsReader.readReportStructure(toReturn);
|
||||
return toReturn;
|
||||
model = new ReportManagerReportBuilder().buildReport(cr, id, "", "unknown author", new Date(), new Date(), "uknown last editor").getReportInstance();
|
||||
} catch (ReportBuilderException e) {
|
||||
e.printStackTrace();
|
||||
} catch (Exception e) {
|
||||
e.printStackTrace();
|
||||
}
|
||||
return null;
|
||||
return model;
|
||||
}
|
||||
|
||||
|
||||
|
||||
private ReportsModeler addSection2(ReportsModeler rm) {
|
||||
rm.add(new Heading(1, "Specific Measure"));
|
||||
ReportSequence seq = new ReportSequence(UUID.randomUUID().toString());
|
||||
|
|
|
@ -7,12 +7,11 @@ public class VMEReportBean extends BaseModel {
|
|||
|
||||
public VMEReportBean() {}
|
||||
|
||||
public VMEReportBean(String id, String rfmo, String name, int year) {
|
||||
public VMEReportBean(String id, String rfmo, String name) {
|
||||
super();
|
||||
set("id", id);
|
||||
set("rfmo", rfmo);
|
||||
set("name", name);
|
||||
set("year", year);
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
|
@ -26,8 +25,4 @@ public class VMEReportBean extends BaseModel {
|
|||
public String getName() {
|
||||
return (String) get("name");
|
||||
}
|
||||
|
||||
public int getYear() {
|
||||
return (Integer) get("year");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -15,3 +15,4 @@ log4j.logger.org.gcube.resources.discovery.icclient=ERROR
|
|||
log4j.logger.org.gcube.common.clients=ERROR
|
||||
log4j.logger.org.gcube.common.homelibrary.jcr=ERROR
|
||||
log4j.logger.org.gcube.application.framework.accesslogger=ERROR
|
||||
log4j.logger.org.gcube.application.rsg.support.builder.impl=ERROR
|
||||
|
|
|
@ -585,18 +585,14 @@ tableBorder td {
|
|||
}
|
||||
|
||||
.readOnlyText {
|
||||
border: 1px solid #CCC !important;
|
||||
-webkit-border-radius: 5px;
|
||||
-moz-border-radius: 5px;
|
||||
border-radius: 5px;
|
||||
background-color: white;
|
||||
margin-top: 5px;
|
||||
padding: 5px;
|
||||
|
||||
font-size: 13px;
|
||||
color: #AAA;
|
||||
font-size: 12px;
|
||||
color: #333;
|
||||
text-align:justify;
|
||||
text-justify:inter-word;
|
||||
padding-left: 5px;
|
||||
}
|
||||
|
||||
|
||||
.bodyArea {
|
||||
background-image: none;
|
||||
}
|
||||
|
|
Reference in New Issue