com.atlassian.jira.web.component.cron
Class CronEditorWebComponent

java.lang.Object
  extended by com.atlassian.jira.web.component.AbstractWebComponent
      extended by com.atlassian.jira.web.component.cron.CronEditorWebComponent

public class CronEditorWebComponent
extends AbstractWebComponent

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, velocityManager
 
Constructor Summary
CronEditorWebComponent()
           
CronEditorWebComponent(com.atlassian.velocity.VelocityManager velocityManager, ApplicationProperties applicationProperties)
           
 
Method Summary
 String getCronExpressionFromInput(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.
 String getHtml(CronEditorBean cronEditorBean, I18nHelper i18n, String paramPrefix)
          Will produce HTML inputs for selecting a time period that will be represented by a cron string.
 String getHtml(CronEditorBean cronEditorBean, String paramPrefix)
          Will produce HTML inputs for selecting a time period that will be represented by a cron string.
 ErrorCollection validateInput(CronEditorBean cronEditorBean, String fieldName)
           
 
Methods inherited from class com.atlassian.jira.web.component.AbstractWebComponent
getHtml
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CronEditorWebComponent

public CronEditorWebComponent()

CronEditorWebComponent

public CronEditorWebComponent(com.atlassian.velocity.VelocityManager velocityManager,
                              ApplicationProperties applicationProperties)
Method Detail

getHtml

public String getHtml(CronEditorBean cronEditorBean,
                      String paramPrefix)
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,
                      I18nHelper i18n,
                      String paramPrefix)
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.
Returns:
HTML that represents the cron editor inputs.

validateInput

public ErrorCollection validateInput(CronEditorBean cronEditorBean,
                                     String fieldName)

getCronExpressionFromInput

public String getCronExpressionFromInput(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. 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.


Copyright © 2002-2012 Atlassian. All Rights Reserved.