</s:else>
</td>
<td>
- <b><s:property value="titleBarSettings.entryType"/>: </b><s:property value="titleBarSettings.entryTitle"/>
+ <b><s:property value="titleBarSettings.entryTypeTitle"/>: </b><s:property value="titleBarSettings.entryTitle"/>
</td>
<td align=right>
<table border="0" cellpadding="0" cellspacing="0" class="text">
<%@ page language="java" contentType="text/html; charset=ISO-8859-1"
pageEncoding="ISO-8859-1"
%>
-<%@ page import="org.splat.som.StudyRights"%>
<%@ page import="org.splat.som.StepRights"%>
<%@ page import="org.splat.simer.OpenStudy"%>
<%@ page import="org.splat.wapp.ToolBar"%>
<%@ page import="org.splat.wapp.ToolButton"%>
-<%@ page import="org.splat.wapp.PopupMenu"%>
<%@ page import="java.util.Iterator"%>
<%@
taglib prefix="s" uri="/struts-tags"
%>
-<%!private enum Tool { none, standard, study, back };%>
-<!-- Initialization of the context
- -->
-<%
- String barname = request.getParameter("tools");
- Tool bar = Tool.valueOf(barname);
-%>
+
<s:url id="properties" namespace="/" action="select">
<s:param name="menu">configuration</s:param>
</s:url>
<table width=100% border=0 cellspacing=0 cellpadding=0>
<tr height=30 valign=middle>
-<%
- if (bar == Tool.study) {
- OpenStudy study = (OpenStudy)session.getAttribute("study.open");
- PopupMenu popup = study.getPopup();
- StudyRights user = study.getStudyRights();
-%>
+
+ <s:if test="toolBarSettings.isToolStudy">
<td width=30 align=left>
-<% if (user.canEditProperties()) {
-%> <s:a href="%{#properties}"><img src="<s:url value="/skin/tool.property.png"/>" border="none" title="<s:text name="tooltip.property"/>" /></s:a>
-<% } else {
-%> <s:a href="%{#properties}"><img src="<s:url value="/skin/tool.property.png"/>" border="none" title="<s:text name="tooltip.details"/>" /></s:a>
-<% }
-%> </td>
+ <s:if test="toolBarSettings.canUserEdit">
+ <s:a href="%{#properties}"><img src="<s:url value="/skin/tool.property.png"/>" border="none" title="<s:text name="tooltip.property"/>" /></s:a>
+ </s:if>
+ <s:else>
+ <s:a href="%{#properties}"><img src="<s:url value="/skin/tool.property.png"/>" border="none" title="<s:text name="tooltip.details"/>" /></s:a>
+ </s:else>
+ </td>
<td width=30 align=left>
-<% if (popup.isEnabled("script")) {
-%> <s:a href="%{#scenario}"><img src="<s:url value="/skin/tool.scenario.png"/>" border="none" title="<s:text name="tooltip.scenario"/>"/></s:a>
-<% } else {
-%> <img src="<s:url value="/skin/disabled.scenario.png"/>" border="none" title="" />
-<% }
-%> </td>
+ <s:if test="toolBarSettings.isEnabledScript">
+ <s:a href="%{#scenario}"><img src="<s:url value="/skin/tool.scenario.png"/>" border="none" title="<s:text name="tooltip.scenario"/>"/></s:a>
+ </s:if>
+ <s:else>
+ <img src="<s:url value="/skin/disabled.scenario.png"/>" border="none" title="" />
+ </s:else>
+
+ </td>
<td align=right>
<img src="<s:url value="/skin/image.vseparator.png"/>" border="none" />
-<% ToolBar mbar = study.getModuleBar();
+<% OpenStudy study = (OpenStudy)session.getAttribute("study.open");
+ ToolBar mbar = study.getModuleBar();
if (study.getSelectedStepRights().canCreateDocument() && mbar != null) {
%>
<applet name="perform" id="perform" code="org.splat.launcher.ToolbarApplet.class" archive="../jap/splat-signedlauncher.jar" width=<%=mbar.getWidth()%> height=<%=mbar.getHeight()%>>
<td width=30 align=right>
<s:a href="%{#idea}"><img src="<s:url value="/skin/icon.idea.png"/>" border="none" title="<s:text name="tooltip.search"/>" /></s:a>
</td>
-<% }
- else if (bar == Tool.standard) {
-%>
- <td width=30 align=left>
- <s:a href="%{#properties}"><img src="<s:url value="/skin/tool.property.png"/>" border="none" title="<s:text name="tooltip.details"/>" /></s:a>
- </td>
-<% }
- else if (bar == Tool.back) {
-%>
- <td width=30 align=left>
- <s:a href="%{#back}"><img src="<s:url value="/skin/icon.back.png"/>" border="none" title="<s:text name="tooltip.back"/>" /></s:a>
- </td>
-<% }
-%></tr>
+ </s:if>
+
+ <s:elseif test="toolBarSettings.isToolStandard">
+ <td width=30 align=left>
+ <s:a href="%{#properties}"><img src="<s:url value="/skin/tool.property.png"/>" border="none" title="<s:text name="tooltip.details"/>" /></s:a>
+ </td>
+ </s:elseif>
+
+ <s:elseif test="toolBarSettings.isToolBack">
+ <td width=30 align=left>
+ <s:a href="%{#back}"><img src="<s:url value="/skin/icon.back.png"/>" border="none" title="<s:text name="tooltip.back"/>" /></s:a>
+ </td>
+ </s:elseif>
+</tr>
</table>
\ No newline at end of file
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="open" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="open" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="open" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="open" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="open" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="open" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="knowledge" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="back" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="open" />
=============================================================================================================================
-->
<div id=left-pane>
- <s:if test="%{writeAccess && userRights.canCreateDocument()}">
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="study" />
- </jsp:include>
- </s:if>
- <s:else>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="standard" />
- </jsp:include>
- </s:else>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="study" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="back" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="open" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="back" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="open" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="study" />
=============================================================================================================================
-->
<div id=left-pane>
- <s:if test="writeAccess">
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="study" />
- </jsp:include>
- </s:if>
- <s:else>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
- </s:else>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="study" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="study" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="scenario" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="open" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="open" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="open" />
=============================================================================================================================
-->
<div id=left-pane>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="study" />
=============================================================================================================================
-->
<div id=left-pane>
- <s:if test="writeAccess">
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="study" />
- </jsp:include>
- </s:if>
- <s:else>
- <jsp:include page="/jsp/toolbar.jsp">
- <jsp:param name="tools" value="none" />
- </jsp:include>
- </s:else>
+ <jsp:include page="/jsp/toolbar.jsp" />
<div id=top-spacer></div>
<jsp:include page="/jsp/menuitem.jsp">
<jsp:param name="menu" value="study" />
import org.apache.log4j.Logger;
import org.splat.dal.bo.kernel.User;
import org.splat.som.ApplicationRights;
+import org.splat.som.StudyRights;
import org.splat.dal.bo.som.KnowledgeElement;
import org.splat.dal.bo.som.SimulationContextType;
import org.splat.dal.bo.som.Study;
import org.splat.dal.bo.som.DocumentType;
import org.splat.wapp.Menu;
+import org.splat.wapp.PopupMenu;
/**
* TitleBarSettings bean.
*/
private TitleBarSettings _titleBarSettings;
+ /**
+ * ToolBarSettings bean.
+ */
+ private ToolBarSettings _toolBarSettings;
+
/**
* Injected application settings bean.
*/
getMenuBarSettings().setIsStudyNull(true);
} else {
getMenuBarSettings().setIsStudyNull(false);
+
+ //for initialization ToolBarSettings.canUserEdit property
+ // and ToolBarSettings.isEnabledScript property.
+
+ OpenStudy currentStudy = (OpenStudy)session.get("study.open");
+ PopupMenu popup = currentStudy.getPopup();
+ StudyRights user = currentStudy.getStudyRights();
+
+ if(user.canEditProperties()) {
+ getToolBarSettings().setCanUserEdit(true);
+ } else {
+ getToolBarSettings().setCanUserEdit(false);
+ }
+
+ if (popup == null) {
+ getToolBarSettings().setIsEnabledScript(false);
+ } else if (popup.isEnabled("script")) {
+ getToolBarSettings().setIsEnabledScript(true);
+ } else {
+ getToolBarSettings().setIsEnabledScript(false);
+ }
}
if (session.get("knowledge.open") == null) {
getTitleBarSettings().setProgressState(entity.getProgressState().toString());
getTitleBarSettings().setSelectionState(entity.getSelection());
- getTitleBarSettings().setEntryType(entity.getType());
+ getTitleBarSettings().setEntryType(entity.getType().toLowerCase());
+ getTitleBarSettings().setEntryTypeTitle(entity.getType());
getTitleBarSettings().setEntryTitle(entity.getTitle());
getTitleBarSettings().setEditDisabledProperty(editDisabledProperty);
}
}
/**
- * Initialization of the screen context for menu bar and tool bar.
+ * Initialization of the screen context for menu bar and title bar.
*
* @param menuProperty - the property of the menu bar.
* @param titleProperty - The title of the open study/knowledge.
initializationContext(titleProperty, editDisabledProperty);
getMenuBarSettings().intializeMenuBar(menuProperty);
}
+
+ /**
+ * Initialization of the screen context for menu bar, title bar and tool bar.
+ *
+ * @param menuProperty - the property of the menu bar.
+ * @param titleProperty - The title of the open study/knowledge.
+ * @param editDisabledProperty - Property that indicates whether the current open study is editable or not.
+ * @param toolProperty - the property of the tool bar.
+ */
+ public void initializationScreenContext(final String menuProperty,
+ final String titleProperty, final String editDisabledProperty,
+ final String toolProperty) {
+
+ initializationScreenContext(menuProperty, titleProperty, editDisabledProperty);
+ getToolBarSettings().intializeMenuBar(toolProperty);
+ }
+
+ /**
+ * Initialization of the screen context for menu bar and tool bar.
+ *
+ * @param menuProperty - the property of the menu bar.
+ * @param toolProperty - the property of the tool bar.
+ */
+ public void initializationScreenContext(final String menuProperty,
+ final String toolProperty) {
+
+ initializationContext();
+ getMenuBarSettings().intializeMenuBar(menuProperty);
+ getToolBarSettings().intializeMenuBar(toolProperty);
+ }
// ==============================================================================================================================
// Getters and setters
// ==============================================================================================================================
public void setTitleBarSettings(TitleBarSettings titleBarSettings) {
_titleBarSettings = titleBarSettings;
}
+ /**
+ * Get the toolBarSettings.
+ * @return the toolBarSettings
+ */
+ public final ToolBarSettings getToolBarSettings() {
+ return _toolBarSettings;
+ }
+ /**
+ * Set the toolBarSettings.
+ * @param toolBarSettings the toolBarSettings to set
+ */
+ public final void setToolBarSettings(ToolBarSettings toolBarSettings) {
+ _toolBarSettings = toolBarSettings;
+ }
+
/**
* Get the applicationSettings.
* @return the applicationSettings
*/
private String _titleProperty;
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
+
/**
* 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.
setMenuProperty("knowledge");
setTitleProperty("knowledge");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("knowledge");
setTitleProperty("knowledge");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("knowledge");
setTitleProperty("knowledge");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("knowledge");
setTitleProperty("knowledge");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
this._editDisabledProperty = _editDisabledProperty;
}
-
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
*/
private String _titleProperty;
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
+
/**
* 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.
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
_editDisabledProperty = editDisabledProperty;
}
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
*/
private String _titleProperty;
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
+
/**
* 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.
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
try {
mystudy = getOpenStudy();
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
try {
// Getting user inputs
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
try {
mystudy = getOpenStudy();
}
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
* It is necessary for correct building the title bar.
*/
private String _editDisabledProperty = "false";
+
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
// ==============================================================================================================================
// Action methods
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
try {
User user = getConnectedUser();
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
* @param menuProperty
* the menuProperty to set
*/
- public void setMenuProperty(String menuProperty) {
+ public void setMenuProperty(final String menuProperty) {
this._menuProperty = menuProperty;
}
}
/**
- * Set the _titleProperty.
- * @param _titleProperty the titleProperty to set
+ * Set the titleProperty.
+ * @param titleProperty the titleProperty to set
*/
- public void setTitleProperty(String titleProperty) {
+ public void setTitleProperty(final String titleProperty) {
_titleProperty = titleProperty;
}
* Get the editDisabledProperty.
* @return the editDisabledProperty
*/
- public final String getEditDisabledProperty() {
+ public String getEditDisabledProperty() {
return _editDisabledProperty;
}
* Set the editDisabledProperty.
* @param editDisabledProperty the editDisabledProperty to set
*/
- public final void setEditDisabledProperty(String editDisabledProperty) {
+ public void setEditDisabledProperty(final String editDisabledProperty) {
_editDisabledProperty = editDisabledProperty;
}
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
+
}
\ No newline at end of file
* It is necessary for correct building the title bar.
*/
private String _editDisabledProperty = "false";
+
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
/**
* Serial version ID.
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("back");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
getProjectElementService().getFirstStep(myscenario)); // For updating the scenario icon
setMenuProperty("study");
- initializationScreenContext(_menuProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _toolProperty);
+
return SUCCESS;
}
_editDisabledProperty = editDisabledProperty;
}
-
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
*/
private String _titleProperty;
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
+
/**
* 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.
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
if (contype.isEmpty())
return "create";
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
int typid = Integer.valueOf(selectype);
if (typid == 0)
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
if (newtype.length() == 0 || value.length() == 0)
return INPUT;
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
try {
mystudy = getOpenStudy();
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
try {
mystudy = getOpenStudy();
_editDisabledProperty = editDisabledProperty;
}
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
*/
private String _titleProperty;
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
+
/**
* 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.
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess()) && getUserRights().canCreateDocument()) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("standard");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
public final void setEditDisabledProperty(String editDisabledProperty) {
_editDisabledProperty = editDisabledProperty;
}
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
*/
private String _titleProperty;
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
+
/**
* 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.
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ if ("true".equals(getWriteAccess())) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("none");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
User user = getConnectedUser();
File updir = getRepositoryService().getDownloadDirectory(user);
new Revision().toString());
if (slot == null) {
setErrorCode("reference.undefined");
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
} else {
if (!slot.isUndefined()) {
setErrorCode("reference.duplicate");
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
}
docref = fileref; // Disables document name and state fields
docver = version.toString();
} catch (ParseException e) {
setErrorCode("format.version");
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
}
docname = tool.extractProperty("title"); // Property kept even if the file is not referenced
check.parse(date);
} catch (ParseException e) {
setErrorCode("format.date");
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
}
} else
return "cancel";
if (doctype == 0) {
setErrorCode("import.type");
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
}
try {
logger.error("Reason:", error);
setErrorCode("internal");
}
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
}
_editDisabledProperty = editDisabledProperty;
}
-
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
*/
private String _titleProperty;
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
+
/**
* 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.
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("study");
setTitleProperty("study");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("standard");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return ERROR;
}
public void setEditDisabledProperty(String _editDisabledProperty) {
this._editDisabledProperty = _editDisabledProperty;
}
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
* Value of the menu property. It can be: none, create, open, study, knowledge, sysadmin, help.
*/
private String _menuProperty;
+
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
// ==============================================================================================================================
// Action methods
+ String.valueOf(number + 1);
setMenuProperty("create");
- initializationScreenContext(_menuProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _toolProperty);
return SUCCESS;
}
open(study); // Opens the study,
setMenuProperty("study");
- initializationScreenContext(_menuProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _toolProperty);
return SUCCESS;
} catch (Exception error) {
public void setMenuProperty(String menuProperty) {
this._menuProperty = menuProperty;
}
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
* It is necessary for correct building the title bar.
*/
private String _editDisabledProperty = "false";
+
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
// ==============================================================================================================================
// Action methods
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
_editDisabledProperty = editDisabledProperty;
}
-
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
* It can be: none, create, open, study, knowledge, sysadmin, help.
*/
private String _menuProperty;
+
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
// ==============================================================================================================================
// Action methods
public String doInitialize() {
setMenuProperty("open");
- initializationScreenContext(_menuProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _toolProperty);
try {
loadFilter();
public void setMenuProperty(String menuProperty) {
this._menuProperty = menuProperty;
}
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
* It can be: none, create, open, study, knowledge, sysadmin, help.
*/
private String _menuProperty;
+
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
/**
* Serial version ID.
setContextTypeOptions(getInvolvedContexts());
setMenuProperty("open");
- initializationScreenContext(_menuProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _toolProperty);
return SUCCESS;
} catch (Exception error) {
public void setMenuProperty(String menuProperty) {
this._menuProperty = menuProperty;
}
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
* It is necessary for correct building the title bar.
*/
private String _editDisabledProperty = "false";
+
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
/**
* Serial version ID.
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return ERROR;
}
public final void setEditDisabledProperty(String editDisabledProperty) {
_editDisabledProperty = editDisabledProperty;
}
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
*/
private String _titleProperty;
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
+
/**
* 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.
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("back");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
if (mystudy.isOpenForWriting() && user.canEditProperties()) {
return "edit";
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("back");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("back");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("back");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("back");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return SUCCESS;
}
_editDisabledProperty = editDisabledProperty;
}
-
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
*/
private String entryType;
+ /**
+ * The type title of the open study/knowledge.
+ */
+ private String entryTypeTitle;
+
/**
* The title of the open study/knowledge.
*/
this.entryType = entryType;
}
+ /**
+ * Get the entryTypeTitle.
+ * @return the entryTypeTitle
+ */
+ public String getEntryTypeTitle() {
+ return entryTypeTitle;
+ }
+
+ /**
+ * Set the entryTypeTitle.
+ * @param entryTypeTitle the entryTypeTitle to set
+ */
+ public void setEntryTypeTitle(final String entryTypeTitle) {
+ this.entryTypeTitle = entryTypeTitle;
+ }
/**
* Get the entryTitle.
--- /dev/null
+/*****************************************************************************
+ * Company EURIWARE
+ * Application SIMAN
+ * File $Id$
+ * Creation date 28.10.2012
+ * @author Author: Maria KRUCHININA
+ * @version Revision:
+ *****************************************************************************/
+
+package org.splat.simer;
+
+/**
+ * @author Maria KRUCHININA
+ *
+ */
+public class ToolBarSettings {
+
+ //=== MENUS==========================================
+
+ /**
+ * Property, is this tool the "None" one.
+ */
+ private Boolean isToolNone;
+
+ /**
+ * Property, is this tool the "Standard" one.
+ */
+ private Boolean isToolStandard;
+
+ /**
+ * Property, is this tool the "Study" one.
+ */
+ private Boolean isToolStudy;
+
+ /**
+ * Property, is this tool the "Back" one.
+ */
+ private Boolean isToolBack;
+
+ //=== OTHER OPERATIONS ============================
+
+ /**
+ * Can the given User edit the given Study/Knowledge.
+ */
+ private Boolean canUserEdit;
+
+ /**
+ * It's for (popup.isEnabled("script") operation on the toolbar.jsp.
+ */
+ private Boolean isEnabledScript;
+
+ /**
+ * Initialize the tool bar properties.
+ * @param toolProperty - parameter of tool bar.
+ */
+ public void intializeMenuBar (final String toolProperty) {
+
+ setIsToolNone(false);
+ setIsToolStandard(false);
+ setIsToolStudy(false);
+ setIsToolBack(false);
+
+ if ("none".equals(toolProperty)) {
+ setIsToolNone(true);
+ } else if ("standard".equals(toolProperty)) {
+ setIsToolStandard(true);
+ } else if ("study".equals(toolProperty)) {
+ setIsToolStudy(true);
+ } else if ("back".equals(toolProperty)) {
+ setIsToolBack(true);
+ }
+ }
+
+ //====== GETTERS AND SETERS ==============
+
+ /**
+ * Get the isToolNone.
+ * @return the isToolNone
+ */
+ public Boolean getIsToolNone() {
+ return isToolNone;
+ }
+
+ /**
+ * Set the isToolNone.
+ * @param isToolNone the isToolNone to set
+ */
+ public void setIsToolNone(final Boolean isToolNone) {
+ this.isToolNone = isToolNone;
+ }
+
+ /**
+ * Get the isToolStandard.
+ * @return the isToolStandard
+ */
+ public Boolean getIsToolStandard() {
+ return isToolStandard;
+ }
+
+ /**
+ * Set the isToolStandard.
+ * @param isToolStandard the isToolStandard to set
+ */
+ public void setIsToolStandard(final Boolean isToolStandard) {
+ this.isToolStandard = isToolStandard;
+ }
+
+ /**
+ * Get the isToolStudy.
+ * @return the isToolStudy
+ */
+ public Boolean getIsToolStudy() {
+ return isToolStudy;
+ }
+
+ /**
+ * Set the isToolStudy.
+ * @param isToolStudy the isToolStudy to set
+ */
+ public void setIsToolStudy(final Boolean isToolStudy) {
+ this.isToolStudy = isToolStudy;
+ }
+
+ /**
+ * Get the isToolBack.
+ * @return the isToolBack
+ */
+ public Boolean getIsToolBack() {
+ return isToolBack;
+ }
+
+ /**
+ * Set the isToolBack.
+ * @param isToolBack the isToolBack to set
+ */
+ public void setIsToolBack(final Boolean isToolBack) {
+ this.isToolBack = isToolBack;
+ }
+
+ /**
+ * Get the canUserEdit.
+ * @return the canUserEdit
+ */
+ public Boolean getCanUserEdit() {
+ return canUserEdit;
+ }
+
+ /**
+ * Set the canUserEdit.
+ * @param canUserEdit the canUserEdit to set
+ */
+ public void setCanUserEdit(final Boolean canUserEdit) {
+ this.canUserEdit = canUserEdit;
+ }
+
+ /**
+ * Get the isEnabledScript.
+ * @return the isEnabledScript
+ */
+ public Boolean getIsEnabledScript() {
+ return isEnabledScript;
+ }
+
+ /**
+ * Set the isEnabledScript.
+ * @param isEnabledScript the isEnabledScript to set
+ */
+ public void setIsEnabledScript(final Boolean isEnabledScript) {
+ this.isEnabledScript = isEnabledScript;
+ }
+}
*/
private String _titleProperty;
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
/**
* 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.
public String doInitialize () {
// -----------------------------
setMenuProperty("study");
- initializationScreenContext(_menuProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _toolProperty);
return SUCCESS;
}
setMenuProperty("none");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
return "outofmemory";
}
this._editDisabledProperty = _editDisabledProperty;
}
-
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
// ----------------------------------
this.action = ToDo.save;
}
+
+ public String getWriteAccess() {
+ if (mystudy == null) {
+ return "false";
+ }
+ return String.valueOf(mystudy.isOpenForWriting());
+ }
// ==============================================================================================================================
// Protected services
// ==============================================================================================================================
*/
private RepositoryService _repositoryService;
/**
- * 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;
/**
- * 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.
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
+
+ /**
+ * 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";
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty);
-
+ if ("true".equals(getWriteAccess())) {
+ setToolProperty("study");
+ } else {
+ setToolProperty("none");
+ }
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
User user = getConnectedUser();
File updir = getRepositoryService().getDownloadDirectory(user);
File upfile = new File(updir.getPath() + "/" + filename);
usedby = new Vector<Publication>();
if (!extractProperties(upfile, doc)) {
+ if (!("none".equals(_toolProperty))) {
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+ }
return ERROR;
}
setupDefaultUses(deftype);
setMenuProperty("study");
setTitleProperty("study");
setEditDisabledProperty("true");
- initializationScreenContext(_menuProperty, _titleProperty,
- _editDisabledProperty);
-
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty);
+
if (action == ToDo.cancel)
return "cancel";
logger.error("Reason:", error);
setErrorCode("internal");
}
+
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _titleProperty, _editDisabledProperty, _toolProperty);
+
return ERROR;
}
public void setEditDisabledProperty(String _editDisabledProperty) {
this._editDisabledProperty = _editDisabledProperty;
}
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
* It can be: none, create, open, study, knowledge, sysadmin, help.
*/
private String _menuProperty;
+
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
// ==============================================================================================================================
// Action methods
indices = "";
setMenuProperty("sysadmin");
- initializationScreenContext(_menuProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _toolProperty);
return SUCCESS;
}
public void setMenuProperty(String menuProperty) {
this._menuProperty = menuProperty;
}
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
* It can be: none, create, open, study, knowledge, sysadmin, help.
*/
private String _menuProperty;
+
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
// ==============================================================================================================================
// Action methods
}
setMenuProperty("sysadmin");
- initializationScreenContext(_menuProperty);
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _toolProperty);
return SUCCESS;
}
public void setMenuProperty(String menuProperty) {
this._menuProperty = menuProperty;
}
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
* Injected simulation context service.
*/
private SimulationContextService _simulationContextService;
+
+ /**
+ * Value of the menu property.
+ * It can be: none, create, open, study, knowledge, sysadmin, help.
+ */
+ private String _menuProperty;
+
+ /**
+ * Value of the tool bar property.
+ * It can be: none, standard, study, back.
+ */
+ private String _toolProperty;
/**
* Context name comparator.
selection = 0;
edition = null;
owner = null;
+
+ setMenuProperty("study");
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _toolProperty);
return SUCCESS;
} catch (Exception error) {
public String doSelect() {
// -------------------------
+
+ setMenuProperty("study");
+ setToolProperty("none");
+ initializationScreenContext(_menuProperty, _toolProperty);
+
Session connex = Database.getCurSession();
Transaction transax = connex.beginTransaction();
try {
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(final String menuProperty) {
+ this._menuProperty = menuProperty;
+ }
+
+ /**
+ * Get the toolProperty.
+ * @return the toolProperty
+ */
+ public String getToolProperty() {
+ return _toolProperty;
+ }
+
+ /**
+ * Set the toolProperty.
+ * @param toolProperty the toolProperty to set
+ */
+ public void setToolProperty(final String toolProperty) {
+ _toolProperty = toolProperty;
+ }
}
\ No newline at end of file
<bean id="titleBarSettings" class="org.splat.simer.TitleBarSettings"
scope="session">
</bean>
+
+ <bean id="toolBarSettings"
+ class="org.splat.simer.ToolBarSettings" scope="session">
+ </bean>
<bean id="slidMenu" scope="session" abstract="true">
<property name="projectElementService"
<property name="openKnowledge" ref="openKnowledge" />
<property name="menuBarSettings" ref="menuBarSettings" />
<property name="titleBarSettings" ref="titleBarSettings" />
+ <property name="toolBarSettings" ref="toolBarSettings" />
</bean>
<!--========= Inherited from baseAction ========= -->
<bean id="simulationContextAction"
class="org.splat.simer.admin.SimulationContextAction"
- scope="prototype">
+ scope="prototype" parent="baseAction">
<property name="knowledgeElementService"
ref="knowledgeElementService" />
<property name="searchService" ref="searchService" />