dpillot 2005/11/22 17:01:54 CET
Modified files:
core/src/webapp/jsp/jahia/engines/importexport dispPickers.jsp
Log:
better layout
Revision Changes Path
1.4 +69 -45
jahia/core/src/webapp/jsp/jahia/engines/importexport/dispPickers.jsp
http://jahia.mine.nu:8080/cgi-bin/cvsweb.cgi/jahia/core/src/webapp/jsp/jahia/engines/importexport/dispPickers.jsp.diff?r1=1.3&r2=1.4&f=h
Index: dispPickers.jsp
===================================================================
RCS file:
/home/cvs/repository/jahia/core/src/webapp/jsp/jahia/engines/importexport/dispPickers.jsp,v
retrieving revision 1.3
retrieving revision 1.4
diff -u -r1.3 -r1.4
--- dispPickers.jsp 9 Nov 2005 15:31:09 -0000 1.3
+++ dispPickers.jsp 22 Nov 2005 16:01:54 -0000 1.4
@@ -16,9 +16,12 @@
* yet another new window to display some infos about Pickers.
*
* @author joe pillot
- * @version $Id: dispPickers.jsp,v 1.3 2005/11/09 15:31:09 dpillot Exp $
+ * @version $Id: dispPickers.jsp,v 1.4 2005/11/22 16:01:54 dpillot Exp $
*/
+ private static final String bundle_prefix =
"org.jahia.engines.importexport.contentpick";
+ private static final org.apache.log4j.Logger logger =
+ org.apache.log4j.Logger.getLogger("jsp.jahia.engines.engine");
/**
* to clean a list from pseudomodel artifacts
@@ -53,15 +56,16 @@
int key = o.getID();
int pageID;
int siteID = 1;
+ boolean isPage = false;
logger.debug("t:" + t);
if (o instanceof ContentContainer) {
pageID = ((ContentContainer) o).getPageID();
siteID = ((ContentContainer) o).getSiteID();
try {
List l = getChildFieldsOnly(o.getChilds(null, null, null));
- logger.debug("continue step1");
+
for (Iterator iterator1 = l.iterator();
iterator1.hasNext();) {
- logger.debug("enter step1");
+
ContentField contentField = (ContentField)
iterator1.next();
String value = contentField.getValue(null,
EntryLoadRequest.STAGED);
if (value != null && !value.trim().equals("") &&
!value.equals("<empty>")) {
@@ -72,12 +76,13 @@
break;
}
}
- logger.debug("continue step2");
+
// case the content object is text
for (Iterator iterator1 = l.iterator();
iterator1.hasNext();) {
- logger.debug("enter step2");
+
ContentField contentField = (ContentField)
iterator1.next();
if (contentField instanceof ContentSmallTextField) {
+ logger.debug("enter step2:object is smalltextField");
String value = contentField.getValue(null,
EntryLoadRequest.STAGED);
if (value != null && !value.trim().equals("") &&
!value.equals("<empty>")) {
t = value;
@@ -91,9 +96,11 @@
logger.debug("continue step3");
//looping list of childs to check page type?
for (Iterator iterator1 = l.iterator();
iterator1.hasNext();) {
- logger.debug("enter step3");
+
ContentField contentField = (ContentField)
iterator1.next();
if (contentField instanceof ContentPageField) {
+ isPage = true;
+ logger.debug("enter step3:object is Contentpage
field");
ContentPage contentPage = ((ContentPageField)
contentField).getContentPage(EntryLoadRequest.STAGED);
t = contentPage.getTitle(EntryLoadRequest.STAGED);
pageID = contentPage.getID();
@@ -102,7 +109,11 @@
break;
}
}
- r = "<a class=\"picklink \" href=\"" +
Jahia.getContextPath() + Jahia.getServletPath() + "/pid/" + pageID + "\"
target=\"_new\">" + t + "</a> (id:" + key + " on site" + siteID + ")";
+ if (!isPage) {
+ r = "<a class=\"picklink \" href=\"" +
Jahia.getContextPath() + Jahia.getServletPath() + "/pid/" + pageID + "\"
target=\"_new\">" + t + "</a> (id:" + key + " on site" + siteID + ")";
+ } else {
+ r = "<a class=\"picklink \" href=\"" +
Jahia.getContextPath() + Jahia.getServletPath() + "/pid/" + pageID + "\"
target=\"_new\">" + t + "</a> (id:" + key + " on site" + siteID + ")";
+ }
} catch (JahiaException e) {
logger.error("error", e);
@@ -115,6 +126,10 @@
return r;
}
+ /**
+ * internal method to render bundle resources
+ * @return a string empty if resource is non existent
+ */
private String getRessource(ResourceBundle bundle, String label) {
try {
@@ -125,9 +140,7 @@
}
- private static final String bundle_prefix =
"org.jahia.engines.importexport.contentpick.";
- private static final org.apache.log4j.Logger logger =
- org.apache.log4j.Logger.getLogger("jsp.jahia.engines.engine");
+
%>
<%
// to bundle html labels
@@ -142,7 +155,7 @@
//JahiaUser theUser = (JahiaUser)
session.getAttribute(ParamBean.SESSION_USER);
if (ids == null || ids.equalsIgnoreCase("")) {
ids = "1";
- render = false;
+ render = false;//inconsistent id
}
id = Integer.parseInt(ids);
@@ -166,7 +179,7 @@
%>
<html>
-<head><title><%=getRessource(bundle, "pickers.title")%></title>
+<head><title><%=getRessource(bundle, ".pickers.title")%></title>
<style type="text/css">
@@ -183,7 +196,7 @@
color: #3E77B0;
}
- td {
+ td, th {
font-size: 12px;
}
@@ -200,46 +213,54 @@
<body>
<img src="/jahia/jsp/jahia/engines/images/view_next.png" width="48"
height="48" border="0"><br>
-<TABLE cellSpacing=0 cellPadding=3 width="100%" border=0>
+<TABLE cellSpacing=1 cellPadding=3 width="100%" border=0>
<TBODY>
<TR>
<TD class="text">
<fieldset>
- <legend><%=getRessource(bundle,
".pickers.table.title")%></legend>
- <table width="100%" border="0" cellspacing="0"
cellpadding="0">
- <tr>
- <td valign="top" width="100%">
- <%
- if (pickers != null) {
- it = pickers.iterator();
- int count = 0;
- %>
- ID liste des pickers pour le picked
id:<%=id%><br>
- <%
- while (it.hasNext()) {
- logger.debug("count=" + count);
- ContentObject co = (ContentObject)
it.next();
-
- String info = getInfoDisplay(co);
-
-
- %>
- <%=count%> <%=info%><br>
- <%
- count++;
- }
- } else {
- %>
- il n' ya pas de pickers....
- <% }
- %>
+ <legend>
+ <!--%=getRessource(bundle,
".pickers.table.title")%--><%=getRessource(bundle, ".results.label")%></legend>
+ <table width="100%" border="0" cellspacing="1"
cellpadding="0">
+ <tr bgcolor="#eeeeee" valign="top">
+ <th><%=getRessource(bundle,
".results.name.label")%></th>
+ <th><%=getRessource(bundle,
".results.author.label")%></th>
+ <th><%=getRessource(bundle,
".results.contributor.label")%></th>
+ <th><%=getRessource(bundle,
".results.publishdate.label")%></th>
+ </tr>
+ <%
+ if (pickers != null) {
+ it = pickers.iterator();
+ int count = 0;
+ %>
+ ID liste des pickers pour le picked id:<%=id%><br>
+ <%
+ while (it.hasNext()) {
+ logger.debug("count=" + count);
+ ContentObject co = (ContentObject) it.next();
+
+ String info = getInfoDisplay(co);
+ String color = "#FFFFFF";
+ if (count % 2 > 0) color = "#EEFFFF";
+
+ %>
+ <tr style="background-color:<%=color%>"
onMouseOver="this.style.backgroundColor='#FFFFEE'"
+
onMouseOut="this.style.backgroundColor='<%=color%>'">
+ <td><%=info%></td>
+ <td colspan="3"></td>
+ </tr>
+ <%
+ count++;
+ }
+ } else {
+ // todo resource bundle
+ %>
+ <tr><td>il n' ya pas de pickers....</td></tr>
+ <% }
+ %>
- <br>
- </td>
- </tr>
</table>
</fieldset>
</TD></tr>
@@ -260,6 +281,9 @@
}
/**
* $Log: dispPickers.jsp,v $
+ * Revision 1.4 2005/11/22 16:01:54 dpillot
+ * better layout
+ *
* Revision 1.3 2005/11/09 15:31:09 dpillot
* npe fix
*