diff Lib/IMPL/Config.pm @ 194:4d0e1962161c

Replaced tabs with spaces IMPL::Web::View - fixed document model, new features (control classes, document constructor parameters)
author cin
date Tue, 10 Apr 2012 20:08:29 +0400
parents d1676be8afcc
children d63f9a92d6d4
line wrap: on
line diff
--- a/Lib/IMPL/Config.pm	Tue Apr 10 08:13:22 2012 +0400
+++ b/Lib/IMPL/Config.pm	Tue Apr 10 20:08:29 2012 +0400
@@ -82,42 +82,42 @@
     my $val;
 
     $val = $this->rawGet($_) and $ctx->AddVar($_ => $val) foreach map $_->Name, $this->get_meta(
-    	'IMPL::Class::PropertyInfo',
-    	sub {
-    		$_->Access == IMPL::Class::Member::MOD_PUBLIC and
-    		$_->canGet;
-    	},
-    	1);    
+        'IMPL::Class::PropertyInfo',
+        sub {
+            $_->Access == IMPL::Class::Member::MOD_PUBLIC and
+            $_->canGet;
+        },
+        1);    
 }
 
 sub spawn {
-	my ($this,$file) = @_;
-	unless ($file) {
-		($file = ref $this || $this) =~ s/:+/./g;
-		$file .= ".xml";
-	}
-	return $this->LoadXMLFile( File::Spec->catfile($ConfigBase,$file) );
+    my ($this,$file) = @_;
+    unless ($file) {
+        ($file = ref $this || $this) =~ s/:+/./g;
+        $file .= ".xml";
+    }
+    return $this->LoadXMLFile( File::Spec->catfile($ConfigBase,$file) );
 }
 
 sub get {
-	my $this = shift;
-	
-	if (@_ == 1) {
-		my $obj = $this->SUPER::get(@_);
-		return UNIVERSAL::isa($obj,'IMPL::Config::Activator') ? $obj->activate : $obj;
-	} else {
-		my @objs = $this->SUPER::get(@_);	
-		return map UNIVERSAL::isa($_,'IMPL::Config::Activator') ? $_->activate : $_, @objs ;	
-	}
+    my $this = shift;
+    
+    if (@_ == 1) {
+        my $obj = $this->SUPER::get(@_);
+        return UNIVERSAL::isa($obj,'IMPL::Config::Activator') ? $obj->activate : $obj;
+    } else {
+        my @objs = $this->SUPER::get(@_);    
+        return map UNIVERSAL::isa($_,'IMPL::Config::Activator') ? $_->activate : $_, @objs ;    
+    }
 }
 
 sub rawGet {
-	my $this = shift;
-	return $this->SUPER::get(@_);
+    my $this = shift;
+    return $this->SUPER::get(@_);
 }
 
 sub Exists {
-	$_[0]->SUPER::get($_[1]) ? 1 : 0;
+    $_[0]->SUPER::get($_[1]) ? 1 : 0;
 }
 
 1;
@@ -150,13 +150,13 @@
     my $this = shift;
     
     $this->DataSource(
-    	new IMPL::Config::Activator(
-    		factory => 'MyDataSource',
-    		parameters=>{
-    			host => 'localhost',
-    			user => 'dbuser'
-    		}
-    	)
+        new IMPL::Config::Activator(
+            factory => 'MyDataSource',
+            parameters=>{
+                host => 'localhost',
+                user => 'dbuser'
+            }
+        )
     ) unless $this->Exists('DataSource');
 }
 
@@ -173,14 +173,14 @@
 =begin code xml
 
 <app type='MyApp'>
-	<SimpleString>The application</SimpleString>
-	<DataSource type='IMPL::Config::Activator'>
-		<factory>MyDataSourceClass</factory>
-		<parameters type='HASH'>
-			<host>localhost</host>
-			<user>dbuser</user>
-		</parameters>
-	</DataSource>
+    <SimpleString>The application</SimpleString>
+    <DataSource type='IMPL::Config::Activator'>
+        <factory>MyDataSourceClass</factory>
+        <parameters type='HASH'>
+            <host>localhost</host>
+            <user>dbuser</user>
+        </parameters>
+    </DataSource>
 </app>
 
 =end code xml