我与Alfresco Community 4.0合作.
我使用cmis来更新Alfresco中的文档.
我已经在Alfresco中注册了一个文档,这是在保存方法之后检索的文档ID:b08e8bce-1b88-489e-a357-1e6385f180a1
现在我想通过其他内容更改此文件的内容.我用这个方法:
public void saveVersioning(File file, String filename, String userName, String pwd, String docId)
throws Exception {
SessionFactory factory = SessionFactoryImpl.newInstance();
Map<String, String> parameters = new HashMap<String, String>();
// User credentials.
parameters.put(SessionParameter.USER,userName);
parameters.put(SessionParameter.PASSWORD, pwd);
// Connection settings.
parameters.put(SessionParameter.BINDING_TYPE, BindingType.ATOMPUB.value());
parameters.put(SessionParameter.ATOMPUB_URL, "http://localhost:9080/alfresco/service/cmis"); // URL to your CMIS server.
// Create session.
// Alfresco only provides one repository.
Repository repository = factory.getRepositories(parameters).get(0);
Session session = repository.createSession();
System.out.println("Connected to repository:" + session.getRepositoryInfo().getName());
System.out.println("Repository id:"+session.getRepositoryInfo().getId());
// Get …Run Code Online (Sandbox Code Playgroud) 我正在开始一个新项目,必须决定我们将使用哪个CMIS客户端库.
我们的Java项目只需要连接一个CMIS服务器(实际上是Alfresco,但它无关紧要),以便执行一些读/写/搜索操作.
我正在寻找一个客户端库:
你会推荐哪一个?为什么?
以下是一些可能性:
我可以从Chrome REST客户端成功访问Sharepoint 2013 AtomPub界面,以下URL为我提供了我想要的文件:
http://ourintranet:100/personal/myname/_vti_bin/cmis/rest/5612e38e-a324-4030-9fee-7d05cd9053a4?getContentStream&objectId=4-512
Run Code Online (Sandbox Code Playgroud)
但是,在Camel CMIS路由中使用相同的URL会得到HTTP 302(找不到文件)并将我转移到错误页面.
我试过的路线是:
from("cmis:http://ourintranet:100/personal/myname/_vti_bin/cmis/rest/5612e38e-a324-4030-9fee-7d05cd9053a4?getContentStream&objectId=4-512")
.to("file:c:/myFolder")
Run Code Online (Sandbox Code Playgroud)
运行Wireshark以查看发生了什么,似乎Camel CMIS未将查询字符串部分传递给服务器,并且可能将其视为CMIS组件的选项(根据组件的使用指南).
那么,使用Sharel的Camel CMIS组件的正确方法是什么?
我是从Alfresco开始的.我安装了Alfresco 4社区版,我正在尝试使用OpenCMIS连接到它.我从OpenCMIS页面获取了这段代码:
SessionFactory sessionFactory = SessionFactoryImpl.newInstance();
Map<String, String> parameter = new HashMap<String, String>();
parameter.put(SessionParameter.USER, "admin");
parameter.put(SessionParameter.PASSWORD, "admin");
parameter.put(SessionParameter.ATOMPUB_URL,
"http://repo.opencmis.org/inmemory/atom/");
parameter.put(SessionParameter.BINDING_TYPE,
BindingType.ATOMPUB.value());
parameter.put(SessionParameter.REPOSITORY_ID,
"");
Session s = sessionFactory.createSession(parameter);
Run Code Online (Sandbox Code Playgroud)
但是,我无法找出存储库ID应该是什么以及如何指定Alfresco的URL.有人可以向我解释一下吗?谢谢.
远程CMIS存储库包含许多文件夹/文件.
我正在编写一个软件,使这些文件夹/文件的本地副本保持同步.
检查远程更改的最有效方法是什么?
(附加/删除文件/文件夹)
最有效=最少的带宽使用.
我只能使用CMIS协议,而且我无法在远程服务器上运行任何自定义软件.
我的想法到目前为止:
还有其他想法吗?
我不太了解CMIS协议,可能会有更方便的东西.
如果我得到它,Apache Sling将为Jackrabbit JCR存储库充当REST CRUD接口.
由于已经存在RESTful协议(其AtomPub实现中的CMIS)以与JCR存储库一起工作,除了视图/模板层之外,使用Apache Sling与CMIS(即通过Apache Chemistry)有什么优势吗?
使用CMIS不支持的JCR(Sling)可以做些什么吗?
我正在尝试使用 Apache Chemistry 连接到 CMIS 服务器,当它使用 AtomPumb url 配置时,它可以正常工作,但是当我切换到 webservices 并尝试创建会话时,它会引发此错误:
java.lang.NoSuchMethodError: com.sun.xml.internal.ws.api.message.Message.getHeaders()
Lcom/sun/xml/internal/ws/api/message/HeaderList;
Run Code Online (Sandbox Code Playgroud)
这些是我的 POM 中的依赖项:
<!-- * * * * * * * * * * * * * * * * * * * * -->
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-commons-api</artifactId>
<version>0.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-client-impl</artifactId>
<version>0.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-commons-impl</artifactId>
<version>0.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-client-bindings</artifactId>
<version>0.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-client-api</artifactId>
<version>0.13.0</version>
</dependency>
<dependency>
<groupId>org.apache.chemistry.opencmis</groupId>
<artifactId>chemistry-opencmis-workbench</artifactId>
<version>0.13.0</version>
</dependency>
<!-- * * * * * * * * * * …Run Code Online (Sandbox Code Playgroud) 我们将Alfresco用作存储库,并使用Apache CMIS api对其进行查询。
我们使用下面的代码来连接它。
parameter.put(SessionParameter.ATOMPUB_URL, "http://localhost:8080/alfresco/api/-default-/cmis/versions/1.1/atom?maxItems=1000");
Run Code Online (Sandbox Code Playgroud)
查询露天...
OperationContext opCon = session.createOperationContext();
opCon.setLoadSecondaryTypeProperties(true);
opCon.setMaxItemsPerPage(1000);
session.query(queryStr);
Run Code Online (Sandbox Code Playgroud)
但是CMIS始终仅返回100条记录。但是,当我使用独立的CMIS工作台程序并提供上述URL以maxItems = 1000连接到Alfresco时,它将返回1000条记录。
当我使用JAVA CMIS api时,maxItems参数不起作用。
请帮忙。
谢谢
cmis ×10
alfresco ×4
java ×3
jcr ×2
apache-camel ×1
jackrabbit ×1
maven ×1
repository ×1
sharepoint ×1
sling ×1
webdav ×1