org.oddjob.input
Class InputJob

java.lang.Object
  extended by org.oddjob.framework.BaseComponent
      extended by org.oddjob.framework.BasePrimary
          extended by org.oddjob.framework.SimpleJob
              extended by org.oddjob.framework.SerializableJob
                  extended by org.oddjob.values.properties.PropertiesJobBase
                      extended by org.oddjob.input.InputJob
All Implemented Interfaces:
Serializable, Runnable, ArooaContextAware, ArooaSessionAware, Forceable, PropertyChangeNotifier, Iconic, LogEnabled, Resetable, Stateful

public class InputJob
extends PropertiesJobBase

Description

Ask for input from the user.

The medium with which Oddjob asks for input will depend on how it's running. When running in Oddjob Explorer a GUI dialogue will be used. When running from the console, input from the console will be requested.

Example

Request lots of input.
<oddjob>
    <job>
        <sequential>
            <jobs>
                <input>
                    <requests>
                        <input-file prompt="Install Directory" default="/home/oddjob/foo" property="config.install"/>
                        <input-text prompt="System" default="Development" property="config.system"/>
                        <input-text prompt="Username" property="config.username"/>
                        <input-password prompt="Password" property="config.password"/>
                        <input-confirm prompt="Agree To Licence" default="false" property="config.agree"/>
                    </requests>
                </input>
                <check value="${config.agree}" eq="true"/>
                <echo>Password for ${config.username} is ${config.password}</echo>
                <input>
                    <requests>
                        <input-message>Logging On to ${config.system} Now!</input-message>
                    </requests>
                </input>
            </jobs>
        </sequential>
    </job>
</oddjob>
See Also:
Serialized Form
Author:
rob

Field Summary
 
Fields inherited from class org.oddjob.framework.SimpleJob
stateHandler, stop
 
Fields inherited from class org.oddjob.framework.BaseComponent
iconHelper
 
Constructor Summary
InputJob()
           
 
Method Summary
protected  int execute()
          Execute this job.
 InputHandler getInputHandler()
           
 InputRequest getRequests(int index)
           
protected  boolean isOverride()
          Are the properties override properties.
 void setInputHandler(InputHandler inputHandler)
           
 void setRequests(int index, InputRequest request)
           
 
Methods inherited from class org.oddjob.values.properties.PropertiesJobBase
addPropertyLookup, createPropertyLookup, getLookup, getProperties, onDestroy, onReset, setArooaContext, setProperties
 
Methods inherited from class org.oddjob.framework.SimpleJob
fireDestroyedState, force, getStateChanger, hardReset, onStop, run, sleep, softReset, stateHandler, stop
 
Methods inherited from class org.oddjob.framework.BasePrimary
configure, getName, logger, logger, loggerName, save, setName, toString
 
Methods inherited from class org.oddjob.framework.BaseComponent
addIconListener, addPropertyChangeListener, addStateListener, configure, destroy, firePropertyChange, getArooaSession, iconForId, initialise, lastStateEvent, onConfigured, onInitialised, removeIconListener, removePropertyChangeListener, removeStateListener, save, setArooaSession
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.oddjob.Stateful
addStateListener, lastStateEvent, removeStateListener
 

Constructor Detail

InputJob

public InputJob()
Method Detail

execute

protected int execute()
Description copied from class: SimpleJob
Execute this job.

Specified by:
execute in class SimpleJob
Returns:
0 if the job is complete, anything else otherwise.

getInputHandler

public InputHandler getInputHandler()

setInputHandler

@Inject
public void setInputHandler(InputHandler inputHandler)

getRequests

public InputRequest getRequests(int index)

setRequests

public void setRequests(int index,
                        InputRequest request)

isOverride

protected boolean isOverride()
Description copied from class: PropertiesJobBase
Are the properties override properties.

Specified by:
isOverride in class PropertiesJobBase
Returns: