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"?>
<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>
<attribute name="optional" value="true"/>
<attribute name="maven.pomderived" value="true"/>
@ -31,5 +31,5 @@
<attribute name="maven.pomderived" value="true"/>
</attributes>
</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>

View File

@ -2,6 +2,6 @@
<<<<<<<=.mine
>>>>>>>=.r71295
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
warSrcDirIsOutput=false

View File

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

View File

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

View File

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