test-resbeans.html 6.74 KB
Newer Older
sistem17user committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html>
    <head>
        <title>Test RESTful Web Services</title>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
        <link rel="stylesheet" href="test-resbeans.css" type="text/css"/>
        <link rel="stylesheet" href="css_master-all.css" type="text/css"/>
        <script type="text/javascript">
            //___ BASE_URL ___ will get replaced by the base url of application
            //whose resource beans needs to be tested For eg:- http://localhost:8080/SimpleServlet/
            var baseURL = "http://localhost:8080/asistenciaAniversario/||/webresources";
        </script>
        <script type="text/javascript" src="test-resbeans.js"></script>
    </head>
    <body>
        <div class="outerBorder">
            <div class="header">
                <div id="subheader" class="subheader"></div> <!-- sub-header -->
                <div class="banner"><img src="./images/pname.png"/></div>
            </div> <!-- header -->
            <div id="main" class="main hide">
                <table width="100%">
                    <tr>
                        <td id="leftSidebar" valign="top" colspan="4"></td>
                        <td class="seperator" valign="top"></td>
                        <td id="content" class="content" valign="top" colspan="12">
                            <div id="navigation" class="details"></div><hr>
                            <div id="request">Select a node on the navigation bar (on the left side of this page) to test.</div><hr>
                            <div id="testaction" class="ConMgn_sun4"></div>
                            <div id="testinput" class="ConMgn_sun4"></div>
                            <hr>
                            <div id="req_headers" class="ConMgn_sun4">
                                <input id = "headers_btn" class="Btn1_sun4 Btn1Hov_sun4" type="button" name="" value="&uarr; Custom HTTP Headers" 
                                       onclick="toggleHeadersBlock('headers_block', 'headers_btn', 'Custom Request Headers');"/>
                                <div id = "headers_block" style="padding-top: 5px;">
                                    <table id="headers_tbl" cellspacing="0" border="1">
                                      <thead>
                                        <tr>
                                          <th style="font-size:10px;text-align: left; background-color: #E5E9ED;">&nbsp;Header Name</th>
                                          <th style="font-size:10px; text-align: left; background-color: #E5E9ED;">&nbsp;Header Value</th>
                                        </tr>
                                      </thead>
                                      <tbody>
                                        <tr>
                                            <td><input style="font-size:10px;" id="req_hdr_1" type="text" size="20"></input></td>
                                            <td><input style="font-size:10px;" id="req_hdr_val_1" type="text" size="50"></input></td>
                                        </tr>
                                        <tr>
                                            <td><input style="font-size:10px;" id="req_hdr_2" type="text" size="20" value=""></input></td>
                                            <td><input style="font-size:10px;" id="req_hdr_val_2" type="text" size="50" value=""></input></td>
                                        </tr>
                                        <tr>
                                            <td><input style="font-size:10px;" id="req_hdr_3" type="text" size="20" value=""></input></td>
                                            <td><input style="font-size:10px;" id="req_hdr_val_3" type="text" size="50" value=""></input></td>
                                        </tr>
                                        <tr>
                                            <td><input style="font-size:10px;" id="req_hdr_4" type="text" size="20" value=""></input></td>
                                            <td><input style="font-size:10px;" id="req_hdr_val_4" type="text" size="50" value=""></input></td>
                                        </tr>
                                        <tr>
                                            <td><input style="font-size:10px;" id="req_hdr_5" type="text" size="20" value=""></input></td>
                                            <td><input style="font-size:10px;" id="req_hdr_val_5" type="text" size="50" value=""></input></td>
                                        </tr>
                                      </tbody>
                                    </table>
                                </div>
                            </div>
                            <div class="ConMgn_sun4">
                                <table class="details">
                                    <tr><td><div id="result"></div></td></tr><tr><td height="10">&nbsp;</td></tr>
                                    <tr><td><div id="resultheaders" class="ml20"></div></td></tr><tr><td height="10">&nbsp;</td></tr>
                                </table>
                            </div>
                        </td>
                    </tr>
                </table>
            </div> <!-- main -->
        </div> <!-- outerborder -->
	<!--<script type="text/javascript">
            var rjsConfig = {
                    isDebug: true
            };
	</script>-->
        <script language="Javascript">
            var ts = new TestSupport();
            ts.init();
            
            // global request headers section toggle function (hiding and opening headers table)
            function toggleHeadersBlock(id, buttonId, buttonText) {
              var o = toggleHeadersBlock.cache;
              var obj = document.getElementById(id);
              var tbdy = obj.getElementsByTagName('table')[0];
              if (obj) {
                if (!o) {
                  o = toggleHeadersBlock.cache = {
                    tbdy: tbdy
                  };
                }
                if (tbdy) {
                  ts.storeRequestHeaders();
                  obj.removeChild(o.tbdy);
                  document.getElementById(buttonId).value = '\u2193 '+buttonText;
                } else {
                  obj.appendChild(o.tbdy);
                  document.getElementById(buttonId).value = '\u2191 '+buttonText;
                }
              }
            }
            
            ts.restoreRequestHeaders();
            toggleHeadersBlock('headers_block', 'headers_btn', 'Custom Request Headers');
            document.getElementById("req_headers").style.visibility="hidden";
            
        </script>
    </body>
</html>