Workflow::Validator::HasRequiredField man page on Fedora

Man page or keyword search:  
man Server   31170 pages
apropos Keyword Search (all sections)
Output format
Fedora logo
[printable version]

Workflow::Validator::HUserqContributedWorkflow::Validator::HasRequiredField(3)

NAME
       Workflow::Validator::HasRequiredField - Validator to ensure certain
       data are in the context

VERSION
       This documentation describes version 1.04 of this package

SYNOPSIS
	# Validator is created automatically when you mark a field as
	# 'is_required=yes' in the action, such as:

	<action name="CreateUser">
	   <field name="username"
		  is_required="yes"
		  source_class="App::Fied::ValidUsers"/>
	   ...

DESCRIPTION
       This is a simple validator to ensure that each of the fields you have
       marked with the 'is_required' property as 'yes' are indeed present
       before the associated action is executed.

       for instance, given the configuration:

	<action name="CreateUser">
	   <field name="username"
		  is_required="yes"/>
	   <field name="email"
		  is_required="yes"/>
	   <field name="office">
	</action>

       An action executed with such a context:

	my $wf = FACTORY->get_workflow( $id );
	$wf->context( username => 'foo' );
	$wf->context( office => 'Ottumwa' );
	$wf->execute_action( 'CreateUser' );

       Would fail with a message:

	The following fields require a value: email

       You normally do not need to configure this validator yourself. It gets
       generated automatically when the Action configration is read in.
       However, if you do need to create it yourself:

	<action name='Foo'>
	   <validator name="HasRequiredField">
	      <arg value="fieldOne"/>
	      <arg value="field_two"/>
	   </validator>
	<?action>

       Note that we do not try to match the value in the context against a set
       of known values or algorithm, just see if the value is defined -- using
       the Perl notion for defined rather than true/false, which means '0' and
       the empty string will both be valid.

   METHODS
       validate

       Validates whether a given set of required fields are defined.

       Takes two parameters: a workflow object and an array of names of
       fields.

       The provided fields are matched against the workflow in question and
       Workflow::Exception's are thrown in case of missing fields.

COPYRIGHT
       Copyright (c) 2003-2007 Chris Winters. All rights reserved.

       This library is free software; you can redistribute it and/or modify it
       under the same terms as Perl itself.

AUTHORS
       Jonas B. Nielsen (jonasbn) <jonasbn@cpan.org> is the current
       maintainer.

       Chris Winters <chris@cwinters.com>

perl v5.14.1			  2011Workflow::Validator::HasRequiredField(3)
[top]

List of man pages available for Fedora

Copyright (c) for man pages and the logo by the respective OS vendor.

For those who want to learn more, the polarhome community provides shell access and support.

[legal] [privacy] [GNU] [policy] [cookies] [netiquette] [sponsors] [FAQ]
Tweet
Polarhome, production since 1999.
Member of Polarhome portal.
Based on Fawad Halim's script.
....................................................................
Vote for polarhome
Free Shell Accounts :: the biggest list on the net