aUser);
if (res) {
if (aScenario.isCheckedout()
- && (!aScenario.getUser().getUsername().equals(aUser.getUsername()))) {
+ && (!aScenario.getUser().getUsername().equals(
+ aUser.getUsername()))) {
throw new NotApplicableException(MessageKeyEnum.SCN_000008
.toString(), scenarioId, aScenario.getUser()
.getUsername());
* the knowledge element to remove
* @return true if removal succeeded
*/
+ @Transactional
public boolean removeKnowledgeElement(final Scenario scenario,
final KnowledgeElement kelm) {
KnowledgeElement torem = scenario.getKnowledgeElement(kelm.getIndex());
- if (torem == null) {
- return false;
- }
- boolean done = scenario.getKnowledgeElements().remove(torem);
- if (done) {
- // Update of my transient data
- // RKV: These transient data are not used indeed.
- // RKV: List<KnowledgeElement> kelms = scenario.getKnowledgeByType().get(
- // RKV: kelm.getType().getIndex());
- // RKV: kelms.remove(torem);
- if (scenario.getKnowledgeElementsList() != null) {
- scenario.getKnowledgeElementsList().remove(torem);
+ boolean isOk = (torem != null);
+ if (isOk) {
+ isOk = scenario.getKnowledgeElements().remove(torem);
+ if (isOk) {
+ getScenarioDAO().merge(scenario);
+ // Update of my transient data
+ // RKV: These transient data are not used indeed.
+ // RKV: List<KnowledgeElement> kelms = scenario.getKnowledgeByType().get(
+ // RKV: kelm.getType().getIndex());
+ // RKV: kelms.remove(torem);
+ if (scenario.getKnowledgeElementsList() != null) {
+ scenario.getKnowledgeElementsList().remove(torem);
+ }
+ // TODO: If the owner study is not private, remove the knowledge from the Lucene index
}
- getScenarioDAO().update(scenario);
- // TODO: If the owner study is not private, remove the knowledge from the Lucene index
- return true;
- } else {
- return false;
}
+ return isOk;
}
/**
</definition>
<definition name="page.displaystudy" extends="baseLayout">
- <put-attribute name="presentation_pane" value="/study/displayStudyStep.jsp"/>
+ <put-attribute name="presentation_pane" value="/study/displayStudyStep.jsp"/>
</definition>
+<!-- RKV: BEGIN: Simulation contexts -->
+<definition name="page.newcontext" extends="baseLayout">
+ <put-attribute name="presentation_pane" value="/study/displayStudyStep.jsp?action=newContext"/>
+</definition>
+
+<definition name="page.selectcontext" extends="baseLayout">
+ <put-attribute name="presentation_pane" value="/study/displayStudyStep.jsp?action=selectContext"/>
+</definition>
+
+<definition name="page.setcontext" extends="baseLayout">
+ <put-attribute name="presentation_pane" value="/study/displayStudyStep.jsp?action=setContext"/>
+</definition>
+<!-- RKV: END: Simulation contexts -->
<definition name="page.displaystudyproperties" extends="baseLayout">
<put-attribute name="presentation_pane" value="/study/displayStudyProperties.jsp"/>
}
return true;
}
-
-//// For making easier on the eyes and fingers
-// function $(id) {
-//// --------------
-// return document.getElementById(id);
-// }
\ No newline at end of file
%>
<%@ taglib prefix="s" uri="/struts-tags"
%>
-<s:set var="todo"><%=request.getParameter("action")%></s:set>
-<s:set var="type"><%=request.getParameter("type")%></s:set>
<s:url id="undo" namespace="/study" action="step-study"></s:url>
<!-- Selection of an existing type of simulation context
-->
-<s:if test="%{#todo == 'selectContext'}">
+<s:if test="%{action == 'selectContext'}">
<table cellpadding=0 cellspacing=0 border=0 class=text>
<tr height=2><td></td></tr>
<s:iterator value="simulationContexts">
<!-- Input of a new type of simulation context
-->
<table cellpadding=0 cellspacing=0 border=0 class=text>
- <s:if test="%{#todo == 'newContext'}">
+ <s:if test="%{action == 'newContext'}">
<tr height=18>
<td width=18 align=center>
<s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
<!-- Input of a value of the selected simulation context type
-->
- <s:elseif test="%{#todo == 'setContext'}">
+ <s:elseif test="%{action == 'setContext'}">
<tr height=18>
<td width=18 align=center>
<s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
</select>
</td>
<td id=enter style="display: none">
- <input type=hidden name=contextType value="<s:property value="%{#type}"/>">
+ <input type=hidden name=contextType value="<s:property value="index"/>">
<input type=text name=contextValue>
</td>
<td>
</s:if>
<s:else>
<td>
- <input type=hidden name=contextType value="<s:property value="%{#type}"/>">
+ <input type=hidden name=contextType value="<s:property value="index"/>">
<input type=hidden name=contextValue value="0">
<input type=text name=contextValue>
</td>
<s:set var="knowledge"><%=type.getIndex().toString()%></s:set>
<tr height=20 valign=bottom>
<td>
- <s:a href="%{addknowledge}?knowledgeType=%{#knowledge}">
+ <s:a href="%{addknowledge}?action=addKnowledge&index=%{#knowledge}">
<img src="<s:url value="/skin/icon.add.png"/>" onMouseOver=this.src="<s:url value="/skin/icon.addhot.png"/>" onMouseOut=this.src="<s:url value="/skin/icon.add.png"/>" border="none" title="<s:text name="tooltip.addknowledge"/>" />
</s:a>
</td>
+++ /dev/null
-<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"
-%>
-<%@
- taglib prefix="s" uri="/struts-tags"
-%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
-<!-- Initialization of the edit action, if any
- =============================================================================================================================
- -->
-<% String action = request.getParameter("action");
- String type = request.getParameter("index");
- if (action == null) action = "display";
-%>
-<s:set var="todo"><%=action%></s:set>
-<html>
-
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
- <title><s:text name="name.module"/></title>
- <link href="<s:url value="/skin/default.css"/>" rel="stylesheet" type="text/css">
- <link href="<s:url value="/rtef/rte.css"/>" rel="stylesheet" type="text/css">
- <script language="JavaScript" type="text/javascript" src="<s:url value="/rtef/lang/fr.js"/>"></script>
- <script language="JavaScript" type="text/javascript" src="<s:url value="/rtef/richtext.js"/>"></script>
- <script language="JavaScript" type="text/javascript" src="<s:url value="/rtef/xhtml.js"/>"></script>
- <script language="JavaScript" type="text/javascript" src="<s:url value="/js/popup.js"/>"></script>
- <script language="JavaScript" type="text/javascript" src="<s:url value="/js/action.js"/>"></script>
-
- <script language="JavaScript">
-
- initTextEditor();
-
- var substitutions = new Array (
- new RegExp("[\r\n]",'g'), " ", // For removing carriage returns & line feeds
- new RegExp("<p> "), "<p>", // For removing of the 1st paragraph
- new RegExp(" </p>"), "</p>", // For removing of the 1st paragraph
-
- new RegExp("é",'g'), "é",
- new RegExp("è",'g'), "è",
- new RegExp("ê",'g'), "ê",
- new RegExp("ë",'g'), "ë",
- new RegExp("à",'g'), "à",
- new RegExp("â",'g'), "â",
- new RegExp("î",'g'), "î",
- new RegExp("ï",'g'), "ï",
- new RegExp("ô",'g'), "ô",
- new RegExp("ù",'g'), "ù",
- new RegExp("û",'g'), "û",
- new RegExp("ü",'g'), "ü",
-
- new RegExp("ç",'g'), "ç"
- );
-
- function initialize (action) {
-// ----------------------------
- if (action == "setContext") {
- edit.elements[2].focus();
- } else
- if (action == "renameDocument") {
- edoc.documentTitle.focus();
- } else
- if (action == "renameKnowledge") {
- edit.knowledgeTitle.focus();
- } else
- if (action == "addKnowledge") {
- edit.elements[1].focus();
- } else
- if (action != "display") {
- edit.elements[0].focus();
- }
- }
- function setValue () {
-// -------------------
- var select = edit.elements[0].value; // contextValue select input
- if (select == "0") { // Creation of a new context type
- tds = document.getElementById("select");
- tde = document.getElementById("enter");
- tds.style.display = "none"; // Hides the select input
- tde.style.display = "block"; // Displays the text input
- }
- edit.elements[2].focus();
- }
- function clean (html) {
-// ---------------------
- html = trim(html);
- for (i=0; i<substitutions.length; i = i+2) {
- html = html.replace(substitutions[i], substitutions[i+1]);
- }
- return html;
- }
- function submitEdit () {
-// ----------------------
- updateRTEs(); // Sets the value of knowledgeValue input
- edit.knowledgeValue.value = clean(edit.knowledgeValue.value);
- edit.submit();
- }
- </script>
- </head>
-
- <body onLoad="initialize('<%=action%>')">
-<!-- Menu-bar
- =============================================================================================================================
- -->
- <jsp:include page="/jsp/menubar.jsp" />
-
-<!-- Title-bar
- =============================================================================================================================
- -->
- <jsp:include page="/jsp/titlebar.jsp" />
-
-<!-- Left pane
- =============================================================================================================================
- -->
- <div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp" />
- <div id=top-spacer></div>
- <jsp:include page="/jsp/menuitem.jsp" />
- <jsp:include page="/jsp/studyProperties.jsp" />
- </div>
-
- <div id=main-pane>
-
-<!-- Description and simulation context sections
- =============================================================================================================================
-
- Display of tabs
- -->
- <div id="tab-bar">
- <div id="tab-description">
- <span id="tab-front"> <s:text name="title.description"/> </span>
- </div>
- <div id="tab-context">
- <span id="tab-front"> <s:text name="title.context"/> </span>
- </div>
- </div>
-
-<!-- Display of contents
- -->
- <div id="article-box">
- <table width=100% border=0 cellspacing=0 cellpadding=0>
- <tr valign=top>
- <td width=38%> <!-- Must conform to the width of above tab-description -->
- <div id="top-spacer"></div>
- <div id=article-body class=text>
- <jsp:include page="/jsp/readDescription.jsp">
- <jsp:param name="entity" value="study" />
- </jsp:include>
- </div>
- </td>
- <td width=1></td> <!-- Trick for aligning the vertical separator with the tab -->
- <td width=1 bgcolor=#AAAAAA></td>
- <td>
- <div id="top-spacer"></div>
- <div id="article-body">
- <s:if test="%{#todo == 'newContext' || #todo == 'selectContext' || #todo == 'setContext'}">
- <form name="edit" action="<%=action%>?selection=<s:property value="selection"/>" method="post">
- <jsp:include page="/jsp/editContext.jsp">
- <jsp:param name="action" value="<%=action%>" />
- <jsp:param name="type" value="<%=type%>" />
- </jsp:include>
- </form>
- </s:if>
- <s:else>
- <jsp:include page="/jsp/readContext.jsp" />
- </s:else>
- </div>
- </td>
- </tr>
- </table>
- </div>
-
-<!-- Knowledge elements section
- =============================================================================================================================
- -->
- <s:if test="knowledges != null">
- <div id=article-box>
- <div id=section><s:text name="title.knowledge"/></div>
- <div id=article-body class=text>
- <s:if test="%{#todo == 'addKnowledge' || #todo == 'renameKnowledge' || #todo == 'editKnowledge'}">
- <form name="edit" action="setKnowledge" method="post">
- <jsp:include page="/jsp/editKnowledge.jsp">
- <jsp:param name="action" value="<%=action%>" />
- <jsp:param name="index" value="<%=type%>" />
- </jsp:include>
- </form>
- </s:if>
- <s:else>
- <jsp:include page="/jsp/readKnowledge.jsp">
- <jsp:param name="entity" value="study" />
- </jsp:include>
- </s:else>
- </div>
- </div>
- </s:if>
-
-<!-- Documents section
- =============================================================================================================================
- -->
- <s:if test="documents != null">
- <div id=article-box>
- <div id=section><s:text name="title.document"/></div>
- <div id=article-body class=text>
- <s:if test="%{writeAccess == 'true' && stepEnabled == 'true'}">
- <form name="edoc" action="setDocument" method="post">
- <jsp:include page="/jsp/editContents.jsp">
- <jsp:param name="action" value="<%=action%>" />
- <jsp:param name="index" value="<%=type%>" />
- </jsp:include>
- </form>
- </s:if>
- <s:else>
- <jsp:include page="/jsp/readContents.jsp">
- <jsp:param name="entity" value="study" />
- </jsp:include>
- </s:else>
- </div>
- </div>
-
-<!-- Comment section
- =============================================================================================================================
- -->
- <s:if test="%{writeAccess == 'true' && stepEnabled == 'true'}">
- <div id=article-box>
- <div id=section><s:text name="title.comment"/></div>
- <div id=article-body class=text>
- <jsp:include page="/jsp/readComment.jsp"/>
- </div>
- </div>
- </s:if>
- </s:if>
-
- </div>
- </body>
-</html>
\ No newline at end of file
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
- pageEncoding="ISO-8859-1"
-%>
-<%@
- taglib prefix="s" uri="/struts-tags"
-%>
-<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
-
+ pageEncoding="ISO-8859-1"%>
+<%@ taglib prefix="s" uri="/struts-tags"%>
<!-- Initialization of the edit action, if any
=============================================================================================================================
-->
if (action == null) action = "display";
%>
<s:set var="todo"><%=action%></s:set>
-<html>
-
<link href=<s:url value="/skin/default.css"/> rel="stylesheet" type="text/css">
+ <link href="<s:url value="/rtef/rte.css"/>" rel="stylesheet" type="text/css">
<script language="JavaScript" type="text/javascript" src="<s:url value="/rtef/lang/fr.js"/>"></script>
<script language="JavaScript" type="text/javascript" src="<s:url value="/rtef/richtext.js"/>"></script>
edit.knowledgeValue.value = clean(edit.knowledgeValue.value);
edit.submit();
}
+ $(document).ready(function (){
+ initialize('<%=action%>');
+ });
</script>
- <body onLoad="initialize('<%=action%>')">
-
<!-- Description and simulation context sections
=============================================================================================================================
<div id="article-body">
<s:if test="%{#todo == 'newContext' || #todo == 'selectContext' || #todo == 'setContext'}">
<form name="edit" action="<%=action%>?selection=<s:property value="selection"/>" method="post">
- <jsp:include page="/jsp/editContext.jsp">
- <jsp:param name="action" value="<%=action%>" />
- <jsp:param name="type" value="<%=type%>" />
- </jsp:include>
+ <jsp:include page="/jsp/editContext.jsp"/>
</form>
</s:if>
<s:else>
</div>
</s:if>
</s:if>
-
- </body>
-</html>
\ No newline at end of file
public abstract class AbstractDisplayAction extends Action {
+ /**
+ * Serial version ID.
+ */
+ private static final long serialVersionUID = 3003902258668626946L;
+
/**
* Index of the open object.
*/
* User activity selection.
*/
protected String _selection = null;
+ /**
+ * Next action.
+ */
protected transient String _action = null;
- /**
- * Serial version ID.
- */
- private static final long serialVersionUID = 3003902258668626946L;
-
protected enum Execute { popup, develop, reduce, reduceall }
// ==============================================================================================================================
// ==============================================================================================================================
public String getSelection () {
-// -----------------------------
return _selection; // Equals to myobject.getSelection()
}
public void setAction (final String action) {
-// -------------------------------------
this._action = action;
}
public void setIndex (final String index) {
-// -----------------------------------
this._myindex = index;
}
+ /**
+ * Get the index.
+ * @return the index
+ */
+ public String getIndex() {
+ return _myindex;
+ }
public void setSelection (final String step) {
-// --------------------------------------
this._selection = step;
}
package org.splat.simer;
-import org.splat.dal.bo.kernel.User;
import org.splat.dal.bo.som.KnowledgeElement;
import org.splat.dal.bo.som.KnowledgeElementType;
import org.splat.dal.bo.som.Scenario;
import org.splat.service.ScenarioService;
import org.splat.service.dto.KnowledgeElementDTO;
import org.splat.som.Step;
+import org.splat.wapp.Constants;
/**
* Action for addition and modification of knowledge elements in the selected scenario.
/**
* Edited knowledge element type.
*/
- private String type = null; // Edited knowledge type
+ private String _knowledgeType = null; // Edited knowledge type
/**
* Edited knowledge element title.
*/
- private String title = null;
+ private String _knowledgeTitle = null;
/**
* Edited knowledge element value.
*/
- private String value = null;
+ private String _knowledgeValue = null;
/**
* Injected scenario service.
*/
public String doInitialize() {
_openStudy = getOpenStudy();
- setMenuProperty("study");
- setTitleProperty("study");
+ setMenuProperty(Constants.STUDY_MENU);
+ setTitleProperty(Constants.STUDY_MENU);
if ("true".equals(getWriteAccess())
&& getUserRights().canCreateDocument()) {
- setToolProperty("study");
+ setToolProperty(Constants.STUDY_MENU);
} else {
setToolProperty("standard");
}
- setLeftMenuProperty("study");
+ setLeftMenuProperty(Constants.STUDY_MENU);
initializationFullScreenContext(_menuProperty, _titleProperty,
_editDisabledProperty, _toolProperty, _leftMenuProperty);
*/
public String doSetKnowledge() {
- setMenuProperty("study");
- setTitleProperty("study");
+ String res = SUCCESS;
+ setMenuProperty(Constants.STUDY_MENU);
+ setTitleProperty(Constants.STUDY_MENU);
if ("true".equals(getWriteAccess())
&& getUserRights().canCreateDocument()) {
- setToolProperty("study");
+ setToolProperty(Constants.STUDY_MENU);
} else {
setToolProperty("standard");
}
- setLeftMenuProperty("study");
+ setLeftMenuProperty(Constants.STUDY_MENU);
initializationFullScreenContext(_menuProperty, _titleProperty,
_editDisabledProperty, _toolProperty, _leftMenuProperty);
try {
- User user = getConnectedUser();
_openStudy = getOpenStudy();
- Step step = _openStudy.getSelectedStep();
- Scenario scene = (Scenario) step.getOwner(); // It is necessarily a Scenario
-
- if ((title == null) || (value == null)) {
+ if ((_knowledgeTitle == null) || (_knowledgeValue == null)) {
KnowledgeElementDTO kelm = new KnowledgeElementDTO(Integer
- .valueOf(type), title, value);
- if (value == null) { // Renaming of an existing Knowledge Element
- getKnowledgeElementService().rename(kelm, title);
+ .valueOf(_knowledgeType), _knowledgeTitle,
+ _knowledgeValue);
+ if (_knowledgeValue == null) { // Renaming of an existing Knowledge Element
+ getKnowledgeElementService().rename(kelm, _knowledgeTitle);
} else { // Edition of a knowledge
- getKnowledgeElementService().update(kelm, value);
+ getKnowledgeElementService().update(kelm, _knowledgeValue);
}
_openStudy.update(kelm); // For updating the truncated value
} else { // Addition of a new Knowledge Element
KnowledgeElement.Properties kprop = new KnowledgeElement.Properties();
KnowledgeElementType ktype = getKnowledgeElementTypeService()
- .selectType(Integer.valueOf(type));
- kprop.setType(ktype).setTitle(title).setValue(value).setAuthor(
- user);
- _openStudy.add(getScenarioService().addKnowledgeElement(scene,
+ .selectType(Integer.valueOf(_knowledgeType));
+ kprop.setType(ktype).setTitle(_knowledgeTitle).setValue(
+ _knowledgeValue).setAuthor(getConnectedUser());
+ _openStudy.add(getScenarioService().addKnowledgeElement(
+ (Scenario) _openStudy.getSelectedStep().getOwner(),
kprop));
- getMenu("study").selects(_openStudy.getSelection()); // Updates the menu icon, in case of first added document
+ getMenu(Constants.STUDY_MENU)
+ .selects(_openStudy.getSelection()); // Updates the menu icon, in case of first added document
}
- return SUCCESS;
} catch (RuntimeException saverror) {
LOG.error("Reason:", saverror);
- return ERROR;
+ res = ERROR;
} catch (Exception error) {
LOG.error("Exception while saving a knowledge: ", error);
- return INPUT;
+ res = INPUT;
}
+ return res;
}
/**
* Update current menu.
*/
private void updateMenu() {
- getMenu("study").selects(_openStudy.getSelection()); // Updates the menu icon, in case of last removed document
+ getMenu(Constants.STUDY_MENU).selects(_openStudy.getSelection()); // Updates the menu icon, in case of last removed document
- setMenuProperty("study");
- setTitleProperty("study");
+ setMenuProperty(Constants.STUDY_MENU);
+ setTitleProperty(Constants.STUDY_MENU);
if ("true".equals(getWriteAccess())
&& getUserRights().canCreateDocument()) {
- setToolProperty("study");
+ setToolProperty(Constants.STUDY_MENU);
} else {
setToolProperty("standard");
}
- setLeftMenuProperty("study");
+ setLeftMenuProperty(Constants.STUDY_MENU);
initializationFullScreenContext(_menuProperty, _titleProperty,
_editDisabledProperty, _toolProperty, _leftMenuProperty);
* @return the knowledge type name
*/
public String getKnowledgeType() {
- // ---------------------------------
- return type;
+ return _knowledgeType;
}
/**
* @return the knowledge element id
*/
public String getSelectedKnowledge() {
- // -------------------------------------
return _myindex;
}
* the knowledge type name
*/
public void setKnowledgeType(final String type) {
- // ------------------------------------------
- this.type = type;
+ this._knowledgeType = type;
}
/**
* the new knowledge title
*/
public void setKnowledgeTitle(final String title) {
- // --------------------------------------------
- this.title = title;
+ this._knowledgeTitle = title;
}
/**
* the knowledge value
*/
public void setKnowledgeValue(final String value) {
- // --------------------------------------------
- this.value = value;
+ this._knowledgeValue = value;
}
/**
_leftMenuProperty = leftMenuProperty;
}
+ /**
+ * Get the knowledgeValue.
+ *
+ * @return the knowledgeValue
+ */
+ public String getKnowledgeValue() {
+ return _knowledgeValue;
+ }
+
+ /**
+ * Get the knowledgeTitle.
+ *
+ * @return the knowledgeTitle
+ */
+ public String getKnowledgeTitle() {
+ return _knowledgeTitle;
+ }
+
}
\ No newline at end of file
import org.splat.dal.bo.som.ProjectElement;
import org.splat.dal.bo.som.SimulationContext;
import org.splat.dal.bo.som.SimulationContextType;
+import org.splat.dal.bo.som.Study;
import org.splat.service.SimulationContextService;
import org.splat.service.SimulationContextTypeService;
import org.splat.service.StepService;
import org.splat.service.StudyService;
import org.splat.som.Step;
-import org.splat.dal.bo.som.Study;
+import org.splat.wapp.Constants;
+/**
+ * Action for simulation context selection or input.
+ */
public class EditSimulationContextAction extends DisplayStudyStepAction {
- private List<SimulationContextType> contype = null;
- private List<SimulationContext> contelm = null;
- private String selectype = null; // Context type, if selected
- private String newtype = null; // Context type, if newed
- private SimulationContextType type = null; // Corresponding context type object
- private String value = null; // Context value
+ /**
+ * Serialization version id.
+ */
+ private static final long serialVersionUID = -641719644024601042L;
+
+ /**
+ * List of involved context types.
+ */
+ private transient List<SimulationContextType> _contype = null;
+ /**
+ * List of simulation context values of the selected type.
+ */
+ private transient List<SimulationContext> _contelm = null;
+ /**
+ * Context type, if selected.
+ */
+ private transient String _selectype = null;
+ /**
+ * Context type, if newed.
+ */
+ private transient String _newtype = null;
+ /**
+ * Corresponding context type object.
+ */
+ private transient SimulationContextType _type = null;
+ /**
+ * Context value.
+ */
+ private transient String _value = null;
/**
* Injected study service.
*/
* Injected simulation context type service.
*/
private SimulationContextTypeService _simulationContextTypeService;
-
+
/**
- * Value of the menu property.
- * It can be: none, create, open, study, knowledge, sysadmin, help.
+ * Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
*/
private String _menuProperty;
-
+
/**
- * Value of the title bar property.
- * It can be: study, knowledge.
+ * Value of the title bar property. It can be: study, knowledge.
*/
private String _titleProperty;
-
+
/**
- * Value of the tool bar property.
- * It can be: none, standard, study, back.
+ * Value of the tool bar property. It can be: none, standard, study, back.
*/
private String _toolProperty;
-
+
/**
- * Value of the left menu property.
- * It can be: open, study, knowledge, scenario.
+ * Value of the left menu property. It can be: open, study, knowledge, scenario.
*/
private String _leftMenuProperty;
-
+
/**
- * Property that indicates whether the current open study is editable or not.
- * On the screen it looks like pen on the status icon, pop-up menu also can be called.
- * It is necessary for correct building the title bar.
+ * Property that indicates whether the current open study is editable or not. On the screen it looks like pen on the status icon, pop-up
+ * menu also can be called. It is necessary for correct building the title bar.
*/
private String _editDisabledProperty = "false";
- private static final long serialVersionUID = -641719644024601042L;
-
// ==============================================================================================================================
// Action methods
// ==============================================================================================================================
+ /**
+ * Initialize context input/selection action.
+ *
+ * @return "create" if there is no involved context types or "select" otherwise
+ */
public String doInitialize() {
+ String res;
_openStudy = getOpenStudy();
- contype = getInvolvedContexts();
-
- setMenuProperty("study");
- setTitleProperty("study");
- if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
- setToolProperty("study");
+ _contype = getInvolvedContexts();
+
+ setMenuProperty(Constants.STUDY_MENU);
+ setTitleProperty(Constants.STUDY_MENU);
+ if (Constants.TRUE.equals(getWriteAccess())
+ && getUserRights().canCreateDocument()) {
+ setToolProperty(Constants.STUDY_MENU);
} else {
- setToolProperty("standard");
+ setToolProperty(Constants.STANDARD_MENU);
}
-
- setLeftMenuProperty("study");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
- if (contype.isEmpty())
- return "create";
- else
- return "select";
+
+ setLeftMenuProperty(Constants.STUDY_MENU);
+ initializationFullScreenContext(_menuProperty, _titleProperty,
+ _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
+ if (_contype.isEmpty()) {
+ res = "create";
+ setAction("newContext");
+ } else {
+ res = "select";
+ setAction("selectContext");
+ }
+ return res;
}
+ /**
+ * Select or create a simulation context. If a type has been selected then initialize the list of context values.
+ *
+ * @return "set" if context type is selected or "create" otherwise
+ */
public String doSelectContext() {
+ String res = "set";
_openStudy = getOpenStudy();
-
- setMenuProperty("study");
- setTitleProperty("study");
- if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
- setToolProperty("study");
+
+ setMenuProperty(Constants.STUDY_MENU);
+ setTitleProperty(Constants.STUDY_MENU);
+ if (Constants.TRUE.equals(getWriteAccess())
+ && getUserRights().canCreateDocument()) {
+ setToolProperty(Constants.STUDY_MENU);
} else {
- setToolProperty("standard");
+ setToolProperty(Constants.STANDARD_MENU);
}
- setLeftMenuProperty("study");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
- int typid = Integer.valueOf(selectype);
- if (typid == 0)
- return "create";
-
- SimulationContext.Properties cprop = new SimulationContext.Properties();
- type = getSimulationContextService().selectType(typid);
- newtype = type.getName();
- contype = getInvolvedContexts();
- contelm = getSimulationContextService()
- .selectSimulationContextsWhere(cprop.setType(type));
-
- return "set";
+ setLeftMenuProperty(Constants.STUDY_MENU);
+ initializationFullScreenContext(_menuProperty, _titleProperty,
+ _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
+ int typid = Integer.valueOf(_selectype);
+ if (typid == 0) {
+ res = "create";
+ setAction("newContext");
+ } else {
+
+ SimulationContext.Properties cprop = new SimulationContext.Properties();
+ _type = getSimulationContextService().selectType(typid);
+ _newtype = _type.getName();
+ _contype = getInvolvedContexts();
+ _contelm = getSimulationContextService()
+ .selectSimulationContextsWhere(cprop.setType(_type));
+
+ setAction("setContext");
+ setIndex(String.valueOf(getContextType().getIndex()));
+ }
+
+ return res;
}
+ /**
+ * Create new context. Add the created context to the step and reindex the study. <BR>
+ * If type or value are undefined then return INPUT.
+ *
+ * @return SUCCESS if added or ERROR or INPUT if failed
+ */
public String doCreateContext() {
- // --------------------------------
+ String res = SUCCESS;
try {
_openStudy = getOpenStudy();
-
- setMenuProperty("study");
- setTitleProperty("study");
- if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
- setToolProperty("study");
+
+ setMenuProperty(Constants.STUDY_MENU);
+ setTitleProperty(Constants.STUDY_MENU);
+ if (Constants.TRUE.equals(getWriteAccess())
+ && getUserRights().canCreateDocument()) {
+ setToolProperty(Constants.STUDY_MENU);
} else {
- setToolProperty("standard");
+ setToolProperty(Constants.STANDARD_MENU);
}
- setLeftMenuProperty("study");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
- if (newtype.length() == 0 || value.length() == 0)
- return INPUT;
+ setLeftMenuProperty(Constants.STUDY_MENU);
+ initializationFullScreenContext(_menuProperty, _titleProperty,
+ _editDisabledProperty, _toolProperty, _leftMenuProperty);
- Step step = _openStudy.getSelectedStep();
- ProjectElement owner = step.getOwner();
+ if (_newtype.length() == 0 || _value.length() == 0) {
+ res = INPUT;
+ } else {
- SimulationContext.Properties cprop = new SimulationContext.Properties();
- SimulationContext contex = null;
- type = getSimulationContextTypeService().createType(newtype,
- step.getStep());
- cprop.setType(type).setValue(value);
- if (owner instanceof Study)
- contex = getStudyService().addProjectContext(((Study) owner),
- cprop); // Re-indexes knowledges and the study
- else
- contex = getStepService().addSimulationContext(step, cprop); // Re-indexes knowledges only
+ Step step = _openStudy.getSelectedStep();
+ ProjectElement owner = step.getOwner();
- _openStudy.add(contex);
- return SUCCESS;
+ SimulationContext.Properties cprop = new SimulationContext.Properties();
+ SimulationContext contex = null;
+ _type = getSimulationContextTypeService().createType(_newtype,
+ step.getStep());
+ cprop.setType(_type).setValue(_value);
+ if (owner instanceof Study) {
+ contex = getStudyService().addProjectContext(
+ ((Study) owner), cprop); // Re-indexes knowledges and the study
+ } else {
+ contex = getStepService().addSimulationContext(step, cprop); // Re-indexes knowledges only
+ }
+
+ _openStudy.add(contex);
+ }
} catch (RuntimeException saverror) {
LOG.error("Reason:", saverror);
- return ERROR;
+ res = ERROR;
} catch (Exception error) {
- return INPUT;
+ setAction("newContext");
+ res = INPUT;
}
+ return res;
}
+ /**
+ * Remove the selected simulation context from the study step.
+ *
+ * @return SUCCESS if removed or ERROR if failed
+ */
public String doDeleteContext() {
-
- setMenuProperty("study");
- setTitleProperty("study");
- if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
- setToolProperty("study");
+
+ String res = SUCCESS;
+ setMenuProperty(Constants.STUDY_MENU);
+ setTitleProperty(Constants.STUDY_MENU);
+ if (Constants.TRUE.equals(getWriteAccess())
+ && getUserRights().canCreateDocument()) {
+ setToolProperty(Constants.STUDY_MENU);
} else {
- setToolProperty("standard");
+ setToolProperty(Constants.STANDARD_MENU);
}
- setLeftMenuProperty("study");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+ setLeftMenuProperty(Constants.STUDY_MENU);
+ initializationFullScreenContext(_menuProperty, _titleProperty,
+ _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
try {
_openStudy = getOpenStudy();
ProjectElement owner = step.getOwner();
SimulationContext context = step.getSimulationContext(Integer
.valueOf(_myindex));
- if (owner instanceof Study)
+ if (owner instanceof Study) {
getStudyService()
.removeProjectContext(((Study) owner), context); // Re-indexes knowledges and the study
- else
+ } else {
getStepService().removeSimulationContext(step, context); // Re-indexes knowledges only
+ }
_openStudy.remove(context);
- return SUCCESS;
} catch (RuntimeException saverror) {
LOG.error("Reason:", saverror);
- return ERROR;
+ res = ERROR;
}
+ return res;
}
+ /**
+ * Add the selected context to the study step and reindex the study. <BR>
+ * If type or value are undefined then return INPUT.
+ *
+ * @return SUCCESS if added or ERROR or INPUT if failed
+ */
public String doSetContext() {
- // -----------------------------
- String[] input = value.split(",");
-// Session connex = Database.getCurSession();
-// Transaction transax = connex.beginTransaction();
-
- setMenuProperty("study");
- setTitleProperty("study");
- if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
- setToolProperty("study");
+ String res = SUCCESS;
+ String[] input = _value.split(",");
+
+ setMenuProperty(Constants.STUDY_MENU);
+ setTitleProperty(Constants.STUDY_MENU);
+ if (Constants.TRUE.equals(getWriteAccess())
+ && getUserRights().canCreateDocument()) {
+ setToolProperty(Constants.STUDY_MENU);
} else {
- setToolProperty("standard");
+ setToolProperty(Constants.STANDARD_MENU);
}
- setLeftMenuProperty("study");
- initializationFullScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty, _leftMenuProperty);
-
+ setLeftMenuProperty(Constants.STUDY_MENU);
+ initializationFullScreenContext(_menuProperty, _titleProperty,
+ _editDisabledProperty, _toolProperty, _leftMenuProperty);
+
try {
_openStudy = getOpenStudy();
int valid = Integer.valueOf(input[0]);
contex = getSimulationContextService().selectSimulationContext(
valid);
- if (owner instanceof Study)
+ if (owner instanceof Study) {
getStudyService()
.addProjectContext(((Study) owner), contex);
- else
+ } else {
getStepService().addSimulationContext(step, contex);
+ }
} else {
// Setting a new simulation context value (input = 0,"new context value")
- int typid = Integer.valueOf(selectype);
+ int typid = Integer.valueOf(_selectype);
SimulationContext.Properties cprop = new SimulationContext.Properties();
cprop.setType(getSimulationContextService().selectType(typid))
.setValue(input[1].trim());
- if (owner instanceof Study)
+ if (owner instanceof Study) {
contex = getStudyService().addProjectContext(
((Study) owner), cprop); // Re-indexes knowledges and the study
- else
+ } else {
contex = getStepService().addSimulationContext(step, cprop); // Re-indexes knowledges only
+ }
}
_openStudy.add(contex);
- contype = getInvolvedContexts();
+ _contype = getInvolvedContexts();
+
+ setAction("setContext");
+ setIndex(String.valueOf(getContextType().getIndex()));
-// transax.commit();
- return SUCCESS;
} catch (RuntimeException saverror) {
LOG.error("Reason:", saverror);
- return ERROR;
+ res = ERROR;
} catch (Exception error) {
- value = input[0];
- return INPUT;
+ _value = input[0];
+ setAction("setContext");
+ res = INPUT;
}
+ return res;
}
// ==============================================================================================================================
// Getters and setters
// ==============================================================================================================================
+ /**
+ * Get context type.
+ *
+ * @return Corresponding context type object
+ */
public SimulationContextType getContextType() {
- // ----------------------------------------------
- return type;
+ return _type;
}
+ /**
+ * Get the new context type to be created.
+ *
+ * @return Context type, if newed
+ */
public String getContextName() {
- // -------------------------------
- return newtype;
+ return _newtype;
}
- // public List<SimulationContextFacade> getSimulationContexts () {
- // -------------------------------------------------------
- // return mystudy.getSelectedStep().getAllSimulationContexts();
- // }
+ /**
+ * Get the list of involved context types.
+ *
+ * @return List of involved context types
+ */
public List<SimulationContextType> getSimulationContextTypes() {
- // ---------------------------------------------------------------
- return contype;
+ return _contype;
}
+ /**
+ * Get the list of simulation context values of the selected type.
+ *
+ * @return List of simulation context values of the selected type
+ */
public List<SimulationContext> getSimulationContextValues() {
- // ------------------------------------------------------------
- return contelm;
+ return _contelm;
}
- public void setContextType(String type) {
- // ----------------------------------------
- this.selectype = type;
+ /**
+ * Get the selected context type.
+ *
+ * @param type
+ * Context type, if selected
+ */
+ public void setContextType(final String type) {
+ this._selectype = type;
}
- public void setContextValue(String value) {
- // -----------------------------------------
- this.value = value;
+ /**
+ * Set the context value.
+ *
+ * @param value
+ * context value
+ */
+ public void setContextValue(final String value) {
+ this._value = value;
}
- public void setNewType(String name) {
- // ------------------------------------
- this.newtype = name;
+ /**
+ * Set the new context type.
+ *
+ * @param name
+ * the new context type
+ */
+ public void setNewType(final String name) {
+ this._newtype = name;
}
// ==============================================================================================================================
// Private service
// ==============================================================================================================================
+ /**
+ * Get the list of context types involved in the current study step.
+ *
+ * @return the list of context types
+ */
private List<SimulationContextType> getInvolvedContexts() {
- // ----------------------------------------------------------
SimulationContextType.Properties sprop = new SimulationContextType.Properties()
.setStep(_openStudy.getSelectedStep().getStep());
List<SimulationContextType> contype = getSimulationContextService()
int to = 0;
while (to < types.length - 1) {
to += 1;
- if (types[to].isApproved() == state)
+ if (types[to].isApproved() == state) {
continue;
+ }
- if (to > from + 1)
+ if (to > from + 1) {
Arrays.sort(types, from, to, compare);
- state = !state;
+ }
+ state ^= state;
from = to;
}
- if (to > from)
+ if (to > from) {
Arrays.sort(types, from, to + 1, compare);
+ }
contype = Arrays.asList(types);
}
return contype;
*
* @return the studyService
*/
+ @Override
public StudyService getStudyService() {
return _studyService;
}
* @param studyService
* the studyService to set
*/
- public void setStudyService(StudyService studyService) {
+ @Override
+ public void setStudyService(final StudyService studyService) {
_studyService = studyService;
}
* the simulationContextService to set
*/
public void setSimulationContextService(
- SimulationContextService simulationContextService) {
+ final SimulationContextService simulationContextService) {
_simulationContextService = simulationContextService;
}
/**
* Get the simulationContextTypeService.
+ *
* @return the simulationContextTypeService
*/
public SimulationContextTypeService getSimulationContextTypeService() {
/**
* Set the simulationContextTypeService.
- * @param simulationContextTypeService the simulationContextTypeService to set
+ *
+ * @param simulationContextTypeService
+ * the simulationContextTypeService to set
*/
public void setSimulationContextTypeService(
- SimulationContextTypeService simulationContextTypeService) {
+ final SimulationContextTypeService simulationContextTypeService) {
_simulationContextTypeService = simulationContextTypeService;
}
-
+
/**
* Get the stepService.
*
* @param stepService
* the stepService to set
*/
- public void setStepService(StepService stepService) {
+ public void setStepService(final StepService stepService) {
_stepService = stepService;
}
-
+
/**
* Get the menuProperty.
+ *
* @return the menuProperty
*/
+ @Override
public String getMenuProperty() {
return _menuProperty;
}
/**
* Set the menuProperty.
- * @param menuProperty the menuProperty to set
+ *
+ * @param menuProperty
+ * the menuProperty to set
*/
- public void setMenuProperty(String menuProperty) {
+ @Override
+ public void setMenuProperty(final String menuProperty) {
this._menuProperty = menuProperty;
}
-
+
/**
* Get the _titleProperty.
+ *
* @return the _titleProperty
*/
+ @Override
public String getTitleProperty() {
return _titleProperty;
}
/**
- * Set the _titleProperty.
- * @param _titleProperty the titleProperty to set
+ * Set the titleProperty.
+ *
+ * @param titleProperty
+ * the titleProperty to set
*/
- public void setTitleProperty(String titleProperty) {
+ @Override
+ public void setTitleProperty(final String titleProperty) {
_titleProperty = titleProperty;
}
/**
* Get the editDisabledProperty.
+ *
* @return the editDisabledProperty
*/
+ @Override
public final String getEditDisabledProperty() {
return _editDisabledProperty;
}
/**
* Set the editDisabledProperty.
- * @param editDisabledProperty the editDisabledProperty to set
+ *
+ * @param editDisabledProperty
+ * the editDisabledProperty to set
*/
- public final void setEditDisabledProperty(String editDisabledProperty) {
+ @Override
+ public final void setEditDisabledProperty(final String editDisabledProperty) {
_editDisabledProperty = editDisabledProperty;
}
/**
* Get the toolProperty.
+ *
* @return the toolProperty
*/
+ @Override
public String getToolProperty() {
return _toolProperty;
}
/**
* Set the toolProperty.
- * @param toolProperty the toolProperty to set
+ *
+ * @param toolProperty
+ * the toolProperty to set
*/
+ @Override
public void setToolProperty(final String toolProperty) {
_toolProperty = toolProperty;
}
-
+
/**
* Get the leftMenuProperty.
+ *
* @return the leftMenuProperty
*/
+ @Override
public String getLeftMenuProperty() {
return _leftMenuProperty;
}
/**
* Set the leftMenuProperty.
- * @param leftMenuProperty the leftMenuProperty to set
+ *
+ * @param leftMenuProperty
+ * the leftMenuProperty to set
*/
+ @Override
public void setLeftMenuProperty(final String leftMenuProperty) {
_leftMenuProperty = leftMenuProperty;
}
public OpenStudy open(final User user, final Study study) {
ResourceBundle custom = ResourceBundle.getBundle("som",
getApplicationSettings().getCurrentLocale());
- SimpleDateFormat datstring = new SimpleDateFormat(
- custom.getString("date.format"));
+ SimpleDateFormat datstring = new SimpleDateFormat(custom
+ .getString("date.format"));
Revision.Format verstring = new Revision.Format(getProjectSettings()
.getRevisionPattern());
// Transfer to the document of all known properties
ResourceBundle locale = ResourceBundle.getBundle("som",
getApplicationSettings().getCurrentLocale());
- SimpleDateFormat get = new SimpleDateFormat(
- locale.getString("date.format"));
+ SimpleDateFormat get = new SimpleDateFormat(locale
+ .getString("date.format"));
Writer tool = Toolbox.getWriter(credoc);
List<Step> slist = getInvolvedSteps();
for (Iterator<Step> i = slist.iterator(); i.hasNext();) {
for (Iterator<SimulationContext> j = clist.iterator(); j
.hasNext();) {
SimulationContext context = j.next();
- tool.updateProperty(context.getType().getName(),
- context.getValue());
+ tool.updateProperty(context.getType().getName(), context
+ .getValue());
}
}
tool.updateProperty("reference", medoc.getReference());
tool.updateProperty("study", _mystudy.getTitle());
- tool.updateProperty("step",
- locale.getString("folder.step." + step.getNumber())
- .replaceAll("''", "'"));
+ tool.updateProperty("step", locale.getString(
+ "folder.step." + step.getNumber()).replaceAll("''", "'"));
tool.updateProperty("author", author.getUsername().toUpperCase());
tool.updateProperty("date", get.format(medoc.getCreationDate()));
tool.updateProperty("history", locale.getString("label.creation")
}
protected void add(final KnowledgeElement kelm) {
- KnowledgeElementFacade facade = new KnowledgeElementFacade(
- BeanHelper.copyBean(kelm, KnowledgeElementDTO.class),
+ KnowledgeElementFacade facade = new KnowledgeElementFacade(BeanHelper
+ .copyBean(kelm, KnowledgeElementDTO.class),
getApplicationSettings());
// RKV KnowledgeIterator known = knowledge.get(kelm.getType().getIndex() - 2);
// Knowledges are ordered by type index, from 0 to n-1, the first one being reserved (reason for -2)
}
protected void remove(final KnowledgeElement kelm) {
- KnowledgeIterator known = _knowledge.get((int) (kelm.getType()
- .getIndex() - 2));
+ // RKV: KnowledgeIterator known = _knowledge.get((int) (kelm.getType()
+ // RKV: .getIndex() - 2));
// Knowledges are ordered by type index, from 0 to n-1, the first one being reserved (reason for -2)
- knowpres.remove(kelm.getIndex());
- for (Iterator<KnowledgeElementFacade> i = known._list.iterator(); i
- .hasNext();) {
- KnowledgeElementFacade facade = i.next();
- if (!facade.isFacadeOf(BeanHelper.copyBean(kelm,
- KnowledgeElementDTO.class))) {
- continue;
+ // RKV:Begin: Find a knowledge iterator for appropriate knowledge type
+ KnowledgeIterator known = null;
+ for (KnowledgeIterator aKnowledgeSection : _knowledge) {
+ if (aKnowledgeSection.getIndex().equals(
+ String.valueOf(kelm.getType().getIndex()))) {
+ known = aKnowledgeSection;
+ break;
+ }
+ }
+ if (known != null) { // RKV:End
+ knowpres.remove(kelm.getIndex());
+ for (Iterator<KnowledgeElementFacade> i = known._list.iterator(); i
+ .hasNext();) {
+ KnowledgeElementFacade facade = i.next();
+ if (!facade.isFacadeOf(BeanHelper.copyBean(kelm,
+ KnowledgeElementDTO.class))) {
+ continue;
+ }
+ i.remove();
+ break;
}
- i.remove();
- break;
}
}
<!-- Edition of simulation contexts
-->
<action name="add-context" class="editSimulationContextAction" method="initialize">
- <result name="create">/study/displayStudy.jsp?action=newContext</result>
- <result name="select">/study/displayStudy.jsp?action=selectContext</result>
+ <result name="create" type="tiles">page.newcontext</result>
+ <result name="select" type="tiles">page.selectcontext</result>
</action>
<action name="selectContext" class="editSimulationContextAction" method="selectContext">
- <result name="create">/study/displayStudy.jsp?action=newContext</result>
- <result name="set">/study/displayStudy.jsp?action=setContext&index=%{contextType.index}</result>
+ <result name="create" type="tiles">page.newcontext</result>
+ <result name="set" type="tiles">page.setcontext</result>
</action>
<action name="newContext" class="editSimulationContextAction" method="createContext">
<result name="success" type="tiles">page.displaystudy</result>
- <result name="input">/study/displayStudy.jsp?action=newContext</result>
+ <result name="input" type="tiles">page.newcontext</result>
<result name="error" type="tiles">page.displaystudy</result>
</action>
<action name="setContext" class="editSimulationContextAction" method="setContext">
<result name="success" type="tiles">page.displaystudy</result>
- <result name="input">/study/displayStudy.jsp?action=setContext&index=%{contextType.index}</result>
+ <result name="input" type="tiles">page.setcontext</result>
<result name="error" type="tiles">page.displaystudy</result>
</action>
<action name="remove-context" class="editSimulationContextAction" method="deleteContext">
<!-- Edition of knowledge elements
-->
<action name="add-knowledge" class="editKnowledgeElementAction" method="initialize">
- <result name="success">/study/displayStudy.jsp?action=addKnowledge&index=%{knowledgeType}</result>
+<!-- <result name="success">/study/displayStudy.jsp?action=addKnowledge&index=%{knowledgeType}</result>-->
+ <result name="success" type="tiles">page.displaystudy</result>
</action>
<action name="edit-knowledge" class="editKnowledgeElementAction" method="initialize">
<result name="success" type="tiles">page.displaystudy</result>