From: <ka...@us...> - 2011-03-27 04:41:24
|
Revision: 8982 http://docbook.svn.sourceforge.net/docbook/?rev=8982&view=rev Author: kasunbg Date: 2011-03-27 04:41:18 +0000 (Sun, 27 Mar 2011) Log Message: ----------- Added Main-Class attribute to the manifest of xsl-webhelpindexer. minor changes to the indexer. Modified Paths: -------------- trunk/xsl-webhelpindexer/nbproject/project.properties trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/IndexerConstants.java trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/IndexerMain.java trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/SaxDocFileParser.java trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/SaxHTMLIndex.java Added Paths: ----------- trunk/xsl-webhelpindexer/manifest.mf trunk/xsl-webhelpindexer/nbproject/private/ trunk/xsl-webhelpindexer/nbproject/private/config.properties trunk/xsl-webhelpindexer/nbproject/private/private.properties Added: trunk/xsl-webhelpindexer/manifest.mf =================================================================== --- trunk/xsl-webhelpindexer/manifest.mf (rev 0) +++ trunk/xsl-webhelpindexer/manifest.mf 2011-03-27 04:41:18 UTC (rev 8982) @@ -0,0 +1 @@ +Manifest-Version: 1.0 Added: trunk/xsl-webhelpindexer/nbproject/private/config.properties =================================================================== Added: trunk/xsl-webhelpindexer/nbproject/private/private.properties =================================================================== --- trunk/xsl-webhelpindexer/nbproject/private/private.properties (rev 0) +++ trunk/xsl-webhelpindexer/nbproject/private/private.properties 2011-03-27 04:41:18 UTC (rev 8982) @@ -0,0 +1,5 @@ +compile.on.save=false +do.depend=false +do.jar=true +javac.debug=true +javadoc.preview=true Modified: trunk/xsl-webhelpindexer/nbproject/project.properties =================================================================== --- trunk/xsl-webhelpindexer/nbproject/project.properties 2011-03-26 10:03:03 UTC (rev 8981) +++ trunk/xsl-webhelpindexer/nbproject/project.properties 2011-03-27 04:41:18 UTC (rev 8982) @@ -1,69 +1,68 @@ -annotation.processing.enabled=true -annotation.processing.enabled.in.editor=false -annotation.processing.run.all.processors=true -application.args= -application.title=webhelpindexer -application.vendor=docbook -build.classes.dir=${build.dir}/classes -build.classes.excludes=**/*.java,**/*.form -build.dir=. -build.generated.dir=${build.dir}/generated -build.generated.sources.dir=${build.dir}/generated-sources -# Only compile against the classpath explicitly listed here: -build.sysclasspath=ignore -build.test.classes.dir=${build.dir}/test/classes -build.test.results.dir=${build.dir}/test/results -debug.classpath=\ - ${run.classpath} -debug.test.classpath=\ - ${run.test.classpath} -dist.dir=. -# This jar file and javadoc are removed when the project is cleaned. -dist.jar=${dist.dir}/webhelpindexer.jar -dist.javadoc.dir=${dist.dir}/javadoc -endorsed.classpath= -excludes= -file.reference.lucene-analyzers-3.0.0.jar=lib/lucene-analyzers-3.0.0.jar -file.reference.lucene-core-3.0.0.jar=lib/lucene-core-3.0.0.jar -includes=** -jar.compress=false -javac.classpath=\ - ${file.reference.lucene-analyzers-3.0.0.jar}:\ - ${file.reference.lucene-core-3.0.0.jar}:\ - ${ant.home}/lib/ant.jar -# Space-separated list of extra javac options -javac.compilerargs= -javac.deprecation=false -javac.processorpath=\ - ${javac.classpath} -javac.source=1.5 -javac.target=1.5 -javac.test.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir}:\ - ${libs.junit.classpath} -javadoc.additionalparam= -javadoc.author=false -javadoc.encoding= -javadoc.noindex=false -javadoc.nonavbar=false -javadoc.notree=false -javadoc.private=false -javadoc.splitindex=true -javadoc.use=true -javadoc.version=false -javadoc.windowtitle= -meta.inf.dir=${src.dir}/META-INF -platform.active=default_platform -run.classpath=\ - ${javac.classpath}:\ - ${build.classes.dir} -# Space-separated list of JVM arguments used when running the project -# (you may also define separate properties like run-sys-prop.name=value instead of -Dname=value -# or test-sys-prop.name=value to set system properties for unit tests): -run.jvmargs= -run.test.classpath=\ - ${javac.test.classpath}:\ - ${build.test.classes.dir} -src.dir=src -test.src.dir=test +annotation.processing.enabled=true +annotation.processing.enabled.in.editor=false +annotation.processing.run.all.processors=true +application.args= +application.title=webhelpindexer +application.vendor=docbook +build.classes.dir=${build.dir}/classes +build.classes.excludes=**/*.java,**/*.form +build.dir=. +build.generated.dir=${build.dir}/generated +build.generated.sources.dir=${build.dir}/generated-sources +# Only compile against the classpath explicitly listed here: +build.sysclasspath=ignore +build.test.classes.dir=${build.dir}/test/classes +build.test.results.dir=${build.dir}/test/results +debug.classpath=\ + ${run.classpath} +debug.test.classpath=\ + ${run.test.classpath} +dist.dir=. +# This jar file and javadoc are removed when the project is cleaned. +dist.jar=${dist.dir}/webhelpindexer.jar +dist.javadoc.dir=${dist.dir}/javadoc +endorsed.classpath= +excludes= +file.reference.lucene-analyzers-3.0.0.jar=lib/lucene-analyzers-3.0.0.jar +file.reference.lucene-core-3.0.0.jar=lib/lucene-core-3.0.0.jar +includes=** +jar.compress=false +javac.classpath=\ + ${file.reference.lucene-analyzers-3.0.0.jar}:\ + ${file.reference.lucene-core-3.0.0.jar}:\ + ${ant.home}/lib/ant.jar +# Space-separated list of extra javac options +javac.compilerargs= +javac.deprecation=false +javac.processorpath=\ + ${javac.classpath} +javac.source=1.5 +javac.target=1.5 +javac.test.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir}:\ + ${libs.junit.classpath} +javadoc.additionalparam= +javadoc.author=false +javadoc.encoding= +javadoc.noindex=false +javadoc.nonavbar=false +javadoc.notree=false +javadoc.private=false +javadoc.splitindex=true +javadoc.use=true +javadoc.version=false +manifest.file=manifest.mf +manifest.available=true +main.class=com.nexwave.nquindexer.IndexerMain +javadoc.windowtitle= +meta.inf.dir=${src.dir}/META-INF +platform.active=default_platform +run.classpath=\ + ${javac.classpath}:\ + ${build.classes.dir} +run.test.classpath=\ + ${javac.test.classpath}:\ + ${build.test.classes.dir} +src.dir=src +test.src.dir=test Modified: trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/IndexerConstants.java =================================================================== --- trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/IndexerConstants.java 2011-03-26 10:03:03 UTC (rev 8981) +++ trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/IndexerConstants.java 2011-03-27 04:41:18 UTC (rev 8982) @@ -1,4 +1,5 @@ package com.nexwave.nquindexer; + /** * Constants used for the indexer. * @@ -8,10 +9,12 @@ */ public abstract class IndexerConstants { // European punctuation - public static final String EUPUNCTUATION1 = "[$|%,;.':()\\/*\"{}=!&+<>#\\?]|\\[|\\]|[-][-]+"; - public static final String EUPUNCTUATION2 = "[$,;.':()\\/*\"{}=!&+<>\\\\]"; - // Japanese punctuation - public static final String JPPUNCTUATION1 = "\\u3000|\\u3001|\\u3002|\\u3003|\\u3008|\\u3009|\\u300C|\\u300D"; - public static final String JPPUNCTUATION2 = "\\u3013|\\u3014|\\u3015|\\u301C|\\u301D|\\u301E|\\u301F"; - public static final String JPPUNCTUATION3 = "\\u3013|\\u300C|\\u300D"; + //TODO: Make sure European punctuation removal process doesn't affect the text with file locations etc. + + public static final String EUPUNCTUATION1 = "[$|%,;.':()\\/*\"{}=!&+<>#\\?]|\\[|\\]|[-][-]+"; + public static final String EUPUNCTUATION2 = "[$,;.':()\\/*\"{}=!&+<>\\\\]"; + // Japanese punctuation + public static final String JPPUNCTUATION1 = "\\u3000|\\u3001|\\u3002|\\u3003|\\u3008|\\u3009|\\u300C|\\u300D"; + public static final String JPPUNCTUATION2 = "\\u3013|\\u3014|\\u3015|\\u301C|\\u301D|\\u301E|\\u301F"; + public static final String JPPUNCTUATION3 = "\\u3013|\\u300C|\\u300D"; } Modified: trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/IndexerMain.java =================================================================== --- trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/IndexerMain.java 2011-03-26 10:03:03 UTC (rev 8981) +++ trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/IndexerMain.java 2011-03-27 04:41:18 UTC (rev 8982) @@ -1,18 +1,3 @@ -/** - * Licensed under the Apache License, Version 2.0 (the "License"); - * you may not use this file except in compliance with the License. - * You may obtain a copy of the License at - * - * http://www.apache.org/licenses/LICENSE-2.0 - * - * Unless required by applicable law or agreed to in writing, - * software distributed under the License is distributed on an - * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY - * KIND, either express or implied. See the License for the - * specific language governing permissions and limitations - * under the License. - */ - package com.nexwave.nquindexer; import com.nexwave.nsidita.DirList; @@ -24,8 +9,10 @@ import java.util.*; /** + * Main class of Stand-alone version of WebHelpIndexer * User: Kasun Gajasinghe, University of Moratuwa, http://kasunbg.blogspot.com * Date: Feb 10, 2011 + * @author Kasun Gajasinghe */ public class IndexerMain { @@ -150,9 +137,12 @@ } else if (args.length >= 2) { indexer = new IndexerMain(args[0], args[1]); - } else { - throw new ArrayIndexOutOfBoundsException("Please specify the parameters htmlDirectory and (optional) " + - "indexerLanguage"); + } else { + throw new RuntimeException("Please specify the parameters htmlDirectory and " + + "indexerLanguage (optional). \n "+ + "ex: java -jar webhelpindexer.jar docs/content en \n" + + "The program will exit now." + ); } indexer.execute(); @@ -333,17 +323,17 @@ */ private static void DisplayHelp() { String lSep = System.getProperty("line.separator"); - StringBuffer msg = new StringBuffer(); - msg.append("USAGE:" + lSep); - msg.append(" java -classpath TesterIndexer inputDir outputDir projectDir" + lSep); - msg.append("with:" + lSep); - msg.append(" inputDir (mandatory) : specify the html files ' directory to index" + lSep); - msg.append(" outputDir (optional) : specify where to output the index files" + lSep); - msg.append(" projectDir (optional) : specify the root of the documentation directory" + lSep); - msg.append("Example:" + lSep); - msg.append(" java -classpath TesterIndexer /home/$USER/DITA/doc" + lSep); - msg.append("Example 2:" + lSep); - msg.append(" java -classpath TesterIndexer /home/$USER/DITA/doc/customer/concepts /home/$USER/temp/search /home/$USER/DITA/doc/" + lSep); + StringBuilder msg = new StringBuilder(); + msg.append("USAGE:").append(lSep); + msg.append(" java -classpath TesterIndexer inputDir outputDir projectDir").append(lSep); + msg.append("with:").append(lSep); + msg.append(" inputDir (mandatory) : specify the html files ' directory to index").append(lSep); + msg.append(" outputDir (optional) : specify where to output the index files").append(lSep); + msg.append(" projectDir (optional) : specify the root of the documentation directory").append(lSep); + msg.append("Example:").append(lSep); + msg.append(" java -classpath TesterIndexer /home/$USER/DITA/doc").append(lSep); + msg.append("Example 2:").append(lSep); + msg.append(" java -classpath TesterIndexer /home/$USER/webhelp/docs/content /home/$USER/docs/content/search /home/$USER/webhelp/docs").append(lSep); System.out.println(msg.toString()); } Modified: trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/SaxDocFileParser.java =================================================================== --- trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/SaxDocFileParser.java 2011-03-26 10:03:03 UTC (rev 8981) +++ trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/SaxDocFileParser.java 2011-03-27 04:41:18 UTC (rev 8982) @@ -122,7 +122,7 @@ addHeaderInfo = true; String attrName = attributes.getValue("name"); if(attrName != null && (attrName.equalsIgnoreCase("keywords") || attrName.equalsIgnoreCase("description"))){ - strbf.append(" " + attributes.getValue("content") + " "); + strbf.append(" ").append(attributes.getValue("content")).append(" "); } // dwc: adding this to make the docbook <abstract> element // (which becomes <meta name="description".../> in html) Modified: trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/SaxHTMLIndex.java =================================================================== --- trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/SaxHTMLIndex.java 2011-03-26 10:03:03 UTC (rev 8981) +++ trunk/xsl-webhelpindexer/src/com/nexwave/nquindexer/SaxHTMLIndex.java 2011-03-27 04:41:18 UTC (rev 8982) @@ -219,14 +219,14 @@ tempStrBuf.append("\\ba\\b"); Iterator it = cleanUpList.iterator(); while (it.hasNext()){ - tempStrBuf.append("|\\b"+it.next()+"\\b"); + tempStrBuf.append("|\\b").append(it.next()).append("\\b"); } } if ((cleanUpPunctuation != null) && (!cleanUpPunctuation.isEmpty())){ tempCharBuf.append("\\u3002"); Iterator it = cleanUpPunctuation.iterator(); while (it.hasNext()){ - tempCharBuf.append("|"+it.next()); + tempCharBuf.append("|").append(it.next()); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |