Class CronEditorWebComponent
java.lang.Object
com.atlassian.jira.web.component.AbstractWebComponent
com.atlassian.jira.web.component.cron.CronEditorWebComponent
Used to display and process a cron-style HTML editor. This generates the inputs that can be placed into a form. You
can get a handle on the form HTML by using the
getHtml(CronEditorBean, String)
method.
Once the form has been submitted you can attain a cron string by processing the input parameters with the getCronExpressionFromInput(CronEditorBean)
method.
-
Field Summary
Fields inherited from class com.atlassian.jira.web.component.AbstractWebComponent
applicationProperties
-
Constructor Summary
ConstructorsConstructorDescriptionCronEditorWebComponent
(VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties) -
Method Summary
Modifier and TypeMethodDescriptiongetCronExpressionFromInput
(CronEditorBean cronEditorBean) This is a utility method that will process the parameters that the view put into the form and create a cron string from the inputs.getHtml
(CronEditorBean cronEditorBean, I18nHelper i18n, String paramPrefix, String errorMessage) Will produce HTML inputs for selecting a time period that will be represented by a cron string.getHtml
(CronEditorBean cronEditorBean, String paramPrefix) Will produce HTML inputs for selecting a time period that will be represented by a cron string.getHtml
(CronEditorBean cronEditorBean, String paramPrefix, String errorMessage) Will produce HTML inputs for selecting a time period that will be represented by a cron string.validateInput
(CronEditorBean cronEditorBean, String fieldName) Methods inherited from class com.atlassian.jira.web.component.AbstractWebComponent
asHtml, getHtml
-
Constructor Details
-
CronEditorWebComponent
public CronEditorWebComponent() -
CronEditorWebComponent
public CronEditorWebComponent(VelocityTemplatingEngine templatingEngine, ApplicationProperties applicationProperties)
-
-
Method Details
-
getHtml
Will produce HTML inputs for selecting a time period that will be represented by a cron string. The incoming expression will populate the values of the form. This uses the default i18n bean to resolve i18n properties.- Parameters:
cronEditorBean
- defines how the form inputs will be intialized.paramPrefix
- prefix's the input names so that you can render multiple versions of this component on one page.- Returns:
- HTML that represents the cron editor inputs.
-
getHtml
public String getHtml(CronEditorBean cronEditorBean, String paramPrefix, @Nullable String errorMessage) Will produce HTML inputs for selecting a time period that will be represented by a cron string. The incoming expression will populate the values of the form. This uses the default i18n bean to resolve i18n properties.- Parameters:
cronEditorBean
- defines how the form inputs will be intialized.paramPrefix
- prefix's the input names so that you can render multiple versions of this component on one page.errorMessage
- the error message that was associated with the last cron expression. Can be null to indicate that there was no error.- Returns:
- HTML that represents the cron editor inputs.
-
getHtml
public String getHtml(CronEditorBean cronEditorBean, I18nHelper i18n, String paramPrefix, @Nullable String errorMessage) Will produce HTML inputs for selecting a time period that will be represented by a cron string. The incoming expression will populate the values of the form.- Parameters:
cronEditorBean
- defines how the form inputs will be intialized.i18n
- used to resolve the i18n labeles.paramPrefix
- prefixes the input names so that you can render multiple versions of this component on one page.errorMessage
- the error message that was associated with the last cron expression. Can be null to indicate that there was no error.- Returns:
- HTML that represents the cron editor inputs.
-
validateInput
-
getCronExpressionFromInput
This is a utility method that will process the parameters that the view put into the form and create a cron string from the inputs. This cron string must be validated, there is no guarantee that this output is a valid cron string.- Parameters:
cronEditorBean
- holds the state of the submitted form- Returns:
- a cron string that represents the user inputs in cron format.
-