我已经为 liferay 配置了 openoffice,它工作正常。我可以看到 .ppt 格式的预览,但 liferay 没有生成任何 ppt 格式的预览。
问问题
94 次
1 回答
0
好的,因为我无法找到解决这个问题的方法,所以我做了什么,我将扩展名 .pps 更改为 .ppt 后端,如下所示
String sourceFileName = file.getName();
String mimeType =MimeTypesUtil.getContentType(file);
int index = sourceFileName.indexOf(".");
String extension = sourceFileName.substring(index);
String name = sourceFileName.substring(0 ,index);
if(extension.equalsIgnoreCase(".pps")){
sourceFileName = name+".ppt";
}
String title = "title name";
String description="desc of video";
String changeLog = StringPool.BLANK;
ServiceContext serviceContext = new ServiceContext();
serviceContext.setAddCommunityPermissions(true);
serviceContext.setAddGuestPermissions(true);
serviceContext.setAddGroupPermissions(true);
DLAppLocalServiceUtil.addFileEntry(userId, repositoryId, folderId, sourceFileName, mimeType, title, description, changeLog, file, serviceContext);
这对我有用,而且它制作预览。我不知道它是否正确,但它对我有用。
于 2013-11-06T12:46:52.173 回答