tsgrp / OpenContent

TSG's Web Services for ECM Repositories
8 stars 4 forks source link

Creating folders in the root directory fails in Alfresco #59

Open mikeblum opened 9 years ago

mikeblum commented 9 years ago

TL;DR: can we create root folders in alfresco?

Using a call like this:

ContentResult folderResult = OCUtil.findOrCreateFolderByPath(ticket, "/test-folder", OCConstants.OBJECT_TYPE_FOLDER);

We run into an issue creating a folder in the root of the repository and get this trace:

2015-06-03 01:41:32,687 ERROR [alfresco.content.AlfrescoEmbContentImpl] [http-apr-8080-exec-1] Unable to find object with path: test-folder 2015-06-03 01:41:32,689 DEBUG [core.util.OCUtil] [http-apr-8080-exec-1] Attempting to create folder: test-folder 2015-06-03 01:41:32,691 DEBUG [alfresco.util.AlfrescoEmbUtil] [http-apr-8080-exec-1] Supplied pathOrId parameter not an Id. Resolving path... 2015-06-03 01:41:32,691 DEBUG [alfresco.util.AlfrescoEmbUtil] [http-apr-8080-exec-1] Initial path: / 2015-06-03 01:41:32,693 ERROR [alfresco.util.AlfrescoEmbUtil] [http-apr-8080-exec-1] Unable to find object with path: org.alfresco.service.cmr.model.FileNotFoundException: File not found: at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.resolveNamePath(FileFolderServiceImpl.java:1564) at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.resolveNamePath(FileFolderServiceImpl.java:1527) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.alfresco.repo.model.ml.MLContentInterceptor.invoke(MLContentInterceptor.java:129) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.model.filefolder.MLTranslationInterceptor.invoke(MLTranslationInterceptor.java:268) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:159) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.model.filefolder.FilenameFilteringInterceptor.invoke(FilenameFilteringInterceptor.java:382) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy70.resolveNamePath(Unknown Source) at com.tsgrp.opencontent.alfresco.util.AlfrescoEmbUtil.getNodeRefByPath(AlfrescoEmbUtil.java:661) at com.tsgrp.opencontent.alfresco.util.AlfrescoEmbUtil.getIdByPathOrId(AlfrescoEmbUtil.java:606) at com.tsgrp.opencontent.alfresco.content.AlfrescoEmbContentImpl.enhancedCreateObject(AlfrescoEmbContentImpl.java:340)

dgrumieaux commented 9 years ago

Must be in Company Home to my knowledge.

On Tue, Jun 2, 2015 at 9:09 PM, Michael Blum notifications@github.com wrote:

TL;DR: can we create root folders in alfresco?

Using a call like this:

ContentResult folderResult = OCUtil.findOrCreateFolderByPath(ticket, "/test-folder", OCConstants.OBJECT_TYPE_FOLDER);

We run into an issue creating a folder in the root of the repository and get this trace:

2015-06-03 01:41:32,687 ERROR [alfresco.content.AlfrescoEmbContentImpl] [http-apr-8080-exec-1] Unable to find object with path: test-folder 2015-06-03 01:41:32,689 DEBUG [core.util.OCUtil] [http-apr-8080-exec-1] Attempting to create folder: test-folder 2015-06-03 01:41:32,691 DEBUG [alfresco.util.AlfrescoEmbUtil] [http-apr-8080-exec-1] Supplied pathOrId parameter not an Id. Resolving path... 2015-06-03 01:41:32,691 DEBUG [alfresco.util.AlfrescoEmbUtil] [http-apr-8080-exec-1] Initial path: / 2015-06-03 01:41:32,693 ERROR [alfresco.util.AlfrescoEmbUtil] [http-apr-8080-exec-1] Unable to find object with path: org.alfresco.service.cmr.model.FileNotFoundException: File not found: at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.resolveNamePath(FileFolderServiceImpl.java:1564) at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.resolveNamePath(FileFolderServiceImpl.java:1527) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source) at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source) at java.lang.reflect.Method.invoke(Unknown Source) at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:317) at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:183) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.alfresco.repo.model.ml.MLContentInterceptor.invoke(MLContentInterceptor.java:129) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.model.filefolder.MLTranslationInterceptor.invoke(MLTranslationInterceptor.java:268) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:46) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.audit.AuditMethodInterceptor.invoke(AuditMethodInterceptor.java:159) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.alfresco.repo.model.filefolder.FilenameFilteringInterceptor.invoke(FilenameFilteringInterceptor.java:382) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.transaction.interceptor.TransactionInterceptor$1.proceedWithInvocation(TransactionInterceptor.java:96) at org.springframework.transaction.interceptor.TransactionAspectSupport.invokeWithinTransaction(TransactionAspectSupport.java:260) at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:94) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:172) at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:204) at com.sun.proxy.$Proxy70.resolveNamePath(Unknown Source) at com.tsgrp.opencontent.alfresco.util.AlfrescoEmbUtil.getNodeRefByPath(AlfrescoEmbUtil.java:661) at com.tsgrp.opencontent.alfresco.util.AlfrescoEmbUtil.getIdByPathOrId(AlfrescoEmbUtil.java:606) at com.tsgrp.opencontent.alfresco.content.AlfrescoEmbContentImpl.enhancedCreateObject(AlfrescoEmbContentImpl.java:340)

— Reply to this email directly or view it on GitHub https://github.com/tsgrp/OpenContent/issues/59.

gsteimer commented 9 years ago

Not sure either. I don't know the AlfrescoEmb APIs that well. Any other thoughts @cmlewis?

cmlewis commented 9 years ago

@dgrumieaux is correct, the root folder located at '/' is the system root that only Alfresco-generated things go into. The root we use MUST be /Company Home (/app:company_home)

mikeblum commented 9 years ago

Keeping this open as an outstanding inquiry. Workaround for now is loading the folders you want in the root directory as an ACP and deploying that.