Interface IPluginFormResources
- All Superinterfaces:
IFCPlugin, IFCRemoteSyncPlugin, INamedUiElement, INameProviding, ITransferable, Serializable
Override findResources(params) to provide a list of
resources that should be included in a form. The parameters include the form and form version, so you can return
different resources depending on the form or its configuration.
Note: Plugins of this type must expect to be executed on a frontend server, i.e. when no classes from the master server are available, such as the DAO provider for accessing the database. If you need to access the database, you must use the APIProvider to request data from the master server.
- Since:
- 8.3.0
- Author:
- XIMA MEDIA GmbH
-
Field Summary
Fields inherited from interface IFCPlugin
CONFIG_FILENAMEFields inherited from interface INamedUiElement
ATTR_DISPLAY_NAMEFields inherited from interface INameProviding
ATTR_NAME, COL_NAME -
Method Summary
Modifier and TypeMethodDescriptiondefault IPluginFormResourceDescriptorfindResourceByFileName(String fileName) Finds the resource with the given file name among the resources that this plugin provides.default Iterable<? extends IPluginFormResourceDescriptor> Gets all resources that this plugin wishes to provide.default Map<String, IPluginFormResourceDescriptor> Deprecated.Methods inherited from interface IFCPlugin
getDescription, getDescription, getDisplayName, getName, initialize, initPlugin, install, shutdown, shutdown, uninstall, validateConfigurationData
-
Method Details
-
getResources
@Deprecated default Map<String, IPluginFormResourceDescriptor> getResources(IPluginFormResourcesParams params) Deprecated.ImplementfindResources(IPluginFormResourcesFindParams)andfindResourceByFileName(String)instead.Gets all resources that this plugin wishes to provide. The resources should depend only on these parameters, as the resources may get cached.The resources are returned as a map, where the map key is the value of
IPluginFormResourceDescriptor.getFileName().- Parameters:
params- Parameters for obtaining the resources.- Returns:
- A map of resource descriptors for the resources that this plugin wishes to provide, with the file name as a map key.
- Throws:
RuntimeException- This method should never throw an exception. But if it does, the behavior depends on the context. When a form is rendered, the exception will be caught and logged, but otherwise ignored. The form will still be rendered, albeit without the resources from this plugin. When a specific resource is requested via the HTTP endpoint, the HTTP endpoint will return an appropriate HTTP status code, such as 500.
-
findResources
default Iterable<? extends IPluginFormResourceDescriptor> findResources(IPluginFormResourcesFindParams params) Gets all resources that this plugin wishes to provide. This method is given a set of parameters, the resources should depend only on these parameters, as the resources may get cached.This method should never return null. The default implementation returns null for backward compatibility:
getResources()will be called if this method returns null.- Parameters:
params- Parameters for obtaining the resources.- Returns:
- All resources that this plugin wishes to provide.
- Throws:
RuntimeException- This method should never throw an exception. But if it does, the behavior depends on the context. When a form is rendered, the exception will be caught and logged, but otherwise ignored. The form will still be rendered, albeit without the resources from this plugin. When a specific resource is requested via the HTTP endpoint, the HTTP endpoint will return an appropriate HTTP status code, such as 500.- Since:
- 8.5.1
-
findResourceByFileName
Finds the resource with the given file name among the resources that this plugin provides. This method is given one of thefile namesof theresource descriptorsas returned byfindResources(). This method should return the resource with the given file name, or null if this plugin does not provide a resource with the given file name.- Parameters:
fileName- The file name of the resource to find.- Returns:
- The resource with the given file name, or null if not found.
- Since:
- 8.5.1
-
findResources(IPluginFormResourcesFindParams)andfindResourceByFileName(String)instead.