changeset 4:8ce07918ec8a

(none)
author jurzua
date Wed, 29 Oct 2014 13:30:55 +0000
parents 1e4835334837
children b7853c2b98a9
files src/main/resources/build.xml src/main/resources/hibernate.cfg.xml src/main/resources/hibernate.cfg.xml.template src/main/resources/log4j.properties src/main/resources/openmind-context.xml src/main/resources/openmind.properties src/main/resources/own-value.cfg.xml src/main/resources/own-value.cfg.xml.template
diffstat 8 files changed, 600 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/resources/build.xml	Wed Oct 29 13:30:55 2014 +0000
@@ -0,0 +1,118 @@
+<project name="Script" default="print" basedir="../">
+
+	<path id="om.classpath">
+		<fileset dir="${basedir}/lib">
+			<include name="*.jar" />
+		</fileset>
+	</path>
+	
+
+	<target name="ShowRepositoryName">
+		<java classname="org.mpi.openmind.scripts.ShowRepositoryName" maxmemory="512m" fork="true" failonerror="true">
+			<arg value="" />
+			<classpath>
+				<pathelement path="${basedir}/classes" />
+				<path refid="om.classpath" />
+			</classpath>
+		</java>
+	</target>
+	
+    <target name="RepositoryName">
+        <java classname="org.mpi.openmind.scripts.RepositoryName" maxmemory="512m" fork="true" failonerror="true">
+            <arg value="" />
+            <classpath>
+                <pathelement path="${basedir}/classes" />
+                <path refid="om.classpath" />
+            </classpath>
+        </java>
+    </target>	
+	
+    <target name="NormalizeOWEntities">
+        <java classname="org.mpi.openmind.scripts.NormalizeOW" maxmemory="1024m" fork="true" failonerror="true">
+            <arg value="ENTITY" />
+            <classpath>
+                <pathelement path="${basedir}/classes" />
+                <path refid="om.classpath" />
+            </classpath>
+        </java>
+    </target> 
+	
+    <target name="NormalizeOWAttributes">
+        <java classname="org.mpi.openmind.scripts.NormalizeOW" maxmemory="1024m" fork="true" failonerror="true">
+            <arg value="ATTRIBUTE" />
+            <classpath>
+                <pathelement path="${basedir}/classes" />
+                <path refid="om.classpath" />
+            </classpath>
+        </java>
+    </target>  	
+	
+    <target name="DoubleRelationsShow">
+        <java classname="org.mpi.openmind.scripts.DoubleRelations" maxmemory="1024m" fork="true" failonerror="true">
+            <arg value="SHOW" />
+            <classpath>
+                <pathelement path="${basedir}/classes" />
+                <path refid="om.classpath" />
+            </classpath>
+        </java>
+    </target>  	
+	
+    <target name="DoubleRelationsReduce">
+        <java classname="org.mpi.openmind.scripts.DoubleRelations" maxmemory="1024m" fork="true" failonerror="true">
+            <arg value="REDUCE" />
+            <classpath>
+                <pathelement path="${basedir}/classes" />
+                <path refid="om.classpath" />
+            </classpath>
+        </java>
+    </target> 	
+	
+    <target name="GenerateWitnessOwnValue">
+        <java classname="org.mpi.openmind.scripts.WitnessOwnValueGenerator" maxmemory="1024m" fork="true" failonerror="true">
+            <arg value="" />
+            <classpath>
+                <pathelement path="${basedir}/classes" />
+                <path refid="om.classpath" />
+            </classpath>
+        </java>
+    </target> 
+	
+    <target name="RoleToRelation">
+        <java classname="org.mpi.openmind.scripts.RoleToRelation" maxmemory="1024m" fork="true" failonerror="true">
+            <arg value="${filePath}" />
+            <classpath>
+                <pathelement path="${basedir}/classes" />
+                <path refid="om.classpath" />
+            </classpath>
+        </java>
+    </target> 	
+	
+	<target name="CurrentVersionForRelations">
+	        <java classname="org.mpi.openmind.scripts.CurrentVersionForRelations" maxmemory="1024m" fork="true" failonerror="true">
+	            <arg value="${filePath}" />
+	            <classpath>
+	                <pathelement path="${basedir}/classes" />
+	                <path refid="om.classpath" />
+	            </classpath>
+	        </java>
+	</target>
+	
+	<target name="print">
+		<echo>
+			### SCRIPTS COMMANDS ###
+			    
+			    *** commands list ***
+			    ShowRepositoryName: show the amount of Repositories without name attribute.	  
+			    RepositoryName: create an attribute name for all repositories without one.
+			    NormalizeOWEntities: generate the normalizedOW for the entities marked as CURRENT_VERSION.
+			    NormalizeOWAttributes: generate the normalizedOW for the attributes marked as CURRENT_VERSION.
+		        DoubleRelationsShow
+			    DoubleRelationsReduce
+		    	GenerateWitnessOwnValue
+			    CurrentVersionForRelations
+			    RoleToRelation use -DfilePath to set location of the definition's file.
+			    
+		</echo>
+	</target>
+	
+</project>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/resources/hibernate.cfg.xml	Wed Oct 29 13:30:55 2014 +0000
@@ -0,0 +1,55 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+	<session-factory>
+	
+		<!-- C3p0 -->
+		<property name="hibernate.c3p0.acquire_increment">1</property>
+		<property name="hibernate.c3p0.idle_test_period">300</property>
+		<property name="hibernate.c3p0.timeout">120</property>
+		<property name="hibernate.c3p0.max_size">25</property>
+		<property name="hibernate.c3p0.min_size">1</property>
+		<property name="hibernate.c3p0.max_statement">0</property>
+		<property name="hibernate.c3p0.preferredTestQuery">select 1;</property>
+		
+  		<property name="connection.provider_class">org.hibernate.connection.C3P0ConnectionProvider</property>
+        
+		<!-- <property name="show_sql">true</property> -->
+		<!-- <property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property> -->
+		
+		<property name="hibernate.dialect">org.mpi.openmind.repository.utils.CustomMysqlDialect</property>
+		<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
+		<property name="hibernate.connection.url">jdbc:mysql://localhost/openmind?characterEncoding=UTF-8</property>
+        <property name="hibernate.connection.charSet">UTF-8</property>  
+        <property name="hibernate.connection.username">root</property>
+        <property name="hibernate.connection.password">admin</property>  
+		<!--
+		<property name="hibernate.connection.username">ismi</property>
+        <property name="hibernate.connection.password">ismipw</property> 
+		<property name="hibernate.connection.username">root</property>
+        <property name="hibernate.connection.password">e1nste1n</property>
+		 -->
+		
+		<!-- <property name="show_sql">true</property> -->
+		<property name="current_session_context_class">thread</property>
+		<!-- <property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property> -->
+		<!-- <property name="hbm2ddl.auto">create</property> -->
+		
+		<mapping class="org.mpi.openmind.repository.bo.Node" />
+		<mapping class="org.mpi.openmind.repository.bo.Attribute" />
+		<mapping class="org.mpi.openmind.repository.bo.Entity" />
+		<mapping class="org.mpi.openmind.repository.bo.Relation" />
+		<mapping class="org.mpi.openmind.repository.bo.View" />
+		<mapping class="org.mpi.openmind.repository.bo.ViewerAttribute" />
+		<mapping class="org.mpi.openmind.repository.bo.ViewerPage" />
+		<mapping class="org.mpi.openmind.repository.bo.utils.Sequence" />
+		<mapping class="org.mpi.openmind.security.bo.User" />
+		<mapping class="org.mpi.openmind.security.bo.Group" />
+		<mapping class="org.mpi.openmind.security.bo.Role" />
+		<mapping class="org.mpi.openmind.security.bo.Permission" />
+		<mapping class="org.mpi.openmind.security.bo.utils.UserRole" />
+		<mapping class="org.mpi.openmind.security.bo.utils.GroupRole" />
+		<mapping class="org.mpi.openmind.security.bo.utils.UserGroup" />
+		<mapping class="org.mpi.openmind.security.bo.utils.RolePermission" />
+	</session-factory>
+</hibernate-configuration>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/resources/hibernate.cfg.xml.template	Wed Oct 29 13:30:55 2014 +0000
@@ -0,0 +1,39 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!DOCTYPE hibernate-configuration PUBLIC "-//Hibernate/Hibernate Configuration DTD 3.0//EN" "http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
+<hibernate-configuration>
+	<session-factory>
+		<!-- second level cache configuration -->
+		<!-- Enable/Disable the second-level cache -->
+		<property name="cache.use_second_level_cache">true</property>
+		<property name="cache.provider_class">org.hibernate.cache.EhCacheProvider</property>
+		<property name="cache.use_structured_entries">true</property>
+		<property name="cache.use_query_cache">false</property>
+		<property name="cache.use_minimal_puts">true</property>
+
+		<!-- property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property-->
+		<property name="hibernate.dialect">org.mpi.openmind.repository.utils.CustomMysqlDialect</property>
+		<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
+		<property name="hibernate.connection.url">jdbc:mysql://localhost/openmind?characterEncoding=UTF-8</property>
+		<property name="hibernate.connection.username">root</property>
+		<property name="hibernate.connection.password">admin</property>
+		<property name="hibernate.connection.charSet">UTF-8</property>
+		<!--property name="show_sql">true</property-->
+		<property name="current_session_context_class">thread</property>
+		<property name="cache.provider_class">org.hibernate.cache.NoCacheProvider</property>
+		<!--property name="hbm2ddl.auto">create</property-->
+		<mapping class="org.mpi.openmind.repository.bo.Node" />
+		<mapping class="org.mpi.openmind.repository.bo.Attribute" />
+		<mapping class="org.mpi.openmind.repository.bo.Entity" />
+		<mapping class="org.mpi.openmind.repository.bo.Relation" />
+		<mapping class="org.mpi.openmind.repository.bo.View" />
+		<mapping class="org.mpi.openmind.repository.bo.utils.Sequence" />
+		<mapping class="org.mpi.openmind.security.bo.User" />
+		<mapping class="org.mpi.openmind.security.bo.Group" />
+		<mapping class="org.mpi.openmind.security.bo.Role" />
+		<mapping class="org.mpi.openmind.security.bo.Permission" />
+		<mapping class="org.mpi.openmind.security.bo.utils.UserRole" />
+		<mapping class="org.mpi.openmind.security.bo.utils.GroupRole" />
+		<mapping class="org.mpi.openmind.security.bo.utils.UserGroup" />
+		<mapping class="org.mpi.openmind.security.bo.utils.RolePermission" />
+	</session-factory>
+</hibernate-configuration>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/resources/log4j.properties	Wed Oct 29 13:30:55 2014 +0000
@@ -0,0 +1,41 @@
+### direct log messages to stdout ###
+log4j.appender.stdout=org.apache.log4j.ConsoleAppender
+log4j.appender.stdout.Target=System.out
+log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
+log4j.appender.stdout.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+### direct messages to file hibernate.log ###
+log4j.appender.file=org.apache.log4j.FileAppender
+log4j.appender.file.File=${catalina.home}/logs/hibernate.log
+log4j.appender.file.layout=org.apache.log4j.PatternLayout
+log4j.appender.file.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+log4j.appender.persistenceServiceFile=org.apache.log4j.FileAppender
+log4j.appender.persistenceServiceFile.File=${catalina.home}/logs/persistenceService.log
+log4j.appender.persistenceServiceFile.layout=org.apache.log4j.PatternLayout
+log4j.appender.persistenceServiceFile.layout.ConversionPattern=%d{ABSOLUTE} %5p %c{1}:%L - %m%n
+
+### set log levels - for more verbose logging change 'info' to 'debug' ##
+
+log4j.rootLogger=info, file
+
+log4j.logger.org.mpi.openmind.repository.services.PersistenceService=info, persistenceServiceFile
+log4j.logger.org.mpi.openmind.search.SearchService=info, persistenceServiceFile
+
+#log4j.logger.net.sf.hibernate=debug, stdout
+#Hibernate
+#log4j.logger.org.hibernate.cfg=debug, file
+#log4j.logger.org.hibernate.cfg.annotations.Version=info, stdout
+#log4j.logger.org.hibernate.cfg.Environment=info, stdout
+#log4j.logger.org.hibernate.cfg.AnnotationBinder=info, stdout
+
+
+### enable the following line if you want to track down connection ###
+### leakages when using DriverManagerConnectionProvider ###
+#log4j.logger.net.sf.hibernate.connection.DriverManagerConnectionProvider=trace
+
+### log JDBC bind parameters ###
+#log4j.logger.net.sf.hibernate.type=debug
+
+### log prepared statement cache activity ###
+#log4j.logger.net.sf.hibernate.ps.PreparedStatementCache=debug
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/resources/openmind-context.xml	Wed Oct 29 13:30:55 2014 +0000
@@ -0,0 +1,75 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<beans xmlns="http://www.springframework.org/schema/beans"
+       xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
+       xsi:schemaLocation="http://www.springframework.org/schema/beans
+           http://www.springframework.org/schema/beans/spring-beans-3.0.xsd">
+
+    <bean id="persistenceService" class="org.mpi.openmind.repository.services.PersistenceService">
+    	<property name="configurationService" ref="configurationService"/>
+    	<property name="ownValueGenerator" ref="ownValueGenerator"/>
+    </bean>
+
+    <bean id="cache" class="org.mpi.openmind.cache.CacheService">
+        <property name="ps" ref="persistenceService"/>
+    </bean>
+    
+    <bean id="wrapper" class="org.mpi.openmind.cache.WrapperService">
+        <property name="cache" ref="cache"/>
+    </bean>  
+    
+    
+    <bean id="searchService" class="org.mpi.openmind.search.SearchService">
+        <property name="om" ref="wrapper"/>
+    </bean>
+     
+    <bean id="ownValueGenerator" class="org.mpi.openmind.repository.utils.OwnValueGenerator">
+    	<property name="configurationService" ref="configurationService"/>
+    </bean>
+    
+     <bean id="configurationService" class="org.mpi.openmind.configuration.ConfigurationService">
+    </bean>
+
+    <!-- 
+    <bean id="ontologyService" class="org.mpi.openmind.repository.services.OntologyService">
+        <property name="persistenceService" ref="persistenceService"/>
+        <property name="searchService" ref="searchService"/>
+    </bean>
+     -->
+    
+    <bean id="securityService" class="org.mpi.openmind.security.SecurityService">
+        <property name="persistenceService" ref="persistenceService"/>
+    </bean>
+    
+    
+    <!-- Scheduler for Date-Based Mailings -->
+    <bean id="scheduling" class="org.mpi.openmind.scheduling.utils.Scheduling">
+        <property name="persistenceService" ref="persistenceService"/>
+        <property name="configurationService" ref="configurationService"/>
+    </bean>
+    
+    <bean id="schedulingJobs" class="org.springframework.scheduling.quartz.MethodInvokingJobDetailFactoryBean">
+        <property name="targetObject" ref="scheduling"/>
+        <property name="targetMethod" value="dailyKickOff"/>
+        <!--property name="concurrent" value="false"/-->
+    </bean>    
+    
+    <bean id="schedulingCronTrigger" class="org.springframework.scheduling.quartz.CronTriggerBean">
+        <property name="jobDetail" ref="schedulingJobs"/>
+        <!-- daily 6 AM -->
+        
+        <property name="cronExpression" value="0 0 6 * * ?"/>
+        <!-- 
+        every 5 minutes 
+        <property name="cronExpression" value="0 0/5 * * * ?"/>
+        -->
+        
+    </bean>
+        
+    <bean class="org.springframework.scheduling.quartz.SchedulerFactoryBean">
+        <property name="triggers">
+            <list>
+                <ref bean="schedulingCronTrigger"/>
+            </list>
+        </property>
+    </bean>        
+</beans>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/resources/openmind.properties	Wed Oct 29 13:30:55 2014 +0000
@@ -0,0 +1,2 @@
+scheduling-path=/home/jurzua/ismi-backup
+scheduling-enable=true
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/resources/own-value.cfg.xml	Wed Oct 29 13:30:55 2014 +0000
@@ -0,0 +1,230 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<own-value-configuration>
+	<own-value-rules>
+	
+        <own-value-rule id="place0">
+            <attribute name="name" end-node="true"/>
+        </own-value-rule>	
+        
+        <own-value-rule id="role0">
+            <attribute name="name" end-node="true"/>
+        </own-value-rule>   
+        
+        <own-value-rule id="repository0">
+            <attribute name="name" end-node="true"/>
+        </own-value-rule>   
+        
+        <own-value-rule id="collection0">
+            <attribute name="name" end-node="true"/>
+        </own-value-rule>          
+
+        <own-value-rule id="alias0">
+            <attribute name="alias" end-node="true"/>
+        </own-value-rule>
+
+        <own-value-rule id="alias1">
+            <attribute name="alias_translit" end-node="true"/>
+        </own-value-rule>
+        
+        <own-value-rule id="alias2">
+          <xor>
+            <rule ref="alias1"/>
+            <rule ref="alias0"/>
+            <rule type="constant" value="alias-empty"/>
+          </xor>
+        </own-value-rule>
+
+        <own-value-rule id="text0">
+            <target-relation name="is_prime_alias_title_of" substring="false">
+                <source object-class="ALIAS">
+                    <attribute name="alias" end-node="true"/>
+                </source>
+            </target-relation>
+        </own-value-rule>
+                
+        <own-value-rule id="text1">
+            <attribute name="full_title_translit" end-node="true"/>
+        </own-value-rule> 
+        
+        <own-value-rule id="text2">
+          <xor>
+            <rule ref="text1"/>
+            <rule ref="text0"/>
+            <rule type="constant" value="empty"/>
+          </xor>
+        </own-value-rule>        
+                        
+        <own-value-rule id="person0">
+            <target-relation name="is_prime_alias_name_of" substring="false">
+                <source object-class="ALIAS">
+                    <attribute name="alias" end-node="true"/>
+                </source>
+            </target-relation>
+        </own-value-rule>
+        
+        <own-value-rule id="person1">
+            <attribute name="name_translit" end-node="true"/>
+        </own-value-rule>    
+        
+        <own-value-rule id="subject0">
+            <attribute name="name" end-node="true"/>
+        </own-value-rule>   
+        
+        <own-value-rule id="person2">
+          <xor>
+            <rule ref="person1"/>
+            <rule ref="person0"/>
+            <rule type="constant" value="empty"/>
+          </xor>
+        </own-value-rule>    
+
+		<own-value-rule id="codex0">
+			<source-relation name="is_part_of" substring="false">
+				<target object-class="COLLECTION">
+					<attribute name="name" end-node="true"/>
+				</target>
+			</source-relation>
+		</own-value-rule>
+		
+		<own-value-rule id="codex1">
+			<source-relation name="is_part_of" substring="false">
+				<target object-class="REPOSITORY">
+					<attribute name="name" end-node="true"/>
+				</target>
+			</source-relation>
+		</own-value-rule>
+		
+		<own-value-rule id="codex2">
+		  <xor>
+		    <rule ref="codex0"/>
+		    <rule ref="codex1"/>
+		    <rule type="constant" value="empty"/>
+		  </xor>
+		</own-value-rule>
+		
+		
+	
+        <own-value-rule id="codex_identifier" object-class="CODEX">
+            <attribute name="identifier" end-node="true" />
+        </own-value-rule>
+
+		<own-value-rule id="codex_identifier2">
+		  <xor>
+		    <rule ref="codex_identifier"/>
+			
+		    <rule type="constant" value="empty"/>
+		  </xor>
+		</own-value-rule>
+		
+		<own-value-rule id="witness-text">
+			<source-relation name="is_exemplar_of" substring="false">
+				<target object-class="TEXT" end-node="true"/>
+			</source-relation>
+		</own-value-rule>
+		
+		<own-value-rule id="witness-codex">
+			<source-relation name="is_part_of" substring="false">
+				<target object-class="CODEX" end-node="true">
+				    <!-- attribute name="identifier" end-node="true" /-->
+				</target>
+			</source-relation>
+		</own-value-rule>
+		
+		<!-- Temporal necessary only for the clean up -->
+        <own-value-rule id="witness-place">
+            <source-relation name="is_part_of" substring="false">
+                <target object-class="CODEX">
+                    <source-relation name="is_part_of" substring="false">
+                        <target object-class="COLLECTION">
+                            <source-relation name="is_part_of" substring="false">
+                                <target object-class="REPOSITORY">
+                                    <source-relation name="is_in" substring="false">
+                                        <target object-class="PLACE"  end-node="true"/>
+                                    </source-relation>
+                                </target>
+                            </source-relation>
+                        </target>
+                    </source-relation>
+                </target>
+            </source-relation>
+        </own-value-rule>		
+        <own-value-rule id="witness-repository">
+            <source-relation name="is_part_of" substring="false">
+                <target object-class="CODEX">
+                    <source-relation name="is_part_of" substring="false">
+                        <target object-class="COLLECTION">
+                            <source-relation name="is_part_of" substring="false">
+                                <target object-class="REPOSITORY" end-node="true"/>
+                            </source-relation>
+                        </target>
+                    </source-relation>
+                </target>
+            </source-relation>
+        </own-value-rule>           	
+	</own-value-rules>
+	
+	<print-rules>	
+	    <print-rule for="PERSON">
+            <formatstr value="%person2%"/>
+            <entry own-value-rule="person2"/>
+        </print-rule>
+        
+        <print-rule for="TEXT">
+            <formatstr value="%text2%"/>
+            <entry own-value-rule="text2"/>
+        </print-rule>        
+        
+        <print-rule for="ALIAS">
+            <formatstr value="%alias2%"/>
+            <entry own-value-rule="alias2"/>
+        </print-rule>
+        
+        <print-rule for="ROLE">
+            <formatstr value="%role0%"/>
+            <entry own-value-rule="role0"/>
+        </print-rule>        
+        
+		<print-rule for="CODEX">
+			<formatstr value="%codex2%_%codex_identifier2%"/>
+			<entry own-value-rule="codex2"/>
+			<entry own-value-rule="codex_identifier2"/>
+		</print-rule>
+	
+        <print-rule for="WITNESS">
+			<formatstr value="%witness-text%_%witness-place%_%witness-repository%_%witness-codex%"/>
+			<entry own-value-rule="witness-text"/>
+			<entry own-value-rule="witness-codex"/>
+			<entry own-value-rule="witness-place"/>
+			<entry own-value-rule="witness-repository"/>
+		</print-rule>
+		
+		<!-- 
+		<print-rule for="TEXT">
+			<formatstr value="%text3%"/>
+			<entry own-value-rule="text3"/>
+		</print-rule>
+		 -->
+		
+        <print-rule for="PLACE">
+            <formatstr value="%place0%"/>
+            <entry own-value-rule="place0"/>
+        </print-rule>		
+
+        <print-rule for="SUBJECT">
+            <formatstr value="%subject0%"/>
+            <entry own-value-rule="subject0"/>
+        </print-rule>   
+                
+        <print-rule for="REPOSITORY">
+            <formatstr value="%repository0%"/>
+            <entry own-value-rule="repository0"/>
+        </print-rule>               
+        
+        <print-rule for="COLLECTION">
+            <formatstr value="%collection0%"/>
+            <entry own-value-rule="collection0"/>
+        </print-rule>          
+	</print-rules>
+	
+</own-value-configuration>
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/resources/own-value.cfg.xml.template	Wed Oct 29 13:30:55 2014 +0000
@@ -0,0 +1,40 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<own-value-configuration>
+	<own-value-rules>
+
+		<own-value-rule id="codex0">
+			<source-relation name="is_part_of" substring="false">
+				<target object-class="COLLECTION">
+					<attribute name="name" end-node="true"/>
+				</target>
+			</source-relation>
+		</own-value-rule>
+		
+		<own-value-rule id="codex1">
+			<source-relation name="is_part_of" substring="false">
+				<target object-class="REPOSITORY">
+					<attribute name="name" end-node="true"/>
+				</target>
+			</source-relation>
+		</own-value-rule>
+		
+		<own-value-rule id="codex2">
+		  <xor>
+		    <rule ref="codex0"/>
+		    <rule ref="codex1"/>
+		    <rule type="constant" value="empty"/>
+		  </xor>
+		</own-value-rule>
+		
+		
+	
+	</own-value-rules>
+	
+	<print-rules>	
+		<print-rule for="CODEX">
+			<formatstr value="%codex2%"/>
+			<entry own-value-rule="codex2"/>
+		</print-rule>
+	</print-rules>
+	
+</own-value-configuration>