Client fixes for building WebDav/CIFS paths

git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@2169 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Kevin Roast
2006-01-20 18:17:53 +00:00
parent d152b3f48a
commit c5b8fba77b
4 changed files with 39 additions and 12 deletions

View File

@@ -19,6 +19,7 @@ package org.alfresco.web.ui.common;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException; import java.io.IOException;
import java.io.StringReader; import java.io.StringReader;
import java.io.UnsupportedEncodingException;
import java.net.URLEncoder; import java.net.URLEncoder;
import java.text.DateFormat; import java.text.DateFormat;
import java.text.SimpleDateFormat; import java.text.SimpleDateFormat;
@@ -50,6 +51,7 @@ import org.alfresco.repo.webdav.WebDAVServlet;
import org.alfresco.service.cmr.dictionary.DictionaryService; import org.alfresco.service.cmr.dictionary.DictionaryService;
import org.alfresco.service.cmr.model.FileFolderService; import org.alfresco.service.cmr.model.FileFolderService;
import org.alfresco.service.cmr.model.FileInfo; import org.alfresco.service.cmr.model.FileInfo;
import org.alfresco.service.cmr.model.FileNotFoundException;
import org.alfresco.service.cmr.repository.InvalidNodeRefException; import org.alfresco.service.cmr.repository.InvalidNodeRefException;
import org.alfresco.service.cmr.repository.NodeRef; import org.alfresco.service.cmr.repository.NodeRef;
import org.alfresco.service.cmr.repository.NodeService; import org.alfresco.service.cmr.repository.NodeService;
@@ -554,10 +556,18 @@ public final class Utils
} }
url = path.toString(); url = path.toString();
} }
catch (Exception e) catch (AccessDeniedException e)
{
// cannot build path if user don't have access all the way up
}
catch (FileNotFoundException nodeErr)
{
// cannot build path if file no longer exists
}
catch (UnsupportedEncodingException encErr)
{ {
if (logger.isWarnEnabled()) if (logger.isWarnEnabled())
logger.warn("Failed to calculate webdav url", e); logger.warn("Failed to calculate webdav url for node: " + node.getNodeRef(), encErr);
} }
break; break;
} }
@@ -581,10 +591,21 @@ public final class Utils
{ {
ContentContext contentCtx = (ContentContext) diskShare.getContext(); ContentContext contentCtx = (ContentContext) diskShare.getContext();
NodeRef rootNode = contentCtx.getRootNode(); NodeRef rootNode = contentCtx.getRootNode();
try
{
Path path = nodeService.getPath(node.getNodeRef()); Path path = nodeService.getPath(node.getNodeRef());
url = Repository.getNamePath(nodeService, path, rootNode, "\\", url = Repository.getNamePath(nodeService, path, rootNode, "\\",
"file:///" + navBean.getCIFSServerPath(diskShare)); "file:///" + navBean.getCIFSServerPath(diskShare));
} }
catch (AccessDeniedException e)
{
// cannot build path if user don't have access all the way up
}
catch (InvalidNodeRefException nodeErr)
{
// cannot build path if node no longer exists
}
}
} }
break; break;
} }

View File

@@ -1616,6 +1616,12 @@
<tag-class>org.alfresco.web.ui.common.tag.OutputTextTag</tag-class> <tag-class>org.alfresco.web.ui.common.tag.OutputTextTag</tag-class>
<body-content>JSP</body-content> <body-content>JSP</body-content>
<attribute>
<name>id</name>
<required>false</required>
<rtexprvalue>true</rtexprvalue>
</attribute>
<attribute> <attribute>
<name>value</name> <name>value</name>
<required>true</required> <required>true</required>

View File

@@ -250,10 +250,10 @@
<a:actionLink value="#{msg.download_content}" href="#{DocumentDetailsBean.downloadUrl}" target="new" id="link4" /> <a:actionLink value="#{msg.download_content}" href="#{DocumentDetailsBean.downloadUrl}" target="new" id="link4" />
</td> </td>
<td> <td>
<a href='<h:outputText value="#{DocumentDetailsBean.bookmarkUrl}" escape="false" id="out1" />' onclick="return false;"><h:outputText value="#{msg.details_page_bookmark}" id="out2" /></a> <a href='<a:outputText value="#{DocumentDetailsBean.bookmarkUrl}" id="out1" />' onclick="return false;"><a:outputText value="#{msg.details_page_bookmark}" id="out2" /></a>
</td> </td>
<td> <td>
<a href='<h:outputText value="#{DocumentDetailsBean.nodeRefUrl}" escape="false" id="out3" />' onclick="return false;"><h:outputText value="#{msg.noderef_link}" id="out4" /></a> <a href='<a:outputText value="#{DocumentDetailsBean.nodeRefUrl}" id="out3" />' onclick="return false;"><a:outputText value="#{msg.noderef_link}" id="out4" /></a>
</td> </td>
</tr> </tr>
</table> </table>

View File

@@ -248,10 +248,10 @@
<a:actionLink value="#{msg.view_in_cifs}" href="#{SpaceDetailsBean.cifsPath}" target="new" id="link2" /> <a:actionLink value="#{msg.view_in_cifs}" href="#{SpaceDetailsBean.cifsPath}" target="new" id="link2" />
</td> </td>
<td> <td>
<a href='<h:outputText value="#{SpaceDetailsBean.bookmarkUrl}" escape="false" id="out1" />' onclick="return false;"><h:outputText value="#{msg.details_page_bookmark}" id="out2" /></a> <a href='<a:outputText value="#{SpaceDetailsBean.bookmarkUrl}" id="out1" />' onclick="return false;"><a:outputText value="#{msg.details_page_bookmark}" id="out2" /></a>
</td> </td>
<td> <td>
<a href='<h:outputText value="#{SpaceDetailsBean.nodeRefUrl}" escape="false" id="out3" />' onclick="return false;"><h:outputText value="#{msg.noderef_link}" id="out4" /></a> <a href='<a:outputText value="#{SpaceDetailsBean.nodeRefUrl}" id="out3" />' onclick="return false;"><a:outputText value="#{msg.noderef_link}" id="out4" /></a>
</td> </td>
</tr> </tr>
</table> </table>