Usage of CSweb

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
ekinge
Posts: 1
Joined: May 19th, 2017, 8:57 pm

Usage of CSweb

Post by ekinge »

Dear Users,

I have successfully installed CSweb on an online server and can log in as admin. I can also sync file to the server via FTP to the files directory on the server. Now my question is I don't see any cases in the admin portal of the CSweb although I have some data in the files directory. How do I sync so I see the cases or how do I use the CSweb server so I get the cases all together so I can download. Please help ASAP.

Thank you all.
htuser
Posts: 638
Joined: December 19th, 2011, 6:26 pm
Location: Silver Spring Area, MD, USA

Re: Usage of CSweb

Post by htuser »

Hi Ekinge,
I don't think ftp sync is linked to the Csweb server. So you can't see ftp synchronized case on the Csweb. FTP sync store cases in csdb database and Csweb store them in Mysql. To sync using Csweb, you must:
1.- upload your dcf file to Csweb (add dictionary),
2.- Using Csweb as a parameter for syncdata function. Easily, you can use built in synchronization in the Cspro designer.

If this insufficient, i can send screen and more explanation to you.
Best Regards,
G.VOLNY, a CSProuser from Haiti, since 2004
sah
Posts: 97
Joined: May 28th, 2015, 3:16 pm

Re: Usage of CSweb

Post by sah »

You can use the Data Viewer tool to download data from a server used for data synchronization. I have tried this and it is awesome.
MrTaco
Posts: 128
Joined: November 18th, 2014, 1:55 am

Re: Usage of CSweb

Post by MrTaco »

hi htuser

please send the screens

thanks in advance
sah
Posts: 97
Joined: May 28th, 2015, 3:16 pm

Re: Usage of CSweb

Post by sah »

You can check the CSweb documentation and also use the script below as well:

string Server = "https://www.myserver.org/api";

// connect to the CSWeb server
if syncconnect(CSWeb,Server) =1 then

// get the latest versions of the application files from the CSWeb server
syncfile(GET,"/MyApp/MyApp.pff");
syncfile(GET,"/MyApp/MyApp.pen");

// send the latest cases to the CSWeb server
syncdata(PUT,SURVEY_DICT);

syncdisconnect();

endif;
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Usage of CSweb

Post by arkagwa »

I have problem with setting up csweb server with WAMPSERVER
see attached file with this error
Failed to connect to database. SQLSTATE[42000]: Syntax error or access violation: 1067 Invalid default value for 'created_time'
Attachments
Configuration.pdf
(130.09 KiB) Downloaded 600 times
josh
Posts: 2401
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Usage of CSweb

Post by josh »

The problem you are facing is most likely due to a strict mode setting in MySQL that is not allowing default dates set to zero.

Here is a link that shows how to enable MySQL to allow zero date value insertions: http://stackoverflow.com/questions/3637 ... r-datetime

If you are using MySQL version 5.7 change your setting in MySQL.ini from:

;sql-mode= "STRICT_ALL_TABLES,ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_AUTO_CREATE_USER"

To:

;sql-mode="ERROR_FOR_DIVISION_BY_ZERO,NO_ZERO_DATE,NO_ZERO_IN_DATE,NO_AUTO_CREATE_USER"

After making this change to MySQL restart your services and run CSWeb setting again to see if you are still having issues.
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Usage of CSweb

Post by arkagwa »

Dear Josh

I have been able to setup csweb successful in local host C/wamp64/csweb and i am able to access the server via http://localhost/csweb/ui/dashboard/

The problem is should i put the folder "UG FORM" which has .pff and pen files. The connection test to the server was successful but when i sync i get nothing in my server, i don't see cases. I have Data fie with 5 cases in my drive where i do data entry.

I have attached the screenshots
Attachments
Screenshot 2017-06-17 11.38.30.png
Screenshot 2017-06-17 11.38.30.png (117.98 KiB) Viewed 18039 times
Screenshot 2017-06-17 10.14.39.png
Screenshot 2017-06-17 10.14.39.png (54.58 KiB) Viewed 18039 times
josh
Posts: 2401
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: Usage of CSweb

Post by josh »

The pen and the pff files go in the directory csweb/files directory on the server. Since in the sync options dialog you have /apps/UG FORM then you should put them in the folder csweb/files/apps/UG FORM (or you can edit the directory in the sync options dialog to match the directory you put them in inside csweb/files).

To see why the cases are not being synced to the server you should look at the sync.log file on the device that you do data entry on. On Android it will be in the csentry directory. On Windows it is in C:\users\<your username>\appdata\Roaming\CSPro.
arkagwa
Posts: 119
Joined: November 18th, 2014, 5:25 am

Re: Usage of CSweb

Post by arkagwa »

I have set path in my PC-CSPro 7 data entry form as /UG FORM and i have uploaded the contents of UG folder in directory C/wamp64/www/csweb/files/apps/UG FORM. I have 4 cases in cspro entry form stored in local drive (another driver not C). I have tested the connection working but still i don't see any Database file after sync

19/05/2017 20:47:51.957 INFO: Connect to server http://www.myserver.com/api using saved credentials
19/05/2017 20:47:56.871 INFO: Canceled connection
19/05/2017 20:48:07.666 INFO: Connect to Dropbox
19/05/2017 20:48:07.666 INFO: Open/create C:\Users\ANDREW KAGWA\AppData\Roaming\CSPro\Dropbox.db in read/write mode.
19/05/2017 20:48:07.744 INFO: Create download table.
19/05/2017 20:51:42.199 INFO: Canceled connection
16/06/2017 21:02:26.999 INFO: Connect to server http://www.myserver.com/api using saved credentials
16/06/2017 21:02:51.569 ERROR: Error connecting to server: Could not resolve host: www.myserver.com
17/06/2017 10:05:47.510 INFO: Connect to server http://localhost/csweb/api using saved credentials
17/06/2017 10:06:52.641 INFO: Server API version: 1
17/06/2017 10:06:52.641 INFO: Connection successful. Server id: http://localhost/csweb/api/
17/06/2017 10:06:52.641 INFO: Disconnecting from server
17/06/2017 12:59:24.195 INFO: Connect to server http://localhost/csweb/api using saved credentials
17/06/2017 12:59:28.876 INFO: Canceled connection
19/06/2017 13:53:05.364 INFO: Connect to server http://localhost/csweb/api using saved credentials
19/06/2017 13:53:26.754 INFO: Server API version: 1
19/06/2017 13:53:26.754 INFO: Connection successful. Server id: http://localhost/csweb/api/
19/06/2017 13:53:26.754 INFO: Disconnecting from server
Post Reply