import org.splat.dal.bo.som.SimulationContext;
import org.splat.service.dto.KnowledgeElementDTO;
import org.splat.som.Step;
+import org.splat.wapp.Constants;
import org.splat.wapp.SimpleMenu;
/**
* Open knowledge details for presentation.
*/
-public class OpenKnowledge extends OpenObject {
+public class OpenKnowledge extends AbstractOpenObject {
/**
* The open knowledge element DTO.
j = i + 1; // Steps are numbered from 1 to N
}
if (step.isStarted()) {
- icon = "icon.done.png";
+ icon = Constants.IMG_DONE;
} else {
- icon = "icon.empty.png";
+ icon = Constants.IMG_EMPTY;
}
addItem(String.valueOf(number), "folder.step." + number, icon,
"step-knowledge?selection=" + number);
ResourceBundle custom = ResourceBundle.getBundle("som",
getApplicationSettings().getCurrentLocale());
SimpleDateFormat convert = new SimpleDateFormat(custom
- .getString("date.format"));
+ .getString("date.format"), getApplicationSettings()
+ .getCurrentLocale());
StringBuffer value = new StringBuffer(knelm.getValue());
String sceneTitle = knelm.getScenarioTitle();
String studyTitle = knelm.getStudyTitle();
// Preparation of the display
_credate = convert.format(_myknelm.getDate());
// involving = getAllSteps(knelm.getOwnerScenario());
- involving = knelm.getInvolving();
- context = new ArrayList<SimulationContextFacade>();
- menu = new Menu(getInvolvedSteps());
- selection = menu.getSelection(); // The default selection is set in the menu definition
- int index = Integer.valueOf(selection);
- for (Iterator<Step> i = involving.iterator(); i.hasNext();) {
+ _involving = knelm.getInvolving();
+ _context = new ArrayList<SimulationContextFacade>();
+ _menu = new Menu(getInvolvedSteps());
+ _selection = _menu.getSelection(); // The default selection is set in the menu definition
+ int index = Integer.valueOf(_selection);
+ for (Iterator<Step> i = _involving.iterator(); i.hasNext();) {
Step next = i.next();
if (next.getNumber() == index) {
- ustep = next;
+ _ustep = next;
}
for (Iterator<SimulationContext> j = next
.getAllSimulationContexts().iterator(); j.hasNext();) {
- context.add(new SimulationContextFacade(j.next(),
- getProjectSettings().getAllSteps()));
+ _context.add(new SimulationContextFacade(j.next(),
+ getProjectSettings().getAllSteps(),
+ getApplicationSettings()));
}
}
value.append("<p>").append("<b>").append(
.append("\",").append("<br>")
.append(sceneTitle/* scene.getTitle() */).append(".").append(
"</p>");
- description = value.toString();
+ _description = value.toString();
setupContents(); // Initializes documents and knowledge at ustep
return this;
}
@Override
public Menu getMenu() {
- return (Menu) menu;
+ return (Menu) _menu;
}
public ProgressState getProgressState() {
}
public String getType() {
- return ResourceBundle.getBundle("som",
- getApplicationSettings().getCurrentLocale()).getString(
- "type.knowledge." + _myknelm.getType().getName());
+ /*
+ * RKV: return ResourceBundle.getBundle("som", getApplicationSettings().getCurrentLocale()).getString( "type.knowledge." +
+ * _myknelm.getType().getName());
+ */
+ return "knowledge";
}
public void setSelection(final String step) {
- selection = step;
- int index = Integer.valueOf(selection);
- for (Iterator<Step> i = involving.iterator(); i.hasNext();) {
- ustep = i.next();
- if (ustep.getNumber() == index) {
+ _selection = step;
+ int index = Integer.valueOf(_selection);
+ for (Iterator<Step> i = _involving.iterator(); i.hasNext();) {
+ _ustep = i.next();
+ if (_ustep.getNumber() == index) {
break;
}
}
- menu.selects(selection);
+ _menu.selects(_selection);
setupContents(); // The contents may have changed even if the selection is the same
}
}
\ No newline at end of file