public String resolve(RequestContext context, RuleCriterion criterion) { return criterion.getValue(); }
public String resolve(RequestContext context, RuleCriterion criterion) { String value = (String)context.getSessionAttribute(criterion.getName()); if (value == null) { value = criterion.getValue(); } return value; }
public String resolve(RequestContext context, RuleCriterion criterion) { String value = context.getRequestParameter(criterion.getName()); if (value == null) { value = criterion.getValue(); } return value; }
public String resolve(RequestContext context, RuleCriterion criterion) { String path = null; ContentPage page = context.getPage(); if(page != null) { path = page.getId(); } else { path = context.getPath(); } if ((path == null) || path.equals("/")) { path = criterion.getValue(); } return path; }
public String resolve(RequestContext context, RuleCriterion criterion) { if (context.getUserPrincipal() instanceof User) { User user = (User)context.getUserPrincipal(); if (user != null) { Map<String, String> map = user.getInfoMap(); String attribute = (String)map.get(criterion.getName()); if (attribute != null) { return attribute; } return criterion.getValue(); } } return null; }
@GET @Path("/edit/{id}/") public ProfileEditBean lookupProfile(@Context HttpServletRequest servletRequest, @Context UriInfo uriInfo, @PathParam("id") String profileId) { checkPrivilege(servletRequest, JetspeedActions.VIEW); if (StringUtils.isBlank(profileId)) { throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity( new UpdateResultBean(Response.Status.BAD_REQUEST.getStatusCode(), "Profile id not specified")).build()); } ProfilingRule rule = profiler.getRule(profileId); if (rule == null) { throw new WebApplicationException(Response.status(Response.Status.BAD_REQUEST).entity( new UpdateResultBean(Response.Status.BAD_REQUEST.getStatusCode(), "Profile id not found with the specified id: " + profileId)).build()); } ProfileEditBean editBean = new ProfileEditBean(rule.getId(), rule.getTitle(), rule.getClassname()); for (RuleCriterion criterion : rule.getRuleCriteria()) { editBean.add(new ProfileCriterionBean(criterion.getName(), criterion.getValue(), criterion.getType(), criterion.getFallbackType(), criterion.getFallbackOrder())); } return editBean; }
public JSRuleCriterion(RuleCriterion c) { this.name = c.getName(); this.type = c.getType(); this.value = c.getValue(); this.fallBackOrder = c.getFallbackOrder(); this.fallBackType = c.getFallbackType(); }
public String resolve(RequestContext context, RuleCriterion criterion) { String value = context.getRequestParameter(criterion.getName()); if (value == null) { value = (String)context.getSessionAttribute(criterion.getName()); if (value == null) { value = criterion.getValue(); } } return value; }
public String resolve(RequestContext context, RuleCriterion criterion) { String path = null; ContentPage page = context.getPage(); if (page != null) { path = page.getId(); } else { path = context.getPath(); } if ((path == null) || path.equals("/")) { String key = this.getClass() + "." + criterion.getName(); path = (String)context.getSessionAttribute(key); if (path == null) { path = criterion.getValue(); } } return path; }
public RuleCriterionImpl(RuleCriterion master) { this.name = master.getName(); this.ruleId = master.getRuleId(); this.type = master.getType(); this.value = master.getValue(); this.fallbackOrder = master.getFallbackOrder(); this.fallbackType = master.getFallbackType(); } /**