Package io.toro.martini
Class WidgetPageMethods
- java.lang.Object
-
- io.toro.martini.WidgetPageMethods
-
public final class WidgetPageMethods extends Object
A utility class containing for widget and page-related operations, containing one-liners for parsing widgets and pages.
-
-
Constructor Summary
Constructors Constructor Description WidgetPageMethods(io.toro.cde.core.processor.CompilerManager compilerManager, io.toro.cde.core.widget.WidgetService widgetService, io.toro.cde.core.page.PageService pageService)
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static String
page(String uri)
Parse a page.static String
page(String uri, Map context)
Parse a page.static String
widget(String widgetName)
Parse a widget.static String
widget(String widgetName, Map params)
Parse a widget.
-
-
-
Constructor Detail
-
WidgetPageMethods
@Autowired WidgetPageMethods(io.toro.cde.core.processor.CompilerManager compilerManager, io.toro.cde.core.widget.WidgetService widgetService, io.toro.cde.core.page.PageService pageService)
-
-
Method Detail
-
widget
public static String widget(String widgetName) throws Exception
Parse a widget.
Example usage:
println 'exampleWidget'.widget()
- Parameters:
widgetName
- the widget name- Returns:
- parsed string from the widget
- Throws:
Exception
- Since:
- 1.0
-
widget
public static String widget(String widgetName, Map params) throws Exception
Parse a widget.
Example usage:
println 'exampleWidget'.widget( [ : ] )
- Parameters:
widgetName
- the widget nameparams
- widget map parameters- Returns:
- parsed string from the widget
- Throws:
Exception
- Since:
- 1.0
-
page
public static String page(String uri) throws Exception
Parse a page.
Example usage:
def pageData = '/page1'.page( ) 'smtp://esb.user%40gmail.com:password@smtp.gmail.com:587/here%is%your%report'.send([to: 'friend@gmail.com'], pageData);
- Parameters:
uri
- URI of the page- Returns:
- parsed content of the page
- Throws:
Exception
- Since:
- 1.0
-
page
public static String page(String uri, Map context) throws Exception
Parse a page.
Example usage:
def params = ['example' : 'exampleValue', 'example2' : 'exampleValue2' ] def pageData = '/page1'.page( params ) 'smtp://esb.user%40gmail.com:password@smtp.gmail.com:587/here%is%your%report'.send([to: 'friend@gmail.com'], pageData);
- Parameters:
uri
- URI of the pagecontext
- a map containing the variables you want to pass to the page for parsing against- Returns:
- parsed content of the page
- Throws:
Exception
- Since:
- 1.0
-
-