1、login the openKM system, cilck the search panel
2、select the start date 2010-08-01,and the end date 2010-10-02,then click the search button
3、openkm the log file "server.log",
2010-10-04 16:31:09,187 DEBUG [com.openkm.module.direct.DirectSearchModule] prepareStatement: /jcr:root/okm:root//*[@jcr:primaryType eq 'okm:void' or (@jcr:primaryType eq 'okm:document' and (@okm:content/jcr:lastModified >= xs:dateTime('2010-10-01T00:00:00.000+08:00') and @okm:content/jcr:lastModified <= xs:dateTime('2010-10-02T00:00:00.000+08:00')))] order by @jcr:score descending
you will find the date changed!
=============solution=====================
1.open the source file com.openkm.frontend.client.widget.searchin.SearchIn.java
2.goto line 130
2、select the start date 2010-08-01,and the end date 2010-10-02,then click the search button
3、openkm the log file "server.log",
2010-10-04 16:31:09,187 DEBUG [com.openkm.module.direct.DirectSearchModule] prepareStatement: /jcr:root/okm:root//*[@jcr:primaryType eq 'okm:void' or (@jcr:primaryType eq 'okm:document' and (@okm:content/jcr:lastModified >= xs:dateTime('2010-10-01T00:00:00.000+08:00') and @okm:content/jcr:lastModified <= xs:dateTime('2010-10-02T00:00:00.000+08:00')))] order by @jcr:score descending
you will find the date changed!
=============solution=====================
1.open the source file com.openkm.frontend.client.widget.searchin.SearchIn.java
2.goto line 130
Code: Select all
change to
private Date modifyDateFrom;
private Date modifyDateTo;
Code: Select all
private Date modifyDateFrom;
private Date modifyDateTo;
private long modifyDateFromLong;
private long modifyDateToLong;
Code: Select all
change to calendar.addChangeHandler(new ChangeHandler(){
@Override
public void onChange(ChangeEvent event) {
calendarPopup.hide();
DateTimeFormat dtf = DateTimeFormat.getFormat(Main.i18n("general.day.pattern"));
switch (calendarFired) {
case CALENDAR_FIRED_START:
startDate.setText(dtf.format(calendar.getDate()));
modifyDateFrom = calendar.getDate();
break;
case CALENDAR_FIRED_END:
endDate.setText(dtf.format(calendar.getDate()));
modifyDateTo = calendar.getDate();
break;
}
calendarFired = CALENDAR_FIRED_NONE;
evaluateSearchButtonVisible();
}
});
Code: Select all
calendar.addChangeHandler(new ChangeHandler(){
@Override
public void onChange(ChangeEvent event) {
calendarPopup.hide();
DateTimeFormat dtf = DateTimeFormat.getFormat(Main.i18n("general.day.pattern"));
switch (calendarFired) {
case CALENDAR_FIRED_START:
startDate.setText(dtf.format(calendar.getDate()));
modifyDateFrom = calendar.getDate();
modifyDateFromLong = calendar.getDate().getTime();
Log.debug("modifyDateFrom="+modifyDateFrom+"||modifyDateFromLong="+modifyDateFromLong);
break;
case CALENDAR_FIRED_END:
endDate.setText(dtf.format(calendar.getDate()));
modifyDateTo = calendar.getDate();
modifyDateToLong = calendar.getDate().getTime();
Log.debug("modifyDateTo="+modifyDateTo+"||modifyDateToLong="+modifyDateToLong);
break;
}
calendarFired = CALENDAR_FIRED_NONE;
evaluateSearchButtonVisible();
}
});
Code: Select all
change to if (modifyDateFrom!=null && modifyDateTo!=null) {
gwtParams.setLastModifiedFrom(modifyDateFrom);
gwtParams.setLastModifiedTo(modifyDateTo);
} else {
gwtParams.setLastModifiedFrom(null);
gwtParams.setLastModifiedTo(null);
}
Code: Select all
if (modifyDateFrom!=null && modifyDateTo!=null) {
// gwtParams.setLastModifiedFrom(modifyDateFrom); //fixed by wangmj
// gwtParams.setLastModifiedTo(modifyDateTo);
gwtParams.setLastModifiedFrom(new Date(modifyDateFromLong));
gwtParams.setLastModifiedTo(new Date(modifyDateToLong));
} else {
gwtParams.setLastModifiedFrom(null);
gwtParams.setLastModifiedTo(null);
}