still bit buggy

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@85505 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-11-14 16:57:40 +00:00
parent f9ea3aa194
commit a1b2de0962
9 changed files with 43 additions and 41 deletions

View File

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

View File

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

View File

@ -5,15 +5,12 @@
<wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/> <wb-resource deploy-path="/" source-path="/src/main/webapp" tag="defaultRootSource"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/src/main/java"/>
<wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/> <wb-resource deploy-path="/WEB-INF/classes" source-path="/target/generated-sources/gwt"/>
<dependent-module archiveName="gcube-reporting-modeler-1.0.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.1-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-interface-dto-0.0.1-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/reports-store-gateway-interface-dto/reports-store-gateway-interface-dto"> <dependent-module archiveName="reports-store-gateway-interface-dto-0.0.1-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> <dependency-type>uses</dependency-type>
</dependent-module> </dependent-module>
<dependent-module archiveName="report-exporter-widget-2.0.0-SNAPSHOT.jar" deploy-path="/WEB-INF/lib" handle="module:/resource/report-exporter-widget/report-exporter-widget">
<dependency-type>uses</dependency-type>
</dependent-module>
<property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/> <property name="java-output-path" value="/${module}/target/www/WEB-INF/classes"/>
<property name="context-root" value="reports"/> <property name="context-root" value="reports"/>
</wb-module> </wb-module>

View File

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

View File

@ -10,6 +10,7 @@ import org.gcube.portlets.d4sreporting.common.shared.ComponentType;
import org.gcube.portlets.d4sreporting.common.shared.Metadata; import org.gcube.portlets.d4sreporting.common.shared.Metadata;
import org.gcube.portlets.d4sreporting.common.shared.Model; import org.gcube.portlets.d4sreporting.common.shared.Model;
import org.gcube.portlets.d4sreporting.common.shared.RepeatableSequence; import org.gcube.portlets.d4sreporting.common.shared.RepeatableSequence;
import org.gcube.portlets.d4sreporting.common.shared.ReportReference;
import org.gcube.portlets.d4sreporting.common.shared.Tuple; import org.gcube.portlets.d4sreporting.common.shared.Tuple;
import org.gcube.portlets.user.reportgenerator.client.Headerbar; import org.gcube.portlets.user.reportgenerator.client.Headerbar;
import org.gcube.portlets.user.reportgenerator.client.ReportConstants; import org.gcube.portlets.user.reportgenerator.client.ReportConstants;
@ -43,7 +44,7 @@ import org.gcube.portlets.user.reportgenerator.client.targets.BasicTextArea;
import org.gcube.portlets.user.reportgenerator.client.targets.ClientImage; import org.gcube.portlets.user.reportgenerator.client.targets.ClientImage;
import org.gcube.portlets.user.reportgenerator.client.targets.ClientRepeatableSequence; import org.gcube.portlets.user.reportgenerator.client.targets.ClientRepeatableSequence;
import org.gcube.portlets.user.reportgenerator.client.targets.ClientSequence; import org.gcube.portlets.user.reportgenerator.client.targets.ClientSequence;
import org.gcube.portlets.user.reportgenerator.client.targets.ClientTuple; import org.gcube.portlets.user.reportgenerator.client.targets.ClientReportReference;
import org.gcube.portlets.user.reportgenerator.client.targets.Coords; import org.gcube.portlets.user.reportgenerator.client.targets.Coords;
import org.gcube.portlets.user.reportgenerator.client.targets.D4sRichTextarea; import org.gcube.portlets.user.reportgenerator.client.targets.D4sRichTextarea;
import org.gcube.portlets.user.reportgenerator.client.targets.GenericTable; import org.gcube.portlets.user.reportgenerator.client.targets.GenericTable;
@ -1052,8 +1053,8 @@ public class Presenter {
ClientRepeatableSequence rps = (ClientRepeatableSequence) component.getContent(); ClientRepeatableSequence rps = (ClientRepeatableSequence) component.getContent();
wp.addComponentToLayout(rps, component.isDoubleColLayout()); wp.addComponentToLayout(rps, component.isDoubleColLayout());
break; break;
case TUPLE: case REPORT_REFERENCE:
ClientTuple cmSeq = (ClientTuple) component.getContent(); ClientReportReference cmSeq = (ClientReportReference) component.getContent();
wp.addComponentToLayout(cmSeq, component.isDoubleColLayout()); wp.addComponentToLayout(cmSeq, component.isDoubleColLayout());
break; break;
case BODY_TABLE_IMAGE: case BODY_TABLE_IMAGE:
@ -1363,9 +1364,9 @@ public class Presenter {
//the Repeatable Seq must be in the 1st Section, second component. (because ReportsModeler put it that way) //the Repeatable Seq must be in the 1st Section, second component. (because ReportsModeler put it that way)
BasicSection firstSection = reportRef.getSections().get(0); BasicSection firstSection = reportRef.getSections().get(0);
if (firstSection.getComponents() != null && firstSection.getComponents().size()==2) { if (firstSection.getComponents() != null && firstSection.getComponents().size()==2) {
@SuppressWarnings("unchecked")
ArrayList<Tuple> toPass = (ArrayList<Tuple>) firstSection.getComponents().get(1).getPossibleContent(); ReportReference toPass = (ReportReference) firstSection.getComponents().get(1).getPossibleContent();
clientSeqSelected.add(toPass.get(0).getKey(), toPass.get(0)); clientSeqSelected.add(toPass.getTuples().get(0).getKey(), toPass.getTuples().get(0));
} }
else { else {
Window.alert("Sorry, we could not locate the ReportRef correctly in the model instance"); Window.alert("Sorry, we could not locate the ReportRef correctly in the model instance");
@ -1392,6 +1393,6 @@ public class Presenter {
return VMETypeIdentifier.FisheryAreasHistory; return VMETypeIdentifier.FisheryAreasHistory;
else if (theType.equals("VmesHistory")) else if (theType.equals("VmesHistory"))
return VMETypeIdentifier.VmesHistory; return VMETypeIdentifier.VmesHistory;
throw new Exception("Could not find any valid Report Ref, got " + theType + " should be any of " + VMETypeIdentifier.values()); throw new Exception("Could not find any valid Report Ref, got " + theType + " should be any of " + VMETypeIdentifier.values().toString());
} }
} }

View File

@ -28,11 +28,11 @@ public class ToolboxPanel extends SimplePanel {
public static final int TOOLBOX_HEIGHT= 800; public static final int TOOLBOX_HEIGHT= 800;
public ToolboxPanel(AppControllerExplorer appController) { public ToolboxPanel(AppControllerExplorer appController) {
this.appController = appController; // this.appController = appController;
AsyncTreePanel tp = appController.getTree(TOOLBOX_WIDTH, TOOLBOX_HEIGHT); // AsyncTreePanel tp = appController.getTree(TOOLBOX_WIDTH, TOOLBOX_HEIGHT);
this.tp = tp; // this.tp = tp;
add(tp); // add(tp);
this.appController.hideSharingFacilities(); //sharing disabled we have problems from Reports // this.appController.hideSharingFacilities(); //sharing disabled we have problems from Reports
} }
public void showExportedVersion(String id, String fileName) { public void showExportedVersion(String id, String fileName) {

View File

@ -8,6 +8,7 @@ import java.util.List;
import org.gcube.portlets.d4sreporting.common.shared.AttributeArea; import org.gcube.portlets.d4sreporting.common.shared.AttributeArea;
import org.gcube.portlets.d4sreporting.common.shared.BasicComponent; import org.gcube.portlets.d4sreporting.common.shared.BasicComponent;
import org.gcube.portlets.d4sreporting.common.shared.ComponentType; import org.gcube.portlets.d4sreporting.common.shared.ComponentType;
import org.gcube.portlets.d4sreporting.common.shared.ReportReference;
import org.gcube.portlets.d4sreporting.common.shared.Tuple; import org.gcube.portlets.d4sreporting.common.shared.Tuple;
import org.gcube.portlets.d4sreporting.common.shared.Metadata; import org.gcube.portlets.d4sreporting.common.shared.Metadata;
import org.gcube.portlets.d4sreporting.common.shared.RepTimeSeries; import org.gcube.portlets.d4sreporting.common.shared.RepTimeSeries;
@ -19,7 +20,7 @@ import org.gcube.portlets.user.reportgenerator.client.targets.AttributeSingleSel
import org.gcube.portlets.user.reportgenerator.client.targets.BasicTextArea; import org.gcube.portlets.user.reportgenerator.client.targets.BasicTextArea;
import org.gcube.portlets.user.reportgenerator.client.targets.ClientImage; import org.gcube.portlets.user.reportgenerator.client.targets.ClientImage;
import org.gcube.portlets.user.reportgenerator.client.targets.ClientSequence; import org.gcube.portlets.user.reportgenerator.client.targets.ClientSequence;
import org.gcube.portlets.user.reportgenerator.client.targets.ClientTuple; import org.gcube.portlets.user.reportgenerator.client.targets.ClientReportReference;
import org.gcube.portlets.user.reportgenerator.client.targets.ClientRepeatableSequence; import org.gcube.portlets.user.reportgenerator.client.targets.ClientRepeatableSequence;
import org.gcube.portlets.user.reportgenerator.client.targets.D4sRichTextarea; import org.gcube.portlets.user.reportgenerator.client.targets.D4sRichTextarea;
import org.gcube.portlets.user.reportgenerator.client.targets.DropTSListener; import org.gcube.portlets.user.reportgenerator.client.targets.DropTSListener;
@ -369,12 +370,13 @@ public class TemplateComponent {
} }
this.content = tti; this.content = tti;
break; break;
case TUPLE: case REPORT_REFERENCE:
GWT.log("FOUND Master SEQUENCE trying getGroup"); GWT.log("FOUND Master SEQUENCE trying getGroup");
@SuppressWarnings("unchecked")
ArrayList<Tuple> tuple = (ArrayList<Tuple>) sc.getPossibleContent();
ClientTuple cmSeq = new ClientTuple(presenter, tuple); ReportReference ref = (ReportReference) sc.getPossibleContent();
ArrayList<Tuple> tuple = ref.getTuples();
ClientReportReference cmSeq = new ClientReportReference(presenter, ref.getRefType(), tuple);
this.content = cmSeq; this.content = cmSeq;
break; break;
} }
@ -482,10 +484,10 @@ public class TemplateComponent {
RepeatableSequence toSave = new RepeatableSequence(getSerializableSequence(tti), height); RepeatableSequence toSave = new RepeatableSequence(getSerializableSequence(tti), height);
content = toSave; content = toSave;
break; break;
case TUPLE: case REPORT_REFERENCE:
ClientTuple cTuples = (ClientTuple) this.content; ClientReportReference cRef = (ClientReportReference) this.content;
ArrayList<Tuple> tuples = cTuples.getTupleList(); ReportReference ref = new ReportReference(cRef.getRefType(), cRef.getTupleList());
content = tuples; content = ref;
break; break;
} }

View File

@ -18,11 +18,12 @@ import com.google.gwt.user.client.ui.VerticalPanel;
* @author massi * @author massi
* *
*/ */
public class ClientTuple extends Composite implements ClientSequence { public class ClientReportReference extends Composite implements ClientSequence {
protected ArrayList<TemplateComponent> groupedComponents = new ArrayList<TemplateComponent>(); protected ArrayList<TemplateComponent> groupedComponents = new ArrayList<TemplateComponent>();
private VerticalPanel myPanel = new VerticalPanel(); private VerticalPanel myPanel = new VerticalPanel();
private String refType;
private ArrayList<Tuple> tupleList; private ArrayList<Tuple> tupleList;
private SequenceWidget first; private SequenceWidget first;
private Presenter p; private Presenter p;
@ -32,8 +33,9 @@ public class ClientTuple extends Composite implements ClientSequence {
* @param p * @param p
* @param ms * @param ms
*/ */
public ClientTuple(Presenter p, ArrayList<Tuple> tupleList) { public ClientReportReference(Presenter p, String refType, ArrayList<Tuple> tupleList) {
this.p = p; this.p = p;
this.refType = refType;
this.tupleList = tupleList; this.tupleList = tupleList;
for (Tuple seq : tupleList) { for (Tuple seq : tupleList) {
if (myPanel.getWidgetCount()==0) { // if is the first one if (myPanel.getWidgetCount()==0) { // if is the first one
@ -86,7 +88,7 @@ public class ClientTuple extends Composite implements ClientSequence {
myPanel.add(seqW); myPanel.add(seqW);
first.hideClearAssociationButton(); first.hideClearAssociationButton();
} }
//needed for the model //TODO: preserve the id!! //needed for the model
Tuple toAdd = new Tuple(id, sequence.getGroupedComponents()); Tuple toAdd = new Tuple(id, sequence.getGroupedComponents());
tupleList.add(toAdd); tupleList.add(toAdd);
return true; return true;
@ -110,10 +112,9 @@ public class ClientTuple extends Composite implements ClientSequence {
@Override @Override
public void AddButtonClicked(RepeatableSequence sequence) { public void AddButtonClicked(RepeatableSequence sequence) {
Tuple tuple = (Tuple) sequence;
VMETypeIdentifier type2Pass = null; VMETypeIdentifier type2Pass = null;
try { try {
type2Pass = p.getTypeIdFromString(tuple.getKey()); type2Pass = p.getTypeIdFromString(refType);
} catch (Exception e) { } catch (Exception e) {
e.printStackTrace(); e.printStackTrace();
} }
@ -121,6 +122,7 @@ public class ClientTuple extends Composite implements ClientSequence {
p.setClientSequenceSelected(this); //important! p.setClientSequenceSelected(this); //important!
} }
public String getRefType() {
return refType;
}
} }

View File

@ -6,8 +6,8 @@
<!-- To Comment out --> <!-- To Comment out -->
<set-property name="user.agent" value="gecko1_8" /> <!-- <set-property name="user.agent" value="gecko1_8" /> -->
<inherits name='org.gcube.portlets.widgets.exporter.Report_exporter_widget' />
<inherits name='org.gcube.portlets.widgets.userselection.UserSelection' /> <inherits name='org.gcube.portlets.widgets.userselection.UserSelection' />
<inherits <inherits
name='org.gcube.portlets.widgets.lighttree.WorkspacePortletLightTree' /> name='org.gcube.portlets.widgets.lighttree.WorkspacePortletLightTree' />
@ -15,7 +15,7 @@
<inherits name='org.gcube.portlets.d4sreporting.common.Reporting' /> <inherits name='org.gcube.portlets.d4sreporting.common.Reporting' />
<inherits name='com.extjs.gxt.ui.GXT' /> <inherits name='com.extjs.gxt.ui.GXT' />
<inherits name='org.gcube.portlets.user.workspace.WorkspaceTree' /> <inherits name='org.gcube.portlets.user.workspace.WorkspaceTree' />
<inherits name='org.gcube.portlets.widgets.exporter.Report_exporter_widget' />
<!-- Specify the app entry point class. --> <!-- Specify the app entry point class. -->
<entry-point <entry-point
class='org.gcube.portlets.user.reportgenerator.client.ReportGenerator' /> class='org.gcube.portlets.user.reportgenerator.client.ReportGenerator' />