Skip to content
This repository has been archived by the owner on Sep 25, 2022. It is now read-only.

Alfresco 6.2 Prevents Content Data setting with addProperties Method #81

Open
sdumont2 opened this issue Jan 24, 2020 · 3 comments
Open

Comments

@sdumont2
Copy link

sdumont2 commented Jan 24, 2020

Bug Report

Steps to Reproduce:

Using Alfresco version 6.2 or newer there is a new Class (ContentPropertyRestrictionInterceptor) that prevents setting Content Property Content Data directly using the Node Service. This prevents any iteration of this Bulk Importer (except for the embedded one, go figure) from adding metadata that includes the Content Property.

Expected Result:

The Ability to set Content metadata as needed.

Actual Result:

When attempting to set Content Metadata as part of import you will receive this error.

The node's content can't be updated via NodeService#addProperties directly: 
content_1            |    node: workspace://SpacesStore/a8e2f27d-b34c-483c-8dc6-b329b06be0ad
content_1            |    property name: content
content_1            |  org.alfresco.service.cmr.dictionary.InvalidTypeException: 00220051 The node's content can't be updated via NodeService#addProperties directly: 
content_1            |    node: workspace://SpacesStore/a8e2f27d-b34c-483c-8dc6-b329b06be0ad
content_1            |    property name: content
content_1            | 	at org.alfresco.repo.node.ContentPropertyRestrictionInterceptor.invoke(ContentPropertyRestrictionInterceptor.java:147)
content_1            | 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
content_1            | 	at org.alfresco.repo.audit.DisableAuditableBehaviourInterceptor.invoke(DisableAuditableBehaviourInterceptor.java:120)
content_1            | 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
content_1            | 	at org.alfresco.module.org_alfresco_module_rm.security.RMMethodSecurityInterceptor.invoke(RMMethodSecurityInterceptor.java:352)
content_1            | 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
content_1            | 	at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:53)
content_1            | 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
content_1            | 	at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:166)
content_1            | 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
content_1            | 	at org.alfresco.repo.transaction.RetryingTransactionInterceptor$1.execute(RetryingTransactionInterceptor.java:86)
content_1            | 	at org.alfresco.repo.transaction.RetryingTransactionHelper.doInTransaction(RetryingTransactionHelper.java:450)
content_1            | 	at org.alfresco.repo.transaction.RetryingTransactionInterceptor.invoke(RetryingTransactionInterceptor.java:76)
content_1            | 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
content_1            | 	at org.alfresco.enterprise.repo.authorization.AuthorizationStatusInterceptor.invoke(AuthorizationStatusInterceptor.java:167)
content_1            | 	at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:186)
content_1            | 	at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:212)
content_1            | 	at com.sun.proxy.$Proxy20.addProperties(Unknown Source)

Environment:

Any Alfresco version 6.2 or higher will have this new class.

Additional Context:

There is a way to disable this class, or add the classes to a whitelist. I intend on updating wiki documentation to specify that these properties must be set in order for the bulk importer to work.

@sdumont2
Copy link
Author

There is technically a way to set this via the code and making it so that you wouldn't have to configure either of the two properties, but that would involve using Reflection to get the current whitelist, and then update it OR disabling the interceptor, setting the properties, then re-enabling it, which would require checking whether it's enabled/disabled to begin with beforehand.

IMO either of those two options feel "hacky" to me, and it's probably better just to use the configuration properties.

@sdumont2
Copy link
Author

Added Documentation to Wiki covering the configuration of the properties and added documentation to the troubleshooting page covering the issue as well.

https://github.com/pmonks/alfresco-bulk-import/wiki/Configuration
https://github.com/pmonks/alfresco-bulk-import/wiki/Troubleshooting

@pmonks please review/close this ticket if the updates to the wiki are satisfactory.

@shazada
Copy link

shazada commented Jan 26, 2020

Thanks for the write up!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants