1.背景
我想实现一个Alfresco-Share Java支持的webscript,就像现有的"I18N资源和消息Web脚本"一样.主要的区别是我想使用响应输出流(而不是编写器).
使用的Alfresco-Share版本:4.1.1.
2.测试用于重现错误的代码
- 春豆:
<bean id="webscript.test.content.get" parent="webscript" class="test.TestWebscript" />
Run Code Online (Sandbox Code Playgroud)
- Java代码:
package test;
import java.io.IOException;
import org.springframework.extensions.webscripts.AbstractWebScript;
import org.springframework.extensions.webscripts.WebScriptRequest;
import org.springframework.extensions.webscripts.WebScriptResponse;
public final class TestWebscript extends AbstractWebScript
{
@Override
public void execute(final WebScriptRequest request, final WebScriptResponse response) throws IOException
{
response.getOutputStream().write("test".getBytes());
}
}
Run Code Online (Sandbox Code Playgroud)
- Webscript desc文件:
<?xml version="1.0" encoding="UTF-8"?>
<webscript>
<shortname>Test webscript</shortname>
<description>A webscript using the response outputstream</description>
<url>/test/content</url>
<format default="">extension</format>
<lifecycle>draft_public_api</lifecycle>
<authentication>guest</authentication>
<transaction>required</transaction>
<family>Tests</family>
</webscript>
Run Code Online (Sandbox Code Playgroud)
3.结果
我有以下例外:
java.lang.IllegalStateException: getOutputStream() has already been called for this response …Run Code Online (Sandbox Code Playgroud) 我正在努力进行alfresco 4.2社区的补充.现在我必须使用某种扫描功能来扫描文档的硬拷贝并上传.
我用谷歌搜索,但没有找到任何好的解决方案.
我想知道是否可以在 Alfresco 共享标题中添加“回收站”按钮。

(来源:alfresco.com)
我正在使用最新版本的Alfresco 5.0.a.我遵循了维基指南关于限制Alfresco网站创建的权限.我只希望Alfresco管理员能够创建它们.我遵循了Alfresco Wiki的指南:
在Alfresco 3.4.6及更高版本中控制站点创建权限
在Alfresco版本3.4.6(及更高版本)和4.0中,站点根目录上的权限已更改.要确保仅在站点根目录中创建"站点"对象,已从"站点"根目录中删除">""贡献者"权限,现在将在"站点服务"本身上处理"站点创建">"权限".
对于Alfresco 4.0,要更改谁能够创建站点,您需要更改spring> context以设置权限.一种方法是更改alfresco/public-services-security-context.xml文件(在webapps/alfresco/WEB-INF/classes/alfresco/public-services-security-context.xml中的默认安装中)
改变
org.alfresco.service.cmr.site.SiteService.createSite = ACL_ALLOW
至
org.alfresco.service.cmr.site.SiteService.createSite = ACL_METHOD.ROLE_ADMINISTRATOR
我找到了另一个Spring文件,类似于wiki中的文件,位于$ TOMCAT_HOME/shared/classes/alfresco/extension/unsecured-public-services-security-context.xml
但我没有找到那些Spring bean系列.所以我添加了这段代码:
<bean id="SiteService_security" class="org.alfresco.repo.security.permissions.impl.acegi.MethodSecurityInterceptor">
<property name="authenticationManager">
<ref bean="authenticationManager"/>
</property>
<property name="accessDecisionManager">
<ref local="accessDecisionManager"/>
</property>
<property name="afterInvocationManager">
<ref local="afterInvocationManager"/>
</property>
<property name="objectDefinitionSource">
<value>
org.alfresco.service.cmr.site.SiteService.createSite=ACL_METHOD.ROLE_ADMINISTRATOR
org.alfresco.service.cmr.site.SiteService.*=ACL_ALLOW
</value>
</property>
</bean>
Run Code Online (Sandbox Code Playgroud)
我得到了这个(以及许多其他例外,但可能这是最有趣的一个)
我添加了catalina.out可能有趣的异常:
2014年7月17日下午11:59:38 org.apache.catalina.core.StandardContext listenerStart SEVERE:将上下文初始化事件发送到类org.alfresco.web.app.ContextLoaderListener org.springframework.beans.factory.parsing的侦听器实例的异常.BeanDefinitionParsingException:配置问题:无法从URL位置导入bean定义[classpath:alfresco/application-context.xml]违规资源:ServletContext资源[/WEB-INF/web-application-context.xml]; 嵌套异常是org.springframework.beans.factory.parsing.BeanDefinitionParsingException:配置问题:无法从URL位置导入bean定义[classpath*:alfresco/extension/* - context.xml]违规资源:类路径资源[alfresco/application -context.xml]; 嵌套异常是org.springframework.beans.factory.xml.XmlBeanDefinitionStoreException:来自文件的XML文档中的第29行[/opt/alfresco-5.0.a/tomcat/webapps/alfresco/WEB-INF/classes/alfresco/extension/public- services-security-context.xml]无效; 嵌套异常是org.xml.sax.SAXParseException; lineNumber:29; columnNumber:9; 标识符为"afterInvocationManager"的元素必须出现在文档中.
我不知道该怎么办.我找不到public-services-security-context.xml Spring文件.尽管我找到了类似的文件,但指南中提出的任何更改都是无用的.有什么想法吗?非常感谢你.我最好的问候.
Mattia Parise
如何在模型文件中的工作流程中拥有文件上传属性?
我使用alfresco 4.2版本.我想在下面的代码中添加fileupload的属性,允许用户在工作流程中上传文件.
<type name="iabookwf:createProjectSizingTask">
<parent>bpm:workflowTask</parent>
<properties>
<property name="iabookwf:mandays">
<title>Estimated Man Days</title>
<type>d:int</type>
<mandatory>true</mandatory>
</property>
<property name="iabookwf:totalCost">
<title>Total Estimated Cost</title>
<type>d:double</type>
<mandatory>true</mandatory>
</property>
</properties>
<overrides>
<property name="bpm:packageItemActionGroup">
<default>edit_package_item_actions</default>
</property>
</overrides>
<mandatory-aspects>
<aspect>bpm:assignee</aspect>
</mandatory-aspects>
</type>
Run Code Online (Sandbox Code Playgroud) 我想使用Afresco REST API下载文档.经过一些研究后,我发现了这个REST API:
/alfresco/s/api/node/content{property}/{store_type}/{store_id}/{id}
Run Code Online (Sandbox Code Playgroud)
但我不知道如何传递参数.
如果我在Share中的文档详细信息URL是:
http://127.0.0.1:8080/share/page/context/mine/document-details?nodeRef=workspace://SpacesStore/7f77488a-60a0-48c3-9369-77183ccad0d2
Run Code Online (Sandbox Code Playgroud)
什么应该被传递{property},{store_type},{store_id}和{id}?
我在互联网上看到很多相互矛盾的信息Alfresco Share clustering.根据我的发现,看起来群集已从Alfresco Community版本中完全删除4.2 and above.
我确实找到了一些文档,显示Alfresco One 5有Share clustering,我注意到我可以启用hazelcast,Alfresco Community 5但集群根本不起作用.
有没有办法Alfresco Community 5在负载均衡器后面有多个实例,并且在共享实例之间发生了适当的同步/复制/集群?
在Alfresco Share中,搜索页面是通过Aikau实现的。我对一个更笼统的问题感兴趣,是否可以调试Aikau小部件?
我已经找到了有关此问题的一些链接,但它们更多地讨论了日志记录,而不是实际的JavaScript调试:
假设我有以下Aikau小部件alfresco / search / AlfSearchResult及其内部的以下方法:
/**
* This function is called to create a
* [SearchResultPropertyLink]{@link module:alfresco/renderers/SearchResultPropertyLink} widget
* to render the displayName of the result. It can be overridden to replace the default widget
* with a reconfigured version.
*
* @instance
*/
createDisplayNameRenderer: function alfresco_search_AlfSearchResult__createDisplayNameRenderer() {
// jshint nonew:false
var config = {
id: this.id + "_DISPLAY_NAME",
currentItem: this.currentItem,
pubSubScope: this.pubSubScope,
propertyToRender: "displayName",
renderSize: "large",
newTabOnMiddleOrCtrlClick: this.newTabOnMiddleOrCtrlClick,
defaultNavigationTarget: this.navigationTarget
};
if (this.navigationTarget)
{ …Run Code Online (Sandbox Code Playgroud)我正在尝试修改 share-config-custom.xml 以便我可以通过以下属性搜索电子邮件:
<!-- cm:emailed aspect -->
<show id="cm:originator" />
<show id="cm:addressee" />
<show id="cm:addressees" />
<show id="cm:sentdate" />
<show id="cm:subjectline" />
Run Code Online (Sandbox Code Playgroud)
这是我的 share-config-custom.xml:
<config evaluator="model-type" condition="cm:content">
<forms>
<form label="Mails">
<field-visibility>
<show id="cm:originator" />
<show id="cm:addressee" />
<show id="cm:addressees" />
<show id="cm:sentdate" />
<show id="cm:subjectline" />
</field-visibility>
</form>
</forms>
</config>
<config evaluator="string-compare" condition="AdvancedSearch">
<advanced-search>
<!-- Forms for the advanced search type list -->
<forms>
<!--
The 'form' config element contains the name of the model type
of the form to …Run Code Online (Sandbox Code Playgroud) 我有一个露天3.4.d实例,在尝试为PDF生成缩略图时似乎有内容转换问题.
是否有一种快速方法来禁用缩略图生成以确认我的怀疑?