*/
@Override
public boolean validateAction() {
boolean result = true;
IActionDefinition actionDefinition = getActionDefinition();
String actionName = getActionName();
if ( actionDefinition instanceof AbstractRelationalDbAction ) {
AbstractRelationalDbAction relationalDbAction = (AbstractRelationalDbAction) actionDefinition;
IActionInput query = relationalDbAction.getQuery();
IActionInput dbUrl = relationalDbAction.getDbUrl();
IActionInput jndi = relationalDbAction.getJndi();
IActionInput sharedConnection = relationalDbAction.getSharedConnection();
if ( query == ActionInputConstant.NULL_INPUT ) {
error( Messages.getInstance().getErrorString( "SQLBaseComponent.ERROR_0001_QUERY_NOT_SPECIFIED", actionName ) ); //$NON-NLS-1$
result = false;
}
if ( ( jndi == ActionInputConstant.NULL_INPUT ) && ( dbUrl == ActionInputConstant.NULL_INPUT )
&& ( sharedConnection == ActionInputConstant.NULL_INPUT ) ) {
error( Messages.getInstance().getErrorString(
"SQLBaseComponent.ERROR_0002_CONNECTION_NOT_SPECIFIED", actionName ) ); //$NON-NLS-1$
result = false;
}
} else if ( actionDefinition instanceof SqlConnectionAction ) {
SqlConnectionAction sqlConnectionAction = (SqlConnectionAction) actionDefinition;
IActionInput dbUrl = sqlConnectionAction.getDbUrl();
IActionInput jndi = sqlConnectionAction.getJndi();
if ( ( jndi == ActionInputConstant.NULL_INPUT ) && ( dbUrl == ActionInputConstant.NULL_INPUT ) ) {
error( Messages.getInstance().getErrorString(
"SQLBaseComponent.ERROR_0002_CONNECTION_NOT_SPECIFIED", actionName ) ); //$NON-NLS-1$
result = false;
}
} else {
error( Messages.getInstance().getErrorString(
"ComponentBase.ERROR_0001_UNKNOWN_ACTION_TYPE", actionDefinition.getElement().asXML() ) ); //$NON-NLS-1$
result = false;
}
return result;
}