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
public class MinimizeSassManager
extends AbstractLogEnabled
implements Component, Serviceable, Initializable, Contextualizable
Minimize manager for CSS files
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptioncompileCss
(String content, String sassLocation, String location, boolean minimize, long lastModified) Compile a sass file.void
contextualize
(Context context) generateCssSourceMap
(String content, String location, String extension, String internalContextPath, String externalContextPath, boolean minimize, long lastModified) Generate the source map of compiled sass file.void
void
service
(ServiceManager smanager) Methods inherited from class org.ametys.runtime.plugin.component.AbstractLogEnabled
getLogger, setLogger
-
Field Details
-
ROLE
The avalon ROLE
-
-
Constructor Details
-
MinimizeSassManager
public MinimizeSassManager()
-
-
Method Details
-
initialize
- Specified by:
initialize
in interfaceInitializable
- Throws:
Exception
-
contextualize
- Specified by:
contextualize
in interfaceContextualizable
- Throws:
ContextException
-
service
- Specified by:
service
in interfaceServiceable
- 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 filesassLocation
- The location of the sass file, e.g. plugin:core-ui:/resources/example/test.scsslocation
- The location of the compiled css, e.g. plugin:core-ui:/resources/example/test.css or plugin:core-ui:/resources/example/test.min.cssminimize
- Minimize the outputlastModified
- The date of last modification- Returns:
- The content of the compiled, and optionally minimized, sass file
- Throws:
URISyntaxException
- If an exception occurredio.bit3.jsass.CompilationException
- If an exception occurredIOException
- 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 filelocation
- 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.mapextension
- The extension of the sass file, e.g. scss or sassinternalContextPath
- The internal context pathexternalContextPath
- The external context pathminimize
- Minimize the outputlastModified
- 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 occurredio.bit3.jsass.CompilationException
- If an exception occurredIOException
- If an exception occurred
-