NetTalk Central

Author Topic: Netsync problem and suggestions (needs)  (Read 2846 times)

Alberto

  • Hero Member
  • *****
  • Posts: 1843
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Netsync problem and suggestions (needs)
« on: September 06, 2019, 10:07:12 AM »
Bruce, in the sync client proc, if I forget to add a File to be synced to the proc, the sync does not work, none error is posted. and the sync process runs over and over like there were no timer.
Is it possible for you to add a line to open the files you detect to be synced?

In the sync method template, when selecting a file to sync it sets the boundary name as the file label lowered, but to sync, you need it to be the External file name.

Problem when syncing spanish caracters:
The result is different if the record is received from the server o if it is sent to the server
In the attached pic you can see:
a record added in the server (Central) and received by the client
and below
a record added in the client (Pilar) and sent to the server, when synced the record in the client is modified too.

The server is on Charset: 'ISO-8859-1' and Store as Spanish

My web server is both a web server and it has the webservices method.
Ive tried going to utf-8 from Spanish and th sync is ok but when I type any spanish chars in a web form I get the same problem, see pic 2

Thanks
« Last Edit: September 08, 2019, 05:46:58 AM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11155
    • View Profile
Re: Netsync problem and suggestions (needs)
« Reply #1 on: September 09, 2019, 02:09:07 AM »
I feel like you're asking many questions here on one thread - not usually a good idea.

>> In the sync client proc, if I forget to add a File to be synced to the proc,

add it where? To the "Other Files" list?
I don't think you need to add any files to the other files list...

>> Is it possible for you to add a line to open the files you detect to be synced?

If you want a file to be opened, add it to the OtherFiles list. It sounds to me like files should _not_ be opened here, because it's not ideal to have "all the files open all the time" which is what you would end up with.

>> The server is on Charset: 'ISO-8859-1' and Store as Spanish

what Charset is the client program using?

cheers
Bruce



Alberto

  • Hero Member
  • *****
  • Posts: 1843
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Netsync problem and suggestions (needs)
« Reply #2 on: September 09, 2019, 05:54:51 AM »
>> The server is on Charset: 'ISO-8859-1' and Store as Spanish

what Charset is the client program using?

Where do I set this in a cliente program? I dont find this set in any of the templates in the client program.
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11155
    • View Profile
Re: Netsync problem and suggestions (needs)
« Reply #3 on: September 09, 2019, 09:39:20 PM »
>> what Charset is the client program using?

Basically it's the FontCharset that you either set globally
system{prop:fontcharset} = whatever

or the Charset you use on your windows. As in
,FONT('Segoe UI',10,,FONT:regular,CHARSET:ANSI)

Cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1843
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Netsync problem and suggestions (needs)
« Reply #4 on: September 10, 2019, 03:06:58 AM »
Ok, and what charset should I use?

The server is on Charset: 'ISO-8859-1' and Store as Spanish

Charset is a long and I dont find any CHARSET:ISO...

CHARSET:ANSI            EQUATE (  0)
CHARSET:DEFAULT         EQUATE (  1)
CHARSET:SYMBOL          EQUATE (  2)
....

Reading at the Net sync method code:

BuildResult  routine
  p_web.ReplyContentFixed = 1
  if Loc:ReturnType = return:json
    p_web.ReplyContentType = p_web.GetContentType('.json')
    json.start()
    jsonResults &= json.CreateCollection('samiApiDatosCliente_response')
    do BuildResultFields
    json.SaveString(packet,1)
    p_web.AsciiToUtf(packet)   ! Json is always utf-8.
  else

Adding a p_web.UtfToAscii(packet) at the end solves the problem when from server to client.

How to do it from client to server, may be changing something in NetSync.clw ?

Or must I use XML instead of json to solve this?

I found another problem, when a file has a field label using spanish characters it is NOT synced, see pic

« Last Edit: September 10, 2019, 08:29:36 AM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11155
    • View Profile
Re: Netsync problem and suggestions (needs)
« Reply #5 on: September 10, 2019, 07:29:56 PM »
JSON is the right format to use - but your server-side, and client-side settings will matter.
I recommend you make a small example app - perhaps with just 1 table, which includes a fieldname with non-latin characters, and so non-latin data.

cheers
Bruce

Alberto

  • Hero Member
  • *****
  • Posts: 1843
    • MSN Messenger - alberto-michelis@hotmail.com
    • View Profile
    • ARMi software solutions
    • Email
Re: Netsync problem and suggestions (needs)
« Reply #6 on: September 11, 2019, 06:12:21 AM »
>>>JSON is the right format to use - but your server-side, and client-side settings will matter.
OK, an how do I set Spanish instead of utf-8 in the client?

>>>I recommend you make a small example app - perhaps with just 1 table, which includes a fieldname with non-latin characters, and so non-latin data.
Bruce, non-latin data works ok, what should I gain doing this?
I need to sync tables with latin data and field names.

Using   
  s_web._SitesQueue.Defaults.HtmlCharset = lower('utf-8')
  s_web._SitesQueue.Defaults.StoreDataAs = net:StoreAsUTF8
makes the sync work ok with spanish characters

But I use the same serve as server web and sync, an the server web, which saves data, needs
  s_web._SitesQueue.Defaults.HtmlCharset = lower('ISO-8859-1')
  s_web._SitesQueue.Defaults.StoreDataAs = net:StoreAsSpanish
to work ok

Is there any way to set those props dependin on which server page or ws method Im calling?

 
« Last Edit: September 11, 2019, 08:11:02 AM by michelis »
-----------
Regards
Alberto

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11155
    • View Profile
Re: Netsync problem and suggestions (needs)
« Reply #7 on: September 11, 2019, 10:02:09 PM »
>> OK, an how do I set Spanish instead of utf-8 in the client?

that is the wrong question, and the wrong approach.

>> Bruce, non-latin data works ok, what should I gain doing this?  I need to sync tables with latin data and field names.

yes, I mean an example with Spanish chars included. (By Latin I meant plain A-Z, as distinct from Non-Latin which has umlauts, and diaeresis, and so on.) So yeah, make an example with spanish chars.

Cheers
Bruce