/** * Get a named Query Parameter from the Request. * * @param request * @param key * @return */ public static String getQueryParam(final SlingHttpServletRequest request, final String key) { return request.getParameter(key); }
/** * Get a named Query Parameter from the Request. * * @param request * @param key * @return */ public static String getQueryParam(final SlingHttpServletRequest request, final String key) { return request.getParameter(key); }
public PageCompareModel(SlingHttpServletRequest request) { this.pathA = request.getParameter("path"); String paramVersionA = request.getParameter("a"); this.pathB = request.getParameter("pathB"); String paramVersionB = request.getParameter("b"); this.versionA = isNullOrEmpty(paramVersionA) ? LATEST : paramVersionA; this.versionB = isNullOrEmpty(paramVersionB) ? LATEST : paramVersionB; }
protected boolean isSendError(SlingHttpServletRequest request){ boolean sendError=false; String sendErrorParam=request.getParameter(SlingPostConstants.RP_SEND_ERROR); if (sendErrorParam!=null && "true".equalsIgnoreCase(sendErrorParam)){ sendError=true; } return sendError; } }
/** * Return true if request is to delete chunks. To return true, request will * should parameter ":applyToChunks" and it should be true. */ protected boolean isDeleteChunkRequest(SlingHttpServletRequest request) { return Boolean.parseBoolean(request.getParameter(SlingPostConstants.RP_APPLY_TO_CHUNKS)); } }
protected boolean isSendError(SlingHttpServletRequest request){ boolean sendError=false; String sendErrorParam=request.getParameter(SlingPostConstants.RP_SEND_ERROR); if (sendErrorParam!=null && "true".equalsIgnoreCase(sendErrorParam)){ sendError=true; } return sendError; } }
@Override public Map<String, String> getRequestPredicate(SlingHttpServletRequest request) { final Map<String, String> params = new HashMap<String, String>(); String term = request.getParameter(REQUEST_PARAM); if (StringUtils.isNotBlank(term)) { params.put("fulltext", term); } return params; }
DumplibsParams(SlingHttpServletRequest request){ path = request.getParameter(PARAM_PATH); categories = getCategoriesArray(request.getParameter(PARAM_CATEGORIES)); themed = parseBoolean(request.getParameter(PARAM_THEMED)); trans = parseBoolean(request.getParameter(PARAM_TRANS)); type = getLibraryType(request.getParameter(PARAM_TYPE)); }
static void maybeAdd(SlingHttpServletRequest request, List<Modification> mods, String name) { if(request.getParameter(PARAM_NAME) != null) { mods.add(new Modification(ModificationType.CREATE, "source:" + name, "dest:" + name)); } } }
private ProcessInstance getProcessFromRequest(SlingHttpServletRequest request) { String id = request.getParameter("id"); if (id != null) { return manager.getManagedProcessInstanceByIdentifier(id); } else { String path = request.getParameter("path"); if (path != null) { return manager.getManagedProcessInstanceByPath(path); } } return null; }
public ViewFileModel(SlingHttpServletRequest request) { this.fileName = PropertiesUtil .toString(request.getParameter(FILENAME_PARAMETER_NAME), StringUtils.EMPTY); this.filePath = PropertiesUtil .toString(request.getParameter(FILEPATH_PARAMETER_NAME), StringUtils.EMPTY); } }
@Inject public ExecutionHistoryModel(@OSGiService History history, SlingHttpServletRequest request) { this.filter = request.getParameter("filter"); executions = new ArrayList<>(); for (Entry entry : history.findAll()) { executions.add(entry); } Collections.sort(executions); }
@Override protected void doGet(final SlingHttpServletRequest request, final SlingHttpServletResponse response) throws ServletException, IOException { final String id = request.getParameter(ID_REQUEST_PARAMETER); if (id == null) { return; } JobProgressOutput jobProgressOutput = scriptRunnerJobManager.checkJobStatus(id); ServletUtils.writeJson(response, gson.toJson(jobProgressOutput)); }
@Override protected void doGet(final SlingHttpServletRequest request, final SlingHttpServletResponse response) throws ServletException, IOException { final String id = request.getParameter(ID_REQUEST_PARAMETER); if (id == null) { return; } JobProgressOutput jobProgressOutput = scriptRunnerJobManager.checkJobStatus(id); ServletUtils.writeJson(response, gson.toJson(jobProgressOutput)); }
protected String getRawFormData(final String formName, final SlingHttpServletRequest request, final SlingHttpServletResponse response) { // Get the QP lookup for this form return this.decode(request.getParameter(this.getGetLookupKey(formName))); }
protected String getRawFormData(final String formName, final SlingHttpServletRequest request, final SlingHttpServletResponse response) { // Get the QP lookup for this form return this.decode(request.getParameter(this.getGetLookupKey(formName))); }
/** * Validate reCAPTCHA with the secret key and Google's service. * * @param request The SlingHttpServletRequest with the reCAPTCHA parameter * from the client-side validation. * @param remoteIP The remote user's IP address. * @return true if not a robot */ public boolean validate(final SlingHttpServletRequest request) { return validate(request.getParameter(RECAPTCHA_REQUEST_PARAMETER), getIPAddress(request)); }
/** * Sightly component initialization. */ @Override public void activate() { resource = getResource(); request = getRequest(); String path = request.getParameter("post"); if (StringUtils.isNotBlank(path)) { getBlog(path); } }
@Inject public ScriptEditModel(SlingHttpServletRequest request, @OSGiService ScriptFinder scriptFinder) { Script script = scriptFinder.find(request.getParameter(PATH_PARAM), request.getResourceResolver()); edit = script != null; if (edit) { fileName = FilenameUtils.getBaseName(script.getPath()); content = script.getData(); } else { fileName = FILE_NAME_DEFAULT; content = getContentDefault(); } }
private ProcessInstance doStartProcess(SlingHttpServletRequest request) throws RepositoryException, ReflectiveOperationException, DeserializeException { String def = request.getParameter("definition"); String description = request.getParameter("description"); ProcessDefinition definition = manager.findDefinitionByNameOrPath(def); ProcessInstance instance = manager.createManagedProcessInstance(definition, description); instance.init(request.getResourceResolver(), convertRequestMap(request.getRequestParameterMap())); instance.run(request.getResourceResolver()); return instance; }