Skip to content

Commit

Permalink
minor update
Browse files Browse the repository at this point in the history
  • Loading branch information
jhuangsoftware committed Feb 5, 2015
1 parent 6cf6cda commit 57c3d25
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 52 deletions.
59 changes: 31 additions & 28 deletions index.asp
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="expires" content="-1" />
<meta http-equiv="content-type" content="text/html; charset=utf-8" />
Expand Down Expand Up @@ -77,34 +78,36 @@
</script>

<script id="template-search-result-options" type="text/x-handlebars-template" data-container="#results" data-action="replace">
<div class="well well-small">
<div class="btn btn-success copy-as-csv pull-right">Copy as CSV to Clipboard</div>
<div class="clearfix"></div>
</div>
<div class="well">
{{#if contentclassname}}
<div class="row-fluid">
<div class="span3"><strong>Content Class</strong></div>
<div class="span6">{{contentclassname}}</div>
</div>
{{/if}}
{{#if contentclassguid}}
<div class="row-fluid">
<div class="span3"><strong>Content Class Guid</strong></div>
<div class="span6">{{contentclassguid}}</div>
</div>
{{/if}}
<div class="row-fluid">
<div class="span3"><strong>Last Modified Date</strong></div>
<div class="span6">{{lastmodifieddate}}</div>
<div class="row">
<div class="well well-small">
<div class="btn btn-success copy-as-csv pull-right">Copy as CSV to Clipboard</div>
<div class="clearfix"></div>
</div>
<div class="row-fluid">
<div class="span3"><strong>Last Modified Users</strong></div>
<div class="span6">{{lastmodifiedusers}}</div>
</div>
<div class="row-fluid">
<div class="span3"><strong>Found results</strong></div>
<div class="span6">{{count}}</div>
<div class="well">
{{#if contentclassname}}
<div class="row-fluid">
<div class="span3"><strong>Content Class</strong></div>
<div class="span9">{{contentclassname}}</div>
</div>
{{/if}}
{{#if contentclassguid}}
<div class="row-fluid">
<div class="span3"><strong>Content Class Guid</strong></div>
<div class="span9">{{contentclassguid}}</div>
</div>
{{/if}}
<div class="row-fluid">
<div class="span3"><strong>Last Modified Date</strong></div>
<div class="span9">{{lastmodifieddate}}</div>
</div>
<div class="row-fluid">
<div class="span3"><strong>Last Modified Users</strong></div>
<div class="span9">{{lastmodifiedusers}}</div>
</div>
<div class="row-fluid">
<div class="span3"><strong>Found results</strong></div>
<div class="span9">{{count}}</div>
</div>
</div>
</div>
</script>
Expand Down Expand Up @@ -142,7 +145,7 @@
</script>
</head>
<body>
<div id="search-options">
<div id="search-options" class="container">
</div>

<div id="results" class="container">
Expand Down
13 changes: 10 additions & 3 deletions rqlconnector/RqlConnector.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,16 @@ RqlConnector.prototype.SendRqlWebService = function(InnerRQL, IsText, CallbackFu
RqlConnector.prototype.SendRqlCOM = function(InnerRQL, IsText, CallbackFunc)
{
var Rql = this.padRQLXML(InnerRQL, IsText);
$.post(this.DCOMProxyUrl, { rqlxml: Rql },
function(data){
data = $('<div/>').append(data);
$.post(this.DCOMProxyUrl, { rqlxml: Rql }, function(data){
if(IsText)
{
// do nothing
}
else
{
data = $('<div/>').append(data);
}

CallbackFunc(data);
});
}
Expand Down
30 changes: 9 additions & 21 deletions rqlconnector/rqlactionwebservice.aspx
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
<%@ Page Language="C#" validateRequest="false" Debug="true" %>
<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Net" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Web" %>
<%@ Page Language="C#" validateRequest="false" %>
<script runat="server">
public class RqlWebServiceConnector
public class RqlWebServiceConnector
{
public string SendRql(string Rql)
{
Expand All @@ -17,24 +13,24 @@
if (string.IsNullOrEmpty(Rql))
return "";
string WebServiceUri = GetWebServiceUrl();
string WebServiceUri = this.GetWebServiceUrl();
string Response = SendRqlToWebService(WebServiceUri, Rql);
string Response = this.SendRqlToWebService(WebServiceUri, Rql);
return Response;
}
private string SendRqlToWebService(string WebServiceUrl, string Rql)
{
ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(
System.Net.ServicePointManager.ServerCertificateValidationCallback = new System.Net.Security.RemoteCertificateValidationCallback(
delegate
{
return true;
}
);
string Response = "";
WebClient oWC = new WebClient();
System.Net.WebClient oWC = new System.Net.WebClient();
oWC.Headers.Add("Content-Type", "text/xml; charset=utf-8");
oWC.Headers.Add("SOAPAction", "http://tempuri.org/RDCMSXMLServer/action/XmlServer.Execute");
Expand All @@ -50,19 +46,19 @@
return Response;
}
private string GetWebServiceUrl()
public string GetWebServiceUrl()
{
if (HttpContext.Current.Session["WebServiceUrl"] == null)
{
HttpContext.Current.Session["WebServiceUrl"] = HttpContext.Current.Request.Url.Scheme + ":" + "//" + HttpContext.Current.Request.Url.Authority + "/cms/WebService/RqlWebService.svc";
HttpContext.Current.Session["WebServiceUrl"] = HttpContext.Current.Request.Url.Scheme + ":" + "//" + "localhost" + "/cms/WebService/RqlWebService.svc";
Uri WebServiceUri = new Uri(HttpContext.Current.Session["WebServiceUrl"].ToString());
string Rql = "";
Rql += "<s:Envelope xmlns:s=\"http://schemas.xmlsoap.org/soap/envelope/\">";
Rql += "<s:Body><q1:Execute xmlns:q1=\"http://tempuri.org/RDCMSXMLServer/message/\"><sParamA></sParamA><sErrorA></sErrorA><sResultInfoA></sResultInfoA></q1:Execute></s:Body>";
Rql += "</s:Envelope>";
string Response = SendRqlToWebService(WebServiceUri.ToString(), Rql);
string Response = this.SendRqlToWebService(WebServiceUri.ToString(), Rql);
if(Response == "")
{
Expand All @@ -79,14 +75,6 @@
return HttpContext.Current.Session["WebServiceUrl"].ToString();
}
private string XmlEscape(string unescaped)
{
XmlDocument doc = new XmlDocument();
XmlNode node = doc.CreateElement("root");
node.InnerText = unescaped;
return node.InnerXml;
}
}
</script>
<%
Expand Down

0 comments on commit 57c3d25

Please sign in to comment.