[MKDoc-commit] [mkd-import] UKAF schema has changed

bruno at mkdoc.demon.co.uk bruno at mkdoc.demon.co.uk
Mon Jul 25 17:37:46 BST 2005


Log Message:
-----------
[mkd-import] UKAF schema has changed

Modified Files:
--------------
    mkd-import/lib/MKDoc/Import/Source:
        UKAF.pm
    mkd-import/t:
        004_CSV_Parser_UKAF_Area.t
    mkd-import/t/data/ukaf:
        Agency.txt
        Area.txt

-------------- next part --------------
Index: UKAF.pm
===================================================================
RCS file: /var/spool/cvs/mkd-import/lib/MKDoc/Import/Source/UKAF.pm,v
retrieving revision 1.4
retrieving revision 1.5
diff -Llib/MKDoc/Import/Source/UKAF.pm -Llib/MKDoc/Import/Source/UKAF.pm -u -r1.4 -r1.5
--- lib/MKDoc/Import/Source/UKAF.pm
+++ lib/MKDoc/Import/Source/UKAF.pm
@@ -89,16 +89,16 @@
     
     my @result = @{$self->{'agency_records'}};
     
-    # strip records which have no 'RecordID'    
-    @result = map { $_->{RecordID} ? $_ : () } @result;
+    # strip records which have no 'RecordId'    
+    @result = map { $_->{RecordId} ? $_ : () } @result;
     
     # strip records which have no associated region information out
-    @result = map { $self->{areas_hash}->{$_->{RecordID}} ? $_ : () } @result;
+    @result = map { $self->{areas_hash}->{$_->{RecordId}} ? $_ : () } @result;
     
     # give an extra 'region' attribute
     for (@result)
     {
-	my $id = $_->{RecordID};
+	my $id = $_->{RecordId};
 	$_->{region} = $self->{areas_hash}->{$id};
 	$_->{region} = $self->{codes_hash}->{$_->{region}};
 	$_->{region} = lc ($_->{region});
@@ -126,7 +126,7 @@
     my %hash = ();
     for (@{$self->{'area_records'}})
     {
-	my $key = $_->{RecordID};
+	my $key = $_->{RecordId};
 	my $val = $_->{Code};
 	next unless (length ($val) == 6);
 	
@@ -311,9 +311,9 @@
     }
     
     @res = map {
-	$_->{RecordID} || die Dumper ($_); # next;
+	$_->{RecordId} || die Dumper ($_); # next;
 	my $producer = new MKDoc::Import::Source::UKAF::Agency (
-	    'Title'   => $_->{RecordID},
+	    'Title'   => $_->{RecordId},
 	    '.parent' => $doc,
 	    'record'  => $_
 	   );
Index: 004_CSV_Parser_UKAF_Area.t
===================================================================
RCS file: /var/spool/cvs/mkd-import/t/004_CSV_Parser_UKAF_Area.t,v
retrieving revision 1.2
retrieving revision 1.3
diff -Lt/004_CSV_Parser_UKAF_Area.t -Lt/004_CSV_Parser_UKAF_Area.t -u -r1.2 -r1.3
--- t/004_CSV_Parser_UKAF_Area.t
+++ t/004_CSV_Parser_UKAF_Area.t
@@ -12,39 +12,39 @@
 ok (!$@ => 'parse');
 
 is ($res->[0]->{Code}, '01VV05',     => 'data check');
-is ($res->[0]->{RecordID}, '11',     => 'data check');
+is ($res->[0]->{RecordId}, '11',     => 'data check');
 is ($res->[0]->{StrongType}, '1',     => 'data check');
 
 is ($res->[1]->{Code}, '01VV07',     => 'data check');
-is ($res->[1]->{RecordID}, '11',     => 'data check');
+is ($res->[1]->{RecordId}, '11',     => 'data check');
 is ($res->[1]->{StrongType}, '1',     => 'data check');
 
 is ($res->[2]->{Code}, '01VV15',     => 'data check');
-is ($res->[2]->{RecordID}, '11',     => 'data check');
+is ($res->[2]->{RecordId}, '11',     => 'data check');
 is ($res->[2]->{StrongType}, '1',     => 'data check');
 
 is ($res->[3]->{Code}, '01VV01',     => 'data check');
-is ($res->[3]->{RecordID}, '19',     => 'data check');
+is ($res->[3]->{RecordId}, '19',     => 'data check');
 is ($res->[3]->{StrongType}, '1',     => 'data check');
 
 is ($res->[4]->{Code}, '01SS09',     => 'data check');
-is ($res->[4]->{RecordID}, '35',     => 'data check');
+is ($res->[4]->{RecordId}, '35',     => 'data check');
 is ($res->[4]->{StrongType}, '1',     => 'data check');
 
 is ($res->[5]->{Code}, '01UU07',     => 'data check');
-is ($res->[5]->{RecordID}, '35',     => 'data check');
+is ($res->[5]->{RecordId}, '35',     => 'data check');
 is ($res->[5]->{StrongType}, '1',     => 'data check');
 
 is ($res->[6]->{Code}, '01UU16',     => 'data check');
-is ($res->[6]->{RecordID}, '35',     => 'data check');
+is ($res->[6]->{RecordId}, '35',     => 'data check');
 is ($res->[6]->{StrongType}, '1',     => 'data check');
 
 is ($res->[7]->{Code}, '01QQ03',     => 'data check');
-is ($res->[7]->{RecordID}, '103',     => 'data check');
+is ($res->[7]->{RecordId}, '103',     => 'data check');
 is ($res->[7]->{StrongType}, '1',     => 'data check');
 
 is ($res->[8]->{Code}, '01QQ02',     => 'data check');
-is ($res->[8]->{RecordID}, '145',     => 'data check');
+is ($res->[8]->{RecordId}, '145',     => 'data check');
 is ($res->[8]->{StrongType}, '1',     => 'data check');
 
 
Index: Agency.txt
===================================================================
RCS file: /var/spool/cvs/mkd-import/t/data/ukaf/Agency.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lt/data/ukaf/Agency.txt -Lt/data/ukaf/Agency.txt -u -r1.1 -r1.2
--- t/data/ukaf/Agency.txt
+++ t/data/ukaf/Agency.txt
@@ -1,4 +1,4 @@
-"RecordID","Status","OrgName","Address1","Address2","Address3","Address4","ConfidentialAddress","PostCode","PublicPhone","AdminPhone","Minicom","Email","Website","Monday","Tuesday","Wednesday","Thursday","Friday","Weekends","OfficeHours","TargetGroup","AreaServed","ServiceOffered","HowtoContact","Languages","TypeofOrganisation","Fax","WheelchairAccess","AdaptedToilets","AccessText","PublicTransport","YearEstablished","Staffing","CharityNo","LocalAuthority","LastUpdated"
+"RecordId","Status","OrgName","Address1","Address2","Address3","Address4","ConfidentialAddress","PostCode","PublicPhone","AdminPhone","Minicom","Email","Website","Monday","Tuesday","Wednesday","Thursday","Friday","Weekends","OfficeHours","TargetGroup","AreaServed","ServiceOffered","HowtoContact","Languages","TypeofOrganisation","Fax","WheelchairAccess","AdaptedToilets","AccessText","PublicTransport","YearEstablished","Staffing","CharityNo","LocalAuthority","LastUpdated"
 11,"09BN","Relate - Shropshire and Herefordshire","The Roy Fletcher Centre","12 - 17 Cross Hill","Shrewsbury","Shropshire",0,"SY1 1JE","01743 344010","01743 344461",,,,"10am - 9pm","10am - 9pm","10am - 9pm","10am - 5pm","10am - 3pm","Saturday 10am -12.30pm",,"Adults experiencing relationship problems.","Shropshire and Herefordshire.","Counselling for adults experiencing relationship problems, provided in 9 towns across the area. Clients are asked to make a payment for counselling - the amount depends on income. Also provide pyschosexual therapy and education and training services. ","Write or phone.","Welsh, Italian, German, Spanish. Access to interpreters.","05A","01743 244362","07AA","08AA","3 offices - access details vary.","Offices based in centres of Telford, Shrewsbury and Hereford.","1965","1 full time and 20 part time staff, 150+ volunteers.","1054670","01VV07",2002-01-03 00:00:00
 19,"09BN","Birmingham Women's Advice and Information Centre (BWAIC)","5th Floor","Ruskin Chambers","191 Corporation Street","Birmingham",0,"B4 6RP","0121 212 1881",,,,,"10am - 4pm appointments","10am - 4pm drop-in","10am - 4pm appointments","10am - 4pm drop-in","10am - 4pm appointments",,,"Women.","Birmingham.","Advice, information, support, short term crisis counselling, training and facilitation for women. Training and volunteering opportunities. The service is provided by women for women.","Drop-in Tuesday and Thursday 10am-4pm or phone for an appointment.","French, Urdu. Access to interpreters.","05A","0121 236 5886","07AB","08BB","Ramped entrance. Small lift. Disabled clients can be seen at accessible premises close by on request. Access to signers.","New Street and Snow Hill train stations.","1985","2 paid sessional workers, 6 volunteers.","1002849","01VV01",2002-06-19 00:00:00
 35,"09BN","Mediation Salisbury and District","24 St Edmund's Church Street","Salisbury",,,0,"SP1 1EF","01722 332936",,,"fms at swilts.ndo.co.uk",,"9am - 5pm","9am - 5pm","9am - 5pm","9am - 5pm","9am - 1pm",,,"Divorcing couples, separating parents, children, general public.","South Wiltshire, North Dorset and North West Hampshire.","Mediators assist people to resolve conflicts relating to divorce, separation, neighbours or other disputes where people can be helped to find agreed solutions. Special service for children who need help arising from their parents separation. Mediation around finance and property issues arising from divorce.","Phone, email or write for an appointment.","French. Access to interpreters.","05A","01722 332936","07AA","08BB","Parking close by. Ramped entrance. Access to BSL signers.","Very close to Endless Street bus station.","1985","9 part time staff.","288726","01UU16",2002-07-19 00:00:00
Index: Area.txt
===================================================================
RCS file: /var/spool/cvs/mkd-import/t/data/ukaf/Area.txt,v
retrieving revision 1.1
retrieving revision 1.2
diff -Lt/data/ukaf/Area.txt -Lt/data/ukaf/Area.txt -u -r1.1 -r1.2
--- t/data/ukaf/Area.txt
+++ t/data/ukaf/Area.txt
@@ -1,4 +1,4 @@
-"RecordID","Code","StrongType"
+"RecordId","Code","StrongType"
 11,"01VV05",1
 11,"01VV07",1
 11,"01VV15",1


More information about the MKDoc-commit mailing list