Preview for AUDIO and VIDEO files on DM

Hi

Is it possible to use the preview functionality using only the DM?

I know that it is possible for DOC, PDF and image files.

In the following picture you can see my example. I have a PDF, MOV, MP3 and DOC files. We can press the preview function only for PDF, and DOC(Office) files.

When I try to preview the MP3 and MOV files the message error is:

" Preview can not be generated for this document

Technical issue:

Blob path: files:files/1/file

org.nuxeo.ecm.platform.preview.api.PreviewException: Converter any2pdf is not available”

alt text

0 votes

2 answers

4904 views

ANSWER



Hi.

We finish this job. The Solution was to create the VideoPreviewer and AudioPreviewer (they extends AbstractPreviewer class and implements MimeTypePreviewer class).

I followed the Nuxeo document ( http://doc.nuxeo.com/display/NXDOC/Preview?src=search#Preview-MimeTypePreviewerDetails ). I contributed with these Preview classes using a config file, like these examples http://explorer.nuxeo.org/nuxeo/site/distribution/current/viewExtensionPoint/org.nuxeo.ecm.platform.preview.adapter.PreviewAdapterManagerComponent--MimeTypePreviewer

VideoPreviewer.java


public List

AudioPreviewer.java


public List

The result is: from every place where Nuxeo call the “Preview” action my classes are called. I'm just using the DAM jars (audio and video)

PS: I'm not sure if the VideoPreview conversion is the best solution, but it works.

0 votes



Thank you for the feedback.
09/04/2014


Hi,

This feature is provided by the DAM Marketplace Package. If you don't want the DAM interface, you can still try to deploy only the addons you're interested in: nuxeo-platform-audio and nuxeo-platform-video.

1 votes



Hi Julien Thanks for your help.

How can I deploy only these addons?

I've tried to download only the JAR files (with the same version as my nuxeo server 5.8) and copy them into $NUXEO_HOME/nxserver/bundles , but I got the following message error:

2014-07-21 09:47:28,372 ERROR [localhost-startStop-1] [org.nuxeo.runtime.osgi.OSGiRuntimeService] Nuxeo EP Started

======================================================================

Component Loading Errors:

  • Failed to register component: service:org.nuxeo.ecm.platform.audio.service.thumbnailfactory (java.lang.NoClassDefFoundError: org/jaudiotagger/tag/TagException)

======================================================================

07/21/2014

You're missing a third-party library (jaudiotagger-2.0.3.jar in that case) and probably a few others. That's the purpose of the Marketplace Package to also deploy the needed third-parties.

The simplest solution is to download the DAM package and pick from it the needed third-party libs (you can even deploy all of them, it's harmless):

$ ./bin/nuxeoctl mp-add nuxeo-dam
(...)
$ tree nxserver/data/packages/store/nuxeo-dam-5.9.3/
nxserver/data/packages/store/nuxeo-dam-5.9.3/
├── install
│   ├── artifacts-dam.properties
│   ├── bundles
│   │   ├── nuxeo-activity-5.9.3.jar
│   │   ├── nuxeo-dam-jsf-5.9.3.jar
│   │   ├── nuxeo-dam-theme-5.9.3.jar
│   │   ├── nuxeo-platform-audio-core-5.9.3.jar
│   │   ├── nuxeo-platform-audio-jsf-5.9.3.jar
│   │   ├── nuxeo-platform-video-api-5.9.3.jar
│   │   ├── nuxeo-platform-video-convert-5.9.3.jar
│   │   ├── nuxeo-platform-video-core-5.9.3.jar
│   │   ├── nuxeo-platform-video-jsf-5.9.3.jar
│   │   ├── nuxeo-rating-api-5.9.3.jar
│   │   ├── nuxeo-rating-core-5.9.3.jar
│   │   ├── nuxeo-rating-web-5.9.3.jar
│   │   └── nuxeo-runtime-datasource-5.9.3.jar
│   ├── lib
│   │   ├── antlr-runtime-3.1.3.jar
│   │   ├── chemistry-opencmis-client-api-0.10.0.jar
│   │   ├── chemistry-opencmis-client-impl-0.10.0.jar
│   │   ├── chemistry-opencmis-commons-api-0.10.0.jar
│   │   ├── chemistry-opencmis-commons-impl-0.10.0.jar
│   │   ├── chemistry-opencmis-server-bindings-0.10.0.jar
│   │   ├── chemistry-opencmis-server-support-0.10.0.jar
│   │   ├── commons-dbcp-1.4.jar
│   │   ├── geronimo-connector-2.2.1-NX1.jar
│   │   ├── geronimo-transaction-2.2.1.jar
│   │   ├── howl-1.0.1-1.jar
│   │   ├── httpcore-4.2.4.jar
│   │   ├── jaudiotagger-2.0.3.jar
│   │   ├── stax2-api-3.1.1.jar
│   │   ├── stax-api-1.0.jar
│   │   ├── stringtemplate-3.2.jar
│   │   └── woodstox-core-asl-4.2.0.jar
│   ├── templates
│   │   └── dam
│   │       ├── config
│   │       │   └── activity-datasource-config.xml
│   │       └── nuxeo.defaults
│   └── test-artifacts-dam.properties
├── install.xml
└── package.xml
07/24/2014

Hi Julien

I'm sorry, but I think I'm not undestand your point.

Do I have to develop my own Preview action?

Or Do I only copy all files ("nuxeo-platform-video.jar", "nuxeo-platform-audio.jar", "jaudiotagger-2.0.3.jar") into folders $NUXEO_HOME/nxserver/bundles and $NUXEO_HOME/nxserver/lib? After the copy… everything works well?

I made a Nuxeo update (all HOTFIX packages), and after that my message error was changed.

When I press the preview icon (the little eye icon) for audio and video files there is a message raised and a error log message. As following: alt text


The log message is:

2014-07-24 11:19:05,207 ERROR [http-bio-0.0.0.0-8080-exec-25] [org.nuxeo.ecm.platform.preview.restlet.PreviewRestlet] Could not build preview for missing blob at files:files/6/file
org.nuxeo.ecm.platform.preview.api.PreviewException: Error during conversion
    at org.nuxeo.ecm.platform.preview.adapter.base.ConverterBasedHtmlPreviewAdapter.getPreviewBlobs(ConverterBasedHtmlPreviewAdapter.java:154)
    at org.nuxeo.ecm.platform.preview.adapter.base.AbstractHtmlPreviewAdapter.getFilePreviewBlobs(AbstractHtmlPreviewAdapter.java:139)
    at org.nuxeo.ecm.platform.preview.restlet.PreviewRestlet.initCachedBlob(PreviewRestlet.java:206)
    at org.nuxeo.ecm.platform.preview.restlet.PreviewRestlet.handle(PreviewRestlet.java:136)
    at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
    at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
    at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
    at java.lang.reflect.Method.invoke(Method.java:601)
    at org.jboss.seam.util.Reflections.invoke(Reflections.java:22)
    at org.jboss.seam.intercept.RootInvocationContext.proceed(RootInvocationContext.java:31)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:56)
    at org.jboss.seam.transaction.RollbackInterceptor.aroundInvoke(RollbackInterceptor.java:28)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.core.BijectionInterceptor.aroundInvoke(BijectionInterceptor.java:68)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.nuxeo.ecm.platform.ui.web.util.NuxeoExceptionInterceptor.aroundInvoke(NuxeoExceptionInterceptor.java:79)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.core.MethodContextInterceptor.aroundInvoke(MethodContextInterceptor.java:44)
    at org.jboss.seam.intercept.SeamInvocationContext.proceed(SeamInvocationContext.java:68)
    at org.jboss.seam.intercept.RootInterceptor.invoke(RootInterceptor.java:107)
    at org.jboss.seam.intercept.JavaBeanInterceptor.interceptInvocation(JavaBeanInterceptor.java:166)
    at org.jboss.seam.intercept.JavaBeanInterceptor.invoke(JavaBeanInterceptor.java:102)
    at org.nuxeo.ecm.platform.preview.restlet.PreviewRestlet_$$_javassist_73.handle(PreviewRestlet_$$_javassist_73.java)
    at org.nuxeo.ecm.platform.ui.web.restAPI.SeamRestletFilter.doHandle(SeamRestletFilter.java:128)
    at org.restlet.Filter.handle(Filter.java:134)
    at org.restlet.Filter.doHandle(Filter.java:105)
    at org.restlet.Filter.handle(Filter.java:134)
    at org.restlet.Router.handle(Router.java:444)
    at com.noelios.restlet.ext.servlet.ServletConverter.service(ServletConverter.java:129)
    at org.nuxeo.ecm.platform.ui.web.restAPI.RestletServlet.service(RestletServlet.java:126)
    at javax.servlet.http.HttpServlet.service(HttpServlet.java:728)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:305)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.nuxeo.wss.servlet.BaseWSSFilter.doFilter(BaseWSSFilter.java:137)
    at org.nuxeo.wss.servlet.FailSafeWSSFilter.doFilter(FailSafeWSSFilter.java:55)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.nuxeo.ecm.core.management.jtajca.internal.Log4jWebFilter.doFilter(Log4jWebFilter.java:64)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.nuxeo.ecm.platform.ui.web.rest.FancyURLFilter.doFilter(FancyURLFilter.java:129)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.nuxeo.ecm.platform.wi.filter.WIRequestFilter.doFilter(WIRequestFilter.java:114)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.nuxeo.ecm.platform.web.common.requestcontroller.filter.NuxeoRequestControllerFilter.doFilter(NuxeoRequestControllerFilter.java:145)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.nuxeo.ecm.platform.ui.web.auth.NuxeoAuthenticationFilter.doFilterInternal(NuxeoAuthenticationFilter.java:614)
    at org.nuxeo.ecm.platform.ui.web.auth.service.NuxeoAuthFilterChain.doFilter(NuxeoAuthFilterChain.java:35)
    at org.nuxeo.ecm.platform.ui.web.auth.oauth.NuxeoOAuthFilter.doFilter(NuxeoOAuthFilter.java:119)
    at org.nuxeo.ecm.platform.ui.web.auth.service.NuxeoAuthFilterChain.doFilter(NuxeoAuthFilterChain.java:33)
    at org.nuxeo.ecm.platform.ui.web.auth.NuxeoAuthenticationFilter.doFilter(NuxeoAuthenticationFilter.java:410)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.nuxeo.ecm.platform.web.common.requestcontroller.filter.NuxeoCorsFilter.doFilter(NuxeoCorsFilter.java:51)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.nuxeo.ecm.platform.web.common.exceptionhandling.NuxeoExceptionFilter.doFilter(NuxeoExceptionFilter.java:79)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.nuxeo.ecm.platform.web.common.encoding.NuxeoEncodingFilter.doFilter(NuxeoEncodingFilter.java:69)
    at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:243)
    at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:210)
    at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:222)
    at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:123)
    at org.apache.catalina.authenticator.AuthenticatorBase.invoke(AuthenticatorBase.java:502)
    at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:171)
    at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:99)
    at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:118)
    at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:408)
    at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1023)
    at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:589)
    at org.apache.tomcat.util.net.JIoEndpoint$SocketProcessor.run(JIoEndpoint.java:312)
    at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1110)
    at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:603)
    at java.lang.Thread.run(Thread.java:722)
Caused by: org.nuxeo.ecm.core.convert.api.ConversionException: An error occurred trying to convert file /20130127_135423.mp4 to from video/mp4 to application/pdf
    at org.nuxeo.ecm.platform.convert.plugins.JODBasedConverter.convert(JODBasedConverter.java:325)
    at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:168)
    at org.nuxeo.ecm.platform.preview.converters.HtmlPreviewConverter.convert(HtmlPreviewConverter.java:123)
    at org.nuxeo.ecm.core.convert.service.ConversionServiceImpl.convert(ConversionServiceImpl.java:168)
    at org.nuxeo.ecm.platform.preview.adapter.base.ConverterBasedHtmlPreviewAdapter.getPreviewBlobs(ConverterBasedHtmlPreviewAdapter.java:147)
    ... 77 more
Caused by: java.lang.NullPointerException
    at org.nuxeo.ecm.platform.convert.plugins.JODBasedConverter.extendPDFFormat(JODBasedConverter.java:118)
    at org.nuxeo.ecm.platform.convert.plugins.JODBasedConverter.getDestinationFormat(JODBasedConverter.java:110)
    at org.nuxeo.ecm.platform.convert.plugins.JODBasedConverter.convert(JODBasedConverter.java:255)
    ... 81 more
07/24/2014

Hi,

The purpose of a Marketplace package is to avoid the pain of manually deploying some addons, their third-party dependencies and their configurations or contributions. However, it is still possible to individually deploy an addon and its requirements.

In your case, it seems what you want is only the audio and video preview features which are provided by the nuxeo-platform-video and nuxeo-platform-audio addons. My point is: manually deploying those two addons looks like installing the DAM package minus a few addons (nuxeo-dam, nuxeo-activity and nuxeo-rating) so you should success with simply copying bundles/nuxeo-platform* and lib/* (excessive third-party libraries are harmless).

Here is what I tried on a stock 5.9.5-SNAPSHOT Nuxeo and it worked fine (I could preview an MP3, a WMV and an Ogg Media):

  • ./bin/nuxeoctl mp-install nuxeo-dam
  • rm nxserver/bundles/nuxeo-activity- nxserver/bundles/nuxeo-dam- nxserver/bundles/nuxeo-rating-*
  • vi bin/nuxeo.conf (removed "dam" from nuxeo.templates)
  • ./bin/nuxeoctl start

Of course, this is not a recommended procedure: hacking the content of the server is bad (especially for later maintenance). You should duplicate the nuxeo-marketplace-dam/marketplace and customize it to build a custom "audio and video preview" Marketplace package.

Note my computer is already configured accordingly to ADMINDOC/Installing+and+Setting+up+Related+Software

07/29/2014