dpillot 2005/10/05 10:36:54 CEST
Modified files:
core/src/webapp/jsp/jahia/engines/importexport contentpick.jsp
Log:
order interface changes
Revision Changes Path
1.19 +81 -28
jahia/core/src/webapp/jsp/jahia/engines/importexport/contentpick.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/jsp/jahia/engines/importexport/contentpick.jsp.diff?r1=1.18&r2=1.19&f=h
Index: contentpick.jsp
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/webapp/jsp/jahia/engines/importexport/contentpick.jsp,v
retrieving revision 1.18
retrieving revision 1.19
diff -u -r1.18 -r1.19
--- contentpick.jsp 4 Oct 2005 09:24:12 -0000 1.18
+++ contentpick.jsp 5 Oct 2005 08:36:53 -0000 1.19
@@ -9,11 +9,13 @@
<%@ page import="java.util.Vector" %>
<%@ page import="org.jahia.services.containers.ContentContainer" %>
<%@ page import="org.apache.log4j.Logger"%>
+<%@ page import="org.jahia.exceptions.JahiaException"%>
+<%@ page import="java.text.SimpleDateFormat"%>
<%@ taglib uri="/WEB-INF/etc/taglibs/pager-taglib" prefix="pg" %>
<%@ taglib uri="JahiaLib" prefix="jahia" %>
<%
/**
- * @version $Id: contentpick.jsp,v 1.18 2005/10/04 09:24:12 dpillot Exp $
+ * @version $Id: contentpick.jsp,v 1.19 2005/10/05 08:36:53 dpillot Exp $
*/
HashMap engineMap = (HashMap)
request.getAttribute("org.jahia.engines.EngineHashMap");
@@ -26,7 +28,7 @@
// server path
String
serverpath="http://"+request.getServerName()+":"+request.getServerPort();
String searchsite=(String) engineMap.get("searchSite");
- Logger logger=Logger.getLogger(this.getClass());
+
%>
<!-- css specific for contentpicker -->
<style type="text/css">
@@ -62,10 +64,12 @@
<div class="menuwrapper"><!-- menuwrapper-->
<div class="content"><!-- content -->
<div id="editor"><!--editor-->
+<!-- debug
sort by <%=orderBy%><br/>
screen <%=theScreen%><br/>
<%=serverpath%>
<%=sitecount%>
+-->
<script type="text/javascript">
function orderby(param) {
@@ -88,8 +92,9 @@
if (keycode == 13)
{
+ //document.mainForm.screen.value = "contentPick";
handleActionChange('contentPick');
- return false;
+ //return false;
}
else
return true;
@@ -127,33 +132,37 @@
height="16"
border="0"></a>
<!-- query -->
- <INPUT name="query" size=50
value="<%=engineMap.get("searchString")%>"/>
- <%=searchsite%>
+ <INPUT name="query" size=50
value="<%=engineMap.get("searchString")%>"
onkeypress="submitenter(this,window.event)"/>
+
<%
int count = 0;
Enumeration enum = (Enumeration) engineMap.get("sites");
if(sitecount>1){
// looping on all sites
%>
- <%=enum%>
+
<select name="searchSite">
<%
-
+ String isSelected="";
while (enum.hasMoreElements()) {
JahiaSite jahiaSite = (JahiaSite) enum.nextElement();
+ String id=""+jahiaSite.getID();
+ String key=""+jahiaSite.getSiteKey();
+ if(searchsite.equalsIgnoreCase(id))
isSelected="selected=selected";
+ else isSelected="";
count++;
%>
- <option value="<%= jahiaSite.getID() %>"><%=
jahiaSite.getSiteKey()%></option>
-
+ <option value="<%=id%>" <%=isSelected%>><%=key%></option>
<%
- }
- //end looping
+ }//end looping
+ if(searchsite.equalsIgnoreCase("all"))
isSelected="selected=selected";
%>
- <option value="all">all</option>
+ <option value="all" <%=isSelected%>>all</option>
</select>
<%
} else {
- JahiaSite jahiaSite = (JahiaSite) enum.nextElement();
+ // one site only
+ JahiaSite jahiaSite = (JahiaSite) enum.nextElement();
%>
on site <b><%=jahiaSite.getSiteKey() %></b>
<input type="hidden" name="searchSite"
value="<%=jahiaSite.getID() %>"/>
@@ -212,16 +221,46 @@
%>
<table border="0" cellspacing="0"
cellpadding="4" width="100%">
<tr>
- <th class="text">teaser</th>
- <th class="text"><a
href="javascript:orderby('creator');">creator</a></th>
- <th class="text"><a
href="javascript:orderby('lastcontributor');">last
- contributor</a></th>
- <th class="text">localisation</th>
+ <th class="text">
+ <% if
(orderBy.equalsIgnoreCase("score")) { %>
+ nom
+ <% } else { %>
+ <a
href="javascript:orderby('score');">nom</a>
+ <% } %>
+ </th>
+ <th class="text">
+ <% if
(orderBy.equalsIgnoreCase("creator")) { %>
+ creator
+ <% } else { %>
+ <a
href="javascript:orderby('creator');">creator</a>
+ <% } %>
+ </th>
+ <th class="text">
+ <% if
(orderBy.equalsIgnoreCase("lastcontributor")) { %>
+ last contributor
+ <% } else { %>
+ <a
href="javascript:orderby('lastcontributor');">last
+ contributor</a>
+ <% } %>
+ </th>
+ <th class="text">usage</th>
<!--th class="text">score</th-->
- <th class="text"><a
href="javascript:orderby('creationdate');">creation date</a>
+ <th class="text">
+ <% if
(orderBy.equalsIgnoreCase("creationdate")) { %>
+ creation date
+ <% } else { %>
+ <a
href="javascript:orderby('creationdate');">creation date</a>
+ <% } %>
</th>
- <th class="text"><a
href="javascript:orderby('lastpublishdate');">last publish
- date</a></th>
+ <th class="text">
+ <% if
(orderBy.equalsIgnoreCase("lastpublishdate")) { %>
+ last publish
+ date
+ <% } else { %>
+ <a
href="javascript:orderby('lastpublishdate');">last publish
+ date</a>
+ <% } %>
+ </th>
<th
class="text"><center>Copy</center></th>
<th class="text"><center>Linked
Copy</center></th>
</tr>
@@ -231,17 +270,28 @@
for (int i = 0; i < totalHits; i++) {
JahiaSearchHit thisHit =
(JahiaSearchHit) sr.results().get(i);
+ String url="#";
+ if(thisHit.getTeaser()!=null &&
!thisHit.getTeaser().equalsIgnoreCase("")){
+ url=serverpath+thisHit.getURL();
+ }
+ String sitekey=null;
+ int pickers=0;
+ try {
+ sitekey =
ServicesRegistry.getInstance().getJahiaSitesService().getSite(thisHit.getPage().getJahiaID()).getSiteKey();
+ pickers =
ContentContainer.getContainer(Integer.parseInt(thisHit.getId())).getPickerObjects().size();
+ } catch (JahiaException e) {
+ e.printStackTrace(); //To
change body of catch statement use File | Settings | File Templates.
+ }
+ SimpleDateFormat df=new
SimpleDateFormat("",request.getLocale());
+
+
%>
<tr>
- <td class="text"><a
href="javascript:viewDoc('<%=serverpath%><%=thisHit.getURL()%>')"><b><%=thisHit.getTeaser()%></b></a>
+ <td class="text"><a
href="javascript:viewDoc('<%=url%>')" alt="<%=thisHit.getId()%> in
<%=sitekey%>"><b><%=thisHit.getTeaser()%></b></a>
</td>
<td
class="text"><%=thisHit.getParsedObject().getValue("creator")%></td>
<td
class="text"><%=thisHit.getParsedObject().getValue("lastcontributor")%></td>
- <td class="text">(container
<%=thisHit.getId()%>
-
usage[<%=ContentContainer.getContainer(Integer.parseInt(thisHit.getId())).getPickerObjects().size()%>
- ]
- in
<%=ServicesRegistry.getInstance().getJahiaSitesService().getSite(thisHit.getPage().getJahiaID()).getSiteKey()%>
- )</td>
+ <td class="text"><%=pickers%></td>
<!--td class="text">score :
<%=thisHit.getScore()%></td-->
<td class="text">
<% if
(thisHit.getParsedObject().getValue("creationdate") != null
@@ -296,9 +346,12 @@
<div class="clearing"> <!--clearing--></div>
-</div>
+</div><!-- end menu wrapper part -->
<% /**
* $Log: contentpick.jsp,v $
+ * Revision 1.19 2005/10/05 08:36:53 dpillot
+ * order interface changes
+ *
* Revision 1.18 2005/10/04 09:24:12 dpillot
* bug fix
*