[Yanel-commits] rev 20643 - in
public/yanel/trunk/src/contributions/resources/wiki/src:
build java/org/wyona/yanel/impl/resources
josias at wyona.com
josias at wyona.com
Thu Dec 7 12:09:30 CET 2006
Author: josias
Date: 2006-12-07 12:09:29 +0100 (Thu, 07 Dec 2006)
New Revision: 20643
Modified:
public/yanel/trunk/src/contributions/resources/wiki/src/build/dependencies.xml
public/yanel/trunk/src/contributions/resources/wiki/src/build/spring-wiki-config.xml
public/yanel/trunk/src/contributions/resources/wiki/src/java/org/wyona/yanel/impl/resources/LinkChecker.java
Log:
added option to choose the javacc wiki parser
Modified: public/yanel/trunk/src/contributions/resources/wiki/src/build/dependencies.xml
===================================================================
--- public/yanel/trunk/src/contributions/resources/wiki/src/build/dependencies.xml 2006-12-07 10:36:13 UTC (rev 20642)
+++ public/yanel/trunk/src/contributions/resources/wiki/src/build/dependencies.xml 2006-12-07 11:09:29 UTC (rev 20643)
@@ -33,8 +33,8 @@
version="0.0.1-dev-r20369"/>
<dependency groupId="wyona-org-wiki-parser" artifactId="wiki-parser-factory"
version="r19560"/>
- <!-- dependency groupId="wyona-org-wiki-parser" artifactId="wyona-wiki-parser"
- version="r16766"/ -->
+ <dependency groupId="wyona-org-wiki-parser" artifactId="wyona-wiki-parser"
+ version="r20641"/>
<dependency groupId="apache-org-lucene" artifactId="lucene-highlighter"
version="1.x"/>
<dependency groupId="apache-org-commons" artifactId="jrcs-diff"
Modified: public/yanel/trunk/src/contributions/resources/wiki/src/build/spring-wiki-config.xml
===================================================================
--- public/yanel/trunk/src/contributions/resources/wiki/src/build/spring-wiki-config.xml 2006-12-07 10:36:13 UTC (rev 20642)
+++ public/yanel/trunk/src/contributions/resources/wiki/src/build/spring-wiki-config.xml 2006-12-07 11:09:29 UTC (rev 20643)
@@ -4,7 +4,5 @@
<beans>
<bean id="jspWikiParser" class="org.wyona.jspwiki.WikiParser"/>
-<!--
- <bean id="javaccWikiParser" class="..."/>
--->
+ <bean id="javaccWikiParser" class="org.wyona.wiki.Wiki2XML"/>
</beans>
Modified: public/yanel/trunk/src/contributions/resources/wiki/src/java/org/wyona/yanel/impl/resources/LinkChecker.java
===================================================================
--- public/yanel/trunk/src/contributions/resources/wiki/src/java/org/wyona/yanel/impl/resources/LinkChecker.java 2006-12-07 10:36:13 UTC (rev 20642)
+++ public/yanel/trunk/src/contributions/resources/wiki/src/java/org/wyona/yanel/impl/resources/LinkChecker.java 2006-12-07 11:09:29 UTC (rev 20643)
@@ -15,6 +15,21 @@
private ByteArrayInputStream byteArrayInputStream = null;
private StringBuffer transformedXmlAsBuffer = null;
private String path2Resource = null;
+ /**
+ * this array with protocols will all be handled as external links
+ * and therefor they dont have to be checked if they exist in repository
+ */
+ private String[] externalLinks = {
+ "http:", "ftp:", "https:", "mailto:",
+ "news:", "file:", "rtsp:", "mms:", "ldap:",
+ "gopher:", "nntp:", "telnet:", "wais:",
+ "prospero:", "z39.50s", "z39.50r", "vemmi:",
+ "imap:", "nfs:", "acap:", "tip:", "pop:",
+ "dav:", "opaquelocktoken:", "sip:", "sips:",
+ "tel:", "fax:", "modem:", "soap.beep:", "soap.beeps",
+ "xmlrpc.beep", "xmlrpc.beeps", "urn:", "go:",
+ "h323:", "ipp:", "tftp:", "mupdate:", "pres:",
+ "im:", "mtqp", "smb:" };
public LinkChecker(String path2Resource) {
this.path2Resource = path2Resource;
@@ -42,7 +57,14 @@
//do not check this link cause it is EXTERNAL
aValue = aValue.substring(9);
} else {//check internal links if they already exist
- if(!resourceExists(aValue)) {
+ boolean externalLink = false;
+ for(int j=0; j<externalLinks.length; j++) {
+ if(aValue.startsWith(externalLinks[j])) {
+ externalLink = true;
+ break;
+ }
+ }
+ if(!externalLink && !resourceExists(aValue)) {
log.error("Resource : [" + aValue + "] does not exist");
transformedXmlAsBuffer.append(" exist=\"false\"");
}
More information about the Yanel-commits
mailing list