• Creator
    Topic
  • #3995
    rfaude
    Participant

    Hi,

    i want to display all tasks, which are not completed.

    Two Problems:


    1. I find a way to create a filter to find all tasks which are completed. But i need a filter to find all tasks which are NOT completed!

    2. How can i display all the tasks?

    My Applet:


    Sub Main(Client, GWEvent)

    dim iFilter
    dim oMessages
    dim iAllFind

    iFilter = “(TASK) AND (COMPLETED)”

    set oMessages = groupwise.account.calendar.messages.find(iFilter)

    iAllFind = oMessages.count

    msgbox iAllFind

    for i = 1 to iAllFind
    msgbox oMessages.item(i)
    next

    set oMessages = nothing

    End Sub

    Thanks for assistance

    Ralf

  • Author
    Replies
  • #6810
    Support 1
    Participant

    I recommend you look at Examples of Valid Filter Expressions. Unfortunately, Novell’s filter reference Filter Expression Syntax is not very helpful.

    The filter for all tasks is:

      iFilter = "(TASK)"

    The filter for all uncompleted tasks is:

      iFilter = "(TASK AND NOT COMPLETED)"

    You can display tasks in one of the following user interfaces:

    • a Formativ dialog (use a ListBoxControl, TabListBoxControl or StringGridControl);
    • a HTML dialog, for which you build the HTML dynamically;
    • a HTML portal, for which you build the HTML dynamically.

    I hope this helps.

    Advansys Support

    [This message was edited by Support 3 on December 11, 2003 at 03:15 PM.]

    #6807
    rfaude
    Participant

    Hi,

    >I recommend you look at Examples of Valid Filter Expressions. Unfortunately, Novell’s filter reference Filter Expression Syntax is not very helpful.

    I do this, but i cannot find a sample for this issue. Your are right with “is not very helpful”

    >iFilter = “(TASK AND NOT COMPLETED)”
    This works fine!

    >You can display tasks in one of the following user interfaces:
    >a Formativ dialog (use a ListBoxControl, TabListBoxControl or StringGridControl);
    >a HTML dialog, for which you build the HTML dynamically;
    >a HTML portal, for which you build the HTML dynamically.
    The final is to display the item as a HTML Portal. But first i tried

    set oMessages = groupwise.account.calendar.messages.find(iFilter)
    iAllFind = oMessages.count
    msgbox iAllFind
    for i = 1 to iAllFind
    msgbox oMessages.item(i)
    next

    It applies the filter, count correct, Show the number of items,
    but the loop doesn’t work.

    How can i access and display the subject of each item in the loop.

    Thanks.

    Ralf

    #6812
    Support 1
    Participant

    To access the subjects of messages via the GroupWise Object API, use something like the following code sample:

    Sub Main(Client, GWEvent)
    
      dim iFilter
      dim oMessage
      dim oMessages
    
      iFilter = "(TASK AND NOT COMPLETED)"
    
      set oMessages = Groupwise.Account.Calendar.Messages.Find(iFilter)
    
      msgbox oMessages.Count
    
      ' The two following FOR statements are equivalent.
      for i = 1 to oMessages.Count
        msgbox oMessages.Item(i).Subject
      next
    
      'for each oMessage in oMessages
      '  msgbox oMessage.Subject
      'next
    
      set oMessage = nothing 
      set oMessages = nothing 
    
    End Sub

    On choosing an appropriate user interface, note the significant difference between the HTML dialog and HTML portal. The dialog is modal while the portal is modeless. Be sure to read through the Formativ Programmer’s Guide, on the Portal Manager and/or HTML Dialogs. I suggest you study some example applets that use the Formativ Portal, and that generate HTML to be loaded into a Portal. A good one to start with is the Formativ Applet: Print Message. I hope this helps.

    Advansys Support

    #6813
    rfaude
    Participant

    Thanks a lot!

    Yes i read the differences and i prefer the Portal to display my Tasklist.

    Thanks for the Link to the other Applet.

    Best Regards

    Ralf

    #6811
    Support 1a
    Participant

    No problems. Please let us know if you require any further assistance.

    Advansys Support

    #6805
    rfaude
    Participant

    Ok, you say

    >Please let us know if you require any further assistance
    Yes, yes i need!

    i collect all infos to put the output into a portal.

    ———————————————%————————————————

    Const LINK_START  = "<A HREF="
    Const UID_MARKER  = "UID:"
    Const TABLE_BEGIN = "<table border=""1"" cellpadding=""0"" cellspacing=""1"">"
    Const TABLE_END   = "</table>"
    Const FONT_STYLE  = "<FONT STYLE=""TEXT-DECORATION:NONE;FONT-FAMILY:ARIAL;COLOR:RED;FONT-SIZE=8PT"">"
    Const FONT_END    = "</FONT>"
    
    Sub Main(Client, GWEvent)
    
    Dim iHRT 
    Dim iMsg 
    Dim iPortal 
    Dim iPortals 
    Dim iHTML 
    dim iFilter
    dim oMessages
    
    iHRT = Chr(13) & Chr(10) 
    
    Set iPortals = GroupWise.PortalManager.Portals 
    Set iPortal = iPortals.Item("TaskManager") 
    
    if iPortal is nothing then 
       Set iPortal = iPortals.add 
       iPortal.ID = "TaskManager" 
       iPortal.OpenMessages = TRUE 
       iPortal.NavigationControlsEnabled = FALSE 
    end if 
    
    iHTML = TABLE_BEGIN & "<tr><th>Prio</th><th align=""left"">Subject</th></tr>"
       
       iFilter = "(TASK AND NOT COMPLETED)"
       
       set oMessages = groupwise.account.calendar.messages.find(iFilter)
    
       for i = 1 to oMessages.count
          iHTML = iHTML & iHRT & "<tr><td align=""center"">" & _
            FONT_STYLE & oMessages.Item(i).TaskPriority & FONT_END & "</td><td>" & _
            FONT_STYLE & " " & "<A HREF=UID:" & oMessages.Item(i).MessageID & _
            " STYLE=""TEXT-DECORATION:NONE"">" & oMessages.Item(i).Subject & "</A>" & _
            FONT_END & "</td></tr>"
       next
     
       set oMessages = nothing    
    
    iHTML = iHTML & TABLE_END
    
    iPortal.HTML = "<HTML><BODY>" & iHTML & "</BODY></HTML>" 
    iPortal.Show 
    iPortals.ActivePortal = iPortal.ID 
    
    

    ———————————————%————————————————

    Question:

    How to sort the column.

    Sample:
    – Sort by Prio
    – Sort by Subject
    – Sort by Prio & Subject

    i read about the Stringlist and look into the Sample Applet. With a single string i understand the way it works. But with MessageID & Prio & Subject i don’t know.

    Best Regards

    Ralf

    [This message was edited by rfaude on December 17, 2003 at 01:28 PM.]

    [This message was edited by Support 3 on December 17, 2003 at 04:33 PM.]

    #6806
    Support 1
    Participant

    The following version of your Portal code takes advantage of a DHTML component that you can download from here. To work with this applet, copy the file into your common Application Data folder, eg. C:Documents and SettingsAll UsersApplication Data.

    For more information about this, see the article Fun with Tables.

    I have used the _ operator to shorten source code lines in the VBScript code, to make it more readable.

    In the HTML table, I have added tags

    <thead>

    ,

    <tbody>

    and replaced the tag

    <th>

    by

    <td>

    in order to make the DHTML Behavior work.

    Notice the Portal property .HTML is no longer used; .URL is used instead. I have done this to make the DHTML Behavior work correctly. You could still use the .HTML property, which requires embedding the JavaScript in the DHTML component into your source HTML – therefore also into your applet source code.

    '-------------------------------------------------------------------------------
    Const LINK_START  = "<A HREF="
    Const UID_MARKER  = "UID:"
    Const TABLE_END   = "</table>"
    Const FONT_STYLE  = "<FONT STYLE=""TEXT-DECORATION:NONE;FONT-FAMILY:ARIAL;COLOR:RED;FONT-SIZE=8PT"">"
    Const FONT_END    = "</FONT>"
    
    Sub Main(Client, GWEvent)
    
      Dim iTABLE_BEGIN
      Dim iHRT
      Dim iMsg
      Dim iPortal
      Dim iPortals
      Dim iHTML
      dim iFilter
      dim iFileName
      dim oFileSystem
      dim oMessage
      dim oMessages
    
      iHRT = Chr(13) & Chr(10)
    
      Set iPortals = GroupWise.PortalManager.Portals
      Set iPortal = iPortals.Item("TaskManager")
    
      if iPortal is nothing then
         Set iPortal = iPortals.add
         iPortal.ID = "TaskManager"
         iPortal.OpenMessages = TRUE
         iPortal.NavigationControlsEnabled = FALSE
      end if
    
      iTABLE_BEGIN = "<table style=""behavior:url(sort.htc);"" border=""1"" cellpadding=""0"" cellspacing=""1"">"
      iHTML = iTABLE_BEGIN & "<thead><tr><td>Prio</td><td align=""left"">Subject</td></tr></thead>"
      iHTML = iHTML & iHRT & "<tbody>"
    
         iFilter = "(TASK AND NOT COMPLETED)"
    
         set oMessages = groupwise.account.calendar.messages.find(iFilter)
    
         for each oMessage in oMessages
            iHTML = iHTML & iHRT & "<tr><td align=""center"">" & _
              FONT_STYLE & oMessage.TaskPriority & FONT_END & "</td><td>" & _
              FONT_STYLE & " " & "<A HREF=UID:" & oMessage.MessageID & _
              " STYLE=""TEXT-DECORATION:NONE"">" & oMessage.Subject & "</A>" & _
              FONT_END & "</td></tr>"
         next
    
         set oMessages = nothing
    
      iHTML = iHTML & "</tbody>" & TABLE_END
      iHTML = "<HTML><BODY>" & iHTML & "</BODY></HTML>"
    
      set oFileSystem = Utilities.FileSystem
      call oFileSystem.CopyFile(oFileSystem.PathCommonAppData & "sort.htc", _
        Utilities.TempFiles & "sort.htc", true)
      set oFileSystem = nothing
    
      iFileName = Utilities.TempFiles & "sort.htm"
      call Utilities.SaveStringToFile(iHTML, iFileName, true)
      iPortal.URL = iFileName
      iPortal.Show
      iPortals.ActivePortal = iPortal.ID
    
    End Sub

    You can modify the JavaScript in the DHTML component to suit your needs, eg. sort by more than one table column.

    I hope this helps.

    Advansys Support

    #6808
    rfaude
    Participant

    Yes the sample on the mickysoft site looks like what i want. But now i need time to learn how it works, because the “sort.htc” is not easy to understand, or do you have a simple sample?

    Thanks

    Ralf

    #6809
    Support 1
    Participant

    We do not have a sample of JavaScript that improves on sort.htc.

    Another way to do this is to sort the tasks in the applet VBScript, rather than using dynamic HTML. You could use a StringList, which has a .Sorted property. In this case, add task data to the .Strings and .Objects properties as follows:

    Sort by        | String               | Object
    -------------------------------------------------
    Prio           | .Priority            | .Subject
    Subject        | .Subject             | .Priority
    Prio & Subject | .Priority + .Subject |

    Once the StringList is filled, simply use it as your source data for the HTML table.

    This approach is less interactive than DHTML; it requires re-executing the applet to see the tasks sorted in a different order.

    Advansys Support

Viewing 9 replies - 1 through 9 (of 9 total)
  • You must be logged in to reply to this topic.