首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >露天预览.ply文件

露天预览.ply文件
EN

Stack Overflow用户
提问于 2017-03-27 20:23:49
回答 1查看 143关注 0票数 1

我有一个STL预览器,可以预览文件与mime类型“应用程序/sla”在户外。因此,我希望将mime类型为"application/pla“的文件呈现为"application/sla”。为此,我使用以下脚本在文件夹上创建了一个规则

var renderingEngineName = 'reformat'; var renditionDefinitionName = 'cm:stl'; var renditionDef = renditionService.createRenditionDefinition(renditionDefinitionName, renderingEngineName); renditionDef.parameters['mime-type'] = 'application/sla'; renditionService.render(document, renditionDef);

我还可以在管理控制台的节点浏览器中看到呈现子项

但是,我仍然无法获得mime类型为"application/pla“的文件的预览。

我还采用了另一种方法,通过以下方式定义新的spring bean来创建自定义缩略图

代码语言:javascript
复制
<bean id="thumbnailDefinitionSTLpreview" class="org.alfresco.repo.thumbnail.ThumbnailDefinition">
    <property name="name" value="stl" />
    <property name="mimetype" value="application/sla" />
    <property name="transformationOptions">
        <!-- The thumbnail definition have transformationOptions mandatory -->
        <!-- But there are none for pdf, so use SWFTransformationsOptions as a dummy -->
        <bean class="org.alfresco.repo.content.transform.swf.SWFTransformationOptions">
            <property name="flashVersion" value="9" />
        </bean>
    </property>
 </bean>

  <bean id="baseThumbnailRegistry" abstract="true">
    <property name="contentService" ref="ContentService"/>
    <property name="renditionService" ref="renditionService" />
    <property name="transactionService" ref="TransactionService" />
    <property name="tenantAdminService" ref="tenantAdminService" />
    <property name="redeployStaticDefsOnStartup" value="${system.thumbnail.redeployStaticDefsOnStartup}" />
    <property name="thumbnailDefinitions">
        <list>
            <ref bean="thumbnailDefinitionMedium" />
            <ref bean="thumbnailDefinitionDoclib" />
            <ref bean="thumbnailDefinitionImgpreview" />
            <ref bean="thumbnailDefinitionAvatar" />
            <ref bean="thumbnailDefinitionAvatar32" />
            <ref bean="thumbnailDefinitionPDFpreview" />
            <ref bean="thumbnailDefinitionWebpreview" />
            <ref bean="thumbnailDefinitionSTLpreview" />
        </list>
    </property>
    <property name="thumbnailRenditionConvertor" ref="thumbnailRenditionConvertor" />
 </bean>

并在"web-preview.get.config.xml“中添加了以下代码,以使用创建的缩略图进行预览

代码语言:javascript
复制
<condition mimeType="application/sla">
      <plugin src="webpreview" paging="true">STLViewer</plugin>
      <plugin srcMaxSize="500000">Image</plugin>
</condition>

<condition thumbnail="stl">
         <plugin src="stl" paging="true">STLViewer</plugin>
</condition>

为了创建缩略图,我正在执行一个关于文件夹规则的脚本,如下所示

代码语言:javascript
复制
document.createThumbnail("stl", true);
document.save();

在最后,我能够得到STLViewer屏幕,但对象没有得到渲染。

如果有人能帮我解决这个问题,我会很高兴。

EN

回答 1

Stack Overflow用户

发布于 2017-03-30 19:11:37

你创建STLViewer插件了吗??您需要将js / css依赖文件添加到share/WEB-INF/classes/alfresco/web-extension/site-webscripts/org/alfresco/components/preview/include/web-preview-css-dependencies.lib.ftl和this -this-js-dependencies.lib.ftl文件中。

有关更多信息,请参阅this博客

票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/43046379

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档