cancel
Showing results for 
Search instead for 
Did you mean: 

nt:linkedFile processing

carina
Champ in-the-making
Champ in-the-making
I am curious if Alfresco supports internal resolution of linked types.  For example, if I create a node of type nt:linkedFile, and I point a WebDAV URL to this file, will Alfresco return the link or the content of the original file?  Likewise, can Alfresco resolve links while indexing, so that I could search a path that contains a linked file and find hits from the original?  Is this controlled by your content model definition?

Thanks,
Carina
5 REPLIES 5

davidc
Star Contributor
Star Contributor
nt:linkedFile types are not automatically resolved.  I don't believe this behaviour is specified in the JSR.

carina
Champ in-the-making
Champ in-the-making
Thanks David.  I see that Alfresco's application model defines an app:filelink, and that in the web application, you can create a shortcut.  This capability is what we were looking for, so I'm fine using app:filelink instead of nt:linkedFile.

However, I think I have discovered a bug.  If I create a shortcut using the web application, and then I try to browse to the folder where the link was placed, either via CIFS or WebDAV, I get a server error:

"An error occurred whilst generating the directory listing, please contact the system administrator."

The stack trace says that app:filelink is not handled by this service.  Is this something I can easily fix?  Possibly via a config file?  Thanks!

11:08:31,053 ERROR [org.alfresco.webdav.protocol] org.alfresco.repo.model.filefolder.FileFolderServiceImpl$InvalidTypeException: Type is not handled by this service: {http://www.alfresco.org/model/application/1.0}filelink
11:16:35,471 ERROR [org.alfresco.smb.protocol] Closing session due to exception
org.alfresco.repo.model.filefolder.FileFolderServiceImpl$InvalidTypeException: Type is not handled by this service: {http://www.alfresco.org/model/application/1.0}filelink
   at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.isFolder(FileFolderServiceImpl.java:273)
   at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.toFileInfo(FileFolderServiceImpl.java:200)
   at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.toFileInfo(FileFolderServiceImpl.java:185)
   at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.search(FileFolderServiceImpl.java:347)
   at org.alfresco.repo.model.filefolder.FileFolderServiceImpl.search(FileFolderServiceImpl.java:330)
   at sun.reflect.GeneratedMethodAccessor190.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:585)
   at org.springframework.aop.support.AopUtils.invokeJoinpointUsingReflection(AopUtils.java:335)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.invokeJoinpoint(ReflectiveMethodInvocation.java:181)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:148)
   at net.sf.acegisecurity.intercept.method.aopalliance.MethodSecurityInterceptor.invoke(MethodSecurityInterceptor.java:80)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.alfresco.repo.security.permissions.impl.ExceptionTranslatorMethodInterceptor.invoke(ExceptionTranslatorMethodInterceptor.java:41)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.transaction.interceptor.TransactionInterceptor.invoke(TransactionInterceptor.java:96)
   at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:170)
   at org.springframework.aop.framework.JdkDynamicAopProxy.invoke(JdkDynamicAopProxy.java:176)
   at $Proxy27.search(Unknown Source)
   at org.alfresco.filesys.smb.server.repo.CifsHelper.getDirectDescendents(CifsHelper.java:422)
   at org.alfresco.filesys.smb.server.repo.CifsHelper.addDescendents(CifsHelper.java:395)
   at org.alfresco.filesys.smb.server.repo.CifsHelper.getNodeRefs(CifsHelper.java:474)
   at org.alfresco.filesys.smb.server.repo.ContentDiskDriver.startSearch(ContentDiskDriver.java:730)
   at org.alfresco.filesys.smb.server.NTProtocolHandler.procTrans2FindFirst(NTProtocolHandler.java:3108)
   at org.alfresco.filesys.smb.server.NTProtocolHandler.processTransactionBuffer(NTProtocolHandler.java:1778)
   at org.alfresco.filesys.smb.server.NTProtocolHandler.procTransact2(NTProtocolHandler.java:1615)
   at org.alfresco.filesys.smb.server.NTProtocolHandler.runProtocol(NTProtocolHandler.java:226)
   at org.alfresco.filesys.smb.server.SMBSrvSession.runHandler(SMBSrvSession.java:1662)
   at org.alfresco.filesys.smb.server.SMBSrvSession.run(SMBSrvSession.java:1563)
   at java.lang.Thread.run(Thread.java:595)
11:16:55,893 ERROR [org.alfresco.webdav.protocol] org.alfresco.repo.model.filefolder.FileFolderServiceImpl$InvalidTypeException: Type is not handled by this service: {http://www.alfresco.org/model/application/1.0}filelink

kevinr
Star Contributor
Star Contributor
That looks like you have found a bug with the FileFolderService (used by both WebDav and CIFS to get directory listings). Unfortuntely i don't think it can be fixed by config change. I've raised it a high priority JIRA item:
http://www.alfresco.org/jira/browse/AR-792

Thanks,

Kevin

carina
Champ in-the-making
Champ in-the-making
Thanks Kevin.  Along this same line of questioning, I see that Alfresco's application model defines an app:folderlink in addition to the app:filelink.  Is it your plan to be able to create linked folders as well?  Will CIFS and WebDAV be able to interpret this type?  (We are interested in both linked folders and files.)

Thanks,
Carina

carina
Champ in-the-making
Champ in-the-making
Oops - ignore my last post Smiley Happy.  I see from the web client that you can create shortcuts to folders as well as files (great!).  (FYI - this is also causes the type not supported error in the FileFolderService.)