cancel
Showing results for 
Search instead for 
Did you mean: 

How to create a new metadata extractor - MAGE-ML tag

sergio
Champ in-the-making
Champ in-the-making
Hi all.

I am going to use Alfresco for a bio-informatics project. We want to use the capabilities of Alfresco to store, manage and retrieve microarray data. In order to reach this goal we want to store MAGE-ML files - XML files - in which there are many tags we want to extract at run-time during the upload step. For each file we have to extract a set of tags and their corresponding values. The extracted metadata will be available for queries in the advanced search function.

The problem is: what is the best way to approach the problem?

I think to create some new java classes, just on the way of HtmlMetadataExtracter and others contained into the repo\content\metadata directory of the project. For example a class named MAGEMLExtracter.java that implements the extraction of some specific metadata.

Is this the correct way? What are the steps I have to do in order to create this kind of extension for Alfresco?

Any suggestions will be appreciated.
18 REPLIES 18

paulhh
Champ in-the-making
Champ in-the-making
This is really cool work - if you have any ideas on how we can make it easier for people to build extensions and make them available, please let us know.

Cheers
Paul.

emorretta
Champ in-the-making
Champ in-the-making
Hi,
I have tried to install the xmp Extension but I have had problems because after the installation as described by the readme file the jboss server doesn't deploy alfresco because it doesn't find just installed beans. Follow I show the server.log file content of jboss:

2008-03-28 17:33:56,484 ERROR [org.springframework.web.context.ContextLoader] Context initialization failed
org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'org.alfresco.repo.content.metadata.GenericMetadataEmbedder' defined in file [C:\jboss-4.0.5.GA\server\default\conf\alfresco\extension\dublin-core-context.xml]: Could not resolve parent bean definition 'baseMetadataEmbedder'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'baseMetadataEmbedder' is defined
Caused by:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'baseMetadataEmbedder' is defined
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:340)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:906)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:952)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:920)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:906)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:159)
   at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:691)
   at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:395)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:328)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
   at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
   at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
   at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
   at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
   at org.jboss.web.WebModule.startModule(WebModule.java:83)
   at org.jboss.web.WebModule.startService(WebModule.java:61)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
   at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
   at $Proxy0.start(Unknown Source)
   at org.jboss.system.ServiceController.start(ServiceController.java:417)
   at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy38.start(Unknown Source)
   at org.jboss.web.AbstractWebContainer.start(AbstractWebContainer.java:466)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
   at org.jboss.mx.interceptor.DynamicInterceptor.invoke(DynamicInterceptor.java:97)
   at org.jboss.system.InterceptorServiceMBeanSupport.invokeNext(InterceptorServiceMBeanSupport.java:238)
   at org.jboss.ws.integration.jboss.DeployerInterceptor.start(DeployerInterceptor.java:92)
   at org.jboss.deployment.SubDeployerInterceptorSupport$XMBeanInterceptor.start(SubDeployerInterceptorSupport.java:188)
   at org.jboss.deployment.SubDeployerInterceptor.invoke(SubDeployerInterceptor.java:95)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy39.start(Unknown Source)
   at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
   at sun.reflect.GeneratedMethodAccessor55.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy8.deploy(Unknown Source)
   at org.jboss.deployment.scanner.URLDeploymentScanner.deploy(URLDeploymentScanner.java:421)
   at org.jboss.deployment.scanner.URLDeploymentScanner.scan(URLDeploymentScanner.java:634)
   at org.jboss.deployment.scanner.AbstractDeploymentScanner$ScannerThread.doScan(AbstractDeploymentScanner.java:263)
   at org.jboss.deployment.scanner.AbstractDeploymentScanner.startService(AbstractDeploymentScanner.java:336)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalStart(ServiceMBeanSupport.java:289)
   at org.jboss.system.ServiceMBeanSupport.jbossInternalLifecycle(ServiceMBeanSupport.java:245)
   at sun.reflect.GeneratedMethodAccessor2.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.system.ServiceController$ServiceProxy.invoke(ServiceController.java:978)
   at $Proxy0.start(Unknown Source)
   at org.jboss.system.ServiceController.start(ServiceController.java:417)
   at sun.reflect.GeneratedMethodAccessor9.invoke(Unknown Source)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:86)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy4.start(Unknown Source)
   at org.jboss.deployment.SARDeployer.start(SARDeployer.java:302)
   at org.jboss.deployment.MainDeployer.start(MainDeployer.java:1025)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:819)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:782)
   at org.jboss.deployment.MainDeployer.deploy(MainDeployer.java:766)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.jboss.mx.interceptor.ReflectedDispatcher.invoke(ReflectedDispatcher.java:155)
   at org.jboss.mx.server.Invocation.dispatch(Invocation.java:94)
   at org.jboss.mx.interceptor.AbstractInterceptor.invoke(AbstractInterceptor.java:133)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.interceptor.ModelMBeanOperationInterceptor.invoke(ModelMBeanOperationInterceptor.java:142)
   at org.jboss.mx.server.Invocation.invoke(Invocation.java:88)
   at org.jboss.mx.server.AbstractMBeanInvoker.invoke(AbstractMBeanInvoker.java:264)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.mx.util.MBeanProxyExt.invoke(MBeanProxyExt.java:210)
   at $Proxy5.deploy(Unknown Source)
   at org.jboss.system.server.ServerImpl.doStart(ServerImpl.java:482)
   at org.jboss.system.server.ServerImpl.start(ServerImpl.java:362)
   at org.jboss.Main.boot(Main.java:200)
   at org.jboss.Main$1.run(Main.java:490)
   at java.lang.Thread.run(Thread.java:619)
2008-03-28 17:33:56,500 ERROR [org.apache.catalina.core.ContainerBase.[jboss.web].[localhost].[/alfresco]] Exception sending context initialized event to listener instance of class org.springframework.web.context.ContextLoaderListener
org.springframework.beans.factory.BeanDefinitionStoreException: Error registering bean with name 'org.alfresco.repo.content.metadata.GenericMetadataEmbedder' defined in file [C:\jboss-4.0.5.GA\server\default\conf\alfresco\extension\dublin-core-context.xml]: Could not resolve parent bean definition 'baseMetadataEmbedder'; nested exception is org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'baseMetadataEmbedder' is defined
Caused by:
org.springframework.beans.factory.NoSuchBeanDefinitionException: No bean named 'baseMetadataEmbedder' is defined
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanDefinition(DefaultListableBeanFactory.java:340)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:906)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:952)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:920)
   at org.springframework.beans.factory.support.AbstractBeanFactory.getMergedBeanDefinition(AbstractBeanFactory.java:906)
   at org.springframework.beans.factory.support.DefaultListableBeanFactory.getBeanNamesForType(DefaultListableBeanFactory.java:159)
   at org.springframework.context.support.AbstractApplicationContext.getBeanNamesForType(AbstractApplicationContext.java:691)
   at org.springframework.context.support.AbstractApplicationContext.invokeBeanFactoryPostProcessors(AbstractApplicationContext.java:395)
   at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:328)
   at org.springframework.web.context.support.AbstractRefreshableWebApplicationContext.refresh(AbstractRefreshableWebApplicationContext.java:156)
   at org.springframework.web.context.ContextLoader.createWebApplicationContext(ContextLoader.java:246)
   at org.springframework.web.context.ContextLoader.initWebApplicationContext(ContextLoader.java:184)
   at org.springframework.web.context.ContextLoaderListener.contextInitialized(ContextLoaderListener.java:49)
   at org.apache.catalina.core.StandardContext.listenerStart(StandardContext.java:3763)
   at org.apache.catalina.core.StandardContext.start(StandardContext.java:4211)
   at org.apache.catalina.core.ContainerBase.addChildInternal(ContainerBase.java:759)
   at org.apache.catalina.core.ContainerBase.addChild(ContainerBase.java:739)
   at org.apache.catalina.core.StandardHost.addChild(StandardHost.java:524)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
   at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.apache.catalina.core.StandardContext.init(StandardContext.java:5052)
   at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
   at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
   at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
   at java.lang.reflect.Method.invoke(Method.java:597)
   at org.apache.commons.modeler.BaseModelMBean.invoke(BaseModelMBean.java:503)
   at org.jboss.mx.server.RawDynamicInvoker.invoke(RawDynamicInvoker.java:164)
   at org.jboss.mx.server.MBeanServerImpl.invoke(MBeanServerImpl.java:659)
   at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeployInternal(TomcatDeployer.java:297)
   at org.jboss.web.tomcat.tc5.TomcatDeployer.performDeploy(TomcatDeployer.java:103)
   at org.jboss.web.AbstractWebDeployer.start(AbstractWebDeployer.java:371)
   at org.jboss.web.WebModule.startModule(WebModule.java:83)
   at org.jboss.web.WebModule.startService(WebModule.java:61)

there is anyone who can solve my problem?,thanks
Emanuele

rgauss
Champ in-the-making
Champ in-the-making
Sorry, the XMP project now depends on the Metadata Embedders project (http://forge.alfresco.com/projects/embedders/) if you want the ability to embed metadata properties back into the actual file.

If you don't need the embedding functionality you should be able to comment out the GenericMetadataEmbedder bean in dublin-core-context.xml.

I'll update the project's documentation for the next release.

Thanks for spotting the omission.

emorretta
Champ in-the-making
Champ in-the-making
Hi,
I am a student and I have to try the iptc/exif metadata extractor for advanced research of images; I have installed the metadata extractor as describe by readme file but even if alfresco extract metadata from images when I try to research the images typing a metadata value in research box it not appears nothing. If there is anyone who have tried to do this please contact me also via mail at the address:emorretta@hotmail.it.thanks

rgauss
Champ in-the-making
Champ in-the-making
If I understand your question correctly you're trying to use the simple search box in the upper right hand corner to find metadata that has already been properly extracted into properties of content nodes.

If that is the case you need to modify the properties which that simple search box is searching:
http://wiki.alfresco.com/wiki/Simple_Customisations#Adding_Properties_to_Simple_Search

emorretta
Champ in-the-making
Champ in-the-making
hi,
thanks for your reply, I have tried to change web-client-config-custom file to enable the research of exif propertiers but when I type a value of a properties in research box the picture researched not appears maybe I have to specified the full exif properties name including the exif namespace in alfresco, can you help me? thanks

rgauss
Champ in-the-making
Champ in-the-making
Yes, you'd need something like:


   <config>
      <client>
         <simple-search-additional-attributes>
            <qname>{http://www.rightsassist.com/model/exif/1.0}artist</qname>
         </simple-search-additional-attributes>
      </client>
   </config>

emorretta
Champ in-the-making
Champ in-the-making
Hi,
I am an Italian student and I have to make a new metadata extractor for video files stored in alfresco, for this reason I need to know the procedure to make a new   metadata extractor. Can you help me? thanks