Minor Update

git-svn-id: https://svn.d4science.research-infrastructures.eu/gcube/trunk/portlets/user/tabular-data-table-widget@95812 82a268e6-3cf1-43bd-a215-b396298e98cf
This commit is contained in:
Giancarlo Panichi 2014-05-16 18:15:37 +00:00 committed by Giancarlo Panichi
parent 9efb9594a2
commit e1cb9638e2
3 changed files with 52 additions and 6 deletions

View File

@ -184,15 +184,48 @@ public class ValidationsTasksPanel extends FramedPanel {
if (value == null) {
sb.appendHtmlConstant("");
} else {
Log.debug("Context: pos=" + context.getIndex() + ", key="
+ context.getKey() + ", column="
+ context.getColumn());
String key = (String) context.getKey();
BaseDto d = store.findModelWithKey(key);
/*
* List<BaseDto> list = ;
* Log.debug("List: ["+list.toString()+"]"); int i = 0;
* BaseDto d=null; for (; i < list.size(); i++) { BaseDto dt
* = list.get(i); if (dt.getId().compareTo((String)
* context.getKey()) == 0) { d=dt;
* Log.debug("Retrieved: "+d+" at pos:"+i); break; } }
*/
String title = "";
if (d != null) {
Log.debug(d.toString());
if (d instanceof ValidationDto) {
ValidationDto v = (ValidationDto) d;
Log.debug("ValidationDto: [" + v.getId() + ", "
+ v.getDescription() + ", "
+ v.getValid() + ", "
+ v.getInvocation() + "]");
if (v.getInvocation() != null) {
title = v.getInvocation().toString();
}
}
}
if (value) {
sb.appendHtmlConstant("<img src='"
+ ResourceBundle.INSTANCE.ok().getSafeUri()
.asString() + "' alt='true'>");
.asString() + "' alt='true' title='"
+ title + "'>");
} else {
sb.appendHtmlConstant("<img src='"
+ ResourceBundle.INSTANCE.exit().getSafeUri()
.asString() + "' alt='true'>");
.asString() + "' alt='false' title='"
+ title + "'>");
}
}

View File

@ -26,7 +26,7 @@ public class TreeDataGenerator {
ArrayList<BaseDto> validations = new ArrayList<BaseDto>();
for (Validations v : job.getValidations()) {
ValidationDto validationDto = new ValidationDto(task.getId()+"-"+job.getId()+"-"+v.getId(),
v.getDescription(), v.isValid());
v.getDescription(), v.isValid(),job.getInvocation());
validations.add(validationDto);
}
FolderDto foldJob = new FolderDto("job",task.getId()+"-"+job.getId(),
@ -39,7 +39,7 @@ public class TreeDataGenerator {
}
root = new FolderDto("root","-1", "root", childrens);
Log.debug("Generated root");
printRecorsive(root);
//printRecorsive(root);
} else {
root = new FolderDto("root","-1", "root", childrens);

View File

@ -1,5 +1,7 @@
package org.gcube.portlets.user.td.tablewidget.client.validation.tree;
import org.gcube.portlets.user.td.gwtservice.shared.task.InvocationS;
/**
*
* @author "Giancarlo Panichi"
@ -11,15 +13,17 @@ public class ValidationDto extends BaseDto {
protected String description;
protected Boolean valid;
protected InvocationS invocation;
public ValidationDto(){
}
public ValidationDto(String id,String description, Boolean valid){
public ValidationDto(String id,String description, Boolean valid,InvocationS invocation){
super(id);
this.description=description;
this.valid=valid;
this.invocation=invocation;
}
@ -39,10 +43,19 @@ public class ValidationDto extends BaseDto {
this.valid = valid;
}
public InvocationS getInvocation() {
return invocation;
}
public void setInvocation(InvocationS invocation) {
this.invocation = invocation;
}
@Override
public String toString() {
return description;
}