09-29-2008 12:29 PM
16:27:55,613 DEBUG [content.metadata.AbstractMappingMetadataExtracter] Added mapping from atoz to [{http://www.centrom.com/alfresco/localgov/model}atoz]
16:27:55,629 DEBUG [metadata.xml.XPathMetadataExtracter] Added mapping from atoz to /art:article/art:header/art:atoz/text()
16:29:18,083 DEBUG [content.metadata.MetadataExtracterRegistry] Finding extractors for text/xml
16:29:18,130 DEBUG [metadata.xml.XPathMetadataExtracter]
No working metadata extractor could be found:
Document: ContentAccessor[ contentUrl=store://2008/9/29/16/29/cf7eb2e7-e0e5-4cca-972f-655a78f91e98.bin, mimetype=text/xml, size=760, encoding=UTF-8, locale=en_US]
16:29:18,130 DEBUG [metadata.xml.XPathMetadataExtracter]
XML metadata extractor redirected:
Reader: ContentAccessor[ contentUrl=store://2008/9/29/16/29/cf7eb2e7-e0e5-4cca-972f-655a78f91e98.bin, mimetype=text/xml, size=760, encoding=UTF-8, locale=en_US]
Extracter: null
Metadata: {{http://www.alfresco.org/model/content/1.0}name=metatest.xml, {http://www.alfresco.org
/model/system/1.0}node-dbid=19105, {http://www.alfresco.org/model/system/1.0}store-identifier=hertsm
ere–admin–preview, {http://www.alfresco.org/model/wcmappmodel/1.0}orginalparentpath=hertsmere--adm
in–preview:/www/avm_webapps/ROOT, {http://www.alfresco.org/model/content/1.0}content=contentUrl=sto
re://2008/9/29/16/29/cf7eb2e7-e0e5-4cca-972f-655a78f91e98.bin|mimetype=text/xml|size=760|encoding=UT
F-8|locale=en_US_, {http://www.alfresco.org/model/content/1.0}owner=admin, {http://www.alfresco.org/
model/content/1.0}title={en_US=metatest.xml}, {http://www.alfresco.org/model/content/1.0}modified=Mo
n Sep 29 16:29:17 BST 2008, {http://www.alfresco.org/model/system/1.0}node-uuid=UNKNOWN, {http://www
.alfresco.org/model/wcmappmodel/1.0}parentformname=web-article, {http://www.alfresco.org/model/conte
nt/1.0}created=Mon Sep 29 16:29:17 BST 2008, {http://www.alfresco.org/model/system/1.0}store-protoco
l=avm, {http://www.alfresco.org/model/content/1.0}creator=admin, {http://www.alfresco.org/model/cont
ent/1.0}modifier=admin, {http://www.alfresco.org/model/wcmappmodel/1.0}renditions=[/www/avm_webapps/
ROOT/metatest.jsp]}
<bean id="extracter.xml.centrom.ArticleModelMetadataExtracter"
class="org.alfresco.repo.content.metadata.xml.XPathMetadataExtracter"
parent="baseMetadataExtracter"
init-method="init" >
<property name="mappingProperties">
<bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="namespace.prefix.lg">http://www.centrom.com/alfresco/localgov/model</prop>
<prop key="atoz">lg:atoz</prop>
</props>
</property>
</bean>
</property>
<property name="xpathMappingProperties">
<bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="namespace.prefix.art">http://www.centrom.com/localgov/wcm/article</prop>
<prop key="atoz">/art:article/art:header/art:atoz/text()</prop>
</props>
</property>
</bean>
</property>
</bean>
<!–
This selector examines the XML documents, executing the given XPath statements until a
match is made.
–>
<bean id="extracter.xml.centrom.selector.XPathSelector"
class="org.alfresco.repo.content.selector.XPathContentWorkerSelector"
init-method="init">
<property name="workers">
<map>
<entry key="/art:article">
<ref bean="extracter.xml.centrom.ArticleModelMetadataExtracter" />
</entry>
</map>
</property>
</bean>
<bean id="extracter.xml.centrom.XMLMetadataExtracter"
class="org.alfresco.repo.content.metadata.xml.XmlMetadataExtracter"
parent="baseMetadataExtracter">
<property name="registry">
<ref bean="avmMetadataExtracterRegistry" />
</property>
<property name="overwritePolicy">
<value>EAGER</value>
</property>
<property name="selectors">
<list>
<ref bean="extracter.xml.centrom.selector.XPathSelector" />
</list>
</property>
</bean>
<namespaces>
<namespace uri="http://www.centrom.com/alfresco/localgov/model" prefix="lg"/>
</namespaces>
<aspects>
<aspect name="lg:article">
<title>Article Aspect</title>
<properties>
<property name="lg:atoz">
<type>d:text</type>
</property>
</properties>
</aspect>
</aspects>
09-29-2008 03:17 PM
what happens if the extractor is setup to write the data into a property field which only exists in an aspect? Is the aspect automatically added to the document, or does it have to already exist on the document?This is exactly how it's intended to work, and in this case the aspect will get applied automatically by the XPath Metadata Extractor - it determines which aspect(s) to apply based on the target properties defined in the "mappingProperties" Spring bean property.
09-30-2008 03:38 AM
what happens if the extractor is setup to write the data into a property field which only exists in an aspect? Is the aspect automatically added to the document, or does it have to already exist on the document?This is exactly how it's intended to work, and in this case the aspect will get applied automatically by the XPath Metadata Extractor - it determines which aspect(s) to apply based on the target properties defined in the "mappingProperties" Spring bean property.
Also, is that the entire Spring configuration? If so, it appears that it's missing the metadata extractor registry Spring bean that enables metadata extraction for WCM content (see http://wiki.alfresco.com/wiki/Metadata_Extraction#Activating_Meta-data_Extraction_for_WCM for details).
09-30-2008 05:24 AM
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<!–
Sample configuration of a XmlMetadataExtracter in use within the WCM environment.
This show how XML metadata extraction can be set up to extract metadata from different
formats of XML. It also shows how metadata can be extracted in WCM projects.
Since: 2.1
Author: Derek Hulley
–>
<beans>
<!–
In order to limit the number of extractors active for Web Content Management, a separate registry
must be created for the extractors.
–>
<bean id="avmMetadataExtracterRegistry" class="org.alfresco.repo.content.metadata.MetadataExtracterRegistry" />
<!–
Configure the AVM services to broadcast the content update notifications.
–>
<bean id="avmNodeService" class="org.alfresco.repo.avm.AVMNodeService" init-method="init">
<property name="dictionaryService">
<ref bean="dictionaryService"/>
</property>
<property name="avmService">
<ref bean="avmLockingAwareService"/>
</property>
<property name="policyComponent">
<ref bean="policyComponent"/>
</property>
<property name="invokePolicies">
<value>true</value>
</property>
</bean>
<bean id="avmMetadataExtracter" class="org.alfresco.repo.avm.AvmMetadataExtracter" init-method="init">
<property name="policyComponent">
<ref bean="policyComponent"/>
</property>
<property name="extracterAction">
<bean class="org.alfresco.repo.action.executer.ContentMetadataExtracter" >
<property name="dictionaryService">
<ref bean="dictionaryService"/>
</property>
<property name="nodeService">
<ref bean="avmNodeService" />
</property>
<property name="contentService">
<ref bean="contentService" />
</property>
<property name="metadataExtracterRegistry">
<ref bean="avmMetadataExtracterRegistry" />
</property>
<property name="carryAspectProperties">
<value>true</value>
</property>
</bean>
</property>
</bean>
<bean id="extracter.xml.centrom.ArticleModelMetadataExtracter"
class="org.alfresco.repo.content.metadata.xml.XPathMetadataExtracter"
parent="baseMetadataExtracter"
init-method="init" >
<property name="mappingProperties">
<bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="namespace.prefix.lg">http://www.centrom.com/alfresco/localgov/model</prop>
<prop key="atoz">lg:atoz</prop>
</props>
</property>
</bean>
</property>
<property name="xpathMappingProperties">
<bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="properties">
<props>
<prop key="namespace.prefix.art">http://www.centrom.com/localgov/wcm/article</prop>
<prop key="atoz">/article/header/atoz/text()</prop>
</props>
</property>
</bean>
</property>
</bean>
<!–
This selector examines the XML documents, executing the given XPath statements until a
match is made.
–>
<bean id="extracter.xml.centrom.selector.XPathSelector"
class="org.alfresco.repo.content.selector.XPathContentWorkerSelector"
init-method="init">
<property name="workers">
<map>
<entry key="/article">
<ref bean="extracter.xml.centrom.ArticleModelMetadataExtracter" />
</entry>
</map>
</property>
</bean>
<bean id="extracter.xml.centrom.XMLMetadataExtracter"
class="org.alfresco.repo.content.metadata.xml.XmlMetadataExtracter"
parent="baseMetadataExtracter">
<property name="registry">
<ref bean="avmMetadataExtracterRegistry" />
</property>
<property name="overwritePolicy">
<value>EAGER</value>
</property>
<property name="selectors">
<list>
<ref bean="extracter.xml.centrom.selector.XPathSelector" />
</list>
</property>
</bean>
</beans>
10-13-2008 06:08 AM
10-13-2008 07:41 AM
10-20-2008 11:14 AM
10-20-2008 04:04 PM
10-20-2008 04:28 PM
The AVM doesn't support behavioural aspects, so the best way to accomplish this is to add the current date into the XML (via a dynamic include) and then extract it (via XML Metadata Extractor) into the aspect.
More generally, it's best not to think of AVM aspects as anything more than an intermediate, temporary storage area between XML element values and the Lucene indexes. In fact in a future release we hope to do away with all this aspect / XML Metadata Extractor stuff for Web Form backed content, and instead allow the indexing behaviour to be configured directly in the Web Form XSD (via annotations, much the same way that we allow the Web Form UI widgets to be configured).
10-20-2008 05:26 PM
Tags
Find what you came for
We want to make your experience in Hyland Connect as valuable as possible, so we put together some helpful links.