taylor 2005/04/09 11:47:16 Modified: components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl AbstractProfilingRule.java Added: components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl UserAgentCriterionResolver.java Log: http://issues.apache.org/jira/browse/JS2-230 locate profiles with user-agent Revision Changes Path 1.5 +2 -1 jakarta-jetspeed-2/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/AbstractProfilingRule.java Index: AbstractProfilingRule.java =================================================================== RCS file: /home/cvs/jakarta-jetspeed-2/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/AbstractProfilingRule.java,v retrieving revision 1.4 retrieving revision 1.5 diff -u -r1.4 -r1.5 --- AbstractProfilingRule.java 3 Nov 2004 19:40:45 -0000 1.4 +++ AbstractProfilingRule.java 9 Apr 2005 18:47:16 -0000 1.5 @@ -61,6 +61,7 @@ resolvers.put(RuleCriterionResolver.GROUP_ROLE_USER, new GroupRoleUserCriterionResolver()); resolvers.put(RuleCriterionResolver.USER_ATTRIBUTE, new UserAttributeResolver()); resolvers.put(RuleCriterionResolver.NAVIGATION, new NavigationCriterionResolver()); + resolvers.put(RuleCriterionResolver.USER_AGENT, new UserAgentCriterionResolver()); } protected ProfileLocator getLocatorFromCache(String key) 1.1 jakarta-jetspeed-2/components/profiler/src/java/org/apache/jetspeed/profiler/rules/impl/UserAgentCriterionResolver.java Index: UserAgentCriterionResolver.java =================================================================== /* * Copyright 2000-2004 The Apache Software Foundation. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ package org.apache.jetspeed.profiler.rules.impl; import org.apache.jetspeed.profiler.rules.RuleCriterion; import org.apache.jetspeed.profiler.rules.RuleCriterionResolver; import org.apache.jetspeed.request.RequestContext; /** * UserAgentCriterionResolver * * @author <a href="mailto:[EMAIL PROTECTED]">David Sean Taylor</a> * @version $Id: UserAgentCriterionResolver.java,v 1.1 2005/04/09 18:47:16 taylor Exp $ */ public class UserAgentCriterionResolver extends StandardResolver implements RuleCriterionResolver { public String resolve(RequestContext context, RuleCriterion criterion) { // look for override String value = super.resolve(context, criterion); if (value != null) { return value; } return context.getCapabilityMap().getClient().getName(); } public boolean isControl(RuleCriterion criterion) { return true; } }
--------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]