mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-07-31 17:39:05 +00:00
Merged V2.9 to HEAD
9231: Merged V2.2 to V2.9 9207: Merged V2.1 to V2.2 9124: Class behaviour compilation doesn't throw exceptions for missing model class definitions. 9125: Part-fix for ACT-2935: AVMSyncException during index rebuild in AVM 9171: Improvements to I18N freemarker template message() method as supplied by Will Abson 9202: Additional servlet mappings added to example NTLM auth section in web.xml git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@9235 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
@@ -87,7 +87,8 @@ import org.alfresco.service.namespace.QName;
|
|||||||
ClassDefinition classDefinition = dictionary.getClass(classQName);
|
ClassDefinition classDefinition = dictionary.getClass(classQName);
|
||||||
if (classDefinition == null)
|
if (classDefinition == null)
|
||||||
{
|
{
|
||||||
throw new PolicyException("Class definition " + classQName.toPrefixString() + " does not exist.");
|
// The class definition doesn't exist so there can be no behaviour bound
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
QName parentClassName = classDefinition.getParentName();
|
QName parentClassName = classDefinition.getParentName();
|
||||||
|
@@ -62,6 +62,7 @@ import org.alfresco.service.cmr.avm.AVMException;
|
|||||||
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
import org.alfresco.service.cmr.avm.AVMNodeDescriptor;
|
||||||
import org.alfresco.service.cmr.avm.AVMService;
|
import org.alfresco.service.cmr.avm.AVMService;
|
||||||
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
import org.alfresco.service.cmr.avmsync.AVMDifference;
|
||||||
|
import org.alfresco.service.cmr.avmsync.AVMSyncException;
|
||||||
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
import org.alfresco.service.cmr.avmsync.AVMSyncService;
|
||||||
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
import org.alfresco.service.cmr.dictionary.DataTypeDefinition;
|
||||||
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
import org.alfresco.service.cmr.dictionary.PropertyDefinition;
|
||||||
@@ -246,7 +247,20 @@ public class AVMLuceneIndexerImpl extends AbstractLuceneIndexerImpl<String> impl
|
|||||||
s_logger.debug("Sync index for " + store + " from " + srcVersion + " to " + dstVersion);
|
s_logger.debug("Sync index for " + store + " from " + srcVersion + " to " + dstVersion);
|
||||||
}
|
}
|
||||||
String path = store + ":/";
|
String path = store + ":/";
|
||||||
List<AVMDifference> changeList = avmSyncService.compare(srcVersion, path, dstVersion, path, null);
|
List<AVMDifference> changeList = null;
|
||||||
|
try
|
||||||
|
{
|
||||||
|
changeList = avmSyncService.compare(srcVersion, path, dstVersion, path, null);
|
||||||
|
}
|
||||||
|
catch (AVMSyncException e)
|
||||||
|
{
|
||||||
|
s_logger.warn("\n" +
|
||||||
|
"Unable to generate change list for synchronous indexing: \n" +
|
||||||
|
" Store: " + store + "\n" +
|
||||||
|
" Start version: " + srcVersion + "\n" +
|
||||||
|
" End version: " + endVersion);
|
||||||
|
return;
|
||||||
|
}
|
||||||
for (AVMDifference difference : changeList)
|
for (AVMDifference difference : changeList)
|
||||||
{
|
{
|
||||||
switch (difference.getDifferenceCode())
|
switch (difference.getDifferenceCode())
|
||||||
|
@@ -28,8 +28,10 @@ import java.util.List;
|
|||||||
|
|
||||||
import org.alfresco.i18n.I18NUtil;
|
import org.alfresco.i18n.I18NUtil;
|
||||||
|
|
||||||
|
import freemarker.template.TemplateDateModel;
|
||||||
import freemarker.template.TemplateMethodModelEx;
|
import freemarker.template.TemplateMethodModelEx;
|
||||||
import freemarker.template.TemplateModelException;
|
import freemarker.template.TemplateModelException;
|
||||||
|
import freemarker.template.TemplateNumberModel;
|
||||||
import freemarker.template.TemplateScalarModel;
|
import freemarker.template.TemplateScalarModel;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -51,39 +53,49 @@ public class I18NMessageMethod extends BaseTemplateProcessorExtension implements
|
|||||||
String result = "";
|
String result = "";
|
||||||
int argSize = args.size();
|
int argSize = args.size();
|
||||||
|
|
||||||
if (argSize > 0)
|
if (argSize != 0)
|
||||||
{
|
{
|
||||||
String id = "";
|
String id = "";
|
||||||
Object arg0 = args.get(0);
|
Object arg0 = args.get(0);
|
||||||
if (arg0 instanceof TemplateScalarModel)
|
if (arg0 instanceof TemplateScalarModel)
|
||||||
{
|
{
|
||||||
id = ((TemplateScalarModel)arg0).getAsString();
|
id = ((TemplateScalarModel)arg0).getAsString();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (argSize == 1)
|
if (id != null)
|
||||||
{
|
{
|
||||||
// Shortcut for no additional params
|
if (argSize == 1)
|
||||||
result = I18NUtil.getMessage(id);
|
{
|
||||||
}
|
// shortcut for no additional msg params
|
||||||
else
|
result = I18NUtil.getMessage(id);
|
||||||
{
|
}
|
||||||
Object arg;
|
else
|
||||||
Object[] params = new Object[argSize - 1];
|
{
|
||||||
for (int i = 0; i < argSize-1; i++)
|
Object[] params = new Object[argSize - 1];
|
||||||
{
|
for (int i = 0; i < argSize-1; i++)
|
||||||
// Note: need to ignore first passed-in arg
|
{
|
||||||
arg = args.get(i+1);
|
// ignore first passed-in arg which is the msg id
|
||||||
if (arg instanceof TemplateScalarModel)
|
Object arg = args.get(i + 1);
|
||||||
{
|
if (arg instanceof TemplateScalarModel)
|
||||||
params[i] = ((TemplateScalarModel)arg).getAsString();
|
{
|
||||||
}
|
params[i] = ((TemplateScalarModel)arg).getAsString();
|
||||||
else
|
}
|
||||||
{
|
else if (arg instanceof TemplateNumberModel)
|
||||||
params[i] = new String("");
|
{
|
||||||
}
|
params[i] = ((TemplateNumberModel)arg).getAsNumber();
|
||||||
}
|
}
|
||||||
result = I18NUtil.getMessage(id, params);
|
else if (arg instanceof TemplateDateModel)
|
||||||
}
|
{
|
||||||
|
params[i] = ((TemplateDateModel)arg).getAsDate();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
params[i] = "";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
result = I18NUtil.getMessage(id, params);
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return result;
|
return result;
|
||||||
|
Reference in New Issue
Block a user