Read mode with RSG WS should be complete.

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@86648 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-12-06 10:35:34 +00:00
parent 2679e47978
commit f0830ba3be
10 changed files with 61 additions and 40 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/reports-4.6.9-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/reports-4.6.10-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.9-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/reports-4.6.10-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.9-SNAPSHOT
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.6.10-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

@ -8,27 +8,6 @@
<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>

15
pom.xml
View File

@ -12,7 +12,7 @@
<groupId>org.gcube.portlets.user</groupId>
<artifactId>reports</artifactId>
<packaging>war</packaging>
<version>4.6.9-SNAPSHOT</version>
<version>4.6.11-SNAPSHOT</version>
<name>gCube Reports Manager</name>
<description>
gCube Reports Portlet.
@ -131,10 +131,15 @@
<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>
<groupId>org.jboss.weld</groupId>
<artifactId>weld-core</artifactId>
<version>2.0.4.Final</version>
<exclusions>
<exclusion>
<groupId>org.jboss.spec.javax.el</groupId>
<artifactId>jboss-el-api_3.0_spec</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>org.gcube.common</groupId>

View File

@ -346,7 +346,7 @@ public class TemplateComponent {
this.content = tsa;
break;
case REPEAT_SEQUENCE_DELIMITER:
GroupingDelimiterArea gp = new GroupingDelimiterArea(height);
GroupingDelimiterArea gp = new GroupingDelimiterArea(width, height);
this.content = gp;
break;
case REPEAT_SEQUENCE_INNER:

View File

@ -30,7 +30,7 @@ public class ClientRepeatableSequence extends Composite implements ClientSequenc
this.repSequence = sRS;
this.identifier = sRS.getKey();
this.originalSequence = extractOriginalSequence(sRS);
SequenceWidget seqW = new SequenceWidget(p, this, originalSequence, true, false);
SequenceWidget seqW = new SequenceWidget(p, this, originalSequence, false, false); //TODO: Now all seq are removable, need to be handled differently
myPanel.add(seqW);
for (RepeatableSequence repeatSeq : getRepeats()) {
@ -40,8 +40,8 @@ public class ClientRepeatableSequence extends Composite implements ClientSequenc
}
/**
* when you repeat a sequence the model is not able to recognize is this was a sequence or not
* to overcome this limitation you have to identify the original sequence by identifying it
* when you repeat a sequence the model is not able to recognize if this was a sequence or not
* to overcome this limitation you have to identify the original sequence
* to identify it you can use the REPEAT_SEQUENCE_DELIMITER ELEMENT
* @param sRS
*/

View File

@ -11,6 +11,7 @@ import org.gcube.portlets.user.reportgenerator.client.model.TemplateComponent;
import org.gcube.portlets.user.reportgenerator.shared.VMETypeIdentifier;
import com.google.gwt.core.shared.GWT;
import com.google.gwt.dom.client.Style.Unit;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.VerticalPanel;
/**
@ -20,6 +21,8 @@ import com.google.gwt.user.client.ui.VerticalPanel;
*/
public class ClientReportReference extends Composite implements ClientSequence {
private final int indentationValue = 20;
protected ArrayList<TemplateComponent> groupedComponents = new ArrayList<TemplateComponent>();
private VerticalPanel myPanel = new VerticalPanel();
@ -28,7 +31,7 @@ public class ClientReportReference extends Composite implements ClientSequence {
private SequenceWidget first;
private Presenter p;
private boolean singleRelation; //allow or not to add new entries
/**
* s
* @param p
@ -39,6 +42,9 @@ public class ClientReportReference extends Composite implements ClientSequence {
this.refType = refType;
this.tupleList = tupleList;
this.singleRelation = singleRelation;
shrinkComponents(tupleList); //(beacuse the ref is indented
for (Tuple seq : tupleList) {
if (myPanel.getWidgetCount()==0) { // if is the first one
first = getMasterSequence(seq);
@ -47,17 +53,34 @@ public class ClientReportReference extends Composite implements ClientSequence {
myPanel.add(first);
} else {
SequenceWidget seqW = new SequenceWidget(p, this, seq, false, false);
seqW.getElement().getStyle().setMarginLeft(indentationValue, Unit.PX);
seqW.getElement().getStyle().setBackgroundColor("#FFF");
seqW.alignButtonsLeft();
myPanel.add(seqW);
}
}
initWidget(myPanel);
}
/**
* to make the components less in width (beacuse the ref is indented)
*/
private void shrinkComponents(ArrayList<Tuple> tupleList) {
for (Tuple seq : tupleList) {
for (BasicComponent bc : seq.getGroupedComponents()) {
bc.setWidth(bc.getWidth()-(indentationValue+5));
}
}
}
/**
* the first seq has to behave differently
*/
private SequenceWidget getMasterSequence(RepeatableSequence seq) {
SequenceWidget toReturn = new SequenceWidget(p, this, seq, true, false);
toReturn.alignButtonsLeft();
toReturn.getElement().getStyle().setMarginLeft(indentationValue, Unit.PX);
toReturn.getElement().getStyle().setBackgroundColor("#FFF");
if (tupleList.size() == 1) {
toReturn.enableClear();
if (isTupleEmpty(tupleList.get(0))) {
@ -144,4 +167,8 @@ public class ClientReportReference extends Composite implements ClientSequence {
public String getRefType() {
return refType;
}
public void clear() {
first.clearAssociation();
}
}

View File

@ -6,9 +6,9 @@ import com.google.gwt.user.client.ui.HTML;
public class GroupingDelimiterArea extends HTML {
public GroupingDelimiterArea(int height) {
public GroupingDelimiterArea(int width, int height) {
super();
setWidth("700px");
setWidth(width+"px");
setHeight(height+"px");
setStyleName("grouping-border");
}

View File

@ -15,7 +15,6 @@ import com.google.gwt.event.dom.client.ClickEvent;
import com.google.gwt.event.dom.client.ClickHandler;
import com.google.gwt.user.client.ui.Button;
import com.google.gwt.user.client.ui.Composite;
import com.google.gwt.user.client.ui.HTML;
import com.google.gwt.user.client.ui.HasAlignment;
import com.google.gwt.user.client.ui.HorizontalPanel;
import com.google.gwt.user.client.ui.VerticalPanel;
@ -26,7 +25,7 @@ public class SequenceWidget extends Composite {
private Button addAnotherB = new Button("Add another Entry");
private Button removeThisB = new Button("Remove Entry");
private Button selectNewB = new Button("Select New");
private Button selectNewB = new Button("Add Source");
private Button clearB = new Button("Clear Association");
private HorizontalPanel buttonPanel = new HorizontalPanel();
@ -65,7 +64,14 @@ public class SequenceWidget extends Composite {
sComp.setPossibleContent("");
sComp.setMetadata(new ArrayList<Metadata>());
}
add(new TemplateComponent(p.getModel(), sComp, p, false, null));
TemplateComponent toAdd = new TemplateComponent(p.getModel(), sComp, p, false, null);
if (isNew && sComp.getType() == ComponentType.REPORT_REFERENCE ) { //when adding a new Sequence blanks the Ref
ClientReportReference cRef = (ClientReportReference) toAdd.getContent();
cRef.clear();
}
add(toAdd);
}
initWidget(myPanel);
@ -196,4 +202,8 @@ public class SequenceWidget extends Composite {
public RepeatableSequence getSequence() {
return repSequence;
}
public void alignButtonsLeft() {
buttonPanel.setWidth("10%");
}
}

View File

@ -1596,7 +1596,7 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
CompiledReport cr = rsgClient.getReferenceReportById(new ReportType(refType.getId()), id);
Model model = null;
try {
model = new ReportManagerReportBuilder().buildReport(cr, id, "", "unknown author", new Date(), new Date(), "uknown last editor").getReportInstance();
model = new ReportManagerReportBuilder().buildReferenceReport(cr, id, "", "unknown author", new Date(), new Date(), "uknown last editor").getReportInstance();
} catch (ReportBuilderException e) {
e.printStackTrace();
} catch (Exception e) {