Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [higgins-dev] Scoping of configuration elements

By "older siblings", I meant, in the recursive process, I can't refer to parents, grandparents, etc., only sibling elements that came before the current element.  This works out a little in that if all the younger siblings refer to the older sibling, I get some benefit.  I've attached an example configuration for reference.

It seems like reference by name might suffice (as long as they don't have to be siblings) but I'll let Duane chime in also on what he'd like to see.

Tom

>>> Greg Byrd <gbyrd@xxxxxxxx> 7/16/2007 10:05 AM >>>
There is a reference type that lets you refer to a previously-encountered element ("setting") by name.  I think that's what you meant by "older siblings"?  You could have a top-level setting that contains the table that you want, and refer to it by name.  Would you prefer some sort of path-oriented naming, like "Setting1/SubSetting3/SubSubSetting2"?  (I think that's fairly easy to add.) Is reference by name OK, or are your really hankering for positional references?

...Greg


Tom Doman wrote: 

In the old Realms configuration code that the Novell contributed CPs have been using, we had the ability to scope configuration elements to allow them to be referenced by any element within the same scope or any sub-scope of that element.  For example, in the JavaScript policy definitions, we could define a mapping table at the highest scope, and reference it throughout a number of context definitions, regardless of the depth of the sub-scope where the reference took place.

In the Higgins configuration code, currently, we can only reference older siblings.  We'd like to be able to retain this scoping ability so we don't have to redefine the same tables in every context.  A "reference by id" mechanism might also suffice or be even cleaner where within the scope we desire it, we can say, "I want elements 12, 19, & 34".  At any rate, we'd like something that allows us to not have to duplicate potentially large pieces of configuration everywhere it's wanted.  Perhaps there's something like this already in there that I've missed.

Thanks,
Tom


_______________________________________________
higgins-dev mailing listhiggins-dev@eclipse.orghttps://dev.eclipse.org/mailman/listinfo/higgins-dev  

<!--
/*******************************************************************************
 * Copyright (c) 2007 Novell Inc.
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * Contributors:
 *    Tom Doman
 *******************************************************************************/ 
 -->
<Configuration
	xmlns:xsd="http://www.w3.org/2001/XMLSchema";
	xmlns="http://higgins.eclipse.org/Configuration";
	xmlns:htf="http://higgins.eclipse.org/Configuration";>

	<!--  The setting handlers are classes that consume Setting elements where the Type matches and generate an object of the Class -->
	<SettingHandlers>
		<SettingHandler Type="htf:map" Class="java.util.Map" Handler="org.eclipse.higgins.configuration.xml.MapHandler"/>
		<SettingHandler Type="htf:list" Class="java.util.List" Handler="org.eclipse.higgins.configuration.xml.ListHandler"/>
		<SettingHandler Type="xsd:string" Class="java.lang.String" Handler="org.eclipse.higgins.configuration.xml.StringHandler"/>
		<SettingHandler Type="xsd:boolean" Class="java.lang.Boolean" Handler="org.eclipse.higgins.configuration.xml.BooleanHandler"/>
		<SettingHandler Type="xsd:anyURI" Class="java.net.URI" Handler="org.eclipse.higgins.configuration.xml.URIHandler"/>
		<SettingHandler Type="htf:file" Class="java.io.FileInputStream" Handler="org.eclipse.higgins.configuration.xml.FileHandler"/>
		<SettingHandler Type="htf:keystore" Class="java.security.KeyStore" Handler="org.eclipse.higgins.configuration.xml.KeyStoreHandler"/>
		<SettingHandler Type="htf:certificate" Class="java.lang.String" Handler="org.eclipse.higgins.configuration.xml.CertificateHandler"/>
		<SettingHandler Type="htf:privatekey" Class="java.security.PrivateKey" Handler="org.eclipse.higgins.configuration.xml.PrivateKeyHandler"/>
		<SettingHandler Type="htf:singleton" Class="java.lang.Object" Handler="org.eclipse.higgins.configuration.xml.SingletonHandler"/>
		<SettingHandler Type="htf:instance" Class="java.lang.Object" Handler="org.eclipse.higgins.configuration.xml.InstanceHandler"/>
		<SettingHandler Type="htf:contextfactory" Class="org.eclipse.higgins.idas.IContextFactory" Handler="org.eclipse.higgins.configuration.xml.ContextFactoryHandler"/>
		<SettingHandler Type="htf:identityattributeservice" Class="org.eclipse.higgins.idas.common.IdASRegistry" Handler="org.eclipse.higgins.configuration.xml.IdentityAttributeServiceHandler"/>
		<SettingHandler Type="htf:jscriptexec" Class="org.bandit.util.jscript.JScriptExec" Handler="org.eclipse.higgins.idas.cp.jndi.JScriptExecSettingHandler"/>
		<SettingHandler Type="htf:jscriptscope" Class="org.bandit.util.jscript.JScriptScope" Handler="org.eclipse.higgins.idas.cp.jndi.JScriptScopeSettingHandler"/>
	</SettingHandlers>

	<Setting Name="JNDICPTestSettings" Type="htf:map">
		<Setting Name="ComponentSettings" Type="htf:map">
			<Setting Name="JNDIContextFactorySettings" Type="htf:map">
			</Setting>
			<Setting Name="Corporate-LDAP-Server" Type="htf:map" contextType="org.eclipse.higgins.idas.cp.jndi">
				<Setting Name="Connection" Type="htf:map" connectionType="LDAP">
					<Setting Name="AddressList" Type="htf:list">
						<Setting Name="Address" Type="xsd:string">ldap://wag.bandit-project.org:389</Setting>
					</Setting>
					<Setting Name="jndiProvider" Type="xsd:string">com.sun.jndi.ldap.LdapCtxFactory</Setting>
					<Setting Name="searchBase" Type="xsd:string">ou=people,dc=wag,dc=bandit-project,dc=org</Setting>
				</Setting>
				<Setting Name="env" Type="htf:map">
					<Setting Name="java.naming.security.authentication" Type="xsd:string">simple</Setting>
					<Setting Name="java.naming.security.principal" Type="xsd:string">cn=admin,o=novell</Setting>
					<Setting Name="java.naming.security.credentials" Type="xsd:string">novelled8</Setting>
					<Setting Name="org.eclipse.higgins.idas.cp.jndi.startTLS" Type="xsd:string">true</Setting>
					<Setting Name="org.eclipse.higgins.idas.cp.jndi.trustStore" Type="xsd:string">JNDICPTest.keystore</Setting>
					<Setting Name="java.naming.ldap.attributes.binary" Type="xsd:string">guid</Setting>
				</Setting>
				<Setting Name="JSPolicyAction" Type="htf:map">
					<Setting Name="JSSharedScope" Type="htf:jscriptscope">
						<![CDATA[
							var multimap = {
								consumer: [],
								provider: []
								};

							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname";] =
								["givenname", "2.5.4.42"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname";] =
								["sn", "surname", "2.5.4.4"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress";] =
								["mail", "email", "emailaddress", "internetaddress", 
								"1.2.840.113549.1.9.1", "rfc822mailbox", "0.9.2342.19200300.100.1.3"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/streetaddress";] =
								["street", "streetaddress", "2.5.4.9"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/locality";] =
								["localityName", "2.5.4.7"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/stateorprovince";] =
								["st", "stateprovincename", "2.5.4.8"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/postalcode";] =
								["postalcode", "2.5.4.17"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country";] =
								["countryname", "2.5.4.6"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/homephone";] =
								["homephone", "telephonenumber", "2.5.4.20"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/otherphone";] =
								["otherphone"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/mobilephone";] =
								["mobilephone"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dateofbirth";] =
								["dateofbirth"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/gender";] =
								["gender"];
							multimap.consumer["http://www.bandit-project.org/identity/claims/groupmembership";] = 
								["groupMembership"];

							for (elem in multimap.consumer)
							{
								for (provider in multimap.consumer[elem])
									multimap.provider[multimap.consumer[elem][provider]] = elem;
							}
						]]>
					</Setting>
					<Setting Name="consumerSubjectIDToProvider" Type="htf:jscriptexec">
						<![CDATA[
							RESULT = "cn=" + consumerID + ",ou=people,dc=wag,dc=bandit-project,dc=org"
						]]>
					</Setting>
					<Setting Name="providerSubjectIDToConsumer" Type="htf:jscriptexec">
						<![CDATA[
							var re = new RegExp("^cn=(.*),ou=people,dc=wag,dc=bandit-project,dc=org$", "i");
							RESULT = String(providerID.toString()).replace(re, "$1");
						]]>
					</Setting>
					<Setting Name="consumerIDToProvider" Type="htf:jscriptexec">
						<![CDATA[
							map = multimap.consumer[String(consumerID.toString())];
							if (!map)
							{
								var re = new RegExp("^http://www.eclipse.org/higgins/ontologies/2006/higgins/ldap#attr_";, "i");
								map = String(consumerID.toString()).replace(re, "");
							}
							RESULT = map;
						]]>
					</Setting>
					<Setting Name="providerIDToConsumer" Type="htf:jscriptexec">
						<![CDATA[
							map = multimap.provider[String(providerID.toString())];
							if (!map)
								map = "http://www.eclipse.org/higgins/ontologies/2006/higgins/ldap#attr_"; + providerID.toString();
							RESULT = map;
						]]>
					</Setting>
					<Setting Name="consumerDSTypeToProvider" Type="htf:jscriptexec">
						<![CDATA[
							var re = new RegExp("^http://www.eclipse.org/higgins/ontologies/2006/higgins/ldap#class_";, "i");
							RESULT = String(consumerType.toString()).replace(re, "");
						]]>
					</Setting>
					<Setting Name="providerDSTypeToConsumer" Type="htf:jscriptexec">
						<![CDATA[
							RESULT = "http://www.eclipse.org/higgins/ontologies/2006/higgins/ldap#class_"+String(providerType.toString());
						]]>
					</Setting>
				</Setting>
			</Setting>
			<Setting Name="6289E76C-0883-49F1-9DCE-85293A83ED3E" Type="htf:map" contextType="org.eclipse.higgins.idas.cp.jndi">
				<Setting Name="Connection" Type="htf:map" connectionType="LDAP">
					<Setting Name="AddressList" Type="htf:list">
						<Setting Name="Address" Type="xsd:string">ldap://localhost:50389</Setting>
					</Setting>
				</Setting>
				<Setting Name="env" Type="htf:map">
					<Setting Name="java.naming.ldap.attributes.binary" Type="xsd:string">guid</Setting>
				</Setting>
				<Setting Name="JSPolicyAction" Type="htf:map">
					<Setting Name="JSSharedScope" Type="htf:jscriptscope">
						<![CDATA[
							var multimap = {
								consumer: [],
								provider: []
								};

							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/givenname";] =
								["givenname", "2.5.4.42"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/surname";] =
								["sn", "surname", "2.5.4.4"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/emailaddress";] =
								["mail", "email", "emailaddress", "internetaddress", 
								"1.2.840.113549.1.9.1", "rfc822mailbox", "0.9.2342.19200300.100.1.3"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/streetaddress";] =
								["street", "streetaddress", "2.5.4.9"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/locality";] =
								["localityName", "2.5.4.7"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/stateorprovince";] =
								["st", "stateprovincename", "2.5.4.8"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/postalcode";] =
								["postalcode", "2.5.4.17"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/country";] =
								["countryname", "2.5.4.6"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/homephone";] =
								["homephone", "telephonenumber", "2.5.4.20"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/otherphone";] =
								["otherphone"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/mobilephone";] =
								["mobilephone"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/dateofbirth";] =
								["dateofbirth"];
							multimap.consumer["http://schemas.xmlsoap.org/ws/2005/05/identity/claims/gender";] =
								["gender"];
							multimap.consumer["http://www.bandit-project.org/identity/claims/groupmembership";] = 
								["groupMembership"];

							for (elem in multimap.consumer)
							{
								for (provider in multimap.consumer[elem])
									multimap.provider[multimap.consumer[elem][provider]] = elem;
							}
						]]>
					</Setting>
					<Setting Name="consumerAIDToProvider" Type="htf:jscriptexec">
						<![CDATA[
							map = multimap.consumer[String(consumerID.toString())];
							if (!map)
							{
								var re = new RegExp("^http://www.eclipse.org/higgins/ontologies/2006/higgins/ldap#attr_";, "i");
								map = String(consumerID.toString()).replace(re, "");
							}
							RESULT = map;
						]]>
					</Setting>
					<Setting Name="providerAIDToConsumer" Type="htf:jscriptexec">
						<![CDATA[
							map = multimap.provider[String(providerID.toString()).toLowerCase()];
							if (!map)
								map = "http://www.eclipse.org/higgins/ontologies/2006/higgins/ldap#attr_"; + providerID.toString();
							RESULT = map;
						]]>
					</Setting>
					<Setting Name="consumerDSTypeToProvider" Type="htf:jscriptexec">
						<![CDATA[
							var re = new RegExp("^http://www.eclipse.org/higgins/ontologies/2006/higgins/ldap#class_";, "i");
							RESULT = String(consumerType.toString()).replace(re, "");
						]]>
					</Setting>
					<Setting Name="providerDSTypeToConsumer" Type="htf:jscriptexec">
						<![CDATA[
							RESULT = "http://www.eclipse.org/higgins/ontologies/2006/higgins/ldap#class_"; + String(providerType.toString());
						]]>
					</Setting>
				</Setting>
			</Setting>
			<Setting Name="IdentityAttributeService" Type="htf:map">
				<Setting Name="ContextFactoryList" Type="htf:list">
					<Setting Name="ContextFactory" Type="xsd:string">JNDIContextFactory</Setting>
				</Setting>
			</Setting>
		</Setting>

		<!-- The name of the class that provides the factory for the class that implements the JNDI Context Provider -->
		<Setting Name="JNDIContextFactory" Type="htf:instance">org.eclipse.higgins.idas.cp.jndi.JNDIContextFactoryConfigurableComponentFactory</Setting>

		<!-- The name of the class that provides the factory for the class that implements the IdASRegistry -->
		<Setting Name="IdentityAttributeService" Type="htf:identityattributeservice">org.eclipse.higgins.idas.common.IdASRegistry</Setting>
	</Setting>

</Configuration>

Back to the top