Tag: alfresco

如何使用java在alfresco中以编程方式获取相关(对等关联)节点?

所以我目前有一个节点,即广告系列,它有一个引用名为authorised_by的用户表的字段/关联。 在代码中我可以像这样设置关联: nodeService.createAssociation(mcdNodeRef, newAuthority, CustomContentModel.ASSOC_MCD_CAMP_AUTHORITY); 现在我需要基本上对这个过程进行逆向工程,并将关联的值从露天数据库中取回,但是没有getAssociation方法,似乎无法解决这个问题。 谢谢

如何使用Java代码将文档添加到Alfresco存储库?

编辑:显然我必须制作一个AMP并将其映射到Alfresco.war。 但现在我无法访问我编写的代码,所以我想我将不得不使用Webscripts等。 有人可以提供一个如何使用Java支持的webscript将文档添加到Alfresco存储库的示例吗? 原始问题: 我在谷歌范围内搜索了一种使用Java代码将文档添加到Alfresco存储库的方法。 但我无法找到一种可行的方法。 我知道如何将文档添加到存储库:使用NodeService。 但问题是我无法获得NodeService的实例。 我试图用@Autowired注入它,我尝试使用bean并尝试使用ApplicationContext。 没有一种方法有效…… 方式#1: 注入课程: @Autowired NodeService nodeService 方式#2: 在service-context.xml中: 在课堂上,我为所有服务和serviceRegistry添加了一个getter和setter: private NodeService nodeService; public void setNodeService(NodeService nodeService) { this.nodeService = nodeService; } 方式#3: appContext = new ClassPathXmlApplicationContext(“classpath:alfresco/application-context.xml”); serviceRegistry = (ServiceRegistry) appContext.getBean(ServiceRegistry.SERVICE_REGISTRY); nodeService = serviceRegistry.getNodeService(); 方式#1和#2给了我一个NullPointerException,只是声明NodeService为null。 方式#3给出了一英里长的StackTrace因为AlfrescoRuntimeException,因为它无法初始化密钥库: Exception in thread “main” java.lang.reflect.InvocationTargetException at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57) at […]

如何使用CMIS REST API访问Alfresco中的文件?

我在我的应用程序中安装了Alfresco Community v4.1。 我想使用CMIS REST API访问其内容(列表文件,添加,删除等)。 我没有找到我需要使用的端点的任何示例。 我使用Apache Chemistry实现了一个小型CMIS客户端(你可以在这里获得它的信息)并列出我用户空间的内容,我得到了这个结果: [Folder] workspace://SpacesStore/624914c7-3ca2-4937-a612-96f1df928cc1 – Dictionnaire de données [Folder] workspace://SpacesStore/846c69d4-4ec2-44c8-972d-f975d9b98d41 – Modèles d’espace [Folder] workspace://SpacesStore/09fe45df-9cba-4843-a1cb-944807e44267 – Projet de conception logicielle …. [Folder] workspace://SpacesStore/ab5cab42-2b47-4042-a8f5-57bb06007cc3 – Espaces Utilisateurs [Folder] workspace://SpacesStore/86f1c760-905e-4920-98a8-a6bdd10aa732 – ombinte [Folder] workspace://SpacesStore/2dbc6156-fdfa-4ddc-9187-481992570369 – MonProjet [Folder] workspace://SpacesStore/fb3bb96f-3eb0-40a5-a890-3d06d6e781cf – Carnet 200 [Folder] workspace://SpacesStore/b9acaf70-d5d5-4dba-a354-bae63ba96072 – Carnet 100 [Docment] workspace://SpacesStore/9c3c6e63-e217-47a8-8216-298d2419cffa;1.0 – file.pdf […]

Alfresco分享登录问题

我在本地安装alfresco共享时发现了一些问题。 当我尝试登录时使用 HTTP://本地主机:8080 /股 它返回给我这个错误消息: The remote server may be unavailable or your authentication details have not been recognized 在我的日志中,我可以看到: 12:02:28,491 http-8080-1 DEBUG [commons.httpclient.HttpClient] Java version: 1.6.0_26 12:02:28,492 http-8080-1 DEBUG [commons.httpclient.HttpClient] Java vendor: Apple Inc. 12:02:28,493 http-8080-1 DEBUG [commons.httpclient.HttpClient] Java class path: /Users/andrea.girardi/Documents/Works/Project/alfresco-3.4.e/tomcat/bin/bootstrap.jar 12:02:28,493 http-8080-1 DEBUG [commons.httpclient.HttpClient] Operating system name: Mac OS X 12:02:28,493 http-8080-1 […]

与alfresco cmis连接

我正在尝试使用配置参数连接alfresco,但我收到错误: Config: sessionParameters.put(SessionParameter.USER, “admin”); sessionParameters.put(SessionParameter.PASSWORD, “admin”); sessionParameters.put(SessionParameter.ATOMPUB_URL, “http://localhost:8080/alfresco/service/cmis”); sessionParameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value()); sessionParameters.put(SessionParameter.REPOSITORY_ID, “CIPBASE”); sessionParameters.put(SessionParameter.AUTH_HTTP_BASIC, “true” ); sessionParameters.put(SessionParameter.COOKIES, “true” ); 错误是: org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException: Not Found at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:499) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:701) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getRepositoriesInternal(AbstractAtomPubService.java:873) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:66) at org.apache.chemistry.opencmis.client.bindings.impl.RepositoryServiceImpl.getRepositoryInfos(RepositoryServiceImpl.java:92) at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:137) at org.apache.chemistry.opencmis.client.runtime.SessionFactoryImpl.getRepositories(SessionFactoryImpl.java:114) at com.bvonesource.rsm.common.AlfrescoConnection.AlfrescoDument(AlfrescoConnection.java:71) at com.bvonesource.rsm.mgtbean.AdminManagement.MatrixMgtView.callAlfresco(MatrixMgtView.java:208) at com.bvonesource.rsm.mgtbean.AdminManagement.MatrixMgtView$$FastClassByCGLIB$$9e86b32e.invoke() at net.sf.cglib.proxy.MethodProxy.invoke(MethodProxy.java:149) at org.springframework.aop.framework.Cglib2AopProxy$CglibMethodInvocation.invokeJoinpoint(Cglib2AopProxy.java:692) at org.springframework.aop.framework.ReflectiveMethodInvocation.proceed(ReflectiveMethodInvocation.java:150) at org.springframework.aop.aspectj.MethodInvocationProceedingJoinPoint.proceed(MethodInvocationProceedingJoinPoint.java:80) at com.bvonesource.foundation.aspect.TracingAspect.invoke(TracingAspect.java:81) at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) […]

自动生成用户密码并直接向相应用户发送有关其在Alfresco中的登录凭据的邮件

我的任务是在Alfresco中执行以下操作: 创建用户时,将自动生成密码并将登录凭据直接发送到用户电子邮件地址,而不是管理员必须输入密码并将其手动发送给新创建的用户。 请指导我如何开始并继续…

禁用用户主文件夹创建

当admin用户创建用户时,我自定义代码以打开和关闭“homeFolderCreationEager”,但它只能延迟创建文件夹。 当相应的用户登录时,将自动创建该用户的文件夹。 我怎样才能防止这种情况发生? 任何帮助表示赞赏。

尝试访问我的Alfresco存储库时出现CmisObjectNotFoundException

我是CMIS和Alfresco的新手,在尝试使用AtomPUB绑定连接到我的Alfresco存储库时遇到了这个错误。 我不知道我的问题的根源。 除非是function吗? 这是我的凭证吗? 当我安装它时,我只选择: – Alfresco社区 – Solr4 如果我想使用Web服务,该怎么办? 我应该在Alfresco中安装特定的插件吗? 我得到了错误: SLF4J: Class path contains multiple SLF4J bindings. SLF4J: Found binding in [jar:file:/C:/Users/ME%2ME/.m2/repository/org/slf4j/slf4j-simple/1.7.9/slf4j-simple-1.7.9.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: Found binding in [jar:file:/C:/Users/ME%2ME/.m2/repository/ch/qos/logback/logback-classic/1.1.3/logback-classic-1.1.3.jar!/org/slf4j/impl/StaticLoggerBinder.class] SLF4J: See http://www.slf4j.org/codes.html#multiple_bindings for an explanation. SLF4J: Actual binding is of type [org.slf4j.impl.SimpleLoggerFactory] Exception in thread “main” org.apache.chemistry.opencmis.commons.exceptions.CmisObjectNotFoundException: Introuvable at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.convertStatusCode(AbstractAtomPubService.java:499) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.read(AbstractAtomPubService.java:701) at org.apache.chemistry.opencmis.client.bindings.spi.atompub.AbstractAtomPubService.getRepositoriesInternal(AbstractAtomPubService.java:873) at […]

Spring RESTful客户端:root标签exception

我试图使用RestTemplate解析RESTFull调用的结果,如下示例http://thekspace.com/home/component/content/article/57-restful-clients-in-spring-3.html XML Response就是这样的: 1111111 Test 首先,我配置了我的application-context.xml: com.kipcast.dataModel.drugs.bean.BrandViewList com.kipcast.dataModel.drugs.bean.BrandViewList类是一个定义了@XStreamAlias(“brand”)的bean。 我在这里如何做其余的电话: ApplicationContext applicationContext = new ClassPathXmlApplicationContext(“application-context.xml”, WebscriptCaller.class); RestTemplate restTemplate = applicationContext.getBean(“restTemplate”, RestTemplate.class); String url = “http://localhost:8081/alfresco/service/search/brand.xml?q={keyword}&alf_ticket={ticket}”; List results = (List) restTemplate.getForObject(url, List.class, params); WebscriptCaller.class是我执行这些指令的类。 当我尝试执行它时,getForObject()失败并且我得到了该exception: XStream unmarshalling exception; nested exception is com.thoughtworks.xstream.mapper.CannotResolveClassException: brands 我的问题是,我该如何解决这个问题? 为什么我会遇到这种例外? 我怎么能告诉他跳过root标签? – – – – – – – 更新 – – – […]

使用版本在alfresco中保存文件并下载最新版本

我在露天社区4.0工作,我使用这个jar alfresco-web-service-client-4.0.d.jar 使用此代码我可以在露天保存我的test.pdf文件: File file = new File(“C:/test.pdf”); saveAttachement(file,”test.pdf”, “/app:company_home/cm:MyFolder”, “admin”, “admin”) public String saveAttachement(File file, String name, String folderName, String userName, String pwd) throws Exception { byte[] contentByte = IOUtils.toByteArray(new FileInputStream(file)); // Start the session AuthenticationUtils.startSession(userName, pwd); try { // Create a reference to the parent where we want to create content Store storeRef […]