====== Files Replica Installation ====== \\ ===== DB changes ===== \\ ==== Field with the file to replicate ==== \\ |**It must be varchar (100).**| |**Code for the Mappings:**| \\ Label: Firma: \\ ==== Table master_replica_slave(server only) ==== \\ |FILEPATH varchar (128)| |It will have the LOCAL route in which the client stores the files at the server. E.g.: “c:\replica\files”| |We ensure that the route is the correct one.| |The folder must have permissions.| \\ We must configure also the route of the files at the FILEPATH field of the slave for the system MID (0,-1), since they are the ones checked by default, for instance, when files replica operations are coming by interface. ==== Table master_replica_fields(client and server) ==== \\ {{wiki:ficheros.png }} \\ * **TBL** It has the name of the table where the field is located. * **FLD** It has the name of the field having the file to replicate. * This field is Case Sensitive, it is not the same “FICHERO” than “fichero” \\ ==== Table master_replica_files(client and server) ==== \\ |This table only has to exist, nothing will be configured, it is the history, as if we say, the master_replica_queue from the files replica.| \\ ==== Status of the master_replica_files Table (Server) ==== \\ ^ Value ^ Description ^ | 0| FS_OK: The file is complete and with no errors. | | 1| FS_READY_TO_GO: The file is ready to travel from the server to the client. BLOCKS has the amount of blocks BLOCK=0 or NULL. | | 2| FS_READY_TO_COME: The file is ready to travel from the client to the server. BLOCKS has the amount of blocks BLOCK=0 or NULL. | | 3| FS_OUTGOING: The file is downloading from ther server to the client. BLOCK has the last block properly sent and confirmed by the client (the first one is zero). | | 4| FS_INCOMING: The file is uplading from the client to the server. BLOCK has the last block properly received and written in the temporary file indicated at TEMPFILE. If BLOCK==BLOCKS-1 all the blocks have been received and the file should be moved toward its permanent destination. | | 5| FS_FILENOTFOUND: The file is not found at the server to send it to the client. The server will retry these files every so often in case if they have temporarily moved . | | 6| FS_CANNOTCREATE: The file cannot be created at the client. This status is not used in the server. | | 7| FS_CANNOTOPEN: The file cannot be opened to send to the server. This status is not used in the server, only in the clients. | | 8| FS_CANNOTREAD: The file to send to the server cannot be read. This status is not used in the server. | | 9| FS_COMPLETE_PENDING: The file has been marked as pending by any cause related to its use in the client. (e.g. it is opened by anothr process) and the client has decided to send the next one and postpone this one. Not all the clients support this status. | | 200| FS_PENDING: The file is in the queue of the server to be sent to the client, but the client has not confirmed it yet. | | 201| FS_COMPLETE: The file has finished sending or receiving. It will be removed from the queue in some minutes. | | 226| FS_OBSOLETE: The file which was uploading toward the server has changed in the client and the sending will be restarted. | | -2| FS_FAILED_UP: The sending from the client to the server has failed. The server will try it again by putting it to 200 to restart the cycle.\\ It can be done by hand by an administrator if we want to force it and not wait for the server. | | -1| FS_FAILED: Any error by reading or writting in the file was occurred. The file will try the operation when it has no more pending files, either by putting it to 200 or indicating the client to send it again. It can be done by hand by an administrator. | \\ ==== Collection to check the files replica status in ANDROID ==== \\ \\ ===== Changes in the devices ===== ==== Web ==== * We change the dbms from the web. /files/ is NOT put, since it is put by itself. \\ The images must be in a folder named files within the web. If not so, then, it would have to create a virtual directory at the IIS, within the web named “files”, whith the real path toward the folder where the images by replica are stored in. It is enough that it is only for reading.\\ \\ ==== Devices ==== \\ * We configure the files path in the replica configuration, for which is the license.ini file, that is where the appropriate keys are put in. Here, we have two ways to make it, in which the way to make it only depends on the device to use, and that we will not be able to choose between one or another: \\ \\ |**Android**| To load the files is not necessary to put anything, but to download, this framework has available a mechanism different to the rest of devices. To be able to make the files downloading it is necessary to put the key **FileDownloadURL** at the license.ini with the path where the files will be downloaded. E.g.: FileDownloadURL=http://80.80.80.80:1234/files.| |**Windows Mobile**| The key **DocPath** has to be put, where is indicated the path of the device where the files to replicate will be saved. | |**BlackBerry**, **iPhone or Symbian**| It is not necessary to put anything at the license.ini to replicate, only it is necessary to put the replica tables. | \\ **CAREFUL**! If we are running the application from the storage card, then it is necessary to put the file path to storage card and not to the one of the program files, because the **framework saves the files into a folder “/files“ within the folder where the application is placed**, with this path we are telling the replicator where the files are. \\ ==== PC ==== * We change the dbms.xml. /files/is NOT put, since the framework puts it automatically. * At the configuration of the client replicator is necessary to put the path where the files will be, since we already know, it is a folder/file inside the folder where the program is in. \\ \\ ===== Common Errors ===== \\ |The folder where the files are stored does not exist or it has no sufficient permits.| |If any change was produced in any of the master_replica_xxx table, at the rl table or at the replicator.ini, it is necessary to restart the replica service.| |The FILEPATH was not defined for the MID "of system" (0,-1), since it is the path "by default", for instance for the files thar are coming by interface.|