fixed workspace temporary saving for VMEs

git-svn-id: http://svn.research-infrastructures.eu/public/d4science/gcube/trunk/portlets/user/reports@90798 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Massimiliano Assante 2014-01-30 18:27:23 +00:00
parent afd8018685
commit e1f91dfe70
5 changed files with 31 additions and 22 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.7.9-SNAPSHOT/WEB-INF/classes" path="src/main/java"> <classpathentry kind="src" output="target/reports-4.7.10-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 @@
<attribute name="maven.pomderived" value="true"/> <attribute name="maven.pomderived" value="true"/>
</attributes> </attributes>
</classpathentry> </classpathentry>
<classpathentry kind="output" path="target/reports-4.7.9-SNAPSHOT/WEB-INF/classes"/> <classpathentry kind="output" path="target/reports-4.7.10-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.7.9-SNAPSHOT lastWarOutDir=/Users/massi/Documents/workspace/reports/target/reports-4.7.10-SNAPSHOT
warSrcDir=src/main/webapp warSrcDir=src/main/webapp
warSrcDirIsOutput=false warSrcDirIsOutput=false

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.7.9-SNAPSHOT</version> <version>4.7.10-SNAPSHOT</version>
<name>gCube Reports Manager</name> <name>gCube Reports Manager</name>
<description> <description>
gCube Reports Portlet. gCube Reports Portlet.

View File

@ -174,14 +174,16 @@ public class ClientRepeatableSequence extends Composite implements ClientSequenc
} }
} }
} }
//for any other component if (co.getAllMetadata() != null) {
for (Metadata prop : co.getAllMetadata()) { //for any other component
//if there's a new component for (Metadata prop : co.getAllMetadata()) {
if ( prop.getAttribute().equals(SequenceWidget.RSG_BINDING_CONTEXT_PROPERTY) && (extractIndexFromBindingContext(prop.getValue()) == -1) ) { //if there's a new component
prop.setValue(replaceIndexFromBindingContext(prop.getValue(), maxBindingContext)); if ( prop.getAttribute().equals(SequenceWidget.RSG_BINDING_CONTEXT_PROPERTY) && (extractIndexFromBindingContext(prop.getValue()) == -1) ) {
break; prop.setValue(replaceIndexFromBindingContext(prop.getValue(), maxBindingContext));
} break;
} }
}
}
} }
return groupedComponents; return groupedComponents;
} }
@ -220,13 +222,17 @@ public class ClientRepeatableSequence extends Composite implements ClientSequenc
*/ */
private int getMaxIndex() { private int getMaxIndex() {
int max = 0; int max = 0;
for (TemplateComponent co : groupedComponents) { for (TemplateComponent co : groupedComponents) {
for (Metadata prop : co.getAllMetadata()) { if (co.getAllMetadata() != null) {
if (prop.getAttribute().equals(SequenceWidget.RSG_BINDING_CONTEXT_PROPERTY) || prop.getAttribute().equals(SequenceWidget.RSG_BINDING_PROPERTY)) { for (Metadata prop : co.getAllMetadata()) {
int currValue = extractIndexFromBindingContext(prop.getValue()); if (prop.getAttribute().equals(SequenceWidget.RSG_BINDING_CONTEXT_PROPERTY) || prop.getAttribute().equals(SequenceWidget.RSG_BINDING_PROPERTY)) {
if (currValue > max) int currValue = extractIndexFromBindingContext(prop.getValue());
max = currValue; if (currValue > max)
max = currValue;
}
} }
} else {
GWT.log("getAllMetadata() null for co=" +co.getType());
} }
} }
GWT.log("return max=" +max); GWT.log("return max=" +max);

View File

@ -384,7 +384,10 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
AccessLogger log = AccessLogger.getAccessLogger(); AccessLogger log = AccessLogger.getAccessLogger();
OpenReportLogEntry logEntry = new OpenReportLogEntry(toReturn.getTemplateName(), templateObjectID); OpenReportLogEntry logEntry = new OpenReportLogEntry(toReturn.getTemplateName(), templateObjectID);
log.logEntry(getASLSession().getUsername(), getASLSession().getScopeName(), logEntry); log.logEntry(getASLSession().getUsername(), getASLSession().getScopeName(), logEntry);
ModelReader reader = new ModelReader(toReturn);
System.out.println(reader);
return toReturn; return toReturn;
} }
} }
@ -827,9 +830,6 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
Model model = toSave; Model model = toSave;
ModelReader reader = new ModelReader(model);
System.out.println(reader);
storeTemplateInSession(toSave); storeTemplateInSession(toSave);
_log.info("Serializing Model in folder: " + folderid ); _log.info("Serializing Model in folder: " + folderid );
_log.info("Trying to convert dynamic images ... "); _log.info("Trying to convert dynamic images ... ");
@ -838,6 +838,9 @@ public class ReportServiceImpl extends RemoteServiceServlet implements ReportSe
ServiceUtil myUtil = new ServiceUtil(getASLSession()); ServiceUtil myUtil = new ServiceUtil(getASLSession());
boolean result = myUtil.writeModel(model, "CURRENT_OPEN", getVreName(), getUsername()); boolean result = myUtil.writeModel(model, "CURRENT_OPEN", getVreName(), getUsername());
ModelReader reader = new ModelReader(model);
System.out.println(reader);
if (!result) { if (!result) {
_log.debug("Could not save report, serializing failed"); _log.debug("Could not save report, serializing failed");
} }