reads repeatable sequences
git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@69676 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
parent
3cd598aeac
commit
f35ba10645
|
@ -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.0.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
|
<classpathentry kind="src" output="target/reports-4.0.1-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"/>
|
||||||
|
@ -30,5 +30,5 @@
|
||||||
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
|
||||||
</attributes>
|
</attributes>
|
||||||
</classpathentry>
|
</classpathentry>
|
||||||
<classpathentry kind="output" path="target/reports-4.0.0-SNAPSHOT/WEB-INF/classes"/>
|
<classpathentry kind="output" path="target/reports-4.0.1-SNAPSHOT/WEB-INF/classes"/>
|
||||||
</classpath>
|
</classpath>
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#Wed Feb 06 12:30:01 CET 2013
|
#Tue Feb 26 17:29:33 CET 2013
|
||||||
eclipse.preferences.version=1
|
eclipse.preferences.version=1
|
||||||
jarsExcludedFromWebInfLib=
|
jarsExcludedFromWebInfLib=
|
||||||
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.0.0-SNAPSHOT
|
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.0.1-SNAPSHOT
|
||||||
warSrcDir=src/main/webapp
|
warSrcDir=src/main/webapp
|
||||||
warSrcDirIsOutput=false
|
warSrcDirIsOutput=false
|
||||||
|
|
12
pom.xml
12
pom.xml
|
@ -1,6 +1,5 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
|
||||||
<modelVersion>4.0.0</modelVersion>
|
<modelVersion>4.0.0</modelVersion>
|
||||||
<parent>
|
<parent>
|
||||||
|
@ -13,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.0.0-SNAPSHOT</version>
|
<version>4.0.1-SNAPSHOT</version>
|
||||||
<name>gCube Reports Portlet</name>
|
<name>gCube Reports Portlet</name>
|
||||||
<description>
|
<description>
|
||||||
gCube Reports Portlet.
|
gCube Reports Portlet.
|
||||||
|
@ -118,7 +117,7 @@
|
||||||
<artifactId>csv4j</artifactId>
|
<artifactId>csv4j</artifactId>
|
||||||
<version>1.2.0-SNAPSHOT</version>
|
<version>1.2.0-SNAPSHOT</version>
|
||||||
<scope>${setScope}</scope>
|
<scope>${setScope}</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>workspace-light-tree</artifactId>
|
<artifactId>workspace-light-tree</artifactId>
|
||||||
|
@ -149,6 +148,11 @@
|
||||||
<version>[6.0.0-SNAPSHOT, 7.0.0-SNAPSHOT)</version>
|
<version>[6.0.0-SNAPSHOT, 7.0.0-SNAPSHOT)</version>
|
||||||
<scope>${setScope}</scope>
|
<scope>${setScope}</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
|
<artifactId>opengcubeapplication</artifactId>
|
||||||
|
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portlets.user</groupId>
|
<groupId>org.gcube.portlets.user</groupId>
|
||||||
<artifactId>home-library</artifactId>
|
<artifactId>home-library</artifactId>
|
||||||
|
|
|
@ -39,8 +39,6 @@ import com.google.gwt.user.client.ui.RichTextArea;
|
||||||
* <code> Headerbar </code> class is the top bar component of the UI
|
* <code> Headerbar </code> class is the top bar component of the UI
|
||||||
*
|
*
|
||||||
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
||||||
*
|
|
||||||
* @version July 2011 (3.0)
|
|
||||||
*/
|
*/
|
||||||
public class Headerbar extends Composite{
|
public class Headerbar extends Composite{
|
||||||
|
|
||||||
|
|
|
@ -1000,7 +1000,7 @@ public class Presenter {
|
||||||
GWT.log("Reading TABLE rows: " + gt.getRowsNo() + " cols: " + gt.getCols());
|
GWT.log("Reading TABLE rows: " + gt.getRowsNo() + " cols: " + gt.getCols());
|
||||||
wp.addComponentToLayout(gt, component.isDoubleColLayout());
|
wp.addComponentToLayout(gt, component.isDoubleColLayout());
|
||||||
break;
|
break;
|
||||||
case ATTRIBUTE:
|
case ATTRIBUTE_MULTI:
|
||||||
AttributeArea at = (AttributeArea) component.getContent();
|
AttributeArea at = (AttributeArea) component.getContent();
|
||||||
wp.addComponentToLayout(at, component.isDoubleColLayout());
|
wp.addComponentToLayout(at, component.isDoubleColLayout());
|
||||||
setCurrCursorPos(uiY);
|
setCurrCursorPos(uiY);
|
||||||
|
|
|
@ -15,7 +15,6 @@ import com.google.gwt.user.client.ui.Widget;
|
||||||
* <code> WorkspacePanel </code> class is the UI Component for displaying the template
|
* <code> WorkspacePanel </code> class is the UI Component for displaying the template
|
||||||
*
|
*
|
||||||
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
* @author Massimiliano Assante, ISTI-CNR - massimiliano.assante@isti.cnr.it
|
||||||
* @version October 2008 (0.2)
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
public class WorkspacePanel extends Composite {
|
public class WorkspacePanel extends Composite {
|
||||||
|
@ -65,7 +64,7 @@ public class WorkspacePanel extends Composite {
|
||||||
presenter = c;
|
presenter = c;
|
||||||
|
|
||||||
templateModel = presenter.getModel();
|
templateModel = presenter.getModel();
|
||||||
mainLayout.setSize(""+(templateModel.getPageWidth()), ""+templateModel.getPageHeight());
|
mainLayout.setWidth(""+(templateModel.getPageWidth()));
|
||||||
|
|
||||||
mainLayout.setStyleName("wpFlow");
|
mainLayout.setStyleName("wpFlow");
|
||||||
|
|
||||||
|
@ -123,7 +122,7 @@ public class WorkspacePanel extends Composite {
|
||||||
* @param height .
|
* @param height .
|
||||||
*/
|
*/
|
||||||
public void resizeWorkspace(int width, int height) {
|
public void resizeWorkspace(int width, int height) {
|
||||||
mainLayout.setPixelSize(width, height);
|
mainLayout.setWidth(""+width);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -41,7 +41,7 @@ public class CommentDialog extends DialogBox {
|
||||||
setSize(PANEL_WIDTH+"px", "100px");
|
setSize(PANEL_WIDTH+"px", "100px");
|
||||||
header.setPixelSize(PANEL_WIDTH, 15);
|
header.setPixelSize(PANEL_WIDTH, 15);
|
||||||
final Image enterImage = new Image(ImageConstants.IMAGE_ARROW_ENTER);
|
final Image enterImage = new Image(ImageConstants.IMAGE_ARROW_ENTER);
|
||||||
final Image closeImage = new Image(images.close());
|
final Image closeImage = new Image(ImageConstants.IMAGE_CLOSE);
|
||||||
final Image binImage = new Image(ImageConstants.IMAGE_BIN);
|
final Image binImage = new Image(ImageConstants.IMAGE_BIN);
|
||||||
closeImage.setStyleName("selectable");
|
closeImage.setStyleName("selectable");
|
||||||
binImage.setStyleName("selectable");
|
binImage.setStyleName("selectable");
|
||||||
|
|
|
@ -127,7 +127,7 @@ public class FimesReportTreePanel extends ScrollPanel{
|
||||||
node = createNodeWidget(image, "Table","gwt-label-componentTree");
|
node = createNodeWidget(image, "Table","gwt-label-componentTree");
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
case ATTRIBUTE: {
|
case ATTRIBUTE_MULTI: {
|
||||||
// TODO
|
// TODO
|
||||||
ImageResource image = FimesReportTreeStructureResources.INSTANCE.comments();
|
ImageResource image = FimesReportTreeStructureResources.INSTANCE.comments();
|
||||||
node = createNodeWidget(image, "Attribute","gwt-label-componentTree");
|
node = createNodeWidget(image, "Attribute","gwt-label-componentTree");
|
||||||
|
|
|
@ -258,7 +258,7 @@ public class TemplateComponent {
|
||||||
GenericTable table = new GenericTable(st, presenter, sc.getX(), sc.getY(), TemplateModel.TEMPLATE_WIDTH - 50, 200);
|
GenericTable table = new GenericTable(st, presenter, sc.getX(), sc.getY(), TemplateModel.TEMPLATE_WIDTH - 50, 200);
|
||||||
this.content = table;
|
this.content = table;
|
||||||
break;
|
break;
|
||||||
case ATTRIBUTE:
|
case ATTRIBUTE_MULTI:
|
||||||
AttributeArea ta = null;
|
AttributeArea ta = null;
|
||||||
if (sc.getPossibleContent() instanceof SerializableAttributeArea) {
|
if (sc.getPossibleContent() instanceof SerializableAttributeArea) {
|
||||||
SerializableAttributeArea sata = (SerializableAttributeArea) sc.getPossibleContent();
|
SerializableAttributeArea sata = (SerializableAttributeArea) sc.getPossibleContent();
|
||||||
|
@ -395,7 +395,7 @@ public class TemplateComponent {
|
||||||
SerializableTable st = gt.getSerializable();
|
SerializableTable st = gt.getSerializable();
|
||||||
content = st;
|
content = st;
|
||||||
break;
|
break;
|
||||||
case ATTRIBUTE:
|
case ATTRIBUTE_MULTI:
|
||||||
AttributeArea att = (AttributeArea) this.content;
|
AttributeArea att = (AttributeArea) this.content;
|
||||||
ArrayList<SerializableAttribute> values = new ArrayList<SerializableAttribute>();
|
ArrayList<SerializableAttribute> values = new ArrayList<SerializableAttribute>();
|
||||||
for (CheckBox box : att.getBoxes()) {
|
for (CheckBox box : att.getBoxes()) {
|
||||||
|
|
|
@ -45,10 +45,7 @@ public class TemplateModel {
|
||||||
*
|
*
|
||||||
*/
|
*/
|
||||||
public static final int TEMPLATE_WIDTH = 750;
|
public static final int TEMPLATE_WIDTH = 750;
|
||||||
/**
|
|
||||||
* TEMPLATE_HEIGHT
|
|
||||||
*/
|
|
||||||
public static final int TEMPLATE_HEIGHT= 1000;
|
|
||||||
/**
|
/**
|
||||||
* DEFAULT_NAME
|
* DEFAULT_NAME
|
||||||
*/
|
*/
|
||||||
|
@ -142,7 +139,7 @@ public class TemplateModel {
|
||||||
super();
|
super();
|
||||||
this.templateName = DEFAULT_NAME;
|
this.templateName = DEFAULT_NAME;
|
||||||
this.pageWidth = TEMPLATE_WIDTH;
|
this.pageWidth = TEMPLATE_WIDTH;
|
||||||
this.pageHeight = TEMPLATE_HEIGHT;
|
this.pageHeight = -1;
|
||||||
this.currentPage = 1;
|
this.currentPage = 1;
|
||||||
this.totalPages = 1;
|
this.totalPages = 1;
|
||||||
this.marginLeft = 25;
|
this.marginLeft = 25;
|
||||||
|
|
|
@ -121,7 +121,7 @@ public class AttributeArea extends Composite {
|
||||||
* @return
|
* @return
|
||||||
*/
|
*/
|
||||||
public ComponentType getType() {
|
public ComponentType getType() {
|
||||||
return ComponentType.ATTRIBUTE;
|
return ComponentType.ATTRIBUTE_MULTI;
|
||||||
}
|
}
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
|
|
|
@ -2,69 +2,79 @@ package org.gcube.portlets.user.reportgenerator.client.targets;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
|
||||||
import org.gcube.portlets.d4sreporting.common.client.uicomponents.ReportUIComponent;
|
|
||||||
import org.gcube.portlets.d4sreporting.common.shared.ComponentType;
|
import org.gcube.portlets.d4sreporting.common.shared.ComponentType;
|
||||||
import org.gcube.portlets.d4sreporting.common.shared.SerializableComponent;
|
import org.gcube.portlets.d4sreporting.common.shared.SerializableComponent;
|
||||||
import org.gcube.portlets.d4sreporting.common.shared.SerializableRepeatableSequence;
|
import org.gcube.portlets.d4sreporting.common.shared.SerializableRepeatableSequence;
|
||||||
import org.gcube.portlets.user.reportgenerator.client.Presenter.Presenter;
|
import org.gcube.portlets.user.reportgenerator.client.Presenter.Presenter;
|
||||||
import org.gcube.portlets.user.reportgenerator.client.model.TemplateComponent;
|
import org.gcube.portlets.user.reportgenerator.client.model.TemplateComponent;
|
||||||
import org.gcube.portlets.user.reportgenerator.client.model.TemplateModel;
|
|
||||||
|
|
||||||
import com.google.gwt.core.client.GWT;
|
import com.google.gwt.core.client.GWT;
|
||||||
|
import com.google.gwt.dom.client.Style.Unit;
|
||||||
|
import com.google.gwt.event.dom.client.ClickEvent;
|
||||||
|
import com.google.gwt.event.dom.client.ClickHandler;
|
||||||
|
import com.google.gwt.user.client.Window;
|
||||||
|
import com.google.gwt.user.client.ui.Button;
|
||||||
|
import com.google.gwt.user.client.ui.Composite;
|
||||||
|
import com.google.gwt.user.client.ui.HasAlignment;
|
||||||
|
import com.google.gwt.user.client.ui.HorizontalPanel;
|
||||||
import com.google.gwt.user.client.ui.VerticalPanel;
|
import com.google.gwt.user.client.ui.VerticalPanel;
|
||||||
|
|
||||||
public class RepeatableSequence extends ReportUIComponent {
|
public class RepeatableSequence extends Composite {
|
||||||
private ArrayList<TemplateComponent> groupedComponents = new ArrayList<TemplateComponent>();
|
private ArrayList<TemplateComponent> groupedComponents = new ArrayList<TemplateComponent>();
|
||||||
|
|
||||||
VerticalPanel myPanel;
|
private VerticalPanel myPanel;
|
||||||
Presenter p;
|
private HorizontalPanel buttonPanel = new HorizontalPanel();
|
||||||
|
private Presenter p;
|
||||||
|
private Button addAnotherB = new Button("Add another entry");
|
||||||
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* constructor used by the system when reading the model
|
* constructor used by the system when reading the model
|
||||||
* @param sRS
|
* @param sRS
|
||||||
*/
|
*/
|
||||||
public RepeatableSequence(Presenter p, SerializableRepeatableSequence sRS) {
|
public RepeatableSequence(Presenter p, SerializableRepeatableSequence sRS) {
|
||||||
super(ComponentType.REPEAT_SEQUENCE, 0, 0, TemplateModel.TEMPLATE_WIDTH - 50, sRS.getHeight());
|
|
||||||
this.p = p;
|
this.p = p;
|
||||||
myPanel = getResizablePanel();
|
addAnotherB.getElement().getStyle().setMargin(10, Unit.PX);
|
||||||
|
addAnotherB.getElement().getStyle().setHeight(30, Unit.PX);
|
||||||
|
addAnotherB.getElement().getStyle().setWidth(200, Unit.PX);
|
||||||
|
myPanel = new VerticalPanel();
|
||||||
|
myPanel.setHorizontalAlignment(HasAlignment.ALIGN_LEFT);
|
||||||
int size = sRS.getGroupedComponents().size();
|
int size = sRS.getGroupedComponents().size();
|
||||||
for (int j = 0; j < size; j++) {
|
for (int j = 0; j < size; j++) {
|
||||||
SerializableComponent sComp = sRS.getGroupedComponents().get(j);
|
SerializableComponent sComp = sRS.getGroupedComponents().get(j);
|
||||||
|
if (j == size-1) {
|
||||||
|
myPanel.add(buttonPanel); //add the button before the last element
|
||||||
|
buttonPanel.setWidth("100%");
|
||||||
|
buttonPanel.setHorizontalAlignment(HasAlignment.ALIGN_RIGHT);
|
||||||
|
buttonPanel.add(addAnotherB);
|
||||||
|
}
|
||||||
add(new TemplateComponent(p.getModel(), sComp, p));
|
add(new TemplateComponent(p.getModel(), sComp, p));
|
||||||
}
|
}
|
||||||
|
initWidget(myPanel);
|
||||||
|
|
||||||
|
addAnotherB.addClickHandler(new ClickHandler() {
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void onClick(ClickEvent event) {
|
||||||
|
Window.alert("TODO: Missing Implementation");
|
||||||
|
|
||||||
|
}
|
||||||
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
public void add(TemplateComponent toAdd) {
|
public void add(TemplateComponent toAdd) {
|
||||||
groupedComponents.add(toAdd);
|
if (toAdd.getType() != ComponentType.REPEAT_SEQUENCE_INNER) {
|
||||||
GWT.log("toAdd.getContent()= NULL? " + (toAdd.getContent() == null));
|
groupedComponents.add(toAdd);
|
||||||
GWT.log("ToAdd= getType " + toAdd.getType());
|
GWT.log("ToAdd= getType " + toAdd.getType());
|
||||||
myPanel.add(toAdd.getContent());
|
myPanel.add(toAdd.getContent());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public ArrayList<TemplateComponent> getGroupedComponents() {
|
public ArrayList<TemplateComponent> getGroupedComponents() {
|
||||||
return groupedComponents;
|
return groupedComponents;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setGroupedComponents(ArrayList<TemplateComponent> groupedComponents) {
|
public void setGroupedComponents(ArrayList<TemplateComponent> groupedComponents) {
|
||||||
this.groupedComponents = groupedComponents;
|
this.groupedComponents = groupedComponents;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getHeight() {
|
|
||||||
return super.mainPanel.getOffsetHeight();
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void removeTemplateComponent(ReportUIComponent toRemove) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
@Override
|
|
||||||
public void lockComponent(ReportUIComponent toLock, boolean locked) {
|
|
||||||
// TODO Auto-generated method stub
|
|
||||||
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,3 +1,5 @@
|
||||||
|
@import url('reports/old-dialog.css');
|
||||||
|
|
||||||
.grouping-inner {
|
.grouping-inner {
|
||||||
background: url('images/grouping-border.png') repeat-x;
|
background: url('images/grouping-border.png') repeat-x;
|
||||||
display: block;
|
display: block;
|
||||||
|
@ -66,11 +68,12 @@ tableBorder td {
|
||||||
.wpFlow {
|
.wpFlow {
|
||||||
margin: 10px 5px 5px 20px;
|
margin: 10px 5px 5px 20px;
|
||||||
border: 1px solid #e3e8f3;
|
border: 1px solid #e3e8f3;
|
||||||
padding-left: 44px;
|
padding: 0px 0px 25px 44px;
|
||||||
background-color: #e3e8f3;
|
background-color: #e3e8f3;
|
||||||
-webkit-border-radius: 5px;
|
-webkit-border-radius: 5px;
|
||||||
-moz-border-radius: 5px;
|
-moz-border-radius: 5px;
|
||||||
border-radius: 5px;
|
border-radius: 5px;
|
||||||
|
width: 750px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.highlight_background {
|
.highlight_background {
|
||||||
|
|
Reference in New Issue