| 1 | # ==================================================================== | ||
| 2 | # Copyright (c) 2002,2003 IBM Corporation | ||
| 3 | # All rights reserved. This program and the accompanying materials | ||
| 4 | # are made available under the terms of the Common Public License v1.0 | ||
| 5 | # which accompanies this distribution, and is available at | ||
| 6 | # http://www.opensource.org/licenses/cpl.php | ||
| 7 | # | ||
| 8 | # ===================================================================== | ||
| 9 | package LS::Authority::WSDL::Mappings; | ||
| 10 | |||
| 11 | use strict; | ||
| 12 | use warnings; | ||
| 13 | |||
| 14 | |||
| 15 | # | ||
| 16 | # $VERSION - | ||
| 17 | # | ||
| 18 | my $VERSION = 'OMG-04-05-01'; | ||
| 19 | |||
| 20 | |||
| 21 | # | ||
| 22 | # %URI_MAPPINGS - | ||
| 23 | # | ||
| 24 | my %URI_MAPPINGS = ( | ||
| 25 | |||
| 26 | 'OMG-04-05-01'=> { | ||
| 27 | 'LSIDMetadataSubsetHTTPBinding'=> 'http://www.omg.org/LSID/2003/DataServiceHTTPBindings', | ||
| 28 | 'LSIDMetadataHTTPBinding'=> 'http://www.omg.org/LSID/2003/DataServiceHTTPBindings', | ||
| 29 | 'LSIDDataHTTPBinding'=> 'http://www.omg.org/LSID/2003/DataServiceHTTPBindings', | ||
| 30 | |||
| 31 | 'LSIDMetadataSubsetSOAPBinding'=> 'http://www.omg.org/LSID/2003/DataServiceSOAPBindings', | ||
| 32 | 'LSIDMetadataSOAPBinding'=> 'http://www.omg.org/LSID/2003/DataServiceSOAPBindings', | ||
| 33 | 'LSIDDataSOAPBinding'=> 'http://www.omg.org/LSID/2003/DataServiceSOAPBindings', | ||
| 34 | |||
| 35 | 'LSIDAuthorityHTTPBinding'=> 'http://www.omg.org/LSID/2003/AuthorityServiceHTTPBindings', | ||
| 36 | 'LSIDAuthoritySOAPBinding'=> 'http://www.omg.org/LSID/2003/AuthorityServiceSOAPBindings', | ||
| 37 | }, | ||
| 38 | |||
| 39 | ); | ||
| 40 | |||
| 41 | |||
| 42 | # | ||
| 43 | # %PREFIX_MAPPINGS - | ||
| 44 | # | ||
| 45 | my %PREFIX_MAPPINGS = ( | ||
| 46 | |||
| 47 | 'OMG-04-05-01'=> { | ||
| 48 | 'LSIDMetadataSubsetHTTPBinding'=> 'dhb', | ||
| 49 | 'LSIDMetadataHTTPBinding'=> 'dhb', | ||
| 50 | 'LSIDDataHTTPBinding'=> 'dhb', | ||
| 51 | |||
| 52 | 'LSIDMetadataSubsetSOAPBinding'=> 'dsb', | ||
| 53 | 'LSIDMetadataSOAPBinding'=> 'dsb', | ||
| 54 | 'LSIDDataSOAPBinding'=> 'dsb', | ||
| 55 | |||
| 56 | 'LSIDAuthorityHTTPBinding'=> 'ahb', | ||
| 57 | 'LSIDAuthoritySOAPBinding'=> 'asb', | ||
| 58 | }, | ||
| 59 | ); | ||
| 60 | |||
| 61 | |||
| 62 | # | ||
| 63 | # uriToBinding( $uri ) - | ||
| 64 | # | ||
| 65 | sub uriToBinding { | ||
| 66 | |||
| 67 | shift; | ||
| 68 | |||
| 69 | my $uri = shift; | ||
| 70 | |||
| 71 | foreach my $binding (keys(%{ $URI_MAPPINGS{ $VERSION } })) { | ||
| 72 | |||
| 73 | return $binding if( $URI_MAPPINGS{$VERSION}->{ $binding } eq $uri); | ||
| 74 | } | ||
| 75 | |||
| 76 | return undef; | ||
| 77 | } | ||
| 78 | |||
| 79 | |||
| 80 | # | ||
| 81 | # bindingToURI( $binding ) - | ||
| 82 | # | ||
| 83 | sub bindingToURI { | ||
| 84 | |||
| 85 | shift; # Throw away | ||
| 86 | |||
| 87 | my $binding = shift; | ||
| 88 | |||
| 89 | return $URI_MAPPINGS{$VERSION}->{ $binding }; | ||
| 90 | } | ||
| 91 | |||
| 92 | |||
| 93 | # | ||
| 94 | # bindingToPrefix( $binding ) - | ||
| 95 | # | ||
| 96 | sub bindingToPrefix { | ||
| 97 | |||
| 98 | shift; | ||
| 99 | |||
| 100 | my $binding = shift; | ||
| 101 | |||
| 102 | return $PREFIX_MAPPINGS{$VERSION}->{ $binding }; | ||
| 103 | } | ||
| 104 | |||
| 105 | |||
| 106 | # | ||
| 107 | # import( %options ) - | ||
| 108 | # | ||
| 109 | sub import { | ||
| 110 | |||
| 111 | shift; | ||
| 112 | |||
| 113 | my (%options) = @_; | ||
| 114 | |||
| 115 | $VERSION = ($options{'version'} || 'OMG-04-05-01'); | ||
| 116 | |||
| 117 | |||
| 118 | return 1; | ||
| 119 | } | ||
| 120 | |||
| 121 | 1; | ||
| 122 | |||
| 123 | __END__ |