diff options
author | Andreas Bille <abi@openoffice.org> | 2001-11-01 12:42:04 +0000 |
---|---|---|
committer | Andreas Bille <abi@openoffice.org> | 2001-11-01 12:42:04 +0000 |
commit | 324b7b7a25bafb3aa3eb0874033f7b63db170eee (patch) | |
tree | b2fccd841b11b7e567860245fc756bf31000d706 /xmlhelp | |
parent | edf848d59d6fff7d10eb6b5585eb012dad1d7d14 (diff) |
The changes necessary for the old java-help content provider to work as
an indexer are now "frozen" in.
Diffstat (limited to 'xmlhelp')
-rw-r--r-- | xmlhelp/source/com/sun/star/help/HelpIndexer.java | 38 |
1 files changed, 34 insertions, 4 deletions
diff --git a/xmlhelp/source/com/sun/star/help/HelpIndexer.java b/xmlhelp/source/com/sun/star/help/HelpIndexer.java index cbfc17877cce..240f08bdc8df 100644 --- a/xmlhelp/source/com/sun/star/help/HelpIndexer.java +++ b/xmlhelp/source/com/sun/star/help/HelpIndexer.java @@ -205,6 +205,7 @@ public class HelpIndexer { { DocInfo info = ( DocInfo ) enum.nextElement(); String url = info.getURL(); + if( url == null ) { System.out.println( "<----------------------------------->" ); @@ -261,13 +262,21 @@ public class HelpIndexer { _hashHelptext.put( tag.get_id(),text ); } } - _urlHandler.setMode( embResolved ); int idx = url.indexOf( '?' ); if( idx != -1 ) - url = url.substring( 0,idx ); - System.out.println( url ); - builder.indexDocument( new URL( url ),"" ); + url = url.substring( 0,idx ); + + if( indexable( docResolved ) ) + { + System.out.println( url ); + _urlHandler.setMode( embResolved ); + builder.indexDocument( new URL( url ),"" ); + } + else + { + System.out.println( "excluded from indexing: " + url ); + } } catch( Exception e ) { @@ -567,6 +576,26 @@ public class HelpIndexer { } + boolean indexable( Node node ) + { + Node test; + NodeIterator it = new NodeIterator( node ); + while( ( test=it.next() ) != null ) + { + if( test.getNodeName().equals( "meta:user-defined" ) && + ((Element)test).getAttribute("meta:name").equals("Info 2" ) ) + break; + } + if( test != null ) + { + NodeList list = test.getChildNodes(); + for( int i = 0; i < list.getLength(); ++ i ) + if( list.item(i).getNodeType() == Node.TEXT_NODE ) + return ! "NOINDEX".equals(((Text)list.item(i)).toString()); + } + return true; + } + // This is a configurable class, which capsulates the parser initialization stuff and all this things @@ -711,6 +740,7 @@ public class HelpIndexer { // Setting the parameters _stuff.setParameter( "Language", _language ); _stuff.setParameter( "Database", _module ); + _stuff.setParameter( "System", _system ); } // and parse |