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

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

Best Java code snippets using org.nuxeo.runtime.services.resource.ResourceService (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.resourceResourceService

Most used methods

  • getResource

Popular in Java

  • Making http requests using okhttp
  • getSupportFragmentManager (FragmentActivity)
  • getApplicationContext (Context)
  • setContentView (Activity)
  • Kernel (java.awt.image)
  • ConnectException (java.net)
    A ConnectException is thrown if a connection cannot be established to a remote host on a specific po
  • DecimalFormat (java.text)
    DecimalFormat is a concrete subclass ofNumberFormat that formats decimal numbers. It has a variety o
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • JButton (javax.swing)
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