Merged V2.1 to HEAD

6455: OpenOffice transformer and extractor register regardless of the initial connection state.
   6456: Fix for WCM-636 (Clicking OK twice while deleting web project results in exception)
   6457: Updated installers and associated config
   6458: AR-1669 Add getQnamePath to Javascript
   6459: Fix for AWC-1456 - Word and Excel documents were being stored as octet streams rather than their correct mimetype
   6460: Reverse order of reject & approve transitions, so that approve appears first in list of ui actions.
   6461: Removed Process.exe (often detected as a virus) and updated config wizard.
   6462: Switch to synchronous indexing for AVM by default
   6463: Better support to query the state of AVM indexes
   6464: Added Office 2007 document mimetypes and icons
   6465: Added Office 2007 icons without the typo this time


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@6736 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-09-10 22:41:44 +00:00
parent 28d4278290
commit 1f3aabc6a0
17 changed files with 265 additions and 158 deletions

View File

@@ -230,7 +230,7 @@ public class AVMSnapShotTriggeredIndexingMethodInterceptor implements MethodInte
avmIndexer.index(store, before, after, getIndexMode(store));
}
}
public void indexSnapshot(String store, int after)
{
StoreRef storeRef = AVMNodeConverter.ToStoreRef(store);
@@ -279,7 +279,73 @@ public class AVMSnapShotTriggeredIndexingMethodInterceptor implements MethodInte
return false;
}
private synchronized IndexMode getIndexMode(String store)
/**
* Check if the index is up to date according to its index defintion and that all asynchronous work is done.
*
* @param store
* @return
*/
public boolean isIndexUpToDateAndSearchable(String store)
{
switch (getIndexMode(store))
{
case UNINDEXED:
return false;
case SYNCHRONOUS:
case ASYNCHRONOUS:
int last = avmService.getLatestSnapshotID(store);
StoreRef storeRef = AVMNodeConverter.ToStoreRef(store);
Indexer indexer = indexerAndSearcher.getIndexer(storeRef);
if (indexer instanceof AVMLuceneIndexer)
{
AVMLuceneIndexer avmIndexer = (AVMLuceneIndexer) indexer;
avmIndexer.flushPending();
return avmIndexer.isSnapshotSearchable(store, last);
}
return false;
default:
return false;
}
}
/**
* Check if the index is up to date according to its index defintion i it does not check that all asynchronous work is done.
*
* @param store
* @return
*/
public boolean isIndexUpToDate(String store)
{
switch (getIndexMode(store))
{
case UNINDEXED:
return true;
case SYNCHRONOUS:
case ASYNCHRONOUS:
int last = avmService.getLatestSnapshotID(store);
StoreRef storeRef = AVMNodeConverter.ToStoreRef(store);
Indexer indexer = indexerAndSearcher.getIndexer(storeRef);
if (indexer instanceof AVMLuceneIndexer)
{
AVMLuceneIndexer avmIndexer = (AVMLuceneIndexer) indexer;
avmIndexer.flushPending();
return avmIndexer.getLastIndexedSnapshot(store) == last;
}
return false;
default:
return false;
}
}
/**
* Given an avm store name determine if it is indexed and if so how.
*
* @param store
* @return
*/
public synchronized IndexMode getIndexMode(String store)
{
IndexMode mode = modeCache.get(store);
if (mode == null)

View File

@@ -51,6 +51,7 @@ import org.alfresco.repo.content.MimetypeMap;
import org.alfresco.repo.content.transform.ContentTransformer;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.repo.search.IndexMode;
import org.alfresco.repo.search.Indexer;
import org.alfresco.repo.search.impl.lucene.fts.FTSIndexerAware;
import org.alfresco.repo.search.impl.lucene.fts.FullTextSearchIndexer;
import org.alfresco.repo.transaction.AlfrescoTransactionSupport;
@@ -379,16 +380,16 @@ public class AVMLuceneIndexerImpl extends AbstractLuceneIndexerImpl<String> impl
if (desc != null)
{
NodeRef nodeRef = AVMNodeConverter.ToNodeRef(endVersion, stringNodeRef);
Document xdoc = new Document();
xdoc.add(new Field("ID", nodeRef.toString(), Field.Store.YES, Field.Index.UN_TOKENIZED, Field.TermVector.NO));
xdoc.add(new Field("ID", stringNodeRef, Field.Store.YES, Field.Index.UN_TOKENIZED, Field.TermVector.NO));
xdoc.add(new Field("TX", AlfrescoTransactionSupport.getTransactionId(), Field.Store.YES, Field.Index.UN_TOKENIZED, Field.TermVector.NO));
boolean isAtomic = true;
Map<QName, Serializable> properties = getIndexableProperties(desc, nodeRef, endVersion, stringNodeRef);
for (QName propertyName : properties.keySet())
{
@@ -402,11 +403,11 @@ public class AVMLuceneIndexerImpl extends AbstractLuceneIndexerImpl<String> impl
isAtomic &= indexProperty(nodeRef, propertyName, value, xdoc, true, properties);
}
}
StringBuilder qNameBuffer = new StringBuilder(64);
if (node.getIsRoot())
{
}
// pseudo roots?
else
@@ -492,7 +493,7 @@ public class AVMLuceneIndexerImpl extends AbstractLuceneIndexerImpl<String> impl
}
else
// not a root node
// not a root node
{
xdoc.add(new Field("QNAME", qNameBuffer.toString(), Field.Store.YES, Field.Index.TOKENIZED, Field.TermVector.NO));
@@ -1375,7 +1376,7 @@ public class AVMLuceneIndexerImpl extends AbstractLuceneIndexerImpl<String> impl
{
String[] split = term.text().split(":");
int test = Integer.parseInt(split[3]);
if(test > end)
if (test > end)
{
end = test;
}
@@ -1485,7 +1486,7 @@ public class AVMLuceneIndexerImpl extends AbstractLuceneIndexerImpl<String> impl
{
String[] split = term.text().split(":");
int test = Integer.parseInt(split[4]);
if(test > end)
if (test > end)
{
end = test;
}