Class MinimizeSassManager

java.lang.Object
org.ametys.runtime.plugin.component.AbstractLogEnabled
org.ametys.core.minimize.css.sass.MinimizeSassManager
All Implemented Interfaces:
LogEnabled, Initializable, Component, Contextualizable, Serviceable

Minimize manager for CSS files
  • Field Details

    • ROLE

      public static final String ROLE
      The avalon ROLE
  • Constructor Details

  • Method Details

    • initialize

      public void initialize() throws Exception
      Specified by:
      initialize in interface Initializable
      Throws:
      Exception
    • contextualize

      public void contextualize(Context context) throws ContextException
      Specified by:
      contextualize in interface Contextualizable
      Throws:
      ContextException
    • service

      public void service(ServiceManager smanager) throws ServiceException
      Specified by:
      service in interface Serviceable
      Throws:
      ServiceException
    • compileCss

      public String compileCss(String content, String sassLocation, String location, boolean minimize, long lastModified) throws URISyntaxException, io.bit3.jsass.CompilationException, IOException
      Compile a sass file. The source map of the file is generated and stored in the source map cache
      Parameters:
      content - The content of the sass file
      sassLocation - The location of the sass file, e.g. plugin:core-ui:/resources/example/test.scss
      location - The location of the compiled css, e.g. plugin:core-ui:/resources/example/test.css or plugin:core-ui:/resources/example/test.min.css
      minimize - Minimize the output
      lastModified - The date of last modification
      Returns:
      The content of the compiled, and optionally minimized, sass file
      Throws:
      URISyntaxException - If an exception occurred
      io.bit3.jsass.CompilationException - If an exception occurred
      IOException - If an exception occurred
    • generateCssSourceMap

      public String generateCssSourceMap(String content, String location, String extension, String internalContextPath, String externalContextPath, boolean minimize, long lastModified) throws URISyntaxException, io.bit3.jsass.CompilationException, IOException
      Generate the source map of compiled sass file. The source map of the file is generated and stored in the source map cache
      Parameters:
      content - The content of the file
      location - The location of the source map file, e.g. plugin:core-ui:/resources/example/test.scss.map or plugin:core-ui:/resources/example/test.css.map
      extension - The extension of the sass file, e.g. scss or sass
      internalContextPath - The internal context path
      externalContextPath - The external context path
      minimize - Minimize the output
      lastModified - The date of last modification
      Returns:
      The content of the source map, or null if no source map was generated
      Throws:
      URISyntaxException - If an exception occurred
      io.bit3.jsass.CompilationException - If an exception occurred
      IOException - If an exception occurred