<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML><HEAD>
<META http-equiv=Content-Type content="text/html; charset=us-ascii">
<META content="MSHTML 6.00.6000.16981" name=GENERATOR></HEAD>
<BODY>
<DIV><FONT face=Arial size=2><SPAN class=706325713-05022010>Hi
</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=706325713-05022010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=706325713-05022010>I'm using
org.opencms.file.collectors.CmsTimeFrameCategoryCollector for the first time,
and I </SPAN></FONT><FONT face=Arial size=2><SPAN class=706325713-05022010>don't
know if there's a bug in this file, or if I'm just
doing something terribly wrong. No matter what time range I define, all
resources in the given folder is returned by the collector. Basically, I
can just as well leave out the timeStart and timeEnd parts of the
collector parameter, as they do not influence the result in any
way(!).</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=706325713-05022010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=706325713-05022010>Any ideas why this
is happening?</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=706325713-05022010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=706325713-05022010>My development
system is the 7.5.1 release version. To avoid misunderstandings, and so
you'll be able to test for yourselves, I'm attaching my JSP test code (in
order for this particular JSP to work, place it in the same folder as
your timestamped resources):</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=706325713-05022010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=706325713-05022010><%@ page
import="org.opencms.jsp.*,<BR>java.util.*,<BR>java.text.SimpleDateFormat,<BR>org.opencms.file.*,<BR>org.opencms.file.collectors.*,<BR>org.opencms.relations.*"
session="false" </SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=706325713-05022010>%><%<BR></SPAN></FONT><FONT><SPAN
class=706325713-05022010><FONT face=Arial size=2>CmsJspXmlContentBean cms = new
CmsJspActionElement(pageContext, request, response);</FONT></SPAN></FONT></DIV>
<DIV><FONT><SPAN class=706325713-05022010><FONT face=Arial
size=2></FONT> </DIV>
<DIV><SPAN class=706325713-05022010></SPAN><FONT face=Arial size=2>/<SPAN
class=706325713-05022010>/ Make the appropriate adjustments to the variables
below</SPAN><BR>String start = "2010-02-07 12:00:00";<BR>String end =
"2010-02-09 12:00:00";<BR>String timeProp = "collector.date";<BR>String
resType = "my_event";</FONT></DIV>
<DIV><SPAN class=706325713-05022010><FONT face=Arial size=2>String listFolder =
cms.getRequestContext().getFolderUri(); // default setting: look inside this
JSP's parent folder</FONT></SPAN></DIV>
<DIV><SPAN class=706325713-05022010><FONT face=Arial size=2>// No need to change
anything below this line</FONT></SPAN></DIV>
<DIV><FONT face=Arial size=2></FONT> </DIV>
<DIV><FONT face=Arial size=2></FONT></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=706325713-05022010>SimpleDateFormat df
= new SimpleDateFormat("yyyy-MM-dd HH:mm:ss");<BR>Date startDate =
df.parse(start);<BR>Date endDate = df.parse(end);</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=706325713-05022010>out.println("<h2>Time range
parameters:</h2>");<BR>out.println("<p>Start set to: " +
df.format(startDate) + "<br/>");<BR>out.println("End set to: " +
df.format(endDate) + "<br/>");<BR>out.println("Time property set to: " +
timeProp + "<br/>");</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN class=706325713-05022010>out.println("List
folder set to: " + listFolder + "<br/>");<BR>out.println("Resource type
set to: " + resType + "</p>");</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=706325713-05022010>String
collectorParam = "resource=" + listFolder;<BR>collectorParam +=
"|resourceType=np_event";<BR>collectorParam += "|timeStart=" +
start;<BR>collectorParam += "|timeEnd=" + end;<BR>collectorParam +=
"|collectorTime=" + timeProp;<BR>collectorParam +=
"|sortDescending=true";<BR>collectorParam +=
"|resultLimit=100";</SPAN></FONT></DIV>
<DIV> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=706325713-05022010>I_CmsXmlContentContainer xmlEvents =
cms.contentload("timeFrameAndCategories", collectorParam,
false);<BR>out.println("<h2>Resources collected for this time
range:</h2>");<BR>out.println("<ul>");<BR>while
(xmlEvents.hasMoreContent()) {<BR> String filename =
cms.contentshow(xmlEvents, "%(opencms.filename)");<BR> String
timePropValue = cms.getCmsObject().readPropertyObject(filename, timeProp,
false).getValue();<BR> Date timestamp = new
Date(Long.valueOf(timePropValue).longValue());<BR>
out.print("<li><code>" + filename + "</code>: timestamp is
<strong>" + df.format(timestamp) + "</strong> –
");<BR> out.print("this is <em>" +
(timestamp.after(startDate) ? "after" : "before") + "</em> the time range
start");<BR> //out.print(" [" + timestamp.getTime() +
(timestamp.getTime() > startDate.getTime() ? " > " : " < ") +
startDate.getTime() + "]"); // Remove comment to print timestamp
long comparisons<BR> out.print(" and <em>" +
(timestamp.after(endDate) ? "after" : "before") + "</em> the time range
end");<BR> //out.print(" [" + timestamp.getTime() +
(timestamp.getTime() > endDate.getTime() ? " > " : " < ") +
endDate.getTime() + "]"); // Remove comment to print timestamp
long comparisons<BR>
out.print("</li>");<BR>}<BR>out.println("</ul>");</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=706325713-05022010>%></SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=706325713-05022010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN class=706325713-05022010>Best
regards,</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=706325713-05022010>Paul</SPAN></FONT></DIV>
<DIV><FONT face=Arial size=2><SPAN
class=706325713-05022010></SPAN></FONT> </DIV>
<DIV><FONT face=Arial size=2><SPAN
class=706325713-05022010></SPAN></FONT> </DIV></BODY></HTML>