]> SALOME platform Git repositories - tools/siman.git/blob
Salome HOME
e8ac5aedab0d51f030d49b27c134bc57c8cdeb67
[tools/siman.git] /
1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2     pageEncoding="ISO-8859-1"
3 %>
4 <%@ taglib prefix="s" uri="/struts-tags"
5 %>
6 <%@ page import="java.util.List"%>
7 <%@ page import="java.util.Iterator"%>
8 <%@ page import="java.util.ResourceBundle"%>
9 <%@ page import="org.splat.simer.OpenObject"%>
10 <%@ page import="org.splat.simer.OpenKnowledge"%>
11 <%@ page import="org.splat.simer.KnowledgeElementFacade"%>
12 <%@ page import="org.splat.simer.DisplayBaseAction"%>
13 <%@ page import="com.opensymphony.xwork2.ActionContext"%>
14 <%@ page import="com.opensymphony.xwork2.util.ValueStack"%>
15 <%
16 //  Scriptlet implementation is required for displaying HTML contents of knowledge values which does not work with Struts tags
17     ValueStack                         stack    = ActionContext.getContext().getValueStack();
18     Object                             stacktop = stack.peek();
19     DisplayBaseAction                  action   = (DisplayBaseAction)stacktop;
20
21     String                             entitype = request.getParameter("entity");             // Study or Knowledge element
22     OpenObject                         object   = (OpenObject)session.getAttribute(entitype + ".open");
23     List<OpenObject.KnowledgeIterator> knowlist = object.getDisplayedKnowledges();
24     ResourceBundle                     locale   = ResourceBundle.getBundle("som");
25 %>
26 <s:set var="entitype"><%=entitype%></s:set>
27 <s:url id="develop" namespace="/study" action="knowledge-%{#entitype}">
28   <s:param name="action">develop</s:param>
29 </s:url>
30 <s:url id="reduce"  namespace="/study" action="knowledge-%{#entitype}">
31   <s:param name="action">reduce</s:param>
32 </s:url>
33 <s:url id="addknowledge" namespace="/study" action="add-knowledge" />
34
35 <table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
36 <%
37     String  curindex = object.getIndex().toString();
38     for (Iterator<OpenObject.KnowledgeIterator> knowtypes = knowlist.iterator(); knowtypes.hasNext(); ) {
39         OpenObject.KnowledgeIterator type = knowtypes.next();
40 %>
41   <tr height=20>
42     <td width=38%><%=locale.getString("type.knowledge." + type.getType())%></td>
43     <td width=62%><s:text name="label.description"/></td>
44   </tr>
45   <tr height=1 bgcolor=#AAAAAA><td colspan=7></td></tr>
46 <%
47       List<KnowledgeElementFacade> knowelms = type.getKnowledgeElements();
48       for (Iterator<KnowledgeElementFacade> iterator = knowelms.iterator(); iterator.hasNext(); ) {
49           KnowledgeElementFacade kelm = iterator.next();
50           if (object instanceof OpenKnowledge && kelm.getIndex().equals(curindex)) continue;
51           stack.push(kelm);
52 %>
53   <tr height=20 valign=top>
54
55 <!--    Title
56   -->
57     <td>
58 <%      if (kelm.getPresentationState().equals("open")) {
59 %>          <img src="<s:url value="/skin/image.hold.gif"/>" border="none" width=18 height=12/>
60 <%      }%> <table cellpadding=0 cellspacing=0 border=0>
61               <tr>
62                 <td width=18>
63 <%      if (action.getWriteAccess().equals("true") && !kelm.getProgressState().equals("APPROVED")) {
64 %>
65                   <s:set var="edimage">/skin/icon.ed<%=kelm.getProgressState()%>.png</s:set>
66                   <div id="popup<s:property value="%{index}"/>" style="position:absolute; display:none; top:0px; left:0px; z-index:10000;" onmouseover="javascript:_mouseOverContext=true;" onmouseout="javascript:_mouseOverContext=false;">
67                     <jsp:include page="/jsp/menupopup.jsp" />
68                   </div>
69                   <s:a href="popup%{index}">
70                     <img src="<s:url value="%{#edimage}"/>" onMouseOver=this.src="<s:url value="/skin/icon.ed.png"/>" onMouseOut=this.src="<s:url value="%{#edimage}"/>" width=14 height=14 border="none" title=""/>
71                   </s:a>
72 <%      } else {
73 %>                <s:set var="reamage">/skin/icon.<%=kelm.getProgressState()%>.png</s:set>
74                   <img src="<s:url value="%{#reamage}"/>" width=14 height=14 border="none" title=""/>
75 <%      }
76 %>              </td>
77                 <td><%=kelm.getTitle()%></td>
78               </tr>
79             </table>
80     </td>
81
82 <!--    Value
83   -->
84         <td>
85           <table cellpadding=0 cellspacing=0 border=0>
86             <tr valign=top>
87               <td background="<s:url value="/skin/image.vline.png"/>" width=20>
88                 <s:set var="knowledge"><%=kelm.getIndex()%></s:set>
89 <%      if (kelm.getPresentationState().equals("open")) {
90 %>              <img src="<s:url value="/skin/image.hide.png"/>" border="none" width=20 height=12/>                
91                 <s:a href="%{reduce}&index=%{#knowledge}"><img src="<s:url value="/skin/icon.minus.png"/>" border="none" title=""/></s:a>       
92 <%      } else {
93 %>                  <s:a href="%{develop}&index=%{#knowledge}"><img src="<s:url value="/skin/icon.plus.png"/>" border="none" title=""/></s:a>
94 <%      }
95 %>            </td>
96               <td><%=kelm.getValue()%></td>
97             </tr>
98 <%      if (kelm.getPresentationState().equals("open")) {
99 %>          <tr height=8>
100               <td><img src="<s:url value="/skin/image.hline.png"/>" border="none" width=20 height=8 title=""/></td>
101             </tr>
102 <%      }
103 %>        </table>
104         </td>
105       </tr>
106 <%
107       }
108 %>
109   <s:if test="writeAccess">
110
111 <!--    Add knowledge element button
112   -->
113     <s:set var="knowledge"><%=type.getIndex()%></s:set>
114     <tr height=20 valign=bottom>
115       <td>
116         <s:a href="%{addknowledge}?knowledgeType=%{#knowledge}">
117           <img src="<s:url value="/skin/icon.add.png"/>" onMouseOver=this.src="<s:url value="/skin/icon.addhot.png"/>" onMouseOut=this.src="<s:url value="/skin/icon.add.png"/>" border="none" title="<s:text name="tooltip.addknowledge"/>" />
118         </s:a>
119       </td>
120     </tr>
121     <tr height=10><td></td></tr>
122   </s:if><s:else>
123     <tr height=20><td></td></tr>
124   </s:else>
125 <%
126     }
127 %>
128 </table>