HowTo-Technical-DetailsSimilarity Check in OpenLSDThe same can be found in this PDF. openlsd.server.admin.CheckSimilarFor some specific applications, users want to know before the insertion of the document in the OpenLSD system if this document is already in.
From my point of view, the first step should be always the business approach that is to say to check if the same document (from the business point of view) is already in the system. To do that, comparing the business index of this new document and the database should enough. Therefore in this case, one is using only the database of the business application. This approach is the default one in OpenLSD. Two documents cannot have (in the same Legacy) the same business index.
However, when this is not enough, the application can use the new function: CheckSimilar.
This function can be chained with an import in a script, using the returned status to choose to import or not this file.
Crypted Legacy Those functions do not work on crypted Legacy since the MD5 and the size are not the same between the original file and the crypted stored file.
However, one can implement a similar function by doing this way:
This is possible only if the crypted file is always the same whatever the date the file is crypted (that is to say the crypto algorithm must not depend on the current date).
From outside the OpenLSD Server If one need this function to be running outside the OpenLSD Server, one could consider this scenario:
|