Project

General

Profile

2968_4.txt

Sergey Ivanovskiy, 03/01/2016 03:31 PM

Download (7.42 KB)

 
1
=== modified file 'src/com/goldencode/p2j/main/WebClientSpawner.java'
2
--- src/com/goldencode/p2j/main/WebClientSpawner.java	2016-03-01 05:48:20 +0000
3
+++ src/com/goldencode/p2j/main/WebClientSpawner.java	2016-03-01 19:32:12 +0000
4
@@ -20,6 +20,8 @@
5
 ** 007 GES 20160201 Moved auth token processing here to be better encapsulated/hidden. Modified
6
 **                  the constructor to handle trusted mode (and to pass the referrer directly
7
 **                  instead of requiring a setter to be called later).
8
+**     SBI 20160301 Fixed the web server to redirect the authorized users to the dedicated web
9
+**                  application handler.
10
 */
11
 
12
 package com.goldencode.p2j.main;
13

    
14
=== modified file 'src/com/goldencode/p2j/ui/client/chui/driver/web/ChuiWebDriver.java'
15
--- src/com/goldencode/p2j/ui/client/chui/driver/web/ChuiWebDriver.java	2016-03-01 05:48:20 +0000
16
+++ src/com/goldencode/p2j/ui/client/chui/driver/web/ChuiWebDriver.java	2016-03-01 19:33:15 +0000
17
@@ -25,6 +25,8 @@
18
 ** 010 GES 20150312 Moved most of the embedded web server code to a common/shared class. 
19
 ** 011 CA  20150820 Added waitInitialization, which waits for a notification from the web page
20
 **                  that it has finished initialized.
21
+** 012 SBI 20160301 Fixed an inconsistent state of the web page handlers to process requests by
22
+**                  the dedicated web application handler.
23
 */
24
 
25
 package com.goldencode.p2j.ui.client.chui.driver.web;
26

    
27
=== modified file 'src/com/goldencode/p2j/ui/client/driver/web/WebClientProtocol.java'
28
--- src/com/goldencode/p2j/ui/client/driver/web/WebClientProtocol.java	2016-03-01 05:48:20 +0000
29
+++ src/com/goldencode/p2j/ui/client/driver/web/WebClientProtocol.java	2016-03-01 20:13:55 +0000
30
@@ -19,7 +19,7 @@
31
 **                  message result.
32
 ** 005 CA  20160203 Fixed deadlock for receivedMessages - it must lock on the "lock" field, as
33
 **                  this object is used for all sock operations (including key reading).
34
-**     SBI 20160225 Added MSG_PARTIAL and MSG_PING_PONG.
35
+**     SBI 20160225 Added MSG_PARTIAL and MSG_PING_PONG, to handle MSG_QUIT.
36
 */
37
 
38
 package com.goldencode.p2j.ui.client.driver.web;
39

    
40
=== modified file 'src/com/goldencode/p2j/ui/client/driver/web/res/p2j.clipboard.js'
41
--- src/com/goldencode/p2j/ui/client/driver/web/res/p2j.clipboard.js	2016-02-17 21:39:23 +0000
42
+++ src/com/goldencode/p2j/ui/client/driver/web/res/p2j.clipboard.js	2016-03-01 18:54:03 +0000
43
@@ -22,7 +22,9 @@
44
 **                  the web which had a typo because I can find no evidence it is a real
45
 **                  thing). Added cut event support. Added base implementation to respond to
46
 **                  GUI processing, there are still open issues.
47
-** 005 SBI 20151014 Implemented to set the current editors selection.
48
+** 005 SBI 20151014 Implemented to set the current editors selection. The CHUI editor code requires
49
+**                  EOL's simulating.
50
+** 006 SBI 20160301 The CHUI editor code requires EOL's simulating.
51
 */
52
 
53
 "use strict";
54
@@ -82,9 +84,12 @@
55
       }
56
       else
57
       {
58
-         // replace line ends in order to be handled properly on the thin client
59
+         // CHUI: replace line ends in order to be handled properly on the thin client
60
          // as if "Enter" was pressed
61
-//         p2j.socket.sendStringBinaryMessage(0x03, text.replace(/\n/g,"\r")); 
62
+         if (!p2j.isGui)
63
+         {
64
+            text = text.replace(/\n/g,"\r");
65
+         }
66
          p2j.socket.sendStringBinaryMessage(0x03, text); 
67
       }
68
       
69

    
70
=== modified file 'src/com/goldencode/p2j/ui/client/driver/web/res/p2j.js'
71
--- src/com/goldencode/p2j/ui/client/driver/web/res/p2j.js	2016-03-01 05:48:20 +0000
72
+++ src/com/goldencode/p2j/ui/client/driver/web/res/p2j.js	2016-03-01 19:19:44 +0000
73
@@ -23,6 +23,8 @@
74
 **                  the "getter" access function. Changed to detect Chrome, IE11 and IE12 (Edge).
75
 **     SBI 20151217 Added displayWaitCursor/restoreCursor.
76
 **     SBI 20150104 Changed to reuse DOJO style API.
77
+**     SBI 20160301 Added new methods to save/restore JSON serialized objects in the session and
78
+**                  local storages.
79
 */
80
 
81
 "use strict";
82

    
83
=== modified file 'src/com/goldencode/p2j/ui/client/driver/web/res/p2j.socket.js'
84
--- src/com/goldencode/p2j/ui/client/driver/web/res/p2j.socket.js	2016-03-01 05:48:20 +0000
85
+++ src/com/goldencode/p2j/ui/client/driver/web/res/p2j.socket.js	2016-03-01 19:49:48 +0000
86
@@ -1339,10 +1339,7 @@
87
          connected = true;
88
          ws.binaryType = 'arraybuffer';
89
          
90
-         var exit = p2j.restoreObject("exitTheApplication", false);
91
-         var date = (new Date()).getTime();
92
-         // reload use case
93
-         if (exit && (date < exit.date + 1000))
94
+         if (isRequiredToRedirect())
95
          {
96
             // reload use case
97
             doRedirectToLoginPage();
98
@@ -1350,11 +1347,7 @@
99
          }
100
          else
101
          {
102
-            if (exit)
103
-            {
104
-               // reopen use case
105
-               p2j.deleteObject("exitTheApplication", false);
106
-            }
107
+           // new session or reopen use case
108
             
109
             exitTheApplication = false;
110
             
111
@@ -1469,6 +1462,38 @@
112
    }
113
    
114
    /**
115
+    * Checks if it is GUI mode and the current page is reloaded or reopened/new. If the GUI page
116
+    * is reloaded, then it returns true.
117
+    * 
118
+    * @return   True iff the GUI page is reloaded, otherwise false.
119
+    */
120
+   function isRequiredToRedirect()
121
+   {
122
+      if (!p2j.isGui)
123
+      {
124
+         return false;
125
+      }
126
+      
127
+      var exit = p2j.restoreObject("exitTheApplication", false);
128
+      var date = (new Date()).getTime();
129
+      
130
+      // reload use case
131
+      if (exit && (date < exit.date + 1000))
132
+      {
133
+         // reload use case
134
+         return true;
135
+      }
136
+      
137
+      if (exit)
138
+      {
139
+         // reopen use case
140
+         p2j.deleteObject("exitTheApplication", false);
141
+      }
142
+      
143
+      return false;
144
+   }
145
+   
146
+   /**
147
     * Initialize module.
148
     * 
149
     * @param {object} cfg  configuration.
150
@@ -1541,6 +1566,10 @@
151
        */
152
       window.onpagehide = function(evt) 
153
       {
154
+         if (!p2j.isGui)
155
+         {
156
+            return;
157
+         }
158
          if (!exitTheApplication)
159
          {
160
             // close or reload cases
161
@@ -1572,9 +1601,10 @@
162
        */
163
       window.onbeforeunload = function(evt) 
164
       {
165
-         if (!exitTheApplication)
166
+         if (p2j.isGui && !exitTheApplication)
167
          {
168
-            var confirmationMessage = "Do you confirm to logout the P2J application?";
169
+            var confirmationMessage = "ANY PENDING CHANGES WILL BE LOST!\n" +
170
+                                          "Please confirm that it is OK to exit the application.";
171
             
172
             // Gecko + IE
173
             (evt || window.event).returnValue = confirmationMessage;
174

    
175
=== modified file 'src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java'
176
--- src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java	2016-03-01 05:48:20 +0000
177
+++ src/com/goldencode/p2j/ui/client/gui/driver/web/GuiWebDriver.java	2016-03-01 19:32:56 +0000
178
@@ -43,6 +43,8 @@
179
 **                  method.  Logic is now in WindowManager. 
180
 ** 014 SBI 20151208 Added new parameters, scroll amount and scroll unit for wheel events and
181
 **                  a mouse modifiers mask for all mouse events.
182
+** 015 SBI 20160301 Fixed an inconsistent state of the web page handlers to process requests by
183
+**                  the dedicated web application handler.
184
 */
185
 
186
 package com.goldencode.p2j.ui.client.gui.driver.web;
187