Forum Replies Created

Viewing 6 replies - 1 through 6 (of 6 total)
  • Author
    Replies
  • dfischer
    Participant

      Hello Support,

      very good News: Today I have launched an internal Test for our Applet at the IT department and it seems to be stable now.

      It was very difficult in the end to handle all the changes of GroupWise 2014 concerning HTML structure with our Applet. To be honest I am a Little bit bugged out about these changes now. The idea of the new div containers with classnames like GroupWiseMessageBody or GroupWiseReplyHeader is nice and helpful but the implementation in the different use cases seems to be defective or at least sloppy. I don´t know if you have contact to somebody at Novell who is responsible for this, I really hope they make it better with a future release…

      I would not be surprised if you have the same issues with your stationery applet. What I´m talking about is the following in Detail:

      For a new Mail (not Reply / Forward) the first line is surrounded by <div class=”GroupWiseMessageBody active” id=”…”> and this container closes right after the first line. All further lines come with another “<div class=”GroupWiseMessageBody active”> – container around them. In case of reply or forward there is just one “GroupwiseMessageBody active” and at this time it goes around the whole new content – that makes more sense. Also there are some bugs in the handling of original mail content. The body gets some ridiculous <meta…> Tags along with them and also some unnecessary line breaks. Also the original mail contents and their headers overlap their code (meta tags) sometimes.

      All these things had to be solved manually. Here is some code snippet I wrote for this…I know it is dirty somehow but it seems to work stable with our Applet:

        'Separate head and foot content and put a div with GroupWiseMessageBody and ID around Body
        Set oHTMLView = oClient.ClientState.HTMLEditor
        Dim oBody: Set oBody = oHTMLView.body
        Dim strBody: strBody = oBody.innerHTML
        If InStr(1, strBody, "<bodycontent>", 1) = 0 And InStr(1, strBody, "</bodycontent>", 1) = 0 Then
          oBody.innerHTML = "<bodycontent>" & strBody & "</bodycontent>"
        End If
        strBody = oBody.innerHTML
        Dim strTemp: strTemp = oHTMLView.documentElement.outerHTML
        strTemp = Replace(strTemp, strBody, "<bodyreplaced/>", 1, 1, 1)
        strTemp = Split(strTemp, "<bodyreplaced/>", -1, 1)
        strHTMLHead = Replace(strTemp(0), "contenteditable=""true""", "contenteditable=""false""", 1, -1, 1)
        strHTMLFoot = strTemp(UBound(strTemp))
        strTemp = ""
        Dim oRegEx: Set oRegEx = CreateObject("VBScript.RegExp")
        oRegEx.Global = True
        oRegEx.IgnoreCase = True
        oRegEx.Pattern = "<div(s|n)*class=""GroupWiseMessageBody active""(s|n)*id=""[^""]*"">"
        Dim oMatches: Set oMatches = oRegEx.Execute(strBody)
        If oMatches.Count = 1 Then
          strHTMLHead = strHTMLHead & oMatches(0).Value
          strHTMLFoot = "</div>" & strHTMLFoot
          strBody = oRegEx.Replace(strBody, "")
          Dim p1: p1 = InStr(1, strBody, "<div", 1)
          Dim p2: p2 = InStr(1, strBody, "</div>", 1)
          If p1 > 0 And p2 > 0 And p2 < p1 Then
            strBody = Replace(strBody, "</div>", "", 1, 1, 1)
          End If
        End If
      
        'Separate new and old content from Body
        strHTMLNew = ""
        strHTMLOld = ""
        Dim oGWBodyReply: Set oGWBodyReply = oBody.getElementsByClassName("GroupwiseReplyHeader")
        If oGWBodyReply.Length > 0 Then
          Dim oGWBodyReplyElement
          For Each oGWBodyReplyElement in oGWBodyReply
            strHTMLOld = strHTMLOld & oGWBodyReplyElement.parentElement.outerHTML
            strBody = Replace(strBody, oGWBodyReplyElement.parentElement.outerHTML, "", 1, -1, 1)
          Next
        End If
        strHTMLNew = strBody
      
        'Remove meta and bodycontent - Tags and double Line Breaks from content
        strHTMLNew = Replace(strHTMLNew, "<bodycontent>", "", 1, -1, 1)
        strHTMLNew = Replace(strHTMLNew, "</bodycontent>", "", 1, -1, 1)
        Dim oMeta: Set oMeta = oBody.getElementsByTagName("meta")
        If oMeta.Length > 0 Then
          Dim oMetaTag
          For Each oMetaTag in oMeta
            strHTMLNew = Replace(strHTMLNew, oMetaTag.outerHTML, "", 1, -1, 1)
            strHTMLOld = Replace(strHTMLOld, oMetaTag.outerHTML, "", 1, -1, 1)
          Next
        End If
        While InStr(1, strHTMLNew, vbLf & vbLf, 0) > 0
          strHTMLNew = Replace(strHTMLNew, vbLf & vbLf, vbLf, 1, -1, 0)
        Wend
        While InStr(1, strHTMLOld, vbLf & vbLf, 0) > 0
          strHTMLOld = Replace(strHTMLOld, vbLf & vbLf, vbLf, 1, -1, 0)
        Wend
      
        'Remove trailing empty Lines from new content
        Dim strAppend: strAppend = ""
        oRegEx.Pattern = "</div>(s|n)*</div>(s|n)*$"
        If oRegEx.Test(strHTMLNew) Then
          strAppend = "</div>"
          strHTMLNew = oRegEx.Replace(strHTMLNew, strAppend)
        End If
        oRegEx.Pattern = "(<div(n|s|class=""GroupWiseMessageBody active"")*>(s|n| |<br>)*</div>(s|n| |<br>)*)*$"
        strHTMLNew = oRegEx.Replace(strHTMLNew, "")
        oRegEx.Pattern = "(s|n| |<br>)*</div>(s|n| |<br>)*$"
        strHTMLNew = oRegEx.Replace(strHTMLNew, "<br></div>")
        strHTMLNew = strHTMLNew & strAppend
      
        'This codes gives us strHTMLHead, strHTMLNew, strHTMLOld, strHTMLFoot and these components can then later be used with or inserted into our different html layouts or alternatively just put together in this order for a Default HTML Mail without layout.
      

      As soon as I find the time for it I´m going to provide you with further Information about our Applet by mail as promised.

      dfischer
      Participant

        Hello,

        right now I found the cause of the Problem! This is the Groupwise 2014 Default HTML content for a new message with only the word “test” in body:

        <html><head>
        <meta http-equiv="X-UA-Compatible" content="IE=11">
        <meta name="Generator" content="Novell Groupwise Client (Version 14.2.0  Build: 122716)">
        <meta http-equiv="Content-Type" content="text/html; charset=utf-8"><link href="C:UsersDFISCH~1.SEEAppDataLocalTempXPgrpwiseGWReply.css" rel="stylesheet"></head>
        <body style="font: 10pt/normal Segoe UI; margin: 16px 16px 4px; font-size-adjust: none; font-stretch: normal;" contenteditable="true"><div class="GroupWiseMessageBody active" id="GroupWiseSection_1457080157000_Daniel.Fischer@seele.com_0F23E78118F70000818E001185C16B56_">test</div></body></html>
        

        The Problem is the body tag and there the contenteditable=”true”…

        I have to do some testing now. Maybe I can easily set this to false for the preview and afterwards to true again when the mail is sent.

        dfischer
        Participant

          Good morning,

          the Windows version seems to be irrelevant – we could reproduce the different behaviour on the same Windows 7 Workstation. With GW 2012 and Formativ 2.6 the preview is not editable there, with GW 2014 and Formativ 2.7 its content can be accessed and changed by the user.

          The IE was also one of my first ideas but on the above mentioned test workstation the IE 11 is present and was not changed for the tests with GW2012 / Formativ 2.6 or GW2014 / Formativ 2.7.

          I will set up a short test applet for you and send it via mail then.

          Thanks in advance Smile

          dfischer
          Participant

            Hello again,

            to give a short update: Our applet is nearly finished and works great.

            There is one thing left which is a bit “unattractive” with the applets form:

            There is a “EmbeddedWB” element on it which shows the mail preview with signature / layout. With Formativ 2.6 this element was not editable and always showed the vertical scrollbar (automatically disabled as long as content fits on one page).

            Now with Formativ 2.7 the scrollbar is not present at start but it shows when content exceeds one page as one difference – but this is OK. The disturbing thing is that the control element is editable now! It is possible to delete the preview text or add something to it inside the EmbeddedWB control – this should be prevented.

            I did not find a solution to this and tried the most properties already without success. Any ideas?

            dfischer
            Participant

              Hello,

              thank you for the fast and helpful response! I have tested your alternative method in a short sample applet with success. The next step is now to implement it in our applet and this will take some time (about 2.400 lines of code which are several years old…). I´ll start this work now and keep you updated.

              After solving our actual urgent problem I would be happy to send you some further information about our applet, I´ll do this by mail then. The biggest part of it is very specific for our company (DMS System “Optimal Systems OS.ECM”, Oracle Database with custom tables for layouts, signatures and employee data)… but maybe it is still interesting for you somehow 🙂

              Kind Regards
              Daniel Fischer

              in reply to: Create Appointment (all-day and without recipient) #7773
              dfischer
              Participant

                Thanks for advice. I´m reading the Object API now and it seems to be exactly what i searched for.

              Viewing 6 replies - 1 through 6 (of 6 total)