@DELETE @Produces({MediaType.APPLICATION_XML, MediaType.APPLICATION_JSON}) public UpdateResultBean deleteProfiles(List<String> profileIds, @Context HttpServletRequest servletRequest) { if (log.isDebugEnabled()) { log.debug(String.format("processing DELETE on /profiler for %s", profileIds)); } checkPrivilege(servletRequest, JetspeedActions.VIEW); if (profileIds == null || profileIds.size() == 0) { throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity( new UpdateResultBean(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), "Profile ids to delete not specified")).build()); } try { //profileIds = PathSegmentUtils.parseNames(profileIdsString); for (String id : profileIds) { ProfilingRule rule = profiler.getRule(id); if (rule != null) { profiler.deleteProfilingRule(rule); } } return new UpdateResultBean(Response.Status.OK.getStatusCode(), "OK"); } catch (Exception e) { String message = String.format("Error converting profiler ids [%s]", profileIds); log.debug(message); throw new WebApplicationException(Response.status(Response.Status.INTERNAL_SERVER_ERROR).entity( new UpdateResultBean(Response.Status.INTERNAL_SERVER_ERROR.getStatusCode(), message)).build()); } }
ProfilingRule profilingRule = profiler.getRule(rule); if (profilingRule != null) { profiler.setRuleForPrincipal(user, profilingRule, ProfileLocator.PAGE_LOCATOR);
@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; }
ProfilingRule profilingRule = profiler.getRule(rule); if (profilingRule != null)
private void recreatePrincipalRules(JSPrincipalRules rules, String principalName) { for (JSPrincipalRule pr : rules) { ProfilingRule pRule = pm.getRule(pr.getRule()); try { PrincipalRule p1 = pm.createPrincipalRule(); p1.setLocatorName(pr.getLocator()); p1.setProfilingRule(pRule); p1.setPrincipalName(principalName); pm.storePrincipalRule(p1); } catch (Exception eRole) { eRole.printStackTrace(); } } }
ProfilingRule rule = profiler.getRule(entry.getValue()); if (rule != null) { profiler.setRuleForPrincipal(user, rule, entry.getKey());
ProfilingRule rule = profiler.getRule(dtoProfile.getId()); if (rule == null) { rule = profiler.createProfilingRule(dtoProfile.getConcreteClass().indexOf("StandardProfilingRule") > -1);
rule = profiler.getRule(jsp.getId()); if (jsp.isStandardRule()) rule = profiler.createProfilingRule(true);