AnsweredAssumed Answered

Aspects and MetadataExtraction

Question asked by gonenc on Sep 18, 2006
Latest reply on Oct 3, 2007 by rmills

Is it possible to do some metadata extraction from the content whenever an update, create or edit in a node's content occurs? My use case is that I have an Domain Specific Language in the form of XML. Whenever this type of XML is uploaded or updated I want to extract some data from the XML and add it as aspect properties to the node.

My exact use case is that I have a report definition in XML (BIRT) and the report may have parameters defined. For efficiency I want to import the parameters needed to run the report as metadata to alfresco. For any report definition XML I have created an ReportDefinitionAspect. I have created an aspect called ReportWithParametersAspect which specifies ReportDefinitionAspect as mandatory. So whenever a ReportDefinition with parameters is added or updated in Alfresco I want to have the parameters list upto date and have the ReportWithParametersAspect applied to the node.

For this reason I have created an metadataextractor with a mimetype such as "application/reportdefinition" for my xml file just to make my mimetype unique. My metadata extractor extracts the parameters and adds the parameters as properties of ReportWithParametersAspect. When I checked out alfresco's code, aspects of properties added are applied to the node. However, ReportDefinitionAspect is not applied.

Another problem with this approach is that, whenever a report definition with parameters is updated and the parameters are removed, I want the ReportWithParametersAspect to be removed too. If I had some hooks for the update and create operations, with access to the node itself I could do this easily. Is this possible? Or should I add wizards to create and update my nodes instead of the default add Content, edit Content dialogs of web client?

Any comments or explanations is appreciated.

Gonenc Ercan