first db wrteing working version

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@90476 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2014-01-24 11:50:50 +00:00
parent 0aa2cbd1cc
commit 8daa22c5ef
5 changed files with 56 additions and 5 deletions

View File

@ -24,6 +24,7 @@ import org.gcube.portlets.user.reportgenerator.client.targets.ClientReportRefere
import org.gcube.portlets.user.reportgenerator.client.targets.ClientSequence;
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.ExtHidden;
import org.gcube.portlets.user.reportgenerator.client.targets.GenericTable;
import org.gcube.portlets.user.reportgenerator.client.targets.GroupingDelimiterArea;
import org.gcube.portlets.user.reportgenerator.client.targets.GroupingInnerArea;
@ -282,6 +283,7 @@ public class TemplateComponent {
else {
ta = new AttributeMultiSelection(presenter, sc.getX(), sc.getY(), width, height, sc.getPossibleContent().toString(), displayBlock);
}
ta.setMetadata(sc.getMetadata());
this.content = ta;
break;
case ATTRIBUTE_UNIQUE:
@ -302,6 +304,7 @@ public class TemplateComponent {
else {
atu = new AttributeSingleSelection(presenter, sc.getX(), sc.getY(), width, height, sc.getPossibleContent().toString(), displayBlock2);
}
atu.setMetadata(sc.getMetadata());
this.content = atu;
break;
case COMMENT: {
@ -331,7 +334,8 @@ public class TemplateComponent {
if (hiddenValue == null) {
hiddenValue = "-1";
}
Hidden hiddenField = new Hidden("SequenceId", hiddenValue);
ExtHidden hiddenField = new ExtHidden("SequenceId", hiddenValue);
hiddenField.setMetadata(sc.getMetadata());
this.content = hiddenField;
break;
case TIME_SERIES:
@ -495,10 +499,12 @@ public class TemplateComponent {
break;
case ATTRIBUTE_MULTI:
AttributeMultiSelection att = (AttributeMultiSelection) this.content;
metas = att.getMetadata();
content = att.getSerializable();
break;
case ATTRIBUTE_UNIQUE:
AttributeSingleSelection atu = (AttributeSingleSelection) this.content;
metas = atu.getMetadata();
content = atu.getSerializable();
break;
case COMMENT:
@ -508,7 +514,9 @@ public class TemplateComponent {
content = ((HTML) this.content).getHTML();
break;
case HIDDEN_FIELD:
content = ((Hidden) this.content).getValue();
ExtHidden hidden = (ExtHidden) this.content;
metas = hidden.getMetadata();
content = hidden.getValue();
break;
case REPEAT_SEQUENCE:
ClientRepeatableSequence repSeq = (ClientRepeatableSequence) this.content;

View File

@ -1,9 +1,11 @@
package org.gcube.portlets.user.reportgenerator.client.targets;
import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.d4sreporting.common.shared.Attribute;
import org.gcube.portlets.d4sreporting.common.shared.AttributeArea;
import org.gcube.portlets.d4sreporting.common.shared.ComponentType;
import org.gcube.portlets.d4sreporting.common.shared.Metadata;
import org.gcube.portlets.user.reportgenerator.client.Presenter.Presenter;
import com.google.gwt.dom.client.Style.Unit;
@ -26,6 +28,7 @@ public class AttributeMultiSelection extends Composite {
private HorizontalPanel myPanel;
private String attrName;
private CheckBox[] boxes;
private List<Metadata> metas;
/**
* Coming form a template constructor
@ -164,6 +167,12 @@ public class AttributeMultiSelection extends Composite {
}
return new AttributeArea(getAttrName().trim(), values);
}
public List<Metadata> getMetadata() {
return metas;
}
public void setMetadata(List<Metadata> metas) {
this.metas = metas;
}
}

View File

@ -2,10 +2,12 @@ package org.gcube.portlets.user.reportgenerator.client.targets;
import java.util.ArrayList;
import java.util.List;
import org.gcube.portlets.d4sreporting.common.shared.Attribute;
import org.gcube.portlets.d4sreporting.common.shared.AttributeArea;
import org.gcube.portlets.d4sreporting.common.shared.ComponentType;
import org.gcube.portlets.d4sreporting.common.shared.Metadata;
import org.gcube.portlets.user.reportgenerator.client.Presenter.Presenter;
import com.google.gwt.dom.client.Style.Unit;
@ -29,7 +31,7 @@ public class AttributeSingleSelection extends Composite {
private HorizontalPanel myPanel;
private String attrName;
private RadioButton[] boxes;
private List<Metadata> metas;
/**
* Coming form a template constructor
*/
@ -166,6 +168,12 @@ public class AttributeSingleSelection extends Composite {
}
return new AttributeArea(getAttrName().trim(), singlevalues);
}
public List<Metadata> getMetadata() {
return metas;
}
public void setMetadata(List<Metadata> metas) {
this.metas = metas;
}
}

View File

@ -0,0 +1,24 @@
package org.gcube.portlets.user.reportgenerator.client.targets;
import java.util.List;
import org.gcube.portlets.d4sreporting.common.shared.Metadata;
import com.google.gwt.user.client.ui.Hidden;
public class ExtHidden extends Hidden {
public ExtHidden(String name, String value) {
super(name, value);
}
private List<Metadata> metas;
public List<Metadata> getMetadata() {
return metas;
}
public void setMetadata(List<Metadata> metas) {
this.metas = metas;
}
}

View File

@ -1607,6 +1607,8 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
@Override
public void exportReportToRSG(Model model) {
System.out.println(new ModelReader(model).toString());
RsgService rsgClient = new RsgClient(getRSGWSAddress());
//Use the RSG client to get a template for the report whose type is the last token (i.e. the corresponding class' 'simple name')