2017-02-28 5 views
0

2014年2月23日から03/01に予定されているLotus Dominoカレンダー(バージョン8.5.1)に予定が「終日」あります。/2017。私はNCSO.jarにを使用して、私は、このようにロータスドミノからこの予定を取得しよう:Lotus Dominoカレンダー(バージョン8.5.1)の予定を「終日」に返す

lotus.domino.Session s = null; 
s = DominoSessionInfo.sessionInfo.getSession(); 
lotus.domino.Database maildb = getMailDb(sessionInfo); 
lotus.domino.DateRange dr = s.createDateRange(startDate, endDate); 
lotus.domino.View calview = maildb.getView("($Calendar)"); 
lotus.domino.ViewEntryCollection docColl = calview.getAllEntriesByKey(dr); 

public static lotus.domino.Database getMailDb(DominoSessionInfo sessionInfo) throws NotesException, NamingException{ 

lotus.domino.Session s = DominoSessionInfo.sessionInfo.getSession(); 
log.info("Open DB on: " + s.getServerName() + " with mail server *" + 
     sessionInfo.getProfileInfo().getMailServer() + "* and mail file *" + 
     sessionInfo.getProfileInfo().getMailFile()); 
    lotus.domino.Database maildb = s.getDatabase(sessionInfo.getProfileInfo().getMailServer(), 
     sessionInfo.getProfileInfo().getMailFile()); 
if (! maildb.isOpen()){ 
    maildb.open(); 
} 
return maildb; 
} 

とするとdr.getText():2017年2月27日12時00分: 00:00 CET - 03/06/2017 12:00:00 CET(startDate:02/27/2017 12:00:00 CETとend​​Date:03/06/2017 12:00:00 CET)このコードdr.getText():02/20/2017 12:00:00 CET - 02/27/2017 12:00:00 CET(すなわちstartDate:02/20/2017 12:00) 00:00 CETおよびendDate:02/27/2017 12:00:00 CET)このコードはこの予定を返します。

startDateとendDateの値がそれぞれ02/27/2017 12:00:00 CETと03/06/2017 12:00:00の場合、この予定を返すためにコードを変更するにはどうすればよいですかAM CET?

ありがとうございます。

画像:Appointment Lotus Notes screenshoot

+0

予定のドキュメントのCalendarDateTimeアイテムの値を調べ、時間コンポーネントが何であるか確認しましたか? –

+0

こんにちはRichard、予定内のCalendarDateTimeアイテムの値は次のとおりです。 doc.getItemValue( "CalendarDateTime"):[02/23/2017 12:00:00 CET] – Edoardo

+0

CalendarDateTimeには1つの値しかありませんか? 2/23から3/1に毎日表示されるリストはありませんか? –

答えて

0

最後に、私はこの問題を解決することができました!代わりに、このコードで:

lotus.domino.DateRange dr = s.createDateRange(startDate, endDate); 
lotus.domino.View calview = maildb.getView("($Calendar)"); 
lotus.domino.ViewEntryCollection docColl = calview.getAllEntriesByKey(dr); 

私はこれを使用:

String strDateFormat; 
// Get the date separator used on the Domino server, e.g./or - 
String dateSep = s.getInternational().getDateSep(); 
// Determine if the server date format is DMY, YMD, or MDY 
if (s.getInternational().isDateDMY()) { 
    strDateFormat = "dd" + dateSep + "MM" + dateSep + "yyyy";     
} 
else if (s.getInternational().isDateYMD()) { 
    strDateFormat = "yyyy" + dateSep + "MM" + dateSep + "dd"; 
} 
else { 
    strDateFormat = "MM" + dateSep + "dd" + dateSep + "yyyy"; 
} 
DateFormat dateFormat = new SimpleDateFormat(strDateFormat); 

String calendarQuery = "SELECT (@IsAvailable(CalendarDateTime) & @IsAvailable(EndDateTime) & (@Explode(CalendarDateTime) *<= @Explode(@TextToTime(\"" + dateFormat.format(endDate) + "\"))) (@Explode(EndDateTime) *>= @Explode(@TextToTime(\"" + dateFormat.format(startDate) + "\"))))"; 

lotus.domino.DocumentCollection queryResults = maildb.search(calendarQuery); 

はそうと、私は3月1日に2017年2月23日から計画(「終日」の予定を返すことができました/ 2017年)に、予定が予定されている少なくとも1日を含む任意の時間間隔で実行されます。

関連する問題