How to get your Lotus Notes calendar on your web profile?


    importPackage(java.lang);
    importPackage(java.util);

    var commonUserName = new String(@Name(“[CN]“,@UserName()));
    var mailServer = new StringBuffer();
    var mailFile = new StringBuffer();
    var mailDomain = new StringBuffer();
    var mailSystem = new StringBuffer();
    var profile = new Vector();

    var Reg:NotesRegistration = session.createRegistration();
    Reg.setRegistrationServer(@Subset(@DbName(),”1″));
    Reg.getUserInfo(commonUserName, mailServer, mailFile, mailDomain, mailSystem, profile);
    var MailFilePath = @ReplaceSubstring(mailFile,”\\”,”/”);

    var mailPath = MailFilePath + “.nsf”
    try {
    // gettting the MailServer Path from Config Documents
    var serverName = @DbLookup(@DbName(),”vwConfig”,”MailServer”,2)

    var mailDb:NotesDatabase = session.getDatabase(@Text(serverName),mailPath)

    var inboxView:NotesView = mailDb.getView(“MeetingsOnMyCalendar”) //this will all entries from the calendar

    var today:NotesDateTime = session.createDateTime(@Today())
    var dateRange = session.createDateRange()
    dateRange.setText(@Text(today.getDateOnly()) +” 12:00:00 AM – ” + @Text(today.getDateOnly())+” 11:59:59 PM”)
    var documentCollection:NotesViewEntryCollection = inboxView.getAllEntriesByKey(dateRange);

    var documentCollection1:NotesDocumentCollection = inboxView.getAllDocumentsByKey(dateRange);
    var totalDocumentCount1:Integer =  documentCollection1.getCount();

    var totalDocumentCount:Integer =  documentCollection.getCount();
    var today:NotesDateTime = session.createDateTime(@Today())

    var MeetingDetails=”";

    if(totalDocumentCount==0)
    {
    return “No Meetings for the day”
    }

    var viewEntry:NotesViewEntry = documentCollection.getFirstEntry()
    var newArr = new Array()
    for(x=0;x<totalDocumentCount;x++)
    {

    var document:NotesDocument = viewEntry.getDocument()

    var MeetingDate:NotesDateTime = session.createDateTime(@Text(document.getItemValue(“StartDateTime”)[0]))
    if(MeetingDate.getDateOnly()==today.getDateOnly()){ //This will get you the non-repeated entry – If need all entries need to try here
    var temp = @Text(document.getItemValue(“StartTime”)) + ” – ” +@Text(document.getItemValue(“EndTime”))+”      “+@Text(document.getItemValue(“Subject”))+”#”
    if(MeetingDetails == “”)
    {

    MeetingDetails = temp
    }
    else
    {

    MeetingDetails = MeetingDetails + temp

    }

    }

    viewEntry = documentCollection.getNextEntry(viewEntry)
    }
    if(MeetingDetails==”")
    {
    MeetingDetails =  “No Meeting for the day”
    }

    return MeetingDetails

    }catch(e){
    //Handle the error page
    }
All code submitted to OpenNTF XSnippets, whether submitted as a "Snippet" or in the body of a Comment, is provided under the Apache License Version 2.0. See Terms of Use for full details.
No comments yetLogin first to comment...