protected Pair < Map < String , String > , Map < String , String > > convertAndSeparateParameters ( WikiParameters params ) { Map < String , String > resourceParameters ; Map < String , String > genericParameters ; if ( params . getSize ( ) > 0 ) { resourceParameters = new LinkedHashMap < String , String > ( ) ; genericParameters = new LinkedHashMap < String , String > ( ) ; for ( WikiParameter wikiParameter : params . toList ( ) ) { String key = wikiParameter . getKey ( ) ; if ( DocumentResourceReference . ANCHOR . equals ( key ) || DocumentResourceReference . QUERY_STRING . equals ( key ) ) { resourceParameters . put ( key , wikiParameter . getValue ( ) ) ; } else { genericParameters . put ( key , wikiParameter . getValue ( ) ) ; } } } else { resourceParameters = Listener . EMPTY_PARAMETERS ; genericParameters = Listener . EMPTY_PARAMETERS ; } return new ImmutablePair < Map < String , String > , Map < String , String > > ( resourceParameters , genericParameters ) ; }
Convert Wikimodel parameters to XWiki parameters format separating anchor and query string parameters which we consider ResourceReference parameters from the rest which we consider generic event parameters .