Package net.officefloor.web.thymeleaf
Class ThymeleafProcedureSource
java.lang.Object
net.officefloor.web.thymeleaf.ThymeleafProcedureSource
- All Implemented Interfaces:
ManagedFunctionProcedureSource,ProcedureSource,ProcedureSourceServiceFactory,ServiceFactory<ProcedureSource>
public class ThymeleafProcedureSource
extends Object
implements ManagedFunctionProcedureSource, ProcedureSourceServiceFactory
ProcedureSource that renders a Thymeleaf template.
The resource name is the Thymeleaf template name (without prefix/suffix).
The procedure parameter (passed from the previous composition step) is
exposed to the template as the model variable.
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncreateService(ServiceContext context) Creates the service.Name of this source.voidlistProcedures(ProcedureListContext context) Provides the availableProcedureinstances for the resource.voidLoads theManagedFunctionfor theProcedure.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface net.officefloor.activity.procedure.spi.ManagedFunctionProcedureSource
loadMethod
-
Field Details
-
SOURCE_NAME
Source name.- See Also:
-
PROCEDURE_NAME
Procedure name.- See Also:
-
-
Constructor Details
-
ThymeleafProcedureSource
public ThymeleafProcedureSource()
-
-
Method Details
-
createService
Description copied from interface:ServiceFactoryCreates the service.- Specified by:
createServicein interfaceServiceFactory<ProcedureSource>- Parameters:
context-ServiceContext.- Returns:
- Service.
- Throws:
Throwable- If fails to create the service.
-
getSourceName
Description copied from interface:ProcedureSourceName of this source.
Note that this is the name used in configuration to identify this
ProcedureSource. Therefore, it can not change without causing configurations to be updated.The reasons for using this logical name over
Classnames is:- Class names can be quite long
- Class names are not easily readable
- Enables swapping plugins for same logical service name
- Specified by:
getSourceNamein interfaceProcedureSource- Returns:
- Name of this source.
-
listProcedures
Description copied from interface:ProcedureSourceProvides the availableProcedureinstances for the resource.- Specified by:
listProceduresin interfaceProcedureSource- Parameters:
context-ProcedureListContext.- Throws:
Exception- If fails to listProcedureinstances.
-
loadManagedFunction
Description copied from interface:ManagedFunctionProcedureSourceLoads theManagedFunctionfor theProcedure.- Specified by:
loadManagedFunctionin interfaceManagedFunctionProcedureSource- Parameters:
context-ProcedureManagedFunctionContext.- Throws:
Exception- If fails to load theManagedFunction.
-