]> SALOME platform Git repositories - tools/siman.git/blob
Salome HOME
20830b5a9874d9a1f303c09e8b473082a297e7a8
[tools/siman.git] /
1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2     pageEncoding="ISO-8859-1"
3 %>
4 <%@
5     taglib prefix="s" uri="/struts-tags"
6 %>
7 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
8
9 <!-- Initialization of the edit action, if any
10      =============================================================================================================================
11   -->
12 <%  String              action = request.getParameter("action");   
13     String              type   = request.getParameter("index");
14     if (action == null) action = "display";
15 %>
16 <s:set var="todo"><%=action%></s:set>
17 <html>
18
19   <head>
20     <meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
21     <title><s:text name="name.module"/></title>
22     <link href=<s:url value="/skin/default.css"/> rel="stylesheet" type="text/css">
23     <link href="../rtef/rte.css" rel="stylesheet" type="text/css">
24     <script language="JavaScript" type="text/javascript" src="../rtef/lang/fr.js"></script>
25     <script language="JavaScript" type="text/javascript" src="../rtef/richtext.js"></script>
26     <script language="JavaScript" type="text/javascript" src="../rtef/xhtml.js"></script>
27     <script language="JavaScript" type="text/javascript" src="../jvs/popup.js"></script>
28     <script language="JavaScript" type="text/javascript" src="../jvs/action.js"></script>
29
30     <script language="JavaScript">
31     
32     initTextEditor();
33
34     var substitutions = new Array (
35       new RegExp("[\r\n]",'g'),   " ",                // For removing carriage returns & line feeds
36       new RegExp("<p>&nbsp;"),    "<p>",              // For removing &nbsp; of the 1st paragraph
37       new RegExp("&nbsp;</p>"),   "</p>",             // For removing &nbsp; of the 1st paragraph
38       
39       new RegExp("&eacute;",'g'), "é",
40       new RegExp("&egrave;",'g'), "è",
41       new RegExp("&ecirc;",'g'),  "ê",
42       new RegExp("&euml;",'g'),   "ë",
43       new RegExp("&agrave;",'g'), "à",
44       new RegExp("&acirc;",'g'),  "â",
45       new RegExp("&icirc;",'g'),  "î",
46       new RegExp("&iuml;",'g'),   "ï",
47       new RegExp("&ocirc;",'g'),  "ô",
48       new RegExp("&ugrave;",'g'), "ù",
49       new RegExp("&ucirc;",'g'),  "û",
50       new RegExp("&uuml;",'g'),   "ü",
51       
52       new RegExp("&ccedil;",'g'), "ç"
53     );
54     
55     function initialize (action) {
56 //  ----------------------------
57       if (action == "setContext") {
58           edit.elements[2].focus();
59       } else
60       if (action == "renameDocument") {
61         edoc.documentTitle.focus();
62       } else
63       if (action == "renameKnowledge") {
64         edit.knowledgeTitle.focus();
65       } else
66       if (action == "addKnowledge") {
67         edit.elements[1].focus();
68       } else
69       if (action != "display") {
70           edit.elements[0].focus();
71       }
72     }
73     function setValue () {
74 //  -------------------
75       var select = edit.elements[0].value;  // contextValue select input
76       if (select == "0") {                  // Creation of a new context type
77         tds = document.getElementById("select");
78         tde = document.getElementById("enter");
79         tds.style.display = "none";         // Hides the select input
80         tde.style.display = "block";        // Displays the text input
81       }
82       edit.elements[2].focus();
83     }
84     function clean (html) {
85 //  ---------------------     
86       html = trim(html);
87       for (i=0; i<substitutions.length; i = i+2) {
88         html = html.replace(substitutions[i], substitutions[i+1]);
89       }
90       return html;
91     }
92     function submitEdit () {
93 //  ----------------------     
94       updateRTEs();   // Sets the value of knowledgeValue input    
95       edit.knowledgeValue.value = clean(edit.knowledgeValue.value);
96       edit.submit();
97     }
98     </script>
99   </head>
100
101   <body onLoad="initialize('<%=action%>')">
102 <!-- Menu-bar
103      =============================================================================================================================
104   -->
105     <jsp:include page="/jsp/menubar.jsp">
106       <jsp:param name="menu" value="study" />
107     </jsp:include>
108
109 <!-- Title-bar
110      =============================================================================================================================
111   -->
112     <jsp:include page="/jsp/titlebar.jsp">
113       <jsp:param name="entity" value="study" />
114     </jsp:include>
115
116 <!-- Left pane
117      =============================================================================================================================
118   -->
119     <div id=left-pane>
120       <s:if test="%{writeAccess && userRights.canCreateDocument()}">
121         <jsp:include page="/jsp/toolbar.jsp">
122           <jsp:param name="tools" value="study" />
123         </jsp:include>
124       </s:if>
125       <s:else>
126         <jsp:include page="/jsp/toolbar.jsp">
127           <jsp:param name="tools" value="standard" />
128         </jsp:include>
129       </s:else>
130       <div id=top-spacer></div>
131       <jsp:include page="/jsp/menuitem.jsp">
132         <jsp:param name="menu" value="study" />
133       </jsp:include>
134       <jsp:include page="/jsp/studyProperties.jsp" />
135     </div>
136
137     <div id=main-pane>
138
139 <!-- Description and simulation context sections
140      =============================================================================================================================
141
142      Display of tabs
143   -->
144       <div id="tab-bar">
145       <div id="tab-description">
146           <span id="tab-front">&nbsp;&nbsp;<s:text name="title.description"/>&nbsp;&nbsp;</span>
147       </div>
148       <div id="tab-context">
149           <span id="tab-front">&nbsp;&nbsp;<s:text name="title.context"/>&nbsp;&nbsp;</span>
150       </div>
151       </div>
152
153 <!-- Display of contents
154   -->
155       <div id="article-box">
156         <table width=100% border=0 cellspacing=0 cellpadding=0>
157           <tr valign=top>
158           <td width=38%>     <!-- Must conform to the width of above tab-description -->
159             <div id="top-spacer"></div>
160             <div id=article-body class=text>
161               <jsp:include page="/jsp/readDescription.jsp">
162                 <jsp:param name="entity" value="study" />
163               </jsp:include>
164             </div>
165           </td>
166           <td width=1></td>    <!-- Trick for aligning the vertical separator with the tab -->
167           <td width=1 bgcolor=#AAAAAA></td>
168           <td>
169             <div id="top-spacer"></div>
170             <div id="article-body">
171               <s:if test="%{#todo == 'newContext' || #todo == 'selectContext' || #todo == 'setContext'}">
172                 <form name="edit" action="<%=action%>?selection=<s:property value="selection"/>" method="post">
173                   <jsp:include page="/jsp/editContext.jsp">
174                     <jsp:param name="action" value="<%=action%>" />
175                     <jsp:param name="type"   value="<%=type%>" />
176                   </jsp:include>
177                 </form>
178               </s:if>
179               <s:else>
180                 <jsp:include page="/jsp/readContext.jsp" />
181               </s:else>
182             </div>
183           </td>
184           </tr>
185         </table>
186       </div>
187
188 <!-- Knowledge elements section
189      =============================================================================================================================
190   -->
191       <s:if test="knowledges != null">
192       <div id=article-box>
193         <div id=section><s:text name="title.knowledge"/></div>
194         <div id=article-body class=text>
195           <s:if test="%{#todo == 'addKnowledge' || #todo == 'renameKnowledge' || #todo == 'editKnowledge'}">
196             <form name="edit" action="setKnowledge" method="post">
197             <jsp:include page="/jsp/editKnowledge.jsp">
198               <jsp:param name="action" value="<%=action%>" />
199               <jsp:param name="index"  value="<%=type%>" />
200             </jsp:include>
201             </form>
202           </s:if>
203           <s:else>
204             <jsp:include page="/jsp/readKnowledge.jsp">
205               <jsp:param name="entity" value="study" />
206             </jsp:include>
207           </s:else>
208         </div>
209       </div>
210       </s:if>
211
212 <!-- Documents section
213      =============================================================================================================================
214   -->
215       <s:if test="documents != null">
216       <div id=article-box>
217         <div id=section><s:text name="title.document"/></div>
218         <div id=article-body class=text>
219           <s:if test="%{writeAccess == 'true' && stepEnabled == 'true'}">
220             <form name="edoc" action="setDocument" method="post">
221             <jsp:include page="/jsp/editContents.jsp">
222               <jsp:param name="action" value="<%=action%>" />
223               <jsp:param name="index"  value="<%=type%>" />
224             </jsp:include>
225             </form>
226           </s:if>
227           <s:else>
228             <jsp:include page="/jsp/readContents.jsp">
229               <jsp:param name="entity" value="study" />
230             </jsp:include>
231           </s:else>
232         </div>
233       </div>
234
235 <!-- Comment section
236      =============================================================================================================================
237   -->
238       <s:if test="%{writeAccess == 'true' && stepEnabled == 'true'}">
239       <div id=article-box>
240         <div id=section><s:text name="title.comment"/></div>
241         <div id=article-body class=text>
242           <jsp:include page="/jsp/readComment.jsp"/>
243         </div>
244       </div>
245       </s:if>
246       </s:if>
247
248     </div>
249   </body>
250 </html>