Refine search
public static String getResourceRequestPath(FacesContext context, String resourceName) { Resource resource = context.getApplication().getResourceHandler().createResource(resourceName, "primefaces"); return resource.getRequestPath(); }
ResourceHandler resourceHandler = application.getResourceHandler(); resource = resourceHandler.createResource(resourceName, resourceLibrary); resource = resourceHandler.createResource(resourceName);
public static Resource newResource(ResourceInfo resourceInfo, FacesContext context) { Resource resource = context.getApplication().getResourceHandler().createResource(resourceInfo.getName(), resourceInfo.getLibrary()); if (resource == null) { throw new FacesException("Resource '" + resourceInfo.getName() + "' in library '" + resourceInfo.getLibrary() + "' not found!"); } return resource; }
Resource resource = context.getApplication().getResourceHandler().createResource("dynamiccontent.properties", "primefaces", "image/png"); String resourcePath = resource.getRequestPath();
protected void encodeValidationResources(FacesContext context, boolean beanValidationEnabled) throws IOException { ResponseWriter writer = context.getResponseWriter(); Resource resource = context.getApplication().getResourceHandler().createResource("validation/validation.js", "primefaces"); if (resource != null) { writer.startElement("script", null); writer.writeAttribute("type", "text/javascript", null); writer.writeAttribute("src", resource.getRequestPath(), null); writer.endElement("script"); } if (beanValidationEnabled) { resource = context.getApplication().getResourceHandler().createResource("validation/beanvalidation.js", "primefaces"); if (resource != null) { writer.startElement("script", null); writer.writeAttribute("type", "text/javascript", null); writer.writeAttribute("src", resource.getRequestPath(), null); writer.endElement("script"); } } } }
Resource resource = context.getApplication().getResourceHandler().createResource( "dynamiccontent.properties", "primefaces", streamedContent.getContentType()); String resourcePath = resource.getRequestPath();
protected String getImageSrc(FacesContext context, GraphicImage image) throws Exception { String name = image.getName(); if (name != null) { String libName = image.getLibrary(); ResourceHandler handler = context.getApplication().getResourceHandler(); Resource res = handler.createResource(name, libName); if (res == null) { return "RES_NOT_FOUND"; } else { String requestPath = res.getRequestPath(); return context.getExternalContext().encodeResourceURL(requestPath); } } else { return DynamicContentSrcBuilder.build(context, image.getValue(), image, image.isCache(), DynamicContentType.STREAMED_CONTENT, image.isStream()); } } }
protected void encodeCSS(FacesContext context, String library, String resource) throws IOException { ResponseWriter writer = context.getResponseWriter(); Resource cssResource = context.getApplication().getResourceHandler().createResource(resource, library); if (cssResource == null) { throw new FacesException("Error loading css, cannot find \"" + resource + "\" resource of \"" + library + "\" library"); } else { writer.startElement("link", null); writer.writeAttribute("type", "text/css", null); writer.writeAttribute("rel", "stylesheet", null); writer.writeAttribute("href", cssResource.getRequestPath(), null); writer.endElement("link"); } }
private void encodeScript(FacesContext context, Editor editor) throws IOException { String clientId = editor.getClientId(context); WidgetBuilder wb = getWidgetBuilder(context); wb.init("Editor", editor.resolveWidgetVar(), clientId) .attr("disabled", editor.isDisabled(), false) .attr("invalid", editor.isValid(), true) .attr("controls", editor.getControls(), null) .attr("width", editor.getWidth(), Integer.MIN_VALUE) .attr("height", editor.getHeight(), Integer.MIN_VALUE) .attr("maxlength", editor.getMaxlength(), Integer.MAX_VALUE) .callback("change", "function(e)", editor.getOnchange()); if (AgentUtils.isIE(context)) { Resource resource = context.getApplication().getResourceHandler().createResource("editor/editor-ie.css", "primefaces"); wb.attr("docCSSFile", resource.getRequestPath()); } if (editor.getMaxlength() != Integer.MAX_VALUE) { LOGGER.info("Maxlength option is deprecated and will be removed in a future version."); } wb.finish(); }
/** * * @since 2.2 * @param context * @param resourceName * @return */ public ViewResource createViewResource(FacesContext context, String resourceName) { return context.getApplication().getResourceHandler().createResource(resourceName); }
protected Resource getInternalResource() { if (internalResource == null) { FacesContext facesContext = FacesContext.getCurrentInstance(); ResourceHandler resourceHandlerChain = facesContext.getApplication().getResourceHandler(); String resourceName = BASE_PATH + modulePath; internalResource = resourceHandlerChain.createResource(resourceName, ResLibResourceHandler.LIBRARY_NAME); } return internalResource; }
public static String getResourcePath(FacesContext context, String library, String resourceName) { String path = null; if (resourceName != null) { ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); Resource resource = (library != null) ? resourceHandler.createResource(resourceName, library) : resourceHandler .createResource(resourceName); if (resource != null) { path = resource.getRequestPath(); } } return path; }
public static String getResourcePath(FacesContext context, String library, String resourceName) { String path = null; if (resourceName != null) { ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); Resource resource = (library != null) ? resourceHandler.createResource(resourceName, library) : resourceHandler .createResource(resourceName); if (resource != null) { path = resource.getRequestPath(); } } return path; }
public String getCKEditorRequestPath(FacesContext facesContext) { Resource resource = facesContext.getApplication().getResourceHandler() .createResource("ckeditor.js", "org.richfaces.ckeditor"); return resource.getRequestPath(); }
public String getECSSQueryString(FacesContext facesContext, String resourceName) { Resource resource = facesContext.getApplication().getResourceHandler() .createResource(resourceName, "org.richfaces.ckeditor"); String requestPath = resource.getRequestPath(); Matcher matcher = DB_PATTERN.matcher(requestPath); if (matcher.matches()) { return "?" + matcher.group(2); } else { return ""; } } }
protected String getPushResourceUrl(FacesContext context) { ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); Resource pushResource = resourceHandler.createResource(PushResource.class.getName()); return pushResource.getRequestPath(); }
public String getCKEditorRequestPath(FacesContext facesContext) { Resource resource = facesContext.getApplication().getResourceHandler() .createResource("ckeditor.js", "org.richfaces.ckeditor"); return resource.getRequestPath(); }
protected String getPushResourceUrl(FacesContext context) { ResourceHandler resourceHandler = context.getApplication().getResourceHandler(); Resource pushResource = resourceHandler.createResource(PushResource.class.getName()); return pushResource.getRequestPath(); }
public String getCKEditorRequestPath(FacesContext facesContext) { Resource resource = facesContext.getApplication().getResourceHandler() .createResource("ckeditor.js", "org.richfaces.ckeditor"); return resource.getRequestPath(); }
protected String getResourceRequestPath(FacesContext context, String resourceName) { Resource resource = context.getApplication().getResourceHandler().createResource(resourceName, "primefaces"); return resource.getRequestPath(); }