cancel
Showing results for 
Search instead for 
Did you mean: 

Check Document Integrity

dranakan
Champ on-the-rise
Champ on-the-rise
Hello,

My Alfresco stores differents documents. All documents are defined with a "key" (done by the type and the meta-data). This key should be unique and I will create an action to verify this…

Keys are like this :
-Type_A, Meta_A,Meta_B
-Type_B, Meta_A,Meta_C,Meta_D
-Type_C, …

The action will take a list will all documents and compare with the others. (here, verify that the values of couple Type_A,Meta_A,Meta_B is always unique,…)

How can I do this to have good performances  (do you have a sample ?)  :?:
How can I do to lauch this action every night  :?:

Thanks
4 REPLIES 4

zaizi
Champ in-the-making
Champ in-the-making

dranakan
Champ on-the-rise
Champ on-the-rise
Thank you. It seems to be good to verify that there no same file (comparaison with hashsum ).

Have you advise to compare the metadata of the documents ? (to have good performance : using search API, sql query, …) ?
Thanks

dranakan
Champ on-the-rise
Champ on-the-rise
I would like to check all in Alfresco that the document added as no same properties values.

I define a contraint to do the check.

In the model
   …
   <constraint name="sg:SingleDoc" type="ch.custom.model.constraint.SingleDocConstraint">
   </constraint>                 
</constraints>

Contraint which check (not implemented)

package ch.custom.model.constraint;

import org.alfresco.repo.dictionary.constraint.AbstractConstraint;
import org.alfresco.service.cmr.dictionary.ConstraintException;

/**
* Check that the document is single in Alfresco. (Check attributes)
*
*/
public class SingleDocConstraint extends AbstractConstraint {
   @Override
   protected void evaluateSingleValue(Object value) {
      // Check if same type with same attributs values exist in alfresco
      …
   }
}

In the model, I need to indicate the constraint to the type of document. How can I do that ?

for exemple, (not working). I don't know how to apply the contraint to the type (and not to a property)

<types>
  <type name="sgf:invoice">
    <title>Invoice</title>
    <parent>sg:doc</parent>
    <properties>
        <property name="sgf:Meta_A">
        <type>d:text</type>
       </property>
    </properties>
    <constraints>
        <constraint ref="sg:SingleDoc" />
    </constraints>
</type>


Thanks

dranakan
Champ on-the-rise
Champ on-the-rise
up…