cancel
Showing results for 
Search instead for 
Did you mean: 

protocols.rootPath in Alfresco Share 5?

matosconsulting
Champ in-the-making
Champ in-the-making
Hi all,

I'm struggling to find an answer on something that I thought would be easy. I have a legacy system that will be dumping some files via CIFS and FTP to a newly set up Alfresco Share 5. Due to the legacy system, we have a very tight restriction on the paths we can use, so I would like to shorten the network and FTP paths.

My research tells me that this would be done by setting protocols.rootPath in the alfresco-global.properties files, however I'm not sure how to define this path. Let's say that I can currently access the path I need at \\servername\Alfresco\files\, how would I configure the protocols.rootPath to make it \\servername\files\?

Thank you.
3 REPLIES 3

mrogers
Star Contributor
Star Contributor
That's not the protocols.rootPath.   

To change \\servername\\Alfresco to \\servername\\files you are changing the shared filesystem name.  

so
filesystem.name=files

mrogers,

Thank you for the details, however I believe you misunderstand. I'm not trying to change "Alfresco" to "files". I am trying to eliminate "Alfresco" from the path.

Again, I currently have a path I access at \\servername\Alfresco\files\.

Your advice would result in \\servername\files\files\. My goal is to get to \\servername\files\.

I came pretty close to setting up some proxy servers and mirroring scripts to accomplish what I needed, but I was able to figure out a workaround by reading through various bits of source code on github. I came across a couple of other threads where this was never answered, so in case someone else comes looking for this information I'm going to provide some info to help get you there. Please note that this is based upon Alfresco 5.0 (which is lacking lots of documentation at this time but is based upon 4.x configuration options). Also please note that I am an Alfresco newbie and am here doing research because I've been told that some things aren't possible when I'm 98% sure they are. I'm presenting this in such a way that it will click for other newbies, although this may be very obvious to experts.

<strong>Foundational Info:</strong>
First, consider that Alfresco stores data in such a way that it's not possible to just directly access data through the native file system. This is by design, of course, due to versioning and millions of other features that Alfresco provides. Just in case this isn't clear - this means you cannot just log in to the server, look at the hard drive, and expect to find files. Metadata goes in the database and the files themselves are stored in a directory structure beyond the scope of this post.

Second, obviously users need some sort of way to access this data (beyond the web interface). Alfresco provides servers that encapsulate (hide) how Alfresco works internally and exposes "filesystems" as WebDAV, FTP, CIFS, etc. Based on my reading most folks leave these configured with defaults right out of the box and don't have advance usage scenarios.

What's important to note is that these servers expose what is basically a virtual file system. Besides being able to run multiple filesystem types concurrently (FTP, CIFS, etc), you can also run multiple of the same type (e.g. three different CIFS). For technical reasons (again beyond the scope of this post), running certain services on non-standard ports can become a huge, unsupportable headache. I'm looking at you, CIFS.

The way Alfresco seems to handle exposing filesystem servers is by creating a virtual folder under the root of the protocol for each server created.

<strong>My Solution:</strong>
So by default, Alfresco creates CIFS server (named "Alfresco") and when you connect via CIFS, you see Alfresco as your one and only folder. Same for FTP. My original post was asking about how to eliminate this due to some restrictions in path lengths in a legacy application, and from what I can tell this is not possible.

However, something that IS possible is setting up an additional fileserver under the same protocol(s) with a root path directly to your target folder. The benefit here is that I can leave the original fileserver configuration alone for users to access. Here is what I did to accomplish this:

<ol>
<li>I grabbed a copy of <em>file-servers-context.xml</em> from github and saved it as <em>[alfrescofolder]/tomcat/shared/classes/alfresco/extension/subsystems/fileServers/default/default/custom-file-servers-context.xml</em></li>
<li>I edited the above file and located the <em>fileSystemContexts</em> element. Inside <em>sourceList</em> there is a bean of class <em>org.alfresco.filesys.repo.ContentContext</em>. I duplicated that entire element. Now there are two.</li>
<li>I changed the duplicated element and set the <em>deviceName</em> property to another value (in my case "EDI"), and then I added a new property called <em>relativePath</em>. I set this to the path of a folder a few levels in.</li>
<li>I restarted Alfresco</li>
</ol>

Once alfresco came back up, when I connected to \\server\ (CIFS) or ftp://server/, I now saw two root level folders: the original "Alfresco" folder and a new "EDI" folder. When I go into my "EDI" folder I am immediately where I wanted to be.

So now, I can use "\\SERVERNAME\EDI\" instead of my previous "\\SERVERNAME\Alfresco\EDI\files", and the same goes for FTP. The way I did this makes this happen for all protocols sharing the same config, but I understand that it's possible to do this for individual protocols if you wish.

I hope this helps someone else!