<tiles-definitions>
-<definition name="baseLayout" template="/WEB-INF/layout/baseLayout.jsp">
+<definition name="baseLayout" template="/layout/baseLayout.jsp">
<put-attribute name="title" value="" type="string"/>
<put-attribute name="menu_bar" value="/jsp/menubar.jsp"/>
<put-attribute name="title_bar" value="/jsp/titlebar.jsp"/>
<body>
<!-- Menu-bar
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
+
<s:if test="%{#error}">
<s:set var="reason"><%=reason%></s:set>
<table border="0" cellpadding="10" cellspacing="0" class="error">
<%@
taglib prefix="s" uri="/struts-tags"
%>
-<%! private enum Menu { none, create, open, study, knowledge, datadmin, sysadmin, help };
-%>
+
<!-- Initialization of the context
-->
<% String login = request.getParameter("login"); // Null or disabled
- String selection = request.getParameter("menu"); // Active menu
-
- Menu selected = Menu.valueOf(selection);
-
- ApplicationRights user = (ApplicationRights)session.getAttribute("user.rights"); // Active user rights
- Object study = (Object)session.getAttribute("study.open"); // Active study, if exists
- Object known = (Object)session.getAttribute("knowledge.open"); // Active knowledge, if exists
+
+ ApplicationRights user = (ApplicationRights)session.getAttribute("user.rights"); // Active user rights
+
%>
<!-- Set of actions associated to menus
-->
-<s:set var="wurl"><%=ApplicationSettings.getWebSiteURL()%></s:set>
-<s:set var="hurl"><%=ApplicationSettings.getHelpURL()%></s:set>
+
<s:url id="login" namespace="/" action="login">
- <s:param name="backMenu"><%=selection%></s:param>
+ <s:param name="backMenu" value="menuProperty"></s:param>
</s:url>
<s:url id="logout" namespace="/" action="logout">
- <s:param name="backMenu"><%=selection%></s:param>
+ <s:param name="backMenu" value="menuProperty"></s:param>
</s:url>
<s:url id="new" namespace="/" action="select">
<s:param name="menu">create</s:param>
<s:url id="sysadmin" namespace="/" action="select">
<s:param name="menu">sysadmin</s:param>
</s:url>
-<s:url id="site" value="%{#wurl}"></s:url>
-<s:url id="help" value="%{#hurl}"></s:url>
+<s:url id="site" value="%{menuBarSettings.webSiteURL}" />
+<s:url id="help" value="%{menuBarSettings.helpURL}"></s:url>
<!-- Display of the menu-bar
-->
</div>
<div id=menu-bar>
-<%
- if (selected == Menu.create) {
-%> <span id="menu-front"><img src="<s:url value="/skin/icon.new.png"/>" border="none" title="<s:text name="tooltip.new"/>" /></span>
-<% } else if (user.canCreateStudy()) {
-%> <span id="menu-back"><s:a href="%{new}"><img src="<s:url value="/skin/icon.new.png"/>" border="none" title="<s:text name="tooltip.new"/>" /></s:a></span>
-<% } else {
-%> <span id="menu-back"><img src="<s:url value="/skin/disabled.new.png"/>" border="none" /></span>
-<% }
- if (selected == Menu.open) {
-%> <span id="menu-front"><img src="<s:url value="/skin/icon.open.png"/>" border="none" title="<s:text name="tooltip.open"/>" /></span>
-<% } else { // Accessible to everyone
-%> <span id="menu-back"><s:a href="%{open}"><img src="<s:url value="/skin/icon.open.png"/>" border="none" title="<s:text name="tooltip.open"/>" /></s:a></span>
-<% }
-
- if (selected == Menu.study) {
-%> <span id="menu-front"><img src="<s:url value="/skin/icon.study.png"/>" border="none" /></span>
-<% } else if (study == null) {
-%> <span id="menu-back"><img src="<s:url value="/skin/disabled.study.png"/>" border="none" /></span>
-<% } else {
-%> <span id="menu-back"><s:a href="%{study}"><img src="<s:url value="/skin/icon.study.png"/>" border="none" title="<s:text name="tooltip.study"/>" /></s:a></span>
-<% }
-
- if (selected == Menu.knowledge) {
-%> <span id="menu-front"><img src="<s:url value="/skin/icon.idea.png"/>" border="none" /></span>
-<% } else if (known == null) {
-%> <span id="menu-back"><img src="<s:url value="/skin/disabled.idea.png"/>" border="none" /></span>
-<% } else {
-%> <span id="menu-back"><s:a href="%{idea}"><img src="<s:url value="/skin/icon.idea.png"/>" border="none" title="<s:text name="tooltip.idea"/>" /></s:a></span>
-<% }
-
- if (selected == Menu.datadmin) {
-%> <span id="menu-front"><img src="<s:url value="/skin/icon.books.png"/>" border="none" /></span>
-<% } else if (user.canManageKnowledges()) {
-%> <span id="menu-back"><s:a href="%{datadmin}"><img src="<s:url value="/skin/icon.books.png"/>" border="none" title="<s:text name="tooltip.datadmin"/>" /></s:a></span>
-<% }
-
- if (selected == Menu.sysadmin) {
-%> <span id="menu-front"><img src="<s:url value="/skin/icon.base.png"/>" border="none" /></span>
-<% } else if (user.canManageDatabase()) {
-%> <span id="menu-back"><s:a href="%{sysadmin}"><img src="<s:url value="/skin/icon.base.png"/>" border="none" title="<s:text name="tooltip.sysadmin"/>" /></s:a></span>
-<% }
-
- if (selected == Menu.help) {
-%> <span id="menu-front"><img src="<s:url value="/skin/icon.help.png"/>" border="none" /></span>
-<% } else { // Accessible to everyone
-%> <span id="menu-back"><s:a href="%{help}" target="_new"><img src="<s:url value="/skin/icon.help.png"/>" border="none" title="<s:text name="tooltip.help"/>" /></s:a></span>
-<% }
-%></div>
+ <s:if test="menuBarSettings.isMenuCreate">
+ <span id="menu-front"><img src="<s:url value="/skin/icon.new.png"/>" border="none" title="<s:text name="tooltip.new"/>" /></span>
+ </s:if>
+ <s:elseif test="menuBarSettings.canUserCreateStudy">
+ <span id="menu-back"><s:a href="%{new}"><img src="<s:url value="/skin/icon.new.png"/>" border="none" title="<s:text name="tooltip.new"/>" /></s:a></span>
+ </s:elseif>
+ <s:else>
+ <span id="menu-back"><img src="<s:url value="/skin/disabled.new.png"/>" border="none" /></span>
+ </s:else>
+
+ <s:if test="menuBarSettings.isMenuOpen">
+ <span id="menu-front"><img src="<s:url value="/skin/icon.open.png"/>" border="none" title="<s:text name="tooltip.open"/>" /></span>
+ </s:if>
+ <s:else>
+ <span id="menu-back"><s:a href="%{open}"><img src="<s:url value="/skin/icon.open.png"/>" border="none" title="<s:text name="tooltip.open"/>" /></s:a></span>
+ </s:else>
+
+ <s:if test="menuBarSettings.isMenuStudy">
+ <span id="menu-front"><img src="<s:url value="/skin/icon.study.png"/>" border="none" /></span>
+ </s:if>
+ <s:elseif test="menuBarSettings.isStudyNull">
+ <span id="menu-back"><img src="<s:url value="/skin/disabled.study.png"/>" border="none" /></span>
+ </s:elseif>
+ <s:else>
+ <span id="menu-back"><s:a href="%{study}"><img src="<s:url value="/skin/icon.study.png"/>" border="none" title="<s:text name="tooltip.study"/>" /></s:a></span>
+ </s:else>
+
+ <s:if test="menuBarSettings.isMenuKnowledge">
+ <span id="menu-front"><img src="<s:url value="/skin/icon.idea.png"/>" border="none" /></span>
+ </s:if>
+ <s:elseif test="menuBarSettings.isKnowledgeNull">
+ <span id="menu-back"><img src="<s:url value="/skin/disabled.idea.png"/>" border="none" /></span>
+ </s:elseif>
+ <s:else>
+ <span id="menu-back"><s:a href="%{idea}"><img src="<s:url value="/skin/icon.idea.png"/>" border="none" title="<s:text name="tooltip.idea"/>" /></s:a></span>
+ </s:else>
+
+ <s:if test="menuBarSettings.isMenuSysAdmin">
+ <span id="menu-front"><img src="<s:url value="/skin/icon.base.png"/>" border="none" /></span>
+ </s:if>
+ <s:elseif test="menuBarSettings.canUserManageDatabase">
+ <span id="menu-back"><s:a href="%{sysadmin}"><img src="<s:url value="/skin/icon.base.png"/>" border="none" title="<s:text name="tooltip.sysadmin"/>" /></s:a></span>
+ </s:elseif>
+
+ <s:if test="menuBarSettings.isMenuHelp">
+ <span id="menu-front"><img src="<s:url value="/skin/icon.help.png"/>" border="none" /></span>
+ </s:if>
+ <s:else>
+ <span id="menu-back"><s:a href="%{help}" target="_new"><img src="<s:url value="/skin/icon.help.png"/>" border="none" title="<s:text name="tooltip.help"/>" /></s:a></span>
+ </s:else>
+
+</div>
<!-- Display of the login menu
-->
<%if (login == null) { // That is, not disabled (yes, null means enabled!)
<%@ taglib uri="http://tiles.apache.org/tags-tiles" prefix="tiles"%>
<%@ page language="java" contentType="text/html; charset=ISO-8859-1" pageEncoding="ISO-8859-1"%>
<%@ taglib prefix="s" uri="/struts-tags"%>
+<%@ taglib prefix="tiles" uri="http://tiles.apache.org/tags-tiles"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<!-- Menu-bar -->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<div id=top-spacer>
</div>
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="<%=menu%>" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<div id=top-spacer></div>
<!-- Selected active menu
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="datadmin" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<div id=top-spacer></div>
<!-- Search menu
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="datadmin" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<div id=top-spacer></div>
<!-- Administration menu
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="sysadmin" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<div id=top-spacer></div>
<!-- Left pane
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="sysadmin" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
+
<div id=top-spacer></div>
<!-- Search menu
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="sysadmin" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<div id=top-spacer></div>
<!-- Left pane
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="knowledge" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<!-- Title-bar
=============================================================================================================================
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="study" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<!-- Title-bar
=============================================================================================================================
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="study" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<!-- Title-bar
=============================================================================================================================
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="study" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<!-- Title-bar
=============================================================================================================================
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="study" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<!-- Title-bar
=============================================================================================================================
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="study" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<!-- Title-bar
=============================================================================================================================
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="study" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<!-- Title-bar
=============================================================================================================================
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="study" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<!-- Title-bar
=============================================================================================================================
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="study" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<!-- Title-bar
=============================================================================================================================
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="create" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<div id=top-spacer></div>
<!-- Creation menu
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="open" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<div id=top-spacer></div>
<!-- Search menu
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="open" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<div id=top-spacer></div>
<!-- Search menu
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="study" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<!-- Title-bar
=============================================================================================================================
<!-- Menu-bar
=============================================================================================================================
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="study" />
- </jsp:include>
+ <jsp:include page="/jsp/menubar.jsp" />
<!-- Title-bar
=============================================================================================================================
<body>
<!-- Menu-bar
-->
- <jsp:include page="/jsp/menubar.jsp">
- <jsp:param name="menu" value="none" />
- </jsp:include>
-
+
+ <jsp:include page="/jsp/menubar.jsp" />
+
<!-- Title-bar
-->
<div id=title-bar><s:text name="message.welcome"/></div>
import java.util.ResourceBundle;
import javax.security.auth.login.LoginContext;
+import javax.servlet.http.HttpServletRequest;
import com.opensymphony.xwork2.ActionSupport;
+import org.apache.struts2.ServletActionContext;
+import org.apache.struts2.interceptor.ServletRequestAware;
import org.apache.struts2.interceptor.SessionAware;
import org.apache.log4j.Logger;
import org.splat.dal.bo.kernel.User;
import org.splat.wapp.Menu;
-public class Action extends ActionSupport implements SessionAware {
+public class Action extends ActionSupport implements ServletRequestAware, SessionAware {
private Map<String, Object> session;
private String mercode;
private OpenStudy _openStudy;
private OpenKnowledge _openKnowledge;
+
+ private MenuBarSettings _menuBarSettings;
+
+ private HttpServletRequest request;
/**
* Serial version ID.
session.put("study.open", open);
return open;
}
+
+ /**
+ * Initialization the Context for menubar.
+ */
+ public void initializationContext() {
+ getMenuBarSettings().initializeInitialMenuProperties();
+
+ if (session.get("study.open") == null) {
+ getMenuBarSettings().setIsStudyNull(true);
+ logger.debug("MKA: setIsStudyNull = true");
+ } else {
+ getMenuBarSettings().setIsStudyNull(false);
+ logger.debug("MKA: setIsStudyNull = false");
+ }
+
+ if (session.get("knowledge.open") == null) {
+ getMenuBarSettings().setIsKnowledgeNull(true);
+ logger.debug("MKA: setIsKnowledgeNull = true");
+ } else {
+ getMenuBarSettings().setIsKnowledgeNull(false);
+ logger.debug("MKA: setIsKnowledgeNull = false");
+ }
+
+ ApplicationRights userRights = (ApplicationRights)session.get("user.rights");
+
+ if (userRights.canCreateStudy()) {
+ getMenuBarSettings().setCanUserCreateStudy(true);
+ } else {
+ getMenuBarSettings().setCanUserCreateStudy(false);
+ }
+
+ if (userRights.canManageDatabase()) {
+ getMenuBarSettings().setCanUserManageDatabase(true);
+ } else {
+ getMenuBarSettings().setCanUserManageDatabase(false);
+ }
+
+ }
+
+ /**
+ * Initialization of the screen context for menu bar.
+ */
+ public void initializationScreenContext(final String menuProperty) {
+
+ initializationContext();
+ getMenuBarSettings().intializeMenuBar(menuProperty);
+ }
// ==============================================================================================================================
// Getters and setters
// ==============================================================================================================================
+
+ public void setServletRequest (HttpServletRequest request) {
+ this.request = request;
+ }
+
+ public HttpServletRequest getServletRequest() {
+ return request;
+ }
public String getErrorCode () {
// -----------------------------
// ----------------------------------------------------
this.session = session;
}
+
+ /**
+ * Get the menuBarSettings.
+ * @return the menuBarSettings
+ */
+ public MenuBarSettings getMenuBarSettings() {
+ return _menuBarSettings;
+ }
+
+ /**
+ * Set the menuBarSettings.
+ * @param menuBarSettings the menuBarSettings to set
+ */
+ public void setMenuBarSettings(final MenuBarSettings menuBarSettings) {
+ _menuBarSettings = menuBarSettings;
+ }
}
\ No newline at end of file
private String username = null;
private String password = null;
private String backmenu = null;
+
+ private String _menuProperty;
/**
* Serial version ID.
sfilter.put("author", String.valueOf(user.getIndex()));
}
this.connect(context, user); // Updates the session context
+
+ setMenuProperty("none");
+ initializationScreenContext(_menuProperty);
+
return backmenu;
} catch (FailedLoginException error) {
setErrorCode("message.error.login." + error.getMessage());
}
}
+
@SuppressWarnings("unchecked")
public String doLogout() {
// -------------------------
sfilter.put("author", "0");
this.disconnect(); // Updates the session context
+
+ setMenuProperty("none");
+ initializationScreenContext(_menuProperty);
+
return backmenu;
} catch (Exception error) {
logger.error("Reason:", error);
}
}
- // ==============================================================================================================================
- // Getters and setters
- // ==============================================================================================================================
-
- public String getUsername() {
- // ----------------------------
- return username;
- }
-
- public String getPassword() {
- // ----------------------------
- return password;
- }
-
- public void setUsername(String value) {
- // --------------------------------------
- this.username = value;
- }
-
- public void setPassword(String value) {
- // --------------------------------------
- this.password = value;
+// ==============================================================================================================================
+// Getters and setters
+// ==============================================================================================================================
+
+ public String getUsername () {
+// ----------------------------
+ return username;
+ }
+ public String getPassword () {
+// ----------------------------
+ return password;
+ }
+
+ public void setUsername (String value) {
+// --------------------------------------
+ this.username = value;
+ }
+ public void setPassword (String value) {
+// --------------------------------------
+ this.password = value;
+ }
+ public void setBackMenu (String menu) {
+// -------------------------------------
+ this.backmenu = menu;
+ }
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
}
- public void setBackMenu(String menu) {
- // -------------------------------------
- this.backmenu = menu;
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
}
}
\ No newline at end of file
* Injected knowledge element service.
*/
private KnowledgeElementService _knowledgeElementService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
// ==============================================================================================================================
// Action methods
myknelm.setSelection(selection);
}
getSession().put("menu.knowledge", myknelm.getMenu());
+
+ setMenuProperty("knowledge");
+ initializationScreenContext(_menuProperty);
return SUCCESS;
}
} else { // Selection of a step of current study
myknelm.setSelection(selection);
}
+
+ setMenuProperty("knowledge");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
myknelm.reduceHistory(myindex);
else if (todo == Execute.reduceall)
myknelm.reduceDocument(myindex);
+
+ setMenuProperty("knowledge");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
myknelm.developKnowledge(myindex);
else if (todo == Execute.reduce)
myknelm.reduceKnowledge(myindex);
+
+ setMenuProperty("knowledge");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
public String doClose() {
closeKnowledge();
+
+ setMenuProperty("none");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
KnowledgeElementService knowledgeElementService) {
_knowledgeElementService = knowledgeElementService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
* Injected study service.
*/
private StudyService _studyService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
// ==============================================================================================================================
// Action methods
menu.selects("prop-general");
}
getSession().put("menu.study", mystudy.getMenu());
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
return SUCCESS;
}
menu.disables("prop-scenario");
menu.selects("prop-general");
}
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
mystudy.reduceHistory(myindex);
else if (todo == Execute.reduceall)
mystudy.reduceDocument(myindex);
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
mystudy.developKnowledge(myindex);
else if (todo == Execute.reduce)
mystudy.reduceKnowledge(myindex);
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
public String doClose() {
closeStudy();
+
+ setMenuProperty("none");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
super.setOpenStudy(study);
mystudy = study;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
* Injected repository service.
*/
private RepositoryService _repositoryService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
/**
* Operations enumeration.
*/
public String doInitialize() {
mystudy = getOpenStudy();
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
public String doSetDocument() {
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
try {
mystudy = getOpenStudy();
// -------------------------
// Session connex = Database.getCurSession();
// Transaction transax = connex.beginTransaction();
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
try {
// Getting user inputs
mystudy = getOpenStudy();
}
public String doDeleteDocument() {
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
try {
mystudy = getOpenStudy();
public void setStepService(StepService stepService) {
_stepService = stepService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
* Injected knowledge element type service.
*/
private KnowledgeElementTypeService _knowledgeElementTypeService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
// ==============================================================================================================================
// Action methods
*/
public String doInitialize() {
mystudy = getOpenStudy();
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
* @return SUCCESS if operation succeeded, ERROR if Runtime exception, otherwise INPUT
*/
public String doSetKnowledge() {
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
try {
User user = getConnectedUser();
mystudy = getOpenStudy();
mystudy.remove(kelm);
getMenu("study").selects(mystudy.getSelection()); // Updates the menu icon, in case of last removed document
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
return SUCCESS;
}
KnowledgeElementTypeService knowledgeElementTypeService) {
_knowledgeElementTypeService = knowledgeElementTypeService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
private String subject;
private ScenarioService _scenarioService;
private ProjectElementService _projectElementService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
/**
* Serial version ID.
myscenario = (Scenario) step.getOwner(); // The selected step belong to a scenario
lasdate = datstring.format(myscenario.getLastModificationDate());
subject = label.getString("label.study") + " " + mystudy.getTitle();
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
return SUCCESS;
}
mystudy.getMenu().refreshGivenStepItem(
getProjectElementService().getFirstStep(myscenario)); // For updating the scenario icon
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
ProjectElementService projectElementService) {
_projectElementService = projectElementService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
* Injected simulation context type service.
*/
private SimulationContextTypeService _simulationContextTypeService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
/**
* Get the stepService.
mystudy = getOpenStudy();
contype = getInvolvedContexts();
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
if (contype.isEmpty())
return "create";
public String doSelectContext() {
mystudy = getOpenStudy();
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
int typid = Integer.valueOf(selectype);
if (typid == 0)
return "create";
// --------------------------------
try {
mystudy = getOpenStudy();
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
if (newtype.length() == 0 || value.length() == 0)
return INPUT;
}
public String doDeleteContext() {
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
try {
mystudy = getOpenStudy();
String[] input = value.split(",");
// Session connex = Database.getCurSession();
// Transaction transax = connex.beginTransaction();
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
try {
mystudy = getOpenStudy();
SimulationContextTypeService simulationContextTypeService) {
_simulationContextTypeService = simulationContextTypeService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
private enum Execute { publish, promote }
private StudyService _studyService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
// ==============================================================================================================================
// Action methods
if (todo == Execute.publish) getStudyService().moveToPublic(study);
else if (todo == Execute.promote) getStudyService().moveToReference(study);
mystudy.getPopup().setContext("study", mystudy.getStudyRights()); // The context has changed
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
return SUCCESS;
}
public void setStudyService(StudyService studyService) {
_studyService = studyService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
/**
* Injected repository service.
*/
- private RepositoryService _repositoryService;
+ private RepositoryService _repositoryService;
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
// ==============================================================================================================================
// Action methods
* @return SUCCESS in success, otherwise - ERROR
*/
public String doInitialize() {
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
User user = getConnectedUser();
File updir = getRepositoryService().getDownloadDirectory(user);
File upfile = new File(updir.getPath() + "/" + filename);
*/
public String doImport() {
// -------------------------
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
if (action == ToDo.cancel)
return "cancel";
if (doctype == 0) {
public void setDocumentTypeService(DocumentTypeService documentTypeService) {
_documentTypeService = documentTypeService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
--- /dev/null
+/*****************************************************************************
+ * Company EURIWARE
+ * Application SIMAN
+ * File $Id$
+ * Creation date 19.10.2012
+ * @author Author: Maria KRUCHININA
+ * @version Revision:
+ *****************************************************************************/
+
+package org.splat.simer;
+
+/**
+ * Settings for menu bar.
+ * @author Maria KRUCHININA
+ *
+ */
+public class MenuBarSettings {
+
+ /**
+ * The SALOME WEB-site URL.
+ */
+ private String webSiteURL;
+
+ /**
+ * Help URL.
+ */
+ private String helpURL;
+
+ //=== MENUS==========================================
+ /**
+ * Property, is this menu the "Create the Study" one.
+ */
+ private Boolean isMenuCreate;
+
+ /**
+ * Property, is this menu the "Open the Study" one.
+ */
+ private Boolean isMenuOpen;
+
+ /**
+ * Property, is this menu the "Display the Open Study" one.
+ */
+ private Boolean isMenuStudy;
+
+ /**
+ * Property, is this menu the "Display the Open Knowledge" one.
+ */
+ private Boolean isMenuKnowledge;
+
+ /**
+ * Property, is this menu the "Managing the database" one.
+ */
+ private Boolean isMenuSysAdmin;
+
+ /**
+ * Property, is this menu the "Help" one.
+ */
+ private Boolean isMenuHelp;
+
+ //=== OTHER OPERATIONS ============================
+
+ /**
+ * Can the given User create the given Study.
+ */
+ private Boolean canUserCreateStudy;
+
+ /**
+ * Is the given Study NULL.
+ */
+ private Boolean isStudyNull;
+
+ /**
+ * Is the given Knowledge NULL.
+ */
+ private Boolean isKnowledgeNull;
+
+ /**
+ * Can the given User manage the Database.
+ */
+ private Boolean canUserManageDatabase;
+
+ /**
+ * Initialize the initial properties for menus.
+ */
+ public void initializeInitialMenuProperties() {
+
+ webSiteURL = ApplicationSettings.getWebSiteURL();
+ helpURL = ApplicationSettings.getHelpURL();
+
+ }
+
+ /**
+ * Initialize the menu bar properties.
+ * @param menuProperty - parameter of menu bar.
+ */
+ public void intializeMenuBar (final String menuProperty) {
+
+ if ("none".equals(menuProperty)) {
+ setIsMenuCreate(false);
+ setIsMenuOpen(false);
+ setIsMenuStudy(false);
+ setIsMenuKnowledge(false);
+ setIsMenuSysAdmin(false);
+ setIsMenuHelp(false);
+ } else if ("create".equals(menuProperty)) {
+ setIsMenuCreate(true);
+ setIsMenuOpen(false);
+ setIsMenuStudy(false);
+ setIsMenuKnowledge(false);
+ setIsMenuSysAdmin(false);
+ setIsMenuHelp(false);
+ } else if ("open".equals(menuProperty)) {
+ setIsMenuCreate(false);
+ setIsMenuOpen(true);
+ setIsMenuStudy(false);
+ setIsMenuKnowledge(false);
+ setIsMenuSysAdmin(false);
+ setIsMenuHelp(false);
+ } else if ("study".equals(menuProperty)) {
+ setIsMenuCreate(false);
+ setIsMenuOpen(false);
+ setIsMenuStudy(true);
+ setIsMenuKnowledge(false);
+ setIsMenuSysAdmin(false);
+ setIsMenuHelp(false);
+ } else if ("knowledge".equals(menuProperty)) {
+ setIsMenuCreate(false);
+ setIsMenuOpen(false);
+ setIsMenuStudy(false);
+ setIsMenuKnowledge(true);
+ setIsMenuSysAdmin(false);
+ setIsMenuHelp(false);
+ } else if ("sysadmin".equals(menuProperty)) {
+ setIsMenuCreate(false);
+ setIsMenuOpen(false);
+ setIsMenuStudy(false);
+ setIsMenuKnowledge(false);
+ setIsMenuSysAdmin(true);
+ setIsMenuHelp(false);
+ } else if ("help".equals(menuProperty)) {
+ setIsMenuCreate(false);
+ setIsMenuOpen(false);
+ setIsMenuStudy(false);
+ setIsMenuKnowledge(false);
+ setIsMenuSysAdmin(false);
+ setIsMenuHelp(true);
+ }
+ }
+
+ //====== GETTERS AND SETERS ==============
+
+ /**
+ * Get the webSiteURL.
+ * @return the webSiteURL
+ */
+ public String getWebSiteURL() {
+ return webSiteURL;
+ }
+
+ /**
+ * Set the webSiteURL.
+ * @param webSiteURL the webSiteURL to set
+ */
+ public void setWebSiteURL(final String webSiteURL) {
+ this.webSiteURL = webSiteURL;
+ }
+
+ /**
+ * Get the helpURL.
+ * @return the helpURL
+ */
+ public String getHelpURL() {
+ return helpURL;
+ }
+
+ /**
+ * Set the helpURL.
+ * @param helpURL the helpURL to set
+ */
+ public void setHelpURL(final String helpURL) {
+ this.helpURL = helpURL;
+ }
+
+ /**
+ * Get the isMenuCreate.
+ * @return the isMenuCreate
+ */
+ public Boolean getIsMenuCreate() {
+ return isMenuCreate;
+ }
+
+ /**
+ * Set the isMenuCreate.
+ * @param isMenuCreate the isMenuCreate to set
+ */
+ public void setIsMenuCreate(final Boolean isMenuCreate) {
+ this.isMenuCreate = isMenuCreate;
+ }
+
+ /**
+ * Get the isMenuOpen.
+ * @return the isMenuOpen
+ */
+ public Boolean getIsMenuOpen() {
+ return isMenuOpen;
+ }
+
+ /**
+ * Set the isMenuOpen.
+ * @param isMenuOpen the isMenuOpen to set
+ */
+ public void setIsMenuOpen(final Boolean isMenuOpen) {
+ this.isMenuOpen = isMenuOpen;
+ }
+
+ /**
+ * Get the isMenuStudy.
+ * @return the isMenuStudy
+ */
+ public Boolean getIsMenuStudy() {
+ return isMenuStudy;
+ }
+
+ /**
+ * Set the isMenuStudy.
+ * @param isMenuStudy the isMenuStudy to set
+ */
+ public void setIsMenuStudy(final Boolean isMenuStudy) {
+ this.isMenuStudy = isMenuStudy;
+ }
+
+ /**
+ * Get the isMenuKnowledge.
+ * @return the isMenuKnowledge
+ */
+ public Boolean getIsMenuKnowledge() {
+ return isMenuKnowledge;
+ }
+
+ /**
+ * Set the isMenuKnowledge.
+ * @param isMenuKnowledge the isMenuKnowledge to set
+ */
+ public void setIsMenuKnowledge(final Boolean isMenuKnowledge) {
+ this.isMenuKnowledge = isMenuKnowledge;
+ }
+
+ /**
+ * Get the isMenuSysAdmin.
+ * @return the isMenuSysAdmin
+ */
+ public Boolean getIsMenuSysAdmin() {
+ return isMenuSysAdmin;
+ }
+
+ /**
+ * Set the isMenuSysAdmin.
+ * @param isMenuSysAdmin the isMenuSysAdmin to set
+ */
+ public void setIsMenuSysAdmin(final Boolean isMenuSysAdmin) {
+ this.isMenuSysAdmin = isMenuSysAdmin;
+ }
+
+ /**
+ * Get the isMenuHelp.
+ * @return the isMenuHelp
+ */
+ public Boolean getIsMenuHelp() {
+ return isMenuHelp;
+ }
+
+ /**
+ * Set the isMenuHelp.
+ * @param isMenuHelp the isMenuHelp to set
+ */
+ public void setIsMenuHelp(final Boolean isMenuHelp) {
+ this.isMenuHelp = isMenuHelp;
+ }
+
+ /**
+ * Get the canUserCreateStudy.
+ * @return the canUserCreateStudy
+ */
+ public Boolean getCanUserCreateStudy() {
+ return canUserCreateStudy;
+ }
+
+ /**
+ * Set the canUserCreateStudy.
+ * @param canUserCreateStudy the canUserCreateStudy to set
+ */
+ public void setCanUserCreateStudy(final Boolean canUserCreateStudy) {
+ this.canUserCreateStudy = canUserCreateStudy;
+ }
+
+ /**
+ * Get the isStudyNull.
+ * @return the isStudyNull
+ */
+ public Boolean getIsStudyNull() {
+ return isStudyNull;
+ }
+
+ /**
+ * Set the isStudyNull.
+ * @param isStudyNull the isStudyNull to set
+ */
+ public void setIsStudyNull(final Boolean isStudyNull) {
+ this.isStudyNull = isStudyNull;
+ }
+
+ /**
+ * Get the isKnowledgeNull.
+ * @return the isKnowledgeNull
+ */
+ public Boolean getIsKnowledgeNull() {
+ return isKnowledgeNull;
+ }
+
+ /**
+ * Set the isKnowledgeNull.
+ * @param isKnowledgeNull the isKnowledgeNull to set
+ */
+ public void setIsKnowledgeNull(final Boolean isKnowledgeNull) {
+ this.isKnowledgeNull = isKnowledgeNull;
+ }
+
+ /**
+ * Get the canUserManageDatabase.
+ * @return the canUserManageDatabase
+ */
+ public Boolean getCanUserManageDatabase() {
+ return canUserManageDatabase;
+ }
+
+ /**
+ * Set the canUserManageDatabase.
+ * @param canUserManageDatabase the canUserManageDatabase to set
+ */
+ public void setCanUserManageDatabase(final Boolean canUserManageDatabase) {
+ this.canUserManageDatabase = canUserManageDatabase;
+ }
+
+}
*/
private ProjectElementService _projectElementService;
private Menu _menu;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
/**
* Serial version ID.
Menu menu = ((NewScenarioMenu)getMenu()).init(study); //RKV
menu.selects(selection);
getSession().put("menu.scenario", menu);
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
action = null;
getMenu("scenario").selects(selection);
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
}
catch (RuntimeException saverror) {
logger.error("Reason:", saverror);
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return ERROR;
}
catch (Exception error) {
public void setScenarioService(ScenarioService scenarioService) {
_scenarioService = scenarioService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
* Injected scenario service.
*/
private ScenarioService _scenarioService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
// ==============================================================================================================================
// Action methods
ApplicationSettings.getCurrentLocale());
title = locale.getString("label.study") + " "
+ String.valueOf(number + 1);
+
+ setMenuProperty("create");
+ initializationScreenContext(_menuProperty);
return SUCCESS;
}
throw new Exception();
if (valid == 0) {
value = input[1].trim();
- if (value.length() == 0)
+ if (value.length() == 0) {
+
+ setMenuProperty("create");
+ initializationScreenContext(_menuProperty);
+
return INPUT; // No need to reinitialize the list of existing products
+ }
}
sprop.setTitle(title).setManager(getConnectedUser());
sprop.checkValidity();
.selectType("product");
contelm = getSimulationContextService()
.selectSimulationContextsWhere(cprop.setType(product));
+
+ setMenuProperty("create");
+ initializationScreenContext(_menuProperty);
+
return INPUT; // Title empty, simply wait for input without error message
}
try {
// Update of the session
number += 1;
open(study); // Opens the study,
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
} catch (Exception error) {
logger.error("Unable to save the study, reason:", error);
+ setMenuProperty("none");
+ initializationScreenContext(_menuProperty);
return ERROR;
}
}
public void setScenarioService(ScenarioService scenarioService) {
_scenarioService = scenarioService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
* Serial version ID.
*/
private static final long serialVersionUID = 3131921588316476454L;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
// ==============================================================================================================================
// Action methods
// ==============================================================================================================================
public String doInitialize () {
-// -----------------------------
+// -----------------------------
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
popup = ApplicationSettings.getPopupMenu("steditable");
popup.setContext("study", new StudyRights(cuser, mystudy));
}
- ustep.setActor(cuser);
+ //ustep = getProjectElementService().getFirstStep(mystudy);
+ if (ustep != null) {
+ ustep.setActor(cuser);
+ }
urightstudy = new StudyRights(cuser, mystudy);
urightstep = new StepRights(cuser, ustep);
}
public void setDocumentService(DocumentService documentService) {
_documentService = documentService;
}
+
+ public Study getMystudy() {
+ return mystudy;
+ }
+
+ public void setMystudy(Study mystudy) {
+ this.mystudy = mystudy;
+ }
}
\ No newline at end of file
* Injected user service.
*/
private UserService _userService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
// ==============================================================================================================================
// Action methods
* @return SUCCESS if succeeded, ERROR if doSearch() is failed
*/
public String doInitialize() {
+
+ setMenuProperty("open");
+ initializationScreenContext(_menuProperty);
+
try {
loadFilter();
doSearch();
protected String doSearch() throws InvalidPropertyException {
// ----------------------------
+ setMenuProperty("open");
+ initializationScreenContext(_menuProperty);
+
Map<String, Object> session = getSession();
User user = getConnectedUser();
public void setUserService(UserService userService) {
_userService = userService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
* Injected user service.
*/
private UserService _userService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
/**
* Serial version ID.
// Final initialization of the form
setCandidates();
setContextTypeOptions(getInvolvedContexts());
+
+ setMenuProperty("open");
+ initializationScreenContext(_menuProperty);
return SUCCESS;
} catch (Exception error) {
// No need to roll back the transaction as it is read only
logger.error("Reason: ", error);
+
+ setMenuProperty("none");
+ initializationScreenContext(_menuProperty);
+
return ERROR;
}
}
public void setUserService(UserService userService) {
_userService = userService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
private ProjectSettingsService _projectSettingsService;
private ApplicationSettings _ApplicationSettings;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
+
/**
* Serial version ID.
*/
session.put("knowledge.filter", wapp.getFilter("knowledge"));
// transax.commit();
+
+ setMenuProperty("none");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
catch (Exception error) {
logger.fatal("Reason:", error);
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return ERROR;
}
}
public void setApplicationSettings(ApplicationSettings applicationSettings) {
_ApplicationSettings = applicationSettings;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
* Injected user service.
*/
private UserService _userService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
/**
* Save operation type enumeration pointing which section of properties has been edited.
member = getStudyService().getContributors(study);
staff = null;
validor = null;
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
- if (mystudy.isOpenForWriting() && user.canEditProperties())
+ if (mystudy.isOpenForWriting() && user.canEditProperties()) {
return "edit";
- else
+ }
+ else {
return "display";
+ }
}
public String doEditTitle() {
other = null;
// transax.commit();
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
i.remove();
}
// transax.commit();
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
}
}
// transax.commit();
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
// transax.commit();
doInitialize(); // Re-initialization following the above edition
+
return SUCCESS;
}
public void setUserService(UserService userService) {
_userService = userService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
* Injected repository service.
*/
private RepositoryService _repositoryService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
private static final long serialVersionUID = 6003880772275115923L;
public String doInitialize () {
// -----------------------------
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
public String doUpload () {
// -------------------------
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
if (action == ToDo.cancel) return "cancel";
try {
File udir = getRepositoryService().getDownloadDirectory(getConnectedUser());
if (file.exists()) file.delete();
Do.copy(upload, file);
logger.info("Uploading \"" + uploadFileName + "\" " + uploadMimeType + " file.");
+ /*if (next == null || next.isEmpty()) {
+ next = "import";
+ }*/
+
+ logger.info("MKA next = " + next);
return next;
}
catch (OutOfMemoryError error) {
+
+ setMenuProperty("none");
+ initializationScreenContext(_menuProperty);
+
return "outofmemory";
}
catch (Exception error) {
public void setRepositoryService(RepositoryService repositoryService) {
_repositoryService = repositoryService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
--- /dev/null
+/*****************************************************************************
+ * Company EURIWARE
+ * Application SIMAN
+ * File $Id$
+ * Creation date 24.10.2012
+ * @author Author: Maria KRUCHININA
+ * @version Revision:
+ *****************************************************************************/
+
+package org.splat.simer;
+
+/**
+ * Action class for uploading the study.
+ * @author Maria KRUCHININA
+ *
+ */
+public class UploadStudyAction extends Action {
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
+
+ private static final long serialVersionUID = 6003880772275115924L;
+
+ public String doInitialize () {
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
+ return SUCCESS;
+ }
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
+}
* Injected repository service.
*/
private RepositoryService _repositoryService;
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
/**
* Serial version ID.
public String doInitialize() {
// -----------------------------
+
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
Session connex = Database.getCurSession();
Transaction transax = connex.beginTransaction();
User user = getConnectedUser();
public String doVersion() {
// -------------------------
+ setMenuProperty("study");
+ initializationScreenContext(_menuProperty);
+
if (action == ToDo.cancel)
return "cancel";
public void setRepositoryService(RepositoryService repositoryService) {
_repositoryService = repositoryService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
* Injected search service.
*/
private SearchService _searchService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
// ==============================================================================================================================
// Action methods
public String doInitialize() {
newstudies = getSearchService().selectStudies();
indices = "";
+
+ setMenuProperty("sysadmin");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
public void setSearchService(SearchService searchService) {
_searchService = searchService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
* Injected user service.
*/
private UserService _userService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
// ==============================================================================================================================
// Action methods
i.remove(); // Just for not showing the corresponding reserved username
break;
}
+
+ setMenuProperty("sysadmin");
+ initializationScreenContext(_menuProperty);
+
return SUCCESS;
}
catch (Exception error) {
return ERROR;
}
}
-
+
// ==============================================================================================================================
// Getters
// ==============================================================================================================================
public void setUserService(UserService userService) {
_userService = userService;
}
+
+ /**
+ * Get the menuProperty.
+ * @return the menuProperty
+ */
+ public String getMenuProperty() {
+ return _menuProperty;
+ }
+
+ /**
+ * Set the menuProperty.
+ * @param menuProperty the menuProperty to set
+ */
+ public void setMenuProperty(String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
}
\ No newline at end of file
<property name="projectSettings" ref="projectSettings" />
<property name="documentTypeService" ref="documentTypeService" />
</bean>
+
+ <bean id="menuBarSettings"
+ class="org.splat.simer.MenuBarSettings" scope="session">
+ </bean>
<bean id="slidMenu" scope="session" abstract="true">
<property name="projectElementService"
scope="prototype" abstract="true">
<property name="openStudy" ref="openStudy" />
<property name="openKnowledge" ref="openKnowledge" />
+ <property name="menuBarSettings" ref="menuBarSettings" />
</bean>
<!--========= Inherited from baseAction ========= -->
<!-- End of Inherited from displayStudyStepAction -->
<bean id="startAction" class="org.splat.simer.StartAction"
- scope="prototype">
+ scope="prototype" parent ="baseAction">
<property name="applicationSettings" ref="applicationSettings" />
<property name="projectSettings" ref="projectSettings" />
</bean>
<bean id="connectionAction" class="org.splat.simer.ConnectionAction"
- scope="prototype">
+ scope="prototype" parent ="baseAction">
</bean>
<bean id="menuAction" class="org.splat.simer.MenuAction"
</bean>
<bean id="notYetImplementedAction"
- class="org.splat.simer.NotYetImplementedAction" scope="prototype">
+ class="org.splat.simer.NotYetImplementedAction"
+ scope="prototype" parent ="baseAction">
</bean>
<bean id="searchStudyAction"
- class="org.splat.simer.SearchStudyAction" scope="prototype">
+ class="org.splat.simer.SearchStudyAction"
+ scope="prototype" parent ="baseAction">
<property name="projectSettings" ref="projectSettings" />
<property name="searchService" ref="searchService" />
<property name="simulationContextService"
</bean>
<bean id="searchKnowledgeAction"
- class="org.splat.simer.SearchKnowledgeAction" scope="prototype">
+ class="org.splat.simer.SearchKnowledgeAction"
+ scope="prototype" parent ="baseAction">
<property name="searchService" ref="searchService" />
<property name="simulationContextService"
ref="simulationContextService" />
</bean>
<bean id="displayKnowledgeAction"
- class="org.splat.simer.DisplayKnowledgeAction" scope="prototype">
+ class="org.splat.simer.DisplayKnowledgeAction"
+ scope="prototype" parent ="baseAction">
<property name="knowledgeElementService"
ref="knowledgeElementService" />
</bean>
<bean id="uploadAction" class="org.splat.simer.UploadAction"
- scope="prototype">
+ scope="prototype" parent ="baseAction">
<property name="repositoryService" ref="repositoryService" />
</bean>
+
+ <bean id="uploadStudyAction" class="org.splat.simer.UploadStudyAction"
+ scope="prototype" parent ="baseAction">
+ </bean>
<bean id="versionDocumentAction"
- class="org.splat.simer.VersionDocumentAction" scope="prototype">
+ class="org.splat.simer.VersionDocumentAction"
+ scope="prototype" parent ="baseAction">
<property name="projectSettings" ref="projectSettings" />
<property name="publicationService" ref="publicationService" />
<property name="stepService" ref="stepService" />
<bean id="databaseIndexingAction"
class="org.splat.simer.admin.DatabaseIndexingAction"
- scope="prototype">
+ scope="prototype" parent ="baseAction">
<property name="searchService" ref="searchService" />
</bean>
<bean id="importUserAction"
- class="org.splat.simer.admin.ImportUserAction" scope="prototype">
+ class="org.splat.simer.admin.ImportUserAction"
+ scope="prototype" parent="baseAction">
<property name="repositoryService" ref="repositoryService" />
<property name="userService" ref="userService" />
</bean>