public String mapNamespace ( String ns , SiteInfo targetWiki ) throws Exception { Map < String , Ns > sourceMap = this . getNamespaces ( ) ; Map < Integer , Ns > targetMap = targetWiki . getNamespacesById ( ) ; Ns sourceNs = sourceMap . get ( ns ) ; if ( sourceNs == null ) { if ( debug ) LOGGER . log ( Level . WARNING , "can not map unknown namespace " + ns ) ; return ns ; } Ns targetNs = targetMap . get ( sourceNs . getId ( ) ) ; if ( targetNs == null ) { if ( debug ) LOGGER . log ( Level . WARNING , "missing namespace " + sourceNs . getValue ( ) + " id:" + sourceNs . getId ( ) + " canonical:" + sourceNs . getCanonical ( ) ) ; return ns ; } return targetNs . getValue ( ) ; }
map the given namespace to the target wiki