Revision 58 hci/trunk/eneraptor-web-app/grails-app/controllers/com/eneraptor/hci/LogicRequestController.groovy
LogicRequestController.groovy | ||
---|---|---|
1 | 1 |
package com.eneraptor.hci |
2 | 2 |
|
3 |
import grails.converters.* |
|
4 |
|
|
3 | 5 |
class LogicRequestController { |
4 | 6 |
|
5 | 7 |
def reportService |
... | ... | |
21 | 23 |
output += reportService.println("<span style='color:red;'>Error: " + testReply['content'] + "</span>") |
22 | 24 |
} else { |
23 | 25 |
output += reportService.println("Connection established succesfully") |
24 |
if(testReply['content'] == "<logic-response type=\"checkConnection\"><data>12345</data></logic-response>") { |
|
25 |
output += "<span style='color:green;'>Logic unit replied! The eneraptor system is set up properly.</span>" |
|
26 |
def rootNode = XML.parse(testReply['content']) |
|
27 |
if(rootNode.data == "12345") { |
|
28 |
output += reportService.println("<span style='color:green;'>Logic unit replied! The eneraptor system is set up properly.</span>") |
|
26 | 29 |
} else { |
27 | 30 |
output += reportService.println("<span style='color:red;'>The connection was established, but there was no reply from the logic unit.</span>") |
28 |
output += reportService.println("<span style='color:red;'>You should check the logic's port number and IP address.</span>"); |
|
29 |
output += reportService.println("<span style='color:red;'>Returned: " + testReply['content'].encodeAsHTML() + "</span>"); |
|
31 |
output += reportService.println("<span style='color:red;'>You should check the logic's port number and IP address.</span>") |
|
32 |
output += reportService.println("<span style='color:red;'> Returned: " + testReply['content'].encodeAsHTML() + "</span>") |
|
33 |
output += reportService.println("<span style='color:red;'>Should be: " + "<logic-response type=\"checkConnection\"><data>12345</data></logic-response>".encodeAsHTML() + "</span>") |
|
30 | 34 |
} |
31 | 35 |
} |
32 | 36 |
|
Also available in: Unified diff