CSEntry error 100110

Discussions about syncing data via Bluetooth, Dropbox, FTP, and using CSWeb
Forum rules
New release: CSPro 8.0
Post Reply
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

CSEntry error 100110

Post by Anne »

Hi,
This is a total mystery to me: I had an application that works when syncing with dropbox, and it worked this morning when I definitely had deployed in a wrong manner.
But now that I believe I deploy it correct, I get the error message "CSEntry Error 100110 Error downloading file "/ENERGY/Menu/Menu.pen".. when trying to sync my tablet with the CSWeb server.

The following is the sync function

function syncHQ()
if syncconnect(CSWeb, "http://myServer/csweb/api") = 1 then
//if syncconnect(Dropbox) then //Synching to dropbox for debugging
syncdata(PUT, COMMUNITY_DICT);
syncdata(PUT, HHQ_DICT);
syncdata(PUT, LISTING_DICT);
syncdata(PUT, SAMPLING_DICT);

syncfile(GET, "/ENERGY/Menu/Menu.pen", "Menu.pen");
syncfile(GET, "/Menu/Menu.pen");
syncfile(GET, "Menu.pen");
syncfile(GET, "/Menu/Menu.pff");

//Cut away the rest as that is more of the same
syncdisconnect();
else
errmsg(tr(1));
endif;
end;

It connects and it syncs the data files, but when it tries the Menu.pen it fails. As you can see, I tried to get the menu with and without path. Still fails. I also tried to enter the Menu.pen file in the deployment tool, but this gives me the error that the file already exists.

When searching for a similar request, I found that Josh answered something in French, but my understanding is that his solution was to not include the pen file. But as we are in a pretest phase, I would be able to update the application on the tablets using sync..
Attachments
deployment.PNG
deployment.PNG (39.13 KiB) Viewed 3378 times
josh
Posts: 2399
Joined: May 5th, 2014, 12:49 pm
Location: Washington DC

Re: CSEntry error 100110

Post by josh »

Unfortunately the deploy applications tool doesn't really mesh with updating the application files using syncfile() in logic. When you use the deploy applications tool it does not upload the individual files to the server. Instead it uploads a zip file that contains everything. To update the application files from the zip file, you can have your user go back to the "Add application" menu on the tablet and go through the steps of adding the application again. When you do this for an application that is already installed you will see that the text on the button changes to "update" if the version on the server is different from the one on the tablet or to "reinstall" if it is the same version. So if you use the deploy tool, the easiest way to update the update application files is to instruct your users to go back through add application steps again when there is an update.

If you really want to update the application files from logic when you sync like you have two options:

1) Upload the application files (pen and pff) to the files directory on your server like you would have done before we had the deploy applications tool.

2) Instead of trying to download the individual application files, use syncfile() to download the zip file and then use the decompress() function in logic to unzip it and copy the files you need using filecopy(). Here is what that might look like:
if syncconnect(csweb, "http://myserver.com/csweb/api") then
    // App was deployed to server using "Deploy Applications"
    // "Deploy Applications" puts all the application files in a zip in the folder "/apps/" and names it based
    // on the package name. To do the update, download the zip file "apps/<pacakgename>.zip" to a temp directory
    // using syncfile, unzip it and then copy the files to our application directory.
   
string packageName = "Synchronization in Logic";
   
numeric OK = syncfile(get,"/apps/" + packageName + ".zip", pathname(temp));
   
if OK then
        dircreate
(pathname(temp) + packageName);
        OK =
decompress(pathname(temp) + packageName + ".zip", pathname(temp) + packageName);
       
if OK then
           
OK = filecopy(pathname(temp) + packageName + "/Household/*.pen", "../Household/");
            OK =
filecopy(pathname(temp) + packageName + "/Household/*.pff", "../Household/");
            OK =
filecopy(pathname(temp) + packageName + "/Menu/*.pen", "./");
            OK =
filecopy(pathname(temp) + packageName + "/Menu/*.pff", "./");
       
endif;
       
filedelete(pathname(temp) + packageName + ".zip");
       
dirdelete(pathname(temp) + packageName);
       
if not OK then
            errmsg
("Update failed");
       
endif;
   
endif;

   
if OK then
        errmsg
("Application updated");
   
endif;
   
syncdisconnect();
endif;
We are planning to a simpler way to do this - probably a logic function named syncpackage() or something that will download and unzip the package for you, but that won't be ready for a while yet.
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

Re: CSEntry error 100110

Post by Anne »

Thank you so much for the help.. Never thought about using the "add application" to achieve this.

And just in time: We just started training with the tablets.. :)
Anne
Posts: 104
Joined: January 11th, 2012, 12:55 am

Re: CSEntry error 100110

Post by Anne »

(BTW: It would be great if the documentation for this is updated. This is how the example at the bottom of the syncfile documentation looks:)
Attachments
Capture.PNG
Capture.PNG (13.91 KiB) Viewed 3357 times
Post Reply