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.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"%>
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;
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");
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>
30 <s:url id="reduce" namespace="/study" action="knowledge-%{#entitype}">
31 <s:param name="action">reduce</s:param>
33 <s:url id="addknowledge" namespace="/study" action="add-knowledge" />
35 <table width=100% cellpadding=0 cellspacing=0 border=0 class=text>
37 String curindex = object.getIndex().toString();
38 for (Iterator<OpenObject.KnowledgeIterator> knowtypes = knowlist.iterator(); knowtypes.hasNext(); ) {
39 OpenObject.KnowledgeIterator type = knowtypes.next();
42 <td width=38%><%=locale.getString("type.knowledge." + type.getType())%></td>
43 <td width=62%><s:text name="label.description"/></td>
45 <tr height=1 bgcolor=#AAAAAA><td colspan=7></td></tr>
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;
53 <tr height=20 valign=top>
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>
63 <% if (action.getWriteAccess().equals("true") && !kelm.getProgressState().equals("APPROVED")) {
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" />
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=""/>
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=""/>
77 <td><%=kelm.getTitle()%></td>
85 <table cellpadding=0 cellspacing=0 border=0>
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>
93 %> <s:a href="%{develop}&index=%{#knowledge}"><img src="<s:url value="/skin/icon.plus.png"/>" border="none" title=""/></s:a>
96 <td><%=kelm.getValue()%></td>
98 <% if (kelm.getPresentationState().equals("open")) {
100 <td><img src="<s:url value="/skin/image.hline.png"/>" border="none" width=20 height=8 title=""/></td>
109 <s:if test="writeAccess">
111 <!-- Add knowledge element button
113 <s:set var="knowledge"><%=type.getIndex()%></s:set>
114 <tr height=20 valign=bottom>
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"/>" />
121 <tr height=10><td></td></tr>
123 <tr height=20><td></td></tr>