<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"
-%>
-<%@ page import="org.splat.simer.OpenKnowledge"%>
-<%@
- taglib prefix="s" uri="/struts-tags"
-%>
-<!-- Initialization of the context
- -->
-<% OpenKnowledge entity = (OpenKnowledge)session.getAttribute("knowledge.open");
-%>
-<!-- Display of the properties tab
- -->
- <div id="tab-bar">
- <span id="tab-front"> <s:text name="title.properties"/> </span>
- </div>
-
-<!-- Display of properties
- -->
- <div id=menuitem-box>
- <table border=0 cellspacing=0 cellpadding=0 class=text>
- <tr height=2><td></td></tr>
- <tr>
- <td> <s:text name="label.reference"/>: </td>
- <td><%=entity.getReference()%></td>
- </tr>
- <tr>
- <td> <s:text name="label.author"/>: </td>
- <td><%=entity.getAuthorName()%></td>
- </tr>
- <tr>
- <td> <s:text name="label.created"/>: </td>
- <td><%=entity.getDate()%></td>
- </tr>
- <tr height=2><td></td></tr>
- </table>
- </div>
\ No newline at end of file
+ pageEncoding="ISO-8859-1"%>
+<%@ taglib prefix="s" uri="/struts-tags"%>
+
+<!-- Display properties tab -->
+<div id="tab-bar"><span id="tab-front"> <s:text
+ name="title.properties" /> </span></div>
+
+<!-- Display properties -->
+<div id="menuitem-box">
+<table border="0" cellspacing="0" cellpadding="0" class="text">
+ <tr height="2">
+ <td></td>
+ </tr>
+ <tr>
+ <td> <s:text name="label.reference" />: </td>
+ <td><s:property value="knelm.reference" /></td>
+ </tr>
+ <tr>
+ <td> <s:text name="label.author" />: </td>
+ <td><s:property value="knelm.authorName" /></td>
+ </tr>
+ <tr>
+ <td> <s:text name="label.created" />: </td>
+ <td><s:property value="knelm.date" /></td>
+ </tr>
+ <tr height="2">
+ <td></td>
+ </tr>
+</table>
+</div>
\ No newline at end of file
import org.splat.som.Step;
import org.splat.wapp.Constants;
+/**
+ * Display the found knowledge action.
+ */
public class DisplayKnowledgeAction extends AbstractDisplayAction {
/**
/**
* Current knowledge element details.
*/
- protected transient OpenKnowledge _myknelm = null;
+ protected transient OpenKnowledge _knelm = null;
/**
* Injected knowledge element service.
*/
private KnowledgeElementService _knowledgeElementService;
- // ==============================================================================================================================
+ // =========================================================================
// Action methods
- // ==============================================================================================================================
+ // =========================================================================
+ /**
+ * Open the found knowledge element.
+ *
+ * @return SUCCESS if succeeded otherwise return ERROR
+ */
public String doOpen() {
- _myknelm = getOpenKnowledge();
+ _knelm = getOpenKnowledge();
if (_myindex == null) {
if (_selection != null) { // Re-opening (refreshing) the currently open knowledge
KnowledgeElementDTO kelm = getKnowledgeElementService()
- .getKnowledgeElement(_myknelm.getIndex());
- _myknelm = open(kelm); // Closes the previously open knowledge
- _myknelm.setSelection(_selection);
+ .getKnowledgeElement(_knelm.getIndex());
+ _knelm = open(kelm); // Closes the previously open knowledge
+ _knelm.setSelection(_selection);
}
} else {
try { // Opening a knowledge from the search result
int index = Integer.valueOf(_myindex);
- if (_myknelm != null && _myknelm.getIndex() == index) { // - The selected knowledge is currently open
- _selection = _myknelm.getSelection(); // Current selection
+ if (_knelm != null && _knelm.getIndex() == index) { // - The selected knowledge is currently open
+ if ((!getSession().containsKey(KNOWLEDGE_OPEN))
+ || getSession().get(KNOWLEDGE_OPEN) == null) {
+ getSession().put(KNOWLEDGE_OPEN, getOpenKnowledge()); // for the case of reopening the
+ }
+ _selection = _knelm.getSelection(); // Current selection
} else { // - The selected knowledge is new
KnowledgeElementDTO kelm = getKnowledgeElementService()
.getKnowledgeElement(index);
- _myknelm = open(kelm);
- _selection = _myknelm.getSelection(); // Default selection
+ _knelm = open(kelm);
+ _selection = _knelm.getSelection(); // Default selection
}
} catch (Exception error) {
LOG.error("Reason:", error);
return ERROR;
}
}
- getSession().put("menu.knowledge", _myknelm.getMenu());
+ getSession().put("menu.knowledge", _knelm.getMenu());
initializationFullScreenContext(Constants.KNOWLEDGE_MENU,
Constants.KNOWLEDGE_MENU, Constants.FALSE, Constants.NONE,
return SUCCESS;
}
+ /**
+ * Show the selected folder.
+ *
+ * @return SUCCESS
+ */
public String doSelectStep() {
- _myknelm = getOpenKnowledge();
+ _knelm = getOpenKnowledge();
if (_selection == null) { // Switch back to the current study
- _selection = _myknelm.getSelection();
+ _selection = _knelm.getSelection();
} else { // Selection of a step of current study
- _myknelm.setSelection(_selection);
+ _knelm.setSelection(_selection);
}
initializationFullScreenContext(Constants.KNOWLEDGE_MENU,
return SUCCESS;
}
+ /**
+ * Perform an operation on a selected document in the presentation area.
+ *
+ * @return SUCCESS
+ */
public String doSelectDocument() {
Execute todo = Execute.valueOf(_action);
- _myknelm = getOpenKnowledge();
+ _knelm = getOpenKnowledge();
if (todo == Execute.develop) {
- _myknelm.developDocument(_myindex);
+ _knelm.developDocument(_myindex);
} else if (todo == Execute.reduce) {
- _myknelm.reduceHistory(_myindex);
+ _knelm.reduceHistory(_myindex);
} else if (todo == Execute.reduceall) {
- _myknelm.reduceDocument(_myindex);
+ _knelm.reduceDocument(_myindex);
}
initializationFullScreenContext(Constants.KNOWLEDGE_MENU,
return SUCCESS;
}
+ /**
+ * Perform an operation on a knowledge in the presentation area.
+ *
+ * @return SUCCESS
+ */
public String doSelectKnowledge() {
Execute todo = Execute.valueOf(_action);
- _myknelm = getOpenKnowledge();
+ _knelm = getOpenKnowledge();
if (todo == Execute.develop) {
- _myknelm.developKnowledge(_myindex);
+ _knelm.developKnowledge(_myindex);
} else if (todo == Execute.reduce) {
- _myknelm.reduceKnowledge(_myindex);
+ _knelm.reduceKnowledge(_myindex);
}
initializationFullScreenContext(Constants.KNOWLEDGE_MENU,
return SUCCESS;
}
+ /**
+ * Close the knowledge.
+ *
+ * @return SUCCESS
+ */
public String doClose() {
closeKnowledge();
return SUCCESS;
}
- // ==============================================================================================================================
+ // =========================================================================
// Getters
- // ==============================================================================================================================
+ // =========================================================================
public List<DocumentFacade> getDocuments() {
- return _myknelm.getDisplayedDocuments();
+ return _knelm.getDisplayedDocuments();
}
public List<AbstractOpenObject.KnowledgeIterator> getKnowledges() {
- return _myknelm.getDisplayedKnowledges();
+ return _knelm.getDisplayedKnowledges();
}
public List<SimulationContextFacade> getSimulationContexts() {
- return _myknelm.getDisplayedSimulationContexts();
+ return _knelm.getDisplayedSimulationContexts();
}
public Step getSelectedStep() {
- return _myknelm.getSelectedStep();
+ return _knelm.getSelectedStep();
}
@Override
final KnowledgeElementService knowledgeElementService) {
_knowledgeElementService = knowledgeElementService;
}
+
+ /**
+ * Get the knowledge element.
+ *
+ * @return the knowledge element
+ */
+ public OpenKnowledge getKnelm() {
+ return _knelm;
+ }
}
\ No newline at end of file