Files Replica Installation




It must be varchar (100).
Code for the Mappings:


Label:

<prop name="MAP_algo" group="6" visible="1" type="TL" labelwidth="40" bgcolor="#5599FF" fieldsize="0">Firma:</prop>
 
<!-- Campo para guardar la firma. -->
<prop name="FIRMA" group="6" visible="1" type="IMG" readonly="false" fieldsize="23" lines="5" width="100%" height="50%" onchange="Refresh"/>
 
<!-- Campo para guardar una foto. -->
<prop name="FOTO" group="4"  visible="1" type="PH" labelwidth="8" fieldsize="15" size="15" left="0" top="10%" width="80%" height="60%" />
 
<!-- Campo para guardar un fichero añadido. -->
<prop name="ATTACH" group="4"  visible="1" type="AT" labelwidth="8" fieldsize="15" size="15" left="0" top="10%" width="80%" height="60%" />



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.



  • 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”



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.



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.



<coll name="ReplicaFiles" fontsize="8" title="ReplicaFiles" objname="master_replica_files" updateobj="master_replica_files" progid="ASData.CASBasicDataObj" 
sql="SELECT * FROM ##PREF##master_replica_files" filter="STATUS!=201 AND REPLICATYPE=1" 
cell-bgcolor="#FFFFFF" cell-height="50" show-selected-item="false" 
check-owner="false" dependent="false" connection="Info_ReplicaFiles" loadall="false" show-toolbar="true" editmask="8">
     <connection prefix="" name="Info_ReplicaFiles" connstring="Provider=Xone Remote Provider;Data Source=local;ProgID=com.xone.db.impl.replicafiles.RplFilesConnection;DBMS Name=LOQUESEA;User Name=LOQUESEA;Password=LOQUESEA;appname=LOQUESEA;Timeout=60" />
      <group name="General" id="1" />
      <frame name="page_contact" width="100%" height="100%" bgcolor="#FFFFFF" />
      <frame name="progress_frame" frame="page_contact" width="100" height="30" framebox="true" bgcolor="#505050" align="left|center" />
      <frame name="progress_bar" frame="progress_frame" width="##FLD_MAP_CALCULOBLOCK##" height="28" framebox="true" bgcolor="#FF0000" align="left|center" />
      <prop name="LICENSE" title="Licencia" labelwidth="0" textfont-size="10" forecolor="#000000" text-border="false" fieldsize="14" size="150" type="T" visible="7" group="1" frame="page_contact" />
      <prop name="FILENAME" title="Nombre" labelwidth="0" textfont-size="10" forecolor="#000000" text-border="false" fieldsize="14" size="150" type="T" visible="7" group="1" frame="page_contact" />
      <prop name="STATUS" title="Status" labelwidth="6" textfont-size="10" forecolor="#000000" text-border="false" fieldsize="6" size="150" type="N" visible="7" group="1" frame="page_contact" />
      <prop name="MAP_IMAGEN" title="B.Tras" path="./icons/progress.png" width="##FLD_MAP_CALCULOBLOCK##" height="60" labelwidth="0" fieldsize="6" size="150" type="IMG" visible="0" group="1" frame="progress_frame" />
      <prop name="MAP_TL" title="" labelwidth="1" fieldsize="6" size="150" type="TL" visible="0" group="1" frame="progress_bar" />
      <prop name="MAP_CALCULOBLOCK" title="Porciento" labelwidth="6" textfont-size="10" forecolor="#000000" text-border="false" fieldsize="6" size="150" type="N" visible="7" group="1" frame="page_contact" />
      <prop name="BLOCK" title="B.Tras" labelwidth="6" textfont-size="10" forecolor="#000000" text-border="false" fieldsize="6" size="150" type="N" visible="7" group="1" frame="page_contact" />
      <prop name="BLOCKS" title="Total" labelwidth="6" textfont-size="10" forecolor="#000000" text-border="false" fieldsize="6" size="150" type="N" visible="7" group="1" frame="page_contact" newline="false" />
      <load>
        <action name="runscript">
          <script language="VBScript">
            if this("BLOCKS")&gt;0 then
                  this("MAP_CALCULOBLOCK")=this("BLOCK")*100/this("BLOCKS")
            else
                  this("MAP_CALCULOBLOCK")=0
            end if
            </script>
        </action>
      </load>
    </coll>


  • We change the dbms from the web.

<defaultdir value=“http://www.cgsoft.es/replica”/> /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.


  • 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.


  • We change the dbms.xml.

<defaultdir value=“c:\rutadondeestalaaplicacion\replica”/> /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.



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.