2 Bugs in a row

1 Microsoft Office
1 Alfresco sharepoint connector.

One of our customers had decided they wanted alfresco instead of microsoft sharepoint (a very wise decision). However since alfresco is by default http and not https it would be very stupid to run it on the internet and it would probably not in sync with the contracts they sign about being confidential with customerdata. This does ask for a very simple solution: Run apache in front of tomcat, talk ajp to tomcat and serve everything over https.

This works very fine just out of the box. Even if the apache runs on a seperate machine. (Did I mention my general hate for java already). However to make sharepoint a very good sharepoint replacement you have to talk a seperate webdav/xml-rpc alike protocol that office does understand.

Alfresco coders decided that it would be too much of a hassle to put this into a nice tomcat web application talking via tomcat with the outside world. Instead they opted to create a:
Tomcat webapp that runs a webserver on it’s own on a seperate port.
If you haven’t had enought of this idea please continue reading..

Since this nice webapp doesn’t support https you have to put a proxy in front to make it talk https. Very simple idea, very bad exercise. I found 2 very annoying bugs.

To understand these bugs you need to know a little bit about URL. A URL is like
https://alfresco.domain.tld:7070/alfresco/some/document/directory/document.html

If you forget the bold part and send in the above document a link to /something it should make it link to https://alfresco.domain.tld:7070/something .

What does happen when you put apache in front of the sharepoint VTI for alfresco is that it does send links like:
http
://alfresco.domain.tld:7070/alfresco/some/document/directory/document.html

This does suck a little bit but should be fixable by sending a redirect or just rewrite the document. However Office does also have a bug and tries to following URL (long):
https://alfresco.domain.tld:7070
/alfresco/http://alfresco.domain.tld:7070/alfresco/some/…/more/..

Which means that office totally ignores the whole concept of URL’s and just matches the first part of the URL and strips it off if it matches. If not it does just create a stupid URL.

The solution in alfresco to avoid rewriting is just to trust that the user application knows where the server lives and you should not care as a server application.

In FileOpenDialog.ftl replace:
<tr class=”recordSetRow” fileattribute=folder ID=”http://${host}${context}/${item.getPath()}”
with
<tr class=”recordSetRow” fileattribute=folder ID=”/${item.getPath()}”

This should work fine.

And the solution for office is simple: Follow the f**** web standards for once.

(Yes I did submit a bug report to alfresco)

2 Responses to “2 Bugs in a row”

  1. Willem Kossen Says:

    nice. And if these nice JAVA people didn’t compile all files into classes, you could actually update that ftl file in the implemented instance. Unfortunately, the ftl file doesn’t exist anymore. so in order to fix this, you need to recompile the updated vti module and redeploy the tomcat-java-whatyamightcallit which isn’t a quick fix really…

  2. Mark Says:

    Interesting. Do you have an updated vti module? As Willem Kossen pointed out, this really isn’t a quick fix unfortunately since you have to recompile the vti module…

    I can’t belive that the Alfresco team still hasn’t fixed it, 4 months after you submitted a bug report with a solution!

Leave a Reply