Merged V2.1 to HEAD

6910: Fix for WCM-858, actions for files with an apostrophe in the name emit JavaScript errors
   6916: Fix to layout when My Spaces portlet follows on same page
   6919: Fix for AWC-1367 and AWC-1627
   6923: Added suport for datetime tokens in the lucene inedx
   6925: Fix for WCM-810
   6930: Fix for WCM-854
   Moved schema version to 110 and adjusted patch accordingly.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@7343 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-11-12 14:08:11 +00:00
parent 1439ded6e0
commit 3cf0420a73
5 changed files with 92 additions and 37 deletions

View File

@@ -36,6 +36,8 @@ import org.alfresco.config.ConfigElement;
import org.alfresco.config.ConfigService;
import org.alfresco.config.JNDIConstants;
import org.alfresco.mbeans.VirtServerRegistry;
import org.alfresco.model.ContentModel;
import org.alfresco.model.WCMAppModel;
import org.alfresco.repo.avm.AVMNodeConverter;
import org.alfresco.repo.domain.PropertyValue;
import org.alfresco.sandbox.SandboxConstants;
@@ -43,6 +45,7 @@ import org.alfresco.service.ServiceRegistry;
import org.alfresco.service.cmr.avm.AVMNotFoundException;
import org.alfresco.service.cmr.avm.AVMService;
import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService;
import org.alfresco.service.cmr.search.ResultSet;
import org.alfresco.service.cmr.search.SearchService;
import org.alfresco.service.namespace.QName;
@@ -926,6 +929,7 @@ public final class AVMUtil
// get services
FacesContext fc = FacesContext.getCurrentInstance();
SearchService searchService = Repository.getServiceRegistry(fc).getSearchService();
NodeService nodeService = Repository.getServiceRegistry(fc).getNodeService();
// construct the query
String path = Application.getRootPath(fc) + "/" + Application.getWebsitesFolderName(fc) + "/*";
@@ -939,10 +943,30 @@ public final class AVMUtil
results = searchService.query(Repository.getStoreRef(),
SearchService.LANGUAGE_LUCENE, query);
// WCM-810:
// the 'avmstore' property was not defined as an identifier in the model (before 2.2)
// which means it may get tokenised which in turn means that 'test' and 'test-site'
// would get returned by the query above even though it's an exact match query,
// we therefore need to go through the results and check names if there is more
// than one result although this shouldn't happen anymore as the
// AVMStorePropertyTokenisationPatch will have reindexed the wca:avmstore property
if (results.length() == 1)
{
webProjectNode = results.getNodeRef(0);
}
else if (results.length() > 1)
{
for (NodeRef node : results.getNodeRefs())
{
String nodeStoreName = (String)nodeService.getProperty(node,
WCMAppModel.PROP_AVMSTORE);
if (nodeStoreName.equals(storeName))
{
webProjectNode = node;
break;
}
}
}
}
finally
{