mirror of
https://github.com/Alfresco/alfresco-community-repo.git
synced 2025-06-23 18:05:32 +00:00
Merged V2.0 to HEAD
5497: cwd variable and forminstancedata 5512: AR-1303 MLPropertyInterceptor 5527: CIFS invalid characters git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5543 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
parent
766c19b128
commit
a85bc773c3
@ -352,6 +352,12 @@
|
||||
<type>d:text</type>
|
||||
<mandatory>true</mandatory>
|
||||
</property>
|
||||
<property name="wca:originalparentpath">
|
||||
<title>The original parent path when this form instance data was created - used for regenerating accurately.</title>
|
||||
<type>d:text</type>
|
||||
<mandatory>false</mandatory>
|
||||
</property>
|
||||
|
||||
<property name="wca:renditions">
|
||||
<title>Renditions of this form instance data</title>
|
||||
<type>d:text</type>
|
||||
|
@ -87,8 +87,8 @@ class CoreProtocolHandler extends ProtocolHandler
|
||||
|
||||
// Invalid file name characters
|
||||
|
||||
private static final String InvalidFileNameChars = "\"/[]:+|<>=;,*?";
|
||||
private static final String InvalidFileNameCharsSearch = "\"/[]:+|<>=;,";
|
||||
private static final String InvalidFileNameChars = "\"/:|<>*?";
|
||||
private static final String InvalidFileNameCharsSearch = "\"/:|<>";
|
||||
|
||||
// SMB packet class
|
||||
|
||||
|
@ -104,6 +104,7 @@ public interface WCMAppModel
|
||||
static final QName ASPECT_FORM_INSTANCE_DATA = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "forminstancedata");
|
||||
static final QName PROP_PARENT_FORM_NAME = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "parentformname");
|
||||
static final QName PROP_RENDITIONS = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "renditions");
|
||||
static final QName PROP_ORIGINAL_PARENT_PATH = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "orginalparentpath");
|
||||
|
||||
static final QName ASPECT_RENDITION = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "rendition");
|
||||
static final QName PROP_PARENT_RENDERING_ENGINE_TEMPLATE = QName.createQName(NamespaceService.WCMAPP_MODEL_1_0_URI, "parentrenderingenginetemplate");
|
||||
|
@ -1751,4 +1751,58 @@ public abstract class BaseNodeServiceTest extends BaseSpringTest
|
||||
setComplete();
|
||||
endTransaction();
|
||||
}
|
||||
|
||||
public static boolean behaviourExecuted = false;
|
||||
|
||||
public void testAR1303() throws Exception
|
||||
{
|
||||
Map<QName, Serializable> props = new HashMap<QName, Serializable>(1);
|
||||
props.put(ContentModel.PROP_NAME, "test.txt");
|
||||
|
||||
NodeRef nodeRef = this.nodeService.createNode(
|
||||
this.rootNodeRef,
|
||||
ContentModel.ASSOC_CHILDREN,
|
||||
ContentModel.ASSOC_CHILDREN,
|
||||
ContentModel.TYPE_CONTENT,
|
||||
props).getChildRef();
|
||||
|
||||
this.nodeService.addAspect(nodeRef, ContentModel.ASPECT_TITLED, null);
|
||||
|
||||
this.nodeService.setProperty(nodeRef, ContentModel.PROP_DESCRIPTION, "my description");
|
||||
this.nodeService.setProperty(nodeRef, ContentModel.PROP_TITLE, "my title");
|
||||
|
||||
JavaBehaviour behaviour = new JavaBehaviour(this, "onUpdateProperties");
|
||||
PolicyComponent policyComponent = (PolicyComponent)this.applicationContext.getBean("policyComponent");
|
||||
policyComponent.bindClassBehaviour(
|
||||
QName.createQName(NamespaceService.ALFRESCO_URI, "onUpdateProperties"),
|
||||
ContentModel.ASPECT_TITLED,
|
||||
behaviour);
|
||||
|
||||
behaviourExecuted = false;
|
||||
|
||||
// Update the title property and check that the behaviour has been fired
|
||||
this.nodeService.setProperty(nodeRef, ContentModel.PROP_TITLE, "changed title");
|
||||
assertTrue("The onUpdateProperties behaviour has not been fired.", behaviourExecuted);
|
||||
}
|
||||
|
||||
public void onUpdateProperties(
|
||||
NodeRef nodeRef,
|
||||
Map<QName, Serializable> before,
|
||||
Map<QName, Serializable> after)
|
||||
{
|
||||
behaviourExecuted = true;
|
||||
assertFalse(before.get(ContentModel.PROP_TITLE).toString().equals(after.get(ContentModel.PROP_TITLE).toString()));
|
||||
|
||||
System.out.print("Before values: ");
|
||||
for (Map.Entry<QName, Serializable> entry : before.entrySet())
|
||||
{
|
||||
System.out.println(entry.getKey().toString() + " : " + entry.getValue().toString());
|
||||
}
|
||||
System.out.print("\nAfter values: ");
|
||||
for (Map.Entry<QName, Serializable> entry : after.entrySet())
|
||||
{
|
||||
System.out.println(entry.getKey().toString() + " : " + entry.getValue().toString());
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
@ -216,8 +216,10 @@ public class MLPropertyInterceptor implements MethodInterceptor
|
||||
NodeRef nodeRef = (NodeRef) args[0];
|
||||
QName propertyQName = (QName) args[1];
|
||||
Serializable inboundValue = (Serializable) args[2];
|
||||
|
||||
// Convert the property
|
||||
inboundValue = convertInboundProperty(contentLocale, nodeRef, propertyQName, inboundValue, null);
|
||||
|
||||
// Pass this through to the node service
|
||||
directNodeService.setProperty(nodeRef, propertyQName, inboundValue);
|
||||
// Done
|
||||
@ -261,21 +263,18 @@ public class MLPropertyInterceptor implements MethodInterceptor
|
||||
{
|
||||
currentValue = directNodeService.getProperty(nodeRef, propertyQName);
|
||||
}
|
||||
MLText currentMLValue = null;
|
||||
if (currentValue == null)
|
||||
MLText returnMLValue = new MLText();
|
||||
if (currentValue != null)
|
||||
{
|
||||
currentMLValue = new MLText();
|
||||
}
|
||||
else
|
||||
{
|
||||
currentMLValue = DefaultTypeConverter.INSTANCE.convert(MLText.class, currentValue);
|
||||
MLText currentMLValue = DefaultTypeConverter.INSTANCE.convert(MLText.class, currentValue);
|
||||
returnMLValue.putAll(currentMLValue);
|
||||
}
|
||||
// Force the inbound value to be a String (it isn't MLText)
|
||||
String inboundValueStr = DefaultTypeConverter.INSTANCE.convert(String.class, inboundValue);
|
||||
// Add it to the current MLValue
|
||||
currentMLValue.put(contentLocale, inboundValueStr);
|
||||
returnMLValue.put(contentLocale, inboundValueStr);
|
||||
// Done
|
||||
ret = currentMLValue;
|
||||
ret = returnMLValue;
|
||||
}
|
||||
}
|
||||
else // It is not defined as d:mltext in the dictionary
|
||||
|
Loading…
x
Reference in New Issue
Block a user