ASP4x-Linker

 view release on metacpan or  search on metacpan

MANIFEST  view on Meta::CPAN

Changes
inc/Module/Install.pm
inc/Module/Install/Base.pm
inc/Module/Install/Can.pm
inc/Module/Install/Fetch.pm
inc/Module/Install/Makefile.pm
inc/Module/Install/Metadata.pm
inc/Module/Install/Win32.pm
inc/Module/Install/WriteAll.pm
lib/ASP4x/Linker.pm
lib/ASP4x/Linker/Widget.pm
Makefile.PL
MANIFEST			This list of files
META.yml
runtests.sh
t/010-basic/010-load.t
t/010-basic/020-basic.t

inc/Module/Install/Metadata.pm  view on Meta::CPAN

#line 1
package Module::Install::Metadata;

use strict 'vars';
use Module::Install::Base;

use vars qw{$VERSION $ISCORE @ISA};
BEGIN {
	$VERSION = '0.79';
	$ISCORE  = 1;
	@ISA     = qw{Module::Install::Base};
}

inc/Module/Install/Metadata.pm  view on Meta::CPAN

	my $type = shift;
	push @{ $self->{values}{no_index}{$type} }, @_ if $type;
	return $self->{values}{no_index};
}

sub read {
	my $self = shift;
	$self->include_deps( 'YAML::Tiny', 0 );

	require YAML::Tiny;
	my $data = YAML::Tiny::LoadFile('META.yml');

	# Call methods explicitly in case user has already set some values.
	while ( my ( $key, $value ) = each %$data ) {
		next unless $self->can($key);
		if ( ref $value eq 'HASH' ) {
			while ( my ( $module, $version ) = each %$value ) {
				$self->can($key)->($self, $module => $version );
			}
		} else {
			$self->can($key)->($self, $value);
		}
	}
	return $self;

lib/ASP4x/Linker.pm  view on Meta::CPAN

  $linker->widget("widgetA")->set( page_number => 2 );
  $uri = $linker->uri;
  # $uri is now "/some-page.asp?widgetA.page_number=2"

=head1 DESCRIPTION

C<ASP4x::Linker> aims to solve the age-old problem of:

B<How do I change one widget on the page without losing my settings for all the other widgets on the page?>

OK - say you have one data grid on your web page that allows paging and sorting.  You can move forward and backward between
pages, change the sorting - life's great.  B<THEN> your boss says:

  We need to have two of those on the same page.  One for Albums and one for Genres.

Now you have 2 options.

=over 4

B<Option 1>: If a user pages "Albums" to page 4, then pages "Genres" to page 2, you forget that "Albums" was on page 4.

lib/ASP4x/Linker.pm  view on Meta::CPAN

Returns an individual L<ASP4x::Linker::Widget> object by that name.

Returns undef if no widget by that name is found.

=head2 uri( [$properties] )

Returns the uri for all widgets based on the intersect of:

=over 4

=item * The incoming form data from the original request

=item * Individually-set values for each widget in the collection.

=item * Any properties provided as an argument to C<uri()>.

=back

=head2 hidden_fields( [$properties] )

Returns a string of XHTML hidden input fields (<input type="hidden" name="$name" value="$value" />).

lib/ASP4x/Linker/Widget.pm  view on Meta::CPAN

  warn $widget->set( %args )->uri();
  
  # Set multiple values by chaining and get the uri:
  warn $widget->set( foo => 'bar' )->set( baz => 'bux' )->uri();

=head1 DESCRIPTION

C<ASP4x::Linker::Widget> provides a simple, simple interface to a "thing" on your
web page (which we'll call a "widget").

A "widget" can be anything.  My experience generally means that a widget is a data grid
that supports paging and sorting through multiple records.  However a widget could
represent anything you want it to, as long as you can describe it with a B<name> and
and arrayref of B<attrs> (attributes).  The B<attrs> arrayref for a data grid might 
look like what you see in the example above:

  attrs => [qw( page_number page_size sort_col sort_dir )]

In English, a "widget" can be anything.  The word "widget" could be replaced with "thing" - 
so in this case a "widget" is just a "thing" - anything (with a name and attributes).

=head1 PUBLIC PROPERTIES

=head2 vars

t/conf/asp4-config.json  view on Meta::CPAN

    "filter_resolver":  "ASP4::FilterResolver",
    "request_filters": [
    ],
    "disable_persistence": [
      {
        "uri_match": "/.*",
        "disable_session": true
      }
    ]
  },
  "data_connections": {
    "session": {
      "manager":          "ASP4::SessionStateManager::NonPersisted",
      "cookie_name":      "session-id",
      "cookie_domain":    "*",
      "session_timeout":  "*",
      "dsn":              "",
      "username":         "",
      "password":         ""
    },
    "main": {



( run in 0.291 second using v1.01-cache-2.11-cpan-8d75d55dd25 )