This section allows you to view all posts made by this member. Note that you can only see posts made in areas you currently have access to.
Pages: [1] 2
1
Web Server - Share Knowledge / Address Bar
« on: December 21, 2017, 07:39:17 AM »
How can I prevent the address bar from being updated as I move from page to page?
2
Web Server - Ask For Help / Re: HTTP Request (get and post)
« on: June 05, 2016, 12:11:58 PM »
Was you able to accomplish this ? I'm having the same problem.
3
Web Server - Ask For Help / Re: Translate to clarion
« on: October 08, 2015, 08:25:38 AM »
I replied to kevin earlier today.. but the one line that's confusing both of us is this one..
byte[] encodedPathAndQueryBytes = encoding.GetBytes(uri.LocalPath + uri.Query);
it's seem that it trying convert to bytes in an array the uRL path and URL query.
the path is something like this /maps/api/geocode/json
the query is something like this /?address=13 main st&channel=dev&sensor=false&client=gme-clientid
image attached
[attachment deleted by admin]
byte[] encodedPathAndQueryBytes = encoding.GetBytes(uri.LocalPath + uri.Query);
it's seem that it trying convert to bytes in an array the uRL path and URL query.
the path is something like this /maps/api/geocode/json
the query is something like this /?address=13 main st&channel=dev&sensor=false&client=gme-clientid
image attached
[attachment deleted by admin]
4
Web Server - Ask For Help / Translate to clarion
« on: October 01, 2015, 11:38:39 AM »
I'm trying put all my code within a clarion app and I have a small c# dll I use sign a url for google maps, and I want to get rid of this dll.
Has anyone or can anyone translate the code below to clarion, I'm figuring I can use some of the functions in kryptonite.
public string GetGoogleURLSignRequest(string url, string ClientID, string APIKey)
{
SignedUrl = string.Empty;
ASCIIEncoding encoding = new ASCIIEncoding();
// converting key to bytes will throw an exception, need to replace '-' and '_' characters first
string usablePrivateKey = APIKey.Replace("-", "+").Replace("_", "/");
byte[] privateKeyBytes = Convert.FromBase64String(usablePrivateKey);
Uri uri = new Uri(url);
byte[] encodedPathAndQueryBytes = encoding.GetBytes(uri.LocalPath + uri.Query);
//Compute the hash
HMACSHA1 algorithm = new HMACSHA1(privateKeyBytes);
byte[] hash = algorithm.ComputeHash(encodedPathAndQueryBytes);
// convert the bytes to string and make url-safe by replacing '+' and '/' characters
string signature = Convert.ToBase64String(hash).Replace("+", "-").Replace("/", "_");
// Add the signature to the existing URI.
SignedUrl = uri.Scheme + "://" + uri.Host + uri.LocalPath + uri.Query + "&signature=" + signature;
return SignedUrl;
Has anyone or can anyone translate the code below to clarion, I'm figuring I can use some of the functions in kryptonite.
public string GetGoogleURLSignRequest(string url, string ClientID, string APIKey)
{
SignedUrl = string.Empty;
ASCIIEncoding encoding = new ASCIIEncoding();
// converting key to bytes will throw an exception, need to replace '-' and '_' characters first
string usablePrivateKey = APIKey.Replace("-", "+").Replace("_", "/");
byte[] privateKeyBytes = Convert.FromBase64String(usablePrivateKey);
Uri uri = new Uri(url);
byte[] encodedPathAndQueryBytes = encoding.GetBytes(uri.LocalPath + uri.Query);
//Compute the hash
HMACSHA1 algorithm = new HMACSHA1(privateKeyBytes);
byte[] hash = algorithm.ComputeHash(encodedPathAndQueryBytes);
// convert the bytes to string and make url-safe by replacing '+' and '/' characters
string signature = Convert.ToBase64String(hash).Replace("+", "-").Replace("/", "_");
// Add the signature to the existing URI.
SignedUrl = uri.Scheme + "://" + uri.Host + uri.LocalPath + uri.Query + "&signature=" + signature;
return SignedUrl;
5
Web Server - Ask For Help / Re: Jfiles - List arrays
« on: July 31, 2015, 07:44:45 AM »
I think it gets a bit more complicated to read this json script since the origin and destination addresses also need to be accounted for.
json Class(JSONClass)
End
addresses &JsonClass
elements &JsonClass
rows &JSONClass
onerow &JsonClass
elementsQ QUEUE
addresses GROUP
OriAddresses STRING(50),name('origin_addresses')
DesAddresses STRING(50),name('destination_addresses')
END
distance GROUP
text STRING(50),name('text')
value STRING(50),name('value')
END
duration GROUP
text string(50),name('text')
value STRING(50),name('value')
END
status STRING(50),name('status')
END
code
json.start()
json.TagCase = jF:CaseLower
json.loadFile('d.json')
rows &= json.GetByName('rows')
loop x = 1 to rows.records()
onerow &= rows.Get(x)
elements &= onerow.GetByName('elements')
elements.load(ElementsQ)
end
json Class(JSONClass)
End
addresses &JsonClass
elements &JsonClass
rows &JSONClass
onerow &JsonClass
elementsQ QUEUE
addresses GROUP
OriAddresses STRING(50),name('origin_addresses')
DesAddresses STRING(50),name('destination_addresses')
END
distance GROUP
text STRING(50),name('text')
value STRING(50),name('value')
END
duration GROUP
text string(50),name('text')
value STRING(50),name('value')
END
status STRING(50),name('status')
END
code
json.start()
json.TagCase = jF:CaseLower
json.loadFile('d.json')
rows &= json.GetByName('rows')
loop x = 1 to rows.records()
onerow &= rows.Get(x)
elements &= onerow.GetByName('elements')
elements.load(ElementsQ)
end
6
Web Server - Ask For Help / Re: Jfiles - List arrays
« on: June 29, 2015, 01:03:42 PM »
Hi there,
That's exactly the problem I have!
The queue always comes up empty, I've many different layouts and none as of this moment works.
it seems that googlemaps uses an unconventional way of formatting the responses. I too am anxious to see how Bruce would approach this.
I have classes for the file structures and write the responses to a SQL table and return a pointer to the record when called from my rest service, but that takes jfiles out of the picture and I don't want to do that as this time.
Thanks for your interest in this.
That's exactly the problem I have!
The queue always comes up empty, I've many different layouts and none as of this moment works.
it seems that googlemaps uses an unconventional way of formatting the responses. I too am anxious to see how Bruce would approach this.
I have classes for the file structures and write the responses to a SQL table and return a pointer to the record when called from my rest service, but that takes jfiles out of the picture and I don't want to do that as this time.
Thanks for your interest in this.
7
Web Server - Ask For Help / Re: Jfiles - List arrays
« on: June 26, 2015, 06:45:46 AM »
Hi Bruce,
I know you're busy person, I just don't know how you do it with so many products and supporting other vendors.
I was able to get to get the address information working but no matter what I do I'm not able to get the element | Distance information
When I try to get the 1st element using the information is correct, but for the 2nd it gets the value" : 26580 instead of text" : "17.0 mi",
Also I can't seem to be able to reach the 2nd element either.
MatrixElements GROUP,PRE(ED)
Distance CSTRING(145),DIM(50),NAME('text')
END
json.start()
json.Loadstring( str )
x = json.Records()
ED:Distance[1] = json.GetValueByName('distance',1) ! first address
ED:Distance[2] = json.GetValueByName('distance',2) ! first address
The Json Response file:
{
"destination_addresses" : [
"6010 Cattleridge Drive, Sarasota, FL 34232, USA",
"3937 Westminster Drive, Sarasota, FL 34241, USA"
],
"origin_addresses" : [
"6615 Anchor Loop, Bradenton, FL 34212, USA",
"121 New Briton Court, Bradenton, FL 34212, USA"
],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "16.5 mi",
"value" : 26580
},
"duration" : {
"text" : "20 mins",
"value" : 1202
},
"status" : "OK"
},
{
"distance" : {
"text" : "17.0 mi",
"value" : 27391
},
"duration" : {
"text" : "21 mins",
"value" : 1254
},
"status" : "OK"
}
]
},
{
"elements" : [
{
"distance" : {
"text" : "16.8 mi",
"value" : 27110
},
"duration" : {
"text" : "21 mins",
"value" : 1243
},
"status" : "OK"
},
{
"distance" : {
"text" : "17.3 mi",
"value" : 27922
},
"duration" : {
"text" : "22 mins",
"value" : 1295
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}
I know you're busy person, I just don't know how you do it with so many products and supporting other vendors.
I was able to get to get the address information working but no matter what I do I'm not able to get the element | Distance information
When I try to get the 1st element using the information is correct, but for the 2nd it gets the value" : 26580 instead of text" : "17.0 mi",
Also I can't seem to be able to reach the 2nd element either.
MatrixElements GROUP,PRE(ED)
Distance CSTRING(145),DIM(50),NAME('text')
END
json.start()
json.Loadstring( str )
x = json.Records()
ED:Distance[1] = json.GetValueByName('distance',1) ! first address
ED:Distance[2] = json.GetValueByName('distance',2) ! first address
The Json Response file:
{
"destination_addresses" : [
"6010 Cattleridge Drive, Sarasota, FL 34232, USA",
"3937 Westminster Drive, Sarasota, FL 34241, USA"
],
"origin_addresses" : [
"6615 Anchor Loop, Bradenton, FL 34212, USA",
"121 New Briton Court, Bradenton, FL 34212, USA"
],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "16.5 mi",
"value" : 26580
},
"duration" : {
"text" : "20 mins",
"value" : 1202
},
"status" : "OK"
},
{
"distance" : {
"text" : "17.0 mi",
"value" : 27391
},
"duration" : {
"text" : "21 mins",
"value" : 1254
},
"status" : "OK"
}
]
},
{
"elements" : [
{
"distance" : {
"text" : "16.8 mi",
"value" : 27110
},
"duration" : {
"text" : "21 mins",
"value" : 1243
},
"status" : "OK"
},
{
"distance" : {
"text" : "17.3 mi",
"value" : 27922
},
"duration" : {
"text" : "22 mins",
"value" : 1295
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}
8
Web Server - Ask For Help / Re: Jfiles - List arrays
« on: June 23, 2015, 08:54:24 AM »
This is a another JSon response it's having a hard time with.. again this response is from googlemaps.
It can't read the array or locate it.
{
"destination_addresses" : [
6000 Cattleridge Drive, Sarasota, FL 34232, USA",
"3937 Westminster Drive, Sarasota, FL 34241, USA"
],
"origin_addresses" : [
"6615 Anchor Loop, Bradenton, FL 34212, USA",
"121 New Briton Court, Bradenton, FL 34212, USA"
],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "16.5 mi",
"value" : 26580
},
"duration" : {
"text" : "20 mins",
"value" : 1198
},
"status" : "OK"
},
{
"distance" : {
"text" : "17.0 mi",
"value" : 27391
},
"duration" : {
"text" : "21 mins",
"value" : 1255
},
"status" : "OK"
}
]
},
{
"elements" : [
{
"distance" : {
"text" : "16.8 mi",
"value" : 27110
},
"duration" : {
"text" : "21 mins",
"value" : 1234
},
"status" : "OK"
},
{
"distance" : {
"text" : "17.3 mi",
"value" : 27922
},
"duration" : {
"text" : "22 mins",
"value" : 1291
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}
It can't read the array or locate it.
{
"destination_addresses" : [
6000 Cattleridge Drive, Sarasota, FL 34232, USA",
"3937 Westminster Drive, Sarasota, FL 34241, USA"
],
"origin_addresses" : [
"6615 Anchor Loop, Bradenton, FL 34212, USA",
"121 New Briton Court, Bradenton, FL 34212, USA"
],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "16.5 mi",
"value" : 26580
},
"duration" : {
"text" : "20 mins",
"value" : 1198
},
"status" : "OK"
},
{
"distance" : {
"text" : "17.0 mi",
"value" : 27391
},
"duration" : {
"text" : "21 mins",
"value" : 1255
},
"status" : "OK"
}
]
},
{
"elements" : [
{
"distance" : {
"text" : "16.8 mi",
"value" : 27110
},
"duration" : {
"text" : "21 mins",
"value" : 1234
},
"status" : "OK"
},
{
"distance" : {
"text" : "17.3 mi",
"value" : 27922
},
"duration" : {
"text" : "22 mins",
"value" : 1291
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}
9
Web Server - Ask For Help / Jfiles - List arrays
« on: June 11, 2015, 08:06:31 AM »
I've been trying to read the structure below, and having a hell of a time with it.
I'm able to get the record count (4), and the labels for the fields.
but I'm unable to get the values for destination_addresses and origin_addresses .
I've set up the field to be a queue with an external name of origin_addresses on the first field, but nothing I've tried works.
Does jfiles support working with list arrarys? is there a specific way I must set up my receiving structure?
public List<string> destination_addresses { get; set; }
public List<string> origin_addresses { get; set; }
!!----------------------------------------------------------Json File
{
"destination_addresses" : [ "5010 Cattleridge Drive, Sarasota, FL 34232, USA" ],
"origin_addresses" : [ "6615 Anchor Loop, Bradenton, FL 34212, USA" ],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "16.5 mi",
"value" : 26580
},
"duration" : {
"text" : "20 mins",
"value" : 1198
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}
I'm able to get the record count (4), and the labels for the fields.
but I'm unable to get the values for destination_addresses and origin_addresses .
I've set up the field to be a queue with an external name of origin_addresses on the first field, but nothing I've tried works.
Does jfiles support working with list arrarys? is there a specific way I must set up my receiving structure?
public List<string> destination_addresses { get; set; }
public List<string> origin_addresses { get; set; }
!!----------------------------------------------------------Json File
{
"destination_addresses" : [ "5010 Cattleridge Drive, Sarasota, FL 34232, USA" ],
"origin_addresses" : [ "6615 Anchor Loop, Bradenton, FL 34212, USA" ],
"rows" : [
{
"elements" : [
{
"distance" : {
"text" : "16.5 mi",
"value" : 26580
},
"duration" : {
"text" : "20 mins",
"value" : 1198
},
"status" : "OK"
}
]
}
],
"status" : "OK"
}
10
Web Server - Share Knowledge / Re: Mapping and Geocoding Example
« on: August 22, 2014, 10:59:28 AM »
I tried many times to compile this example and it always fails to compile.
Inside the pagefootertag
I get the following error: cannot call procedure as a function. the items in bold are the error points.
packet = clip(packet) & p_web.Script('startCountDown('& int(p_web.site.SessionExpiryAfterHS/100) &',"'& clip(p_web.site.LoginPage) &'","countdown");')
do SendPacket
end
2nd procedure : I get the following error: cannot call procedure as a function. it has a problem with the clip(packet)
rDisplayMap Routine
packet = clip(packet) & p_web.AsciiToUTF(|
I also noticed the zip file did not have the simplemap.js file either.
NetTalk 8.25
String Theory 2.06X-Files 2.52
Clarion 8.9661
Windows 7 Pro 64bit
Browser: IE 9
Inside the pagefootertag
I get the following error: cannot call procedure as a function. the items in bold are the error points.
packet = clip(packet) & p_web.Script('startCountDown('& int(p_web.site.SessionExpiryAfterHS/100) &',"'& clip(p_web.site.LoginPage) &'","countdown");')
do SendPacket
end
2nd procedure : I get the following error: cannot call procedure as a function. it has a problem with the clip(packet)
rDisplayMap Routine
packet = clip(packet) & p_web.AsciiToUTF(|
I also noticed the zip file did not have the simplemap.js file either.
NetTalk 8.25
String Theory 2.06X-Files 2.52
Clarion 8.9661
Windows 7 Pro 64bit
Browser: IE 9
11
Web Server - Ask For Help / Re: Dates , Submit and memory form
« on: August 02, 2012, 04:04:37 PM »
Bruce,
As you suggested, I started to reread the handbook, AND LOL.. you're explaing the same process but in a different manner..
Thanks for the advice...
As you suggested, I started to reread the handbook, AND LOL.. you're explaing the same process but in a different manner..
Thanks for the advice...
12
Web Server - Ask For Help / Re: Dates , Submit and memory form
« on: August 02, 2012, 12:29:29 PM »
Hi Bruce,
You are correct in the me not using the Stop statements, I had to put this together since it was tied to a very large SQL dictionary and I could not release that to you,
NOTE: I saw we I had put in the clearing of the fields and for the life of me could not remember at the moment where and Why I did the clear values routines, i'm getting too dam old!!!
My apologies for screaming Wolf....
BUT, I put the procedure together following your exact intstructions ,granted it's a different of version of nettalk, BUT I wanted to keep as close as possible to your example.
I do have a browse at the bottom but removed it since it was working correctly, I was only concerned with the main filter screen.
In your Advance Searching Example, you specifiy to use a submit button for both the search and reset buttons, and you also state to put the search build query in the procedure setup.
>>> The Query and l:Reset fields are Submit buttons. The l:Reset button is hidden if the l:Filter2 is blank, and displayed if it is filled in.
>>>Notice that the URL will call the SAME PROCEDURE that I created. Here is how that is possible.
>>>At the top of the procedure in the embed "Procedure Setup", the following code is added:
>>>l:Filter2 = p_web.GetSessionValue('CustomerFilter')
>>> IF p_web.GetValue('cusaccount') <> ''
>>> p_web.SetValue('l:Account',p_web.GetValue('cusaccount'))
And Yes, I do have your book and will review it to make sure I haved missed/forgotten etc... anything.
Thanks for your help!
You are correct in the me not using the Stop statements, I had to put this together since it was tied to a very large SQL dictionary and I could not release that to you,
NOTE: I saw we I had put in the clearing of the fields and for the life of me could not remember at the moment where and Why I did the clear values routines, i'm getting too dam old!!!
My apologies for screaming Wolf....
BUT, I put the procedure together following your exact intstructions ,granted it's a different of version of nettalk, BUT I wanted to keep as close as possible to your example.
I do have a browse at the bottom but removed it since it was working correctly, I was only concerned with the main filter screen.
In your Advance Searching Example, you specifiy to use a submit button for both the search and reset buttons, and you also state to put the search build query in the procedure setup.
>>> The Query and l:Reset fields are Submit buttons. The l:Reset button is hidden if the l:Filter2 is blank, and displayed if it is filled in.
>>>Notice that the URL will call the SAME PROCEDURE that I created. Here is how that is possible.
>>>At the top of the procedure in the embed "Procedure Setup", the following code is added:
>>>l:Filter2 = p_web.GetSessionValue('CustomerFilter')
>>> IF p_web.GetValue('cusaccount') <> ''
>>> p_web.SetValue('l:Account',p_web.GetValue('cusaccount'))
And Yes, I do have your book and will review it to make sure I haved missed/forgotten etc... anything.
Thanks for your help!
13
Web Server - Ask For Help / Re: Session Timeout
« on: July 31, 2012, 01:20:38 PM »
Yup, can't go pass 23:59 ,
The override works perfect thanks.
The override works perfect thanks.
14
Web Server - Ask For Help / Re: Dates , Submit and memory form
« on: July 31, 2012, 12:46:39 PM »Hi Bruce,
I've attach the small demo reproducing the problem.!!
Thanks for you help on this..
[attachment deleted by admin]
15
Web Server - Ask For Help / Dates , Submit and memory form
« on: July 30, 2012, 08:27:28 AM »
I am following the step to do the advance searching methods outlined by Bruce.
I got everything working, BUT I have a standard date field, and everytime I put information in the field for searching, it gets cleared out by the submit button.
All other fields String, Bytes are not cleared when I click on the submit button, and no the field is not duplicated anywhere else.
I created 3 fields with dates and same thing happens.
Any idea as to whats going on? I'm tempted to think it has to do with the calendar look up button it automactically gets.
I got everything working, BUT I have a standard date field, and everytime I put information in the field for searching, it gets cleared out by the submit button.
All other fields String, Bytes are not cleared when I click on the submit button, and no the field is not duplicated anywhere else.
I created 3 fields with dates and same thing happens.
Any idea as to whats going on? I'm tempted to think it has to do with the calendar look up button it automactically gets.
Pages: [1] 2