Added configuration directives to remove static dependencies with ztfy.skin and zopyx.zxng3.core packages ZTK-1.1
authorThierry Florac <tflorac@ulthar.net>
Sat, 10 May 2014 11:15:34 +0200
branchZTK-1.1
changeset 250 16a535e0eb92
parent 249 650534afe60d
child 251 bb37ceec4298
Added configuration directives to remove static dependencies with ztfy.skin and zopyx.zxng3.core packages
src/ztfy/utils/browser/configure.zcml
src/ztfy/utils/catalog/configure.zcml
--- a/src/ztfy/utils/browser/configure.zcml	Wed May 07 19:04:14 2014 +0200
+++ b/src/ztfy/utils/browser/configure.zcml	Sat May 10 11:15:34 2014 +0200
@@ -2,6 +2,7 @@
 	xmlns="http://namespaces.zope.org/zope"
 	xmlns:browser="http://namespaces.zope.org/browser"
 	xmlns:z3c="http://namespaces.zope.org/z3c"
+	xmlns:zcml="http://namespaces.zope.org/zcml"
 	i18n_domain="ztfy.i18n">
 
 	<!-- ZEO connection views -->
@@ -11,22 +12,24 @@
 		class="..zodb.ZEOConnectionUtility"
 		permission="zope.ManageServices" />
 
-	<z3c:pagelet
-		name="properties.html"
-		for="..interfaces.IZEOConnection"
-		class=".zodb.ZEOConnectionEditForm"
-		layer="ztfy.skin.layer.IZTFYBrowserLayer"
-		permission="ztfy.ViewManagementScreens" />
+	<configure zcml:condition="installed ztfy.skin">
+		<z3c:pagelet
+			name="properties.html"
+			for="..interfaces.IZEOConnection"
+			class=".zodb.ZEOConnectionEditForm"
+			layer="ztfy.skin.layer.IZTFYBrowserLayer"
+			permission="ztfy.ViewManagementScreens" />
 
-	<browser:viewlet
-		name="Properties"
-		viewURL="@@properties.html"
-		for="..interfaces.IZEOConnection"
-		manager="ztfy.skin.viewlets.actions.interfaces.IActionsViewletManager"
-		class="ztfy.skin.menu.PropertiesMenuItem"
-		permission="ztfy.ViewManagementScreens"
-		layer="ztfy.skin.layer.IZTFYBackLayer"
-		weight="10" />
+		<browser:viewlet
+			name="Properties"
+			viewURL="@@properties.html"
+			for="..interfaces.IZEOConnection"
+			manager="ztfy.skin.viewlets.actions.interfaces.IActionsViewletManager"
+			class="ztfy.skin.menu.PropertiesMenuItem"
+			permission="ztfy.ViewManagementScreens"
+			layer="ztfy.skin.layer.IZTFYBackLayer"
+			weight="10" />
+	</configure>
 
 	<!-- Encoding selection widget -->
 	<adapter factory=".encoding.EncodingSelectFieldWidget" />
--- a/src/ztfy/utils/catalog/configure.zcml	Wed May 07 19:04:14 2014 +0200
+++ b/src/ztfy/utils/catalog/configure.zcml	Sat May 10 11:15:34 2014 +0200
@@ -1,16 +1,19 @@
 <configure
 	xmlns="http://namespaces.zope.org/zope"
+	xmlns:zcml="http://namespaces.zope.org/zcml"
 	i18n_domain="ztfy.utils">
 
-	<class class=".index.TextIndexNG">
-		<require
-			interface="zope.catalog.interfaces.IAttributeIndex
-					   zope.index.interfaces.IStatistics"
-			set_schema="zope.catalog.interfaces.IAttributeIndex"
-			permission="zope.ManageServices" />
-		<require
-			interface="zope.index.interfaces.IIndexSearch"
-			permission="zope.View" />
-	</class>
+	<configure zcml:condition="installed zopyx.txng3.core">
+		<class class=".index.TextIndexNG">
+			<require
+				interface="zope.catalog.interfaces.IAttributeIndex
+						   zope.index.interfaces.IStatistics"
+				set_schema="zope.catalog.interfaces.IAttributeIndex"
+				permission="zope.ManageServices" />
+			<require
+				interface="zope.index.interfaces.IIndexSearch"
+				permission="zope.View" />
+		</class>
+	</configure>
 
 </configure>