Test configurable XML metadata extractors.

This doesn't include the wrapper extractor, yet, but there are two extractors that extract metadata from Eclipse Project XML and Alfresco Model XML files.


git-svn-id: https://svn.alfresco.com/repos/alfresco-enterprise/alfresco/HEAD/root@5980 c4b6b30b-aa2e-2d43-bbcb-ca4b014f7261
This commit is contained in:
Derek Hulley
2007-06-15 15:11:54 +00:00
parent 94862d134e
commit f1b226a279
9 changed files with 314 additions and 30 deletions

View File

@@ -0,0 +1,12 @@
#
# XmlMetadataExtracter - mapping for Alfresco model properties
#
# author: Derek Hulley
# Namespaces
namespace.prefix.cm=http://www.alfresco.org/model/content/1.0
# Mappings
author=cm:author
title=cm:title
description=cm:description

View File

@@ -0,0 +1,25 @@
<?xml version="1.0" encoding="UTF-8"?>
<model name="fm:forummodel" xmlns="http://www.alfresco.org/model/dictionary/1.0">
<description>Forum Model</description>
<author>Gavin Cornwell</author>
<version>1.0</version>
<imports>
<import uri="http://www.alfresco.org/model/dictionary/1.0" prefix="d"/>
<import uri="http://www.alfresco.org/model/content/1.0" prefix="cm"/>
</imports>
<namespaces>
<namespace uri="http://www.alfresco.org/model/forum/1.0" prefix="fm"/>
</namespaces>
<types>
<type name="fm:forums">
<parent>cm:folder</parent>
</type>
</types>
</model>

View File

@@ -0,0 +1,14 @@
#
# Maps document properties to the required XPaths for Alfresco model files
#
# author: Derek Hulley
# Namespaces
namespace.prefix.fm=http://www.alfresco.org/model/forum/1.0
# Mappings
author=/model/author/text()
title=/model/@name
description=/model/description/text()
version=/model/version/text()
ignored-with-ns=/model/fm:ignored

View File

@@ -0,0 +1,11 @@
#
# XmlMetadataExtracter - mapping for Eclipse project files
#
# author: Derek Hulley
# Namespaces
namespace.prefix.cm=http://www.alfresco.org/model/content/1.0
# Mappings
name=cm:title
description=cm:description

View File

@@ -0,0 +1,28 @@
<?xml version="1.0" encoding="UTF-8"?>
<projectDescription>
<name>Repository</name>
<comment>JavaCC Nature</comment>
<projects>
</projects>
<buildSpec>
<buildCommand>
<name>org.eclipse.jdt.core.javabuilder</name>
<arguments>
</arguments>
</buildCommand>
<buildCommand>
<name>org.eclipse.ui.externaltools.ExternalToolBuilder</name>
<triggers>auto,incremental,</triggers>
<arguments>
<dictionary>
<key>LaunchConfigHandle</key>
<value>&lt;project&gt;/.externalToolBuilders/JibX.launch</value>
</dictionary>
</arguments>
</buildCommand>
</buildSpec>
<natures>
<nature>org.eclipse.jdt.core.javanature</nature>
<nature>rk.eclipse.javacc.javaccnature</nature>
</natures>
</projectDescription>

View File

@@ -0,0 +1,10 @@
#
# Maps document properties to the required XPaths for Eclipse project files
#
# author: Derek Hulley
# Namespaces
# Mappings
name=/projectDescription/name/text()
description=/projectDescription/comment/text()

View File

@@ -0,0 +1,50 @@
<?xml version='1.0' encoding='UTF-8'?>
<!DOCTYPE beans PUBLIC '-//SPRING//DTD BEAN//EN' 'http://www.springframework.org/dtd/spring-beans.dtd'>
<!-- Test configurations for XmlMetadataExtracters -->
<beans>
<import resource="classpath:alfresco/application-context.xml" />
<!-- An extractor that operates on Alfresco models -->
<bean id="extracter.xml.AlfrescoModelMetadataExtracter"
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="location">
<value>classpath:xml-metadata/alfresco-model-mappings.properties</value>
</property>
</bean>
</property>
<property name="xpathMappingProperties">
<bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="location">
<value>classpath:xml-metadata/alfresco-model-xpath-mappings.properties</value>
</property>
</bean>
</property>
</bean>
<!-- An extractor that operates on Eclipse project files -->
<bean id="extracter.xml.EclipseProjectMetadataExtracter"
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="location">
<value>classpath:xml-metadata/eclipse-project-mappings.properties</value>
</property>
</bean>
</property>
<property name="xpathMappingProperties">
<bean class="org.springframework.beans.factory.config.PropertiesFactoryBean">
<property name="location">
<value>classpath:xml-metadata/eclipse-project-xpath-mappings.properties</value>
</property>
</bean>
</property>
</bean>
</beans>