fixed not saving images when Report case

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@71075 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2013-03-07 18:22:29 +00:00
parent 76b573fa6a
commit 805b40d661
5 changed files with 23 additions and 9 deletions

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?>
<classpath>
<classpathentry kind="src" output="target/reports-4.1.0-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<classpathentry kind="src" output="target/reports-4.0.3-SNAPSHOT/WEB-INF/classes" path="src/main/java">
<attributes>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -30,5 +30,5 @@
<attribute name="org.eclipse.jst.component.dependency" value="/WEB-INF/lib"/>
</attributes>
</classpathentry>
<classpathentry kind="output" path="target/reports-4.1.0-SNAPSHOT/WEB-INF/classes"/>
<classpathentry kind="output" path="target/reports-4.0.3-SNAPSHOT/WEB-INF/classes"/>
</classpath>

View File

@ -1,5 +1,5 @@
#Thu Mar 07 16:00:56 CET 2013
#Thu Mar 07 19:02:40 CET 2013
eclipse.preferences.version=1
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.1.0-SNAPSHOT
lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.0.3-SNAPSHOT
warSrcDir=src/main/webapp
warSrcDirIsOutput=false

View File

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

View File

@ -164,7 +164,7 @@ public class TemplateComponent {
switch (sc.getType()) {
case DYNA_IMAGE:
ClientImage dp = new ClientImage(sc, presenter, sc.getWidth());
ClientImage dp = new ClientImage(sc, presenter, sc.getWidth(), sc.getHeight());
this.content = dp;
// String possibelContent = ((String) sc.getPossibleContent());
@ -355,6 +355,8 @@ public class TemplateComponent {
if (((String) content).compareTo("") == 0)
content = DEFAULT_IMAGE_PATH;
metadata = da.getMetadata();
width = da.getImageWidth();
height = da.getImageHeight();
break;
case BODY:
if (this.isLocked()) {

View File

@ -49,6 +49,8 @@ public class ClientImage extends Composite {
private final String METADATA_DESC_KEY = "description";
private final String METADATA_SOURCE_KEY = "source";
private int imageWidth;
private int imageHeight;
private FocusPanel focusPanel = new FocusPanel();
private VerticalPanel mainPanel = new VerticalPanel();
@ -78,7 +80,9 @@ public class ClientImage extends Composite {
* @param width
* @param tag
*/
public ClientImage(BasicComponent co, Presenter presenter, int width) {
public ClientImage(BasicComponent co, Presenter presenter, int width, int height) {
imageHeight = height;
imageWidth = width;
this.presenter = presenter;
this.basicComponent = co;
HorizontalPanel controlPanel = getControlPanel();
@ -104,7 +108,7 @@ public class ClientImage extends Composite {
}
else {
GWT.log("Found ImageUrl="+imageURL);
showImage(new Image(imageURL));
showImage(new Image(imageURL), width, height);
}
//set style for buttons
@ -175,7 +179,7 @@ public class ClientImage extends Composite {
}
HorizontalPanel hp1 = new HorizontalPanel();
HTML title = new HTML("Title: <span style=\"color: red;\">*&nbsp;</span>", true);
HTML title = new HTML("<div style=\"white-space:nowrap;\">Title: <span style=\"color: red;\">*&nbsp;</span></div>", true);
hp1.add(title);
hp1.add(titleTB);
titleTB.setWidth("135px");
@ -221,6 +225,8 @@ public class ClientImage extends Composite {
toShow.setWidth(checkedWidth+"px");
imagePanel.setSize(checkedWidth+"px", checkedHeight+"px");
imagePanel.add(toShow);
imageWidth = checkedWidth;
imageHeight = checkedHeight;
saveStatus();
}
@ -327,7 +333,13 @@ public class ClientImage extends Composite {
public String getIdInBasket() {
return idInBasket;
}
public int getImageWidth() {
return imageWidth;
}
public int getImageHeight() {
return imageHeight;
}
/**
*
* @param idInBasket .