@@ -198,8 +198,8 @@ public DocumentFuture replaceFile(long docId, String fileVersion, File newFile,
198198 // Update the document's gridRecord
199199 documentDAO .initialize (document );
200200 document .setFileSize (fileSize );
201- if (document .getIndexed () != DocumentIndexed .SKIP )
202- document .setIndexed ( DocumentIndexed .TO_INDEX );
201+ if (document .getIndexed () != IndexingStatus .SKIP )
202+ document .setIndexingStatus ( IndexingStatus .TO_INDEX );
203203 document .setOcrd (0 );
204204 document .setBarcoded (0 );
205205 document .setSigned (0 );
@@ -346,8 +346,8 @@ public DocumentFuture checkin(long docId, File file, String filename, boolean re
346346 document .setOcrd (0 );
347347 document .setBarcoded (0 );
348348
349- if (document .getIndexed () != DocumentIndexed .SKIP )
350- document .setIndexed ( DocumentIndexed .TO_INDEX );
349+ if (document .getIndexed () != IndexingStatus .SKIP )
350+ document .setIndexingStatus ( IndexingStatus .TO_INDEX );
351351
352352 documentDAO .store (document );
353353
@@ -386,7 +386,7 @@ public DocumentFuture checkin(long docId, File file, String filename, boolean re
386386 document .setOcrTemplateId (oldDocument .getOcrTemplateId ());
387387 document .setBarcoded (oldDocument .getBarcoded ());
388388 document .setBarcodeTemplateId (oldDocument .getBarcodeTemplateId ());
389- document .setIndexed (oldDocument .getIndexed ());
389+ document .setIndexingStatus (oldDocument .getIndexed ());
390390 document .setCustomId (oldDocument .getCustomId ());
391391 document .setStatus (oldDocument .getStatus ());
392392 document .setStamped (oldDocument .getStamped ());
@@ -502,7 +502,7 @@ public void deleteFromIndex(Document doc) {
502502 // Physically remove the document from full-text index
503503 indexer .deleteHit (docId );
504504
505- doc .setIndexed ( DocumentIndexed .TO_INDEX );
505+ doc .setIndexingStatus ( IndexingStatus .TO_INDEX );
506506 documentDAO .store (doc );
507507
508508 markAliasesToIndex (doc .getId ());
@@ -597,8 +597,8 @@ public long index(long docId, String content, DocumentHistory transaction)
597597 // We are indexing an alias, so index the real document first
598598 Document realDoc = documentDAO .findById (doc .getDocRef ());
599599 if (realDoc != null ) {
600- if (realDoc .getIndexed () == DocumentIndexed .TO_INDEX
601- || realDoc .getIndexed () == DocumentIndexed .TO_INDEX_METADATA )
600+ if (realDoc .getIndexed () == IndexingStatus .TO_INDEX
601+ || realDoc .getIndexed () == IndexingStatus .TO_INDEX_METADATA )
602602 parsingTime = index (realDoc .getId (), content , new DocumentHistory (transaction ));
603603
604604 // Take the content from the real document to avoid double
@@ -609,12 +609,12 @@ public long index(long docId, String content, DocumentHistory transaction)
609609 log .debug ("Alias {} cannot be indexed because it references an unexisting document {}" , doc ,
610610 doc .getDocRef ());
611611 documentDAO .jdbcUpdate (
612- UPDATE_LD_DOCUMENT_SET_LD_INDEXED + DocumentIndexed .SKIP + " where ld_id=" + doc .getId ());
612+ UPDATE_LD_DOCUMENT_SET_LD_INDEXED + IndexingStatus .SKIP + " where ld_id=" + doc .getId ());
613613 return 0 ;
614614 }
615615 }
616616
617- if (StringUtils .isEmpty (cont ) && doc .getIndexed () != DocumentIndexed .TO_INDEX_METADATA ) {
617+ if (StringUtils .isEmpty (cont ) && doc .getIndexed () != IndexingStatus .TO_INDEX_METADATA ) {
618618 // Extracts the content from the file. This may take very long
619619 // time.
620620 Date beforeParsing = new Date ();
@@ -632,7 +632,7 @@ public long index(long docId, String content, DocumentHistory transaction)
632632 }
633633
634634 // For additional safety update the DB directly
635- doc .setIndexed ( DocumentIndexed .INDEXED );
635+ doc .setIndexingStatus ( IndexingStatus .INDEXED );
636636 documentDAO .jdbcUpdate (UPDATE_LD_DOCUMENT_SET_LD_INDEXED + doc .getIndexed ().ordinal () + " where ld_id=" + doc .getId ());
637637
638638 // Save the event
@@ -671,7 +671,7 @@ private void recordIndexingError(DocumentHistory transaction, Document document,
671671 if (Context .get ().getProperties ().getBoolean (tenant + ".index.skiponerror" , false )) {
672672 DocumentDAO dDao = Context .get (DocumentDAO .class );
673673 dDao .initialize (document );
674- document .setIndexed ( DocumentIndexed .SKIP );
674+ document .setIndexingStatus ( IndexingStatus .SKIP );
675675 dDao .store (document );
676676 }
677677 }
@@ -693,7 +693,7 @@ private void addHit(Document doc, String cont) throws ParsingException {
693693 }
694694
695695 private void markAliasesToIndex (long referencedDocId ) throws PersistenceException {
696- documentDAO .jdbcUpdate (UPDATE_LD_DOCUMENT_SET_LD_INDEXED + DocumentIndexed .TO_INDEX .ordinal () + " where ld_docref="
696+ documentDAO .jdbcUpdate (UPDATE_LD_DOCUMENT_SET_LD_INDEXED + IndexingStatus .TO_INDEX .ordinal () + " where ld_docref="
697697 + referencedDocId + " and not ld_id = " + referencedDocId );
698698 }
699699
@@ -740,7 +740,7 @@ private synchronized void synchronizedUpdate(Document document, Document docVO,
740740 checkCustomIdUniquenesOnUpdate (document , docVO );
741741
742742 // The document must be re-indexed
743- document .setIndexed ( DocumentIndexed .TO_INDEX );
743+ document .setIndexingStatus ( IndexingStatus .TO_INDEX );
744744
745745 document .setWorkflowStatus (docVO .getWorkflowStatus ());
746746 document .setColor (docVO .getColor ());
@@ -894,12 +894,12 @@ public DocumentFuture moveToFolder(Document doc, Folder folder, DocumentHistory
894894 doc .setFolder (folder );
895895
896896 // The document needs to be reindexed
897- if (doc .getIndexed () == DocumentIndexed .INDEXED ) {
898- doc .setIndexed ( DocumentIndexed .TO_INDEX );
897+ if (doc .getIndexed () == IndexingStatus .INDEXED ) {
898+ doc .setIndexingStatus ( IndexingStatus .TO_INDEX );
899899 indexer .deleteHit (doc .getId ());
900900
901901 // The same thing should be done on each shortcut
902- documentDAO .jdbcUpdate (UPDATE_LD_DOCUMENT_SET_LD_INDEXED + DocumentIndexed .TO_INDEX .ordinal ()
902+ documentDAO .jdbcUpdate (UPDATE_LD_DOCUMENT_SET_LD_INDEXED + IndexingStatus .TO_INDEX .ordinal ()
903903 + " where ld_docref=" + doc .getId ());
904904 }
905905
@@ -1177,8 +1177,8 @@ public DocumentFuture copyToFolder(Document doc, Folder folder, DocumentHistory
11771177 cloned .setFolder (folder );
11781178 cloned .setLastModified (null );
11791179 cloned .setDate (null );
1180- if (cloned .getIndexed () == DocumentIndexed .INDEXED )
1181- cloned .setIndexed ( DocumentIndexed .TO_INDEX );
1180+ if (cloned .getIndexed () == IndexingStatus .INDEXED )
1181+ cloned .setIndexingStatus ( IndexingStatus .TO_INDEX );
11821182 cloned .setStamped (0 );
11831183 cloned .setSigned (0 );
11841184 cloned .setLinks (0 );
@@ -1351,7 +1351,7 @@ public DocumentFuture rename(long docId, String newName, DocumentHistory transac
13511351 document .setType (UNKNOWN );
13521352 }
13531353
1354- document .setIndexed ( DocumentIndexed .TO_INDEX );
1354+ document .setIndexingStatus ( IndexingStatus .TO_INDEX );
13551355
13561356 Version version = Version .create (document , transaction .getUser (), transaction .getComment (),
13571357 DocumentEvent .RENAMED .toString (), false );
@@ -1504,18 +1504,18 @@ public Document createAlias(Document doc, Folder folder, String aliasType, Docum
15041504 * @param doc The document for which will be changed the indexer status.
15051505 * @param status The new document indexer status.
15061506 */
1507- public void changeIndexingStatus (Document doc , DocumentIndexed status ) {
1508- if (status == DocumentIndexed .SKIP && doc .getIndexed () == DocumentIndexed .SKIP )
1507+ public void changeIndexingStatus (Document doc , IndexingStatus status ) {
1508+ if (status == IndexingStatus .SKIP && doc .getIndexed () == IndexingStatus .SKIP )
15091509 return ;
1510- if (status == DocumentIndexed .TO_INDEX && doc .getIndexed () == DocumentIndexed .TO_INDEX )
1510+ if (status == IndexingStatus .TO_INDEX && doc .getIndexed () == IndexingStatus .TO_INDEX )
15111511 return ;
1512- if (status == DocumentIndexed .TO_INDEX_METADATA && doc .getIndexed () == DocumentIndexed .TO_INDEX_METADATA )
1512+ if (status == IndexingStatus .TO_INDEX_METADATA && doc .getIndexed () == IndexingStatus .TO_INDEX_METADATA )
15131513 return ;
15141514
15151515 documentDAO .initialize (doc );
1516- if (doc .getIndexed () == DocumentIndexed .INDEXED )
1516+ if (doc .getIndexed () == IndexingStatus .INDEXED )
15171517 deleteFromIndex (doc );
1518- doc .setIndexed (status );
1518+ doc .setIndexingStatus (status );
15191519 try {
15201520 documentDAO .store (doc );
15211521 } catch (PersistenceException e ) {
0 commit comments