如何使用 Alfresco“在线编辑” Spring MVC 应用程序的功能
我目前正在研究 Alfresco 的 Sharepoint 功能。 我安装了 Alfresco 3.4,并按照Web 快速入门安装进行操作。
然后,我将一个 Word 文档上传到 Alfresco,并可以在浏览器中导航到该文档。我的网址是 http://localhost:8080/share/page/site/webqs/document-details?nodeRef=workspace://SpacesStore/f7f5881e-320e-4d73-85e4-b62752fef1b8
使用 Internet Explorer “文档操作”部分下有一个“在线编辑”按钮。遗憾的是,此按钮在 Firefox 或 google chrome 中不可用。该按钮的 HTML 源代码对我没有多大帮助,因为我可以看到一个 URL:
<div class="onActionEditOnline">
<a rel="edit,online-edit" href="" class="action-link" title="Edit Online">
<span>Edit Online</span>
</a>
</div>
在露天站点研究内容时,人们建议学习 Spring Surf 作为 Alfresco /share 应用程序是使用它编写的。 Spring Surf 教程使用 Roo,这又具有一个 Spring Surf 插件,我无法运行它,由其他人此处报告。
返回“在线编辑”按钮本身;当我单击它时,Word 文档会在客户端计算机上的 Word 中打开,我可以对其进行编辑 然后在 Word 中单击“保存”,使用 Sharepoint 协议将文档正确保存回 Alfresco。
我的问题是如何从我自己的 Spring MVC 应用程序访问此“在线编辑”功能?我想 在我的 JSP 之一上显示“在线编辑”按钮,但我不知道如何与 Alfresco 交互。有 有人做过这个吗?任何帮助表示赞赏!
I am currently investigating Alfresco's Sharepoint functionality.
I installed Alfresco 3.4 and followed the Web Quick Start Installation.
I then uploaded a word document to Alfresco and can navigate to it in a browser. My URL is http://localhost:8080/share/page/site/webqs/document-details?nodeRef=workspace://SpacesStore/f7f5881e-320e-4d73-85e4-b62752fef1b8
Using Internet Explorer there is an 'Edit Online' button under the 'Document Actions' section. Sadly this button is not available with firefox or google chrome. The HTML source for the button doesn't help me much as I can see a URL:
<div class="onActionEditOnline">
<a rel="edit,online-edit" href="" class="action-link" title="Edit Online">
<span>Edit Online</span>
</a>
</div>
While researching thing at the alfresco site people recommended learning Spring Surf as the Alfresco /share application was written using it. The Spring Surf tutorial uses Roo, this in turn has a Spring Surf addin, which I could not get running, reported by someone else here.
Back to the 'Edit Online' button itself; when I click it the word document is opened in Word on my client machine, I can edit it
and click save in Word, using the Sharepoint protocol the document is correctly saved back to Alfresco.
My question is how can I access this 'Edit Online' functionality from my own Spring MVC application? I would like
to have this 'Edit Online' button visible on one of my JSPs but I don't know how to interact with Alfresco. Has
anyone done this? Any help appreciated!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
Alfresco 中的 Sharepoint 集成利用运行 Sharepoint 服务器的嵌入式 Jetty 服务器。如果您查看“在线编辑”的 URL,它将显示与所有 Alfresco 网页不同的端口号(默认为 7070)。
我从未对这个主题进行过任何深入的调查,但由于 Sharepoint 是一个类似 WebDAV 的 HTTP 扩展,可能使用一些特殊的标头或内置的浏览器插件/功能,以便在您的网站中创建“在线编辑”功能,您只需必须提供 Alfresco 为在线编辑创建的相同 URL,并确保用户正在运行 IE。这会将用户引导至 VTI 服务器,从而几乎完全将 SpringMVC 排除在外(您只需生成正确的 URL)。
编辑:alfresco 如何生成 VTI URL
查看 actions.js,它实际上生成共享中编辑在线链接的 URL。
_launchOnlineEditor
方法负责处理您看到的那些空链接的点击,它还提供创建 url 的逻辑:如果我们有例如:
使用 VTI 服务器的默认值,它将生成以下 URL :
如果您还继续阅读该方法,那么事实证明我完全错了:这不仅仅是将 Office 应用程序与特定 URL 关联起来的简单 MS 魔法,而是一个 ActiveX 控件 正在您的浏览器上创建,从而导致正确的调用:
这应该完成该图展示了如何从自定义应用程序创建 Sharepoint 链接,指向 Alfresco 存储库中的正确位置。
The Sharepoint integration in Alfresco makes use of an embedded Jetty server running the Sharepoint server. If you look at the URL that the "Edit Online", it will show a different port number than all Alfresco web pages (7070 by default).
I never ran any deep investigation on the subject, but since Sharepoint is a WebDAV-like extension of HTTP, possibly using some special headers or built in browser plugin/feature, in order to create an "Edit online" functionality in your site you just have to offer the same URLs Alfresco creates for online editing, and make sure the user is running IE. This will direct the user to the VTI server, thus almost completely leaving SpringMVC out of the picture (you just have to generate proper URLs).
EDIT: how alfresco generates VTI URLs
Have a look at actions.js, which is actually generating the URLs underlying the Edit Online links in Share. The
_launchOnlineEditor
method is what handles clicks to those empty links you saw, and it also provides the logic that creates the url:if we had e.g.:
with default values for the VTI server it would produce the following URL:
If you also continue reading that method, it turns out that I was totally wrong: it's not just simple MS magic that associate Office applications to specific URLs, but rather an ActiveX control being created on your browser that results in the proper invocation:
This should complete the picture of how to create Sharepoint links from your custom applications, pointing to the right location in the Alfresco repository.