【发布时间】:2017-05-31 11:49:40
【问题描述】:
我目前正在开发一个 java/jee 应用程序,使用 alfresco 作为 ged 和 spring 作为框架。我想在导航器中显示一个文件而不需要身份验证。那么我该怎么做。顺便说一下,我有 2 个模块我的项目:前端和后端通过休息调用进行通信。从后端我尝试传递对象的字节数组,但不幸的是我将它作为字符串接收,所以我无法使用它。所以有什么建议可以解决这个问题?
public Map<String, Object> getCourrierDetails(String idCourrier) throws Exception {
Map<String, Object> courriersDetails = runtimeService.getVariables(idCourrier);
courriersDetails.put("idCourrier", idCourrier);
DocumentDaoImpl dao=new DocumentDaoImpl();
Document docCmis = (Document) dao.getDocument("workspace://SpacesStore/73871a36-9a6c-42c6-b3e3-7d68362fe9c0");
byte[] myByteArray = readContent(docCmis.getContentStream().getStream());
ByteArrayResource resource = new ByteArrayResource(myByteArray) {
@Override
public String getFilename() {
return docCmis.getContentStreamFileName();
}
};
System.out.println(resource.getFilename());
//courriersDetails.put("resources", myByteArray);
System.out.println(courriersDetails.get("resources")+" rrrr");
//courriersDetails.put("contentStream",docCmis.getContentStream().getStream());
return courriersDetails;
}
【问题讨论】:
-
据我所知,您只能显示 PDF 文档,您将使用 InputStream 进行工作
标签: javascript java alfresco cmis opencmis