@Override public final void suppressComponentErrorHandling(final SlingHttpServletRequest request) { request.setAttribute(SUPPRESS_ATTR, true); }
@Override public final void suppressComponentErrorHandling(final SlingHttpServletRequest request) { request.setAttribute(SUPPRESS_ATTR, true); }
public static void markRequest(SlingHttpServletRequest request) { request.setAttribute(REQUEST_ATTR_KEY, true); }
@Override protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { request.setAttribute(RenderCondition.class.getName(), INSTANCE); }
/** * Sets the targetResourceType as part of the delegation history and adds update history set to the Request * * @param request * @param targetResourceType */ private void setDelegationHistory(final SlingHttpServletRequest request, final String targetResourceType) { final Set<String> history = this.getDelegationHistory(request); history.add(targetResourceType); request.setAttribute(REQUEST_ATTR_DELEGATION_HISTORY, history); }
private boolean isFirstInChain(final SlingHttpServletRequest request) { if (request.getAttribute(REQ_ATTR_PREVIOUSLY_PROCESSED) != null) { return false; } else { request.setAttribute(REQ_ATTR_PREVIOUSLY_PROCESSED, true); return true; } }
/** * Sets the targetResourceType as part of the delegation history and adds update history set to the Request * * @param request * @param targetResourceType */ private void setDelegationHistory(final SlingHttpServletRequest request, final String targetResourceType) { final Set<String> history = this.getDelegationHistory(request); history.add(targetResourceType); request.setAttribute(REQUEST_ATTR_DELEGATION_HISTORY, history); }
private boolean isFirstInChain(final SlingHttpServletRequest request) { if (request.getAttribute(REQ_ATTR_PREVIOUSLY_PROCESSED) != null) { return false; } else { request.setAttribute(REQ_ATTR_PREVIOUSLY_PROCESSED, true); return true; } }
@Override public void activate() throws Exception { getRequest().setAttribute("hello", "world"); }
@Override protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { SimpleDataSource allowedTypesDataSource = new SimpleDataSource(getAllowedTypes(request).iterator()); request.setAttribute(DataSource.class.getName(), allowedTypesDataSource); }
@PostConstruct private void initModel() { slingRequest.setAttribute(FormsHelper.REQ_ATTR_FORM_STRUCTURE_HELPER, formStructureHelperFactory.getFormStructureHelper(resource)); String[] prefillValues = FormsHelper.getValues(slingRequest, resource); if (prefillValues == null || prefillValues.length == 0) { prefillValues = new String[]{PROP_VALUE_DEFAULT}; } if (value == null) { value = prefillValues[0]; } }
@Override protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { SimpleDataSource actionTypeDataSource = new SimpleDataSource(getActionTypeResources( request.getResourceResolver()).iterator()); request.setAttribute(DataSource.class.getName(), actionTypeDataSource); }
@Override protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { SimpleDataSource actionTypeSettingsDataSource = new SimpleDataSource(getSettingsDialogs( request.getResourceResolver()).iterator()); request.setAttribute(DataSource.class.getName(), actionTypeSettingsDataSource); }
/** * Persists the Form obj to the Request via Request Attribute. * * @param request * @param form */ protected final void setRequestAttrForm(final SlingHttpServletRequest request, final Form form) { final String key = this.getLookupKey(form.getName()); request.setAttribute(key, form); } }
/** * Persists the Form obj to the Request via Request Attribute. * * @param request * @param form */ protected final void setRequestAttrForm(final SlingHttpServletRequest request, final Form form) { final String key = this.getLookupKey(form.getName()); request.setAttribute(key, form); } }
/** * Gets or sets and gets the original WCMMode for the Request. * * @param request the Request * @return the original WCMMode for the Request */ private WCMMode getOrSetFirstWCMMode(final SlingHttpServletRequest request) { WCMMode wcmMode = (WCMMode) request.getAttribute(ATTR_FILTER); if (wcmMode == null) { wcmMode = WCMMode.fromRequest(request); request.setAttribute(ATTR_FILTER, wcmMode); } return wcmMode; }
/** * Gets or sets and gets the original WCMMode for the Request. * * @param request the Request * @return the original WCMMode for the Request */ private WCMMode getOrSetFirstWCMMode(final SlingHttpServletRequest request) { WCMMode wcmMode = (WCMMode) request.getAttribute(ATTR_FILTER); if (wcmMode == null) { wcmMode = WCMMode.fromRequest(request); request.setAttribute(ATTR_FILTER, wcmMode); } return wcmMode; }
@PostConstruct private void initModel() { slingRequest.setAttribute(FormsHelper.REQ_ATTR_FORM_STRUCTURE_HELPER, formStructureHelperFactory.getFormStructureHelper(resource)); prefillValues = FormsHelper.getValues(slingRequest, resource); if (prefillValues == null) { prefillValues = new String[]{this.getDefaultValue()}; } if (usePlaceholder) { placeholder = helpMessage; } }
@Override protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { try { WorkflowSession workflowSession = request.getResourceResolver().adaptTo(WorkflowSession.class); ArrayList<Resource> resources = new ArrayList<>(); if (workflowSession != null) { WorkflowModel[] models = workflowSession.getModels(); for (WorkflowModel model : models) { resources.add(new WorkflowModelResource(model, request.getResourceResolver())); } } SimpleDataSource dataSource = new SimpleDataSource(resources.iterator()); request.setAttribute(DataSource.class.getName(), dataSource); } catch (WorkflowException e) { throw new ServletException(e); } }
@Override protected void doGet(@Nonnull SlingHttpServletRequest request, @Nonnull SlingHttpServletResponse response) throws ServletException, IOException { LibraryType libraryType = null; Resource dataSourceResource = request.getResource().getChild(Config.DATASOURCE); if (dataSourceResource != null) { ValueMap dataSourceValueMap = ResourceUtil.getValueMap(dataSourceResource); if (dataSourceValueMap != null) { String type = dataSourceValueMap.get(PN_LIBRARY_TYPE, String.class); if (type != null) { type = type.toUpperCase(); libraryType = LibraryType.valueOf(type); } } } SimpleDataSource clientLibraryCategoriesDataSource = new SimpleDataSource(getCategoryResourceList(request, libraryType).iterator()); request.setAttribute(DataSource.class.getName(), clientLibraryCategoriesDataSource); }