Index: xdocs/guides/index.xml
===================================================================
--- xdocs/guides/index.xml	(revision 446567)
+++ xdocs/guides/index.xml	(working copy)
@@ -64,6 +64,7 @@
 			<li><a href="guide-simple-velocity-portlet.html">Guide to a very simple velocity portlet with Jetspeed-2</a></li>
 			<li><a href="guide-simple-jsf-portlet.html">Guide to a very simple jsf portlet with Jetspeed-2</a></li>
 			<li><a href="guide-portlet-bridges.html">Guide to portlet bridges</a></li>				
+			<li><a href="guide-profiling-ip.html">Guide to Profiling IP Addresses</a></li>			
 		</ul>
 		</subsection>
 		<subsection name="Jetspeed-2 Development Guide">
Index: applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileCriterionForm.java
===================================================================
--- applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileCriterionForm.java	(revision 446567)
+++ applications/j2-admin/src/java/org/apache/jetspeed/portlets/profiler/ProfileCriterionForm.java	(working copy)
@@ -64,7 +64,8 @@
             new SelectItem("page"),
             new SelectItem("path.session"),
             new SelectItem("user.attribute"),
-            new SelectItem("navigation")
+            new SelectItem("navigation"),
+            new SelectItem("ip")
     };
 
     private transient SelectItem[] fallbackTypes =
Index: src/webapp/WEB-INF/assembly/profiler.xml
===================================================================
--- src/webapp/WEB-INF/assembly/profiler.xml	(revision 446567)
+++ src/webapp/WEB-INF/assembly/profiler.xml	(working copy)
@@ -101,6 +101,9 @@
           <entry key="user.agent">
             <ref bean="UserAgentCriterionResolver" />
           </entry>          
+          <entry key="ip">
+            <ref bean="IPCriterionResolver" />
+          </entry>          
         </map>
         </constructor-arg>                  
     </bean>
@@ -122,5 +125,6 @@
     <bean id='UserAttributeResolver' class='org.apache.jetspeed.profiler.rules.impl.UserAttributeResolver'></bean>
     <bean id='NavigationCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.NavigationCriterionResolver'></bean>
     <bean id='UserAgentCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.UserAgentCriterionResolver'></bean>
+    <bean id='IPCriterionResolver' class='org.apache.jetspeed.profiler.rules.impl.IPCriterionResolver'></bean>
     
-</beans>
\ No newline at end of file
+</beans>
Index: etc/sql/populate-db-default.sql
===================================================================
--- etc/sql/populate-db-default.sql	(revision 446567)
+++ etc/sql/populate-db-default.sql	(working copy)
@@ -425,6 +425,10 @@
 insert into RULE_CRITERION values ('53', 'subsite2-role-fallback-home', 0, 'navigation', 'navigation', 'subsite-root', 2);
 insert into RULE_CRITERION values ('54', 'subsite2-role-fallback-home', 1, 'role', 'role', null, 2);
 insert into RULE_CRITERION values ('55', 'subsite2-role-fallback-home', 2, 'path', 'path', 'subsite2-default-page', 0);
+insert into PROFILING_RULE values ('ip-address', 
+   'org.apache.jetspeed.profiler.rules.impl.StandardProfilingRule',
+   'Resolves pages based on the clients remote IP address.');
+insert into RULE_CRITERION values ('60', 'ip-address', 0, 'ip', 'ip', null, 0);
 
 insert into PRINCIPAL_RULE_ASSOC values ( 'guest', 'page', 'j2' );
 insert into PRINCIPAL_RULE_ASSOC values ( 'jetspeed', 'page', 'role-fallback' );
@@ -435,6 +439,8 @@
 insert into PRINCIPAL_RULE_ASSOC values ('subsite', 'page', 'subsite-role-fallback-home');
 insert into PRINCIPAL_RULE_ASSOC values ('subsite2', 'page', 'subsite2-role-fallback-home');
 
+insert into PRINCIPAL_RULE_ASSOC values ('geo', 'page', 'ip-address');
+
 -- test data for db browser
 insert into CLUBS values ('AC Milan', 'Italy', 'Milan', 'San Siro', 85700, 1926, '105x68m', '');
 insert into CLUBS values ('Arsenal', 'England', 'London', 'Highbury', 38500, 1913, '101x65', 'Gunners');
Index: etc/sql/populate-userinfo-for-default-psml.sql
===================================================================
--- etc/sql/populate-userinfo-for-default-psml.sql	(revision 446567)
+++ etc/sql/populate-userinfo-for-default-psml.sql	(working copy)
@@ -97,3 +97,7 @@
 INSERT INTO SECURITY_PERMISSION VALUES(100,'org.apache.jetspeed.security.PortletPermission','j2-admin::*','view, edit','2004-05-22 16:27:12.572','2004-05-22 16:27:12.572');
 INSERT INTO PRINCIPAL_PERMISSION VALUES(6,100);
 
+-- Test User for Mapping IP addresses to geographic locations
+-- And ip-address Profile rule
+INSERT INTO SECURITY_PRINCIPAL VALUES(60,'org.apache.jetspeed.security.JetspeedUserPrincipalImpl',0,1,'/user/geo','2006-09-03 12:07:25.234','2006-09-03 12:07:25.234');
+INSERT INTO SECURITY_CREDENTIAL VALUES(60,60,'geo',0,'org.apache.jetspeed.security.spi.impl.DefaultPasswordCredentialImpl',0,0,1,0,0,'2006-09-03 12:07:25.234','2006-09-03 12:07:25.234',null,null,null);
