1 <%@ page language="java" contentType="text/html; charset=ISO-8859-1"
2 pageEncoding="ISO-8859-1"
4 <%@ taglib prefix="s" uri="/struts-tags"
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.OpenStudy"%>
11 <%@ page import="org.splat.simer.KnowledgeElementFacade"%>
13 private enum Action { addKnowledge, renameKnowledge, editKnowledge };
15 // Scriptlet implementation is required for displaying HTML contents of knowledge values which does not work with Struts tags
16 Action todo = Action.valueOf(request.getParameter("action"));
17 String typenumber = request.getParameter("index");
18 OpenStudy study = (OpenStudy)session.getAttribute("study.open");
19 List<OpenObject.KnowledgeIterator> knowlist = study.getDisplayedKnowledges();
20 ResourceBundle locale = ResourceBundle.getBundle("som");
22 <s:url id="undo" namespace="/study" action="step-study"></s:url>
24 <table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
25 <input type=hidden name=knowledgeType value="<%=typenumber%>">
27 for (Iterator<OpenObject.KnowledgeIterator> knowtypes = knowlist.iterator(); knowtypes.hasNext(); ) {
28 OpenObject.KnowledgeIterator type = knowtypes.next();
31 <td width=38%><%=locale.getString("type.knowledge." + type.getType())%></td>
32 <td width=62%><s:text name="label.description"/></td>
34 <tr height=1 bgcolor=#AAAAAA><td colspan=7></td></tr>
36 List<KnowledgeElementFacade> knowelms = type.getKnowledgeElements();
37 for (Iterator<KnowledgeElementFacade> iterator = knowelms.iterator(); iterator.hasNext(); ) {
38 KnowledgeElementFacade kelm = iterator.next();
40 <tr height=20 valign=top>
45 <% if (kelm.getPresentationState().equals("open")) {
46 %> <img src="<s:url value="/skin/image.hold.gif"/>" border="none" width=18 height=12/>
47 <% }%> <table cellpadding=0 cellspacing=0 border=0>
50 if (todo == Action.renameKnowledge && kelm.getIndex().equals(typenumber)) {
52 <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
54 <td><input type=text size="35" name=knowledgeTitle value="<%=kelm.getTitle()%>"></td>
56 if (todo == Action.editKnowledge && kelm.getIndex().equals(typenumber)) {
58 <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
60 <td><%=kelm.getTitle()%></td>
63 <s:set var="path">/skin/icon.<%=kelm.getProgressState()%>.png</s:set>
64 <img src="<s:url value="%{#path}"/>" width=14 height=14 border="none" title=""/>
66 <td><%=kelm.getTitle()%></td>
75 <table cellpadding=0 cellspacing=0 border=0>
78 if (todo == Action.editKnowledge && kelm.getIndex().equals(typenumber)) {
80 <input type=hidden name=text>
81 <script language='JavaScript' type='text/javascript'>
82 <% out.print("displayTextEditor('knowledgeValue', '" + kelm.getFullValue() + "', 450, 150);");
86 %> <td background="<s:url value="/skin/image.vline.png"/>" width=20>
87 <% if (kelm.getPresentationState().equals("open")) {
88 %> <img src="<s:url value="/skin/image.hide.png"/>" border="none" width=20 height=12/>
89 <% } %> <img src="<s:url value="/skin/image.box.png"/>" border="none" title=""/>
91 <td><%=kelm.getValue()%></td>
94 <% if (kelm.getPresentationState().equals("open")) {
96 <td><img src="<s:url value="/skin/image.hline.png"/>" border="none" width=20 height=8 title=""/></td>
104 if (todo == Action.addKnowledge && type.getIndex().equals(typenumber)) {
105 %> <tr height=5><td></td></tr>
108 <table cellpadding=0 cellspacing=0 border=0>
111 <s:a href="%{undo}"><img src="<s:url value="/skin/icon.undo.png"/>" border="none" title="<s:text name="tooltip.cancel"/>" /></s:a>
113 <td><input type=text size="35" name=knowledgeTitle></td>
118 <input type=hidden name=text>
119 <script language='JavaScript' type='text/javascript'>
120 <% out.print("displayTextEditor('knowledgeValue', '<p> </p>', 450, 150);");
124 <tr height=4><td></td></tr>
127 %> <tr height=30><td></td></tr>
130 %> <tr height=30 valign=middle><td></td></tr>