Codota Logo
ResourceService.getResource
Code IndexAdd Codota to your IDE (free)

How to use
getResource
method
in
org.nuxeo.runtime.services.resource.ResourceService

Best Java code snippets using org.nuxeo.runtime.services.resource.ResourceService.getResource (Showing top 4 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
LocalDateTime l =
  • Codota Iconnew LocalDateTime()
  • Codota IconLocalDateTime.now()
  • Codota IconDateTimeFormatter formatter;String text;formatter.parseLocalDateTime(text)
  • Smart code suggestions by Codota
}
origin: acaren-nuxeo-base/acaren-nuxeo-base-core

@Override
public URL getResourceURL(String key) {
  URL url = null;
  
  ResourceService rs = getService();
  if (null != rs) {
    url = rs.getResource(key);
  }
  
  return url;
}

origin: org.nuxeo.ecm.automation/nuxeo-automation-core

@Override
public URL getResourceURL(String key) {
  try {
    if (key.startsWith(Renderer.TEMPLATE_PREFIX)) {
      return Framework.getService(ResourceService.class).getResource(
          key.substring(Renderer.TEMPLATE_PREFIX.length()));
    } else {
      return new URL(key);
    }
  } catch (MalformedURLException e) {
    return null;
  }
}
origin: toutatice-services.dafpic/toutatice-dafpic-ecm

@Override
public URL getResourceURL(String key) {
  URL url = null;
  
  ResourceService rs = getService();
  if (null != rs) {
    url = rs.getResource(key);
  }
  
  return url;
}

origin: org.nuxeo.ecm.automation/nuxeo-automation-core

@Override
public String render(String uriOrContent, Map<String, Object> root) throws OperationException, IOException {
  CompiledTemplate compiled;
  String content;
  if (uriOrContent.startsWith(Renderer.TEMPLATE_PREFIX)) {
    String name = uriOrContent.substring(Renderer.TEMPLATE_PREFIX.length());
    compiled = cache.get(name);
    if (compiled == null) {
      URL url = Framework.getService(ResourceService.class).getResource(name);
      if (url == null) {
        throw new OperationException("Rendering resource not found: " + name);
      }
      try (InputStream in = url.openStream()) {
        content = IOUtils.toString(in, UTF_8);
      }
      compiled = TemplateCompiler.compileTemplate(content);
      cache.put(name, compiled);
    }
  } else {
    content = uriOrContent;
    compiled = TemplateCompiler.compileTemplate(content);
  }
  Object obj = TemplateRuntime.execute(compiled, root);
  return obj == null ? "" : obj.toString();
}
org.nuxeo.runtime.services.resourceResourceServicegetResource

Popular methods of ResourceService

    Popular in Java

    • Updating database using SQL prepared statement
    • getApplicationContext (Context)
    • getSystemService (Context)
    • getOriginalFilename (MultipartFile)
      Return the original filename in the client's filesystem.This may contain path information depending
    • Path (java.nio.file)
    • SortedMap (java.util)
      A map that has its keys ordered. The sorting is according to either the natural ordering of its keys
    • BlockingQueue (java.util.concurrent)
      A java.util.Queue that additionally supports operations that wait for the queue to become non-empty
    • TimeUnit (java.util.concurrent)
      A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
    • IOUtils (org.apache.commons.io)
      General IO stream manipulation utilities. This class provides static utility methods for input/outpu
    • Get (org.apache.hadoop.hbase.client)
      Used to perform Get operations on a single row. To get everything for a row, instantiate a Get objec
    Codota Logo
    • Products

      Search for Java codeSearch for JavaScript codeEnterprise
    • IDE Plugins

      IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
    • Company

      About UsContact UsCareers
    • Resources

      FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
    Get Codota for your IDE now