Java Doc for SpamFilter.java in  » Wiki-Engine » JSPWiki » com » ecyrd » jspwiki » filters » Java Source Code / Java DocumentationJava Source Code and Java Documentation

Java Source Code / Java Documentation
1. 6.0 JDK Core
2. 6.0 JDK Modules
3. 6.0 JDK Modules com.sun
4. 6.0 JDK Modules com.sun.java
5. 6.0 JDK Modules sun
6. 6.0 JDK Platform
7. Ajax
8. Apache Harmony Java SE
9. Aspect oriented
10. Authentication Authorization
11. Blogger System
12. Build
13. Byte Code
14. Cache
15. Chart
16. Chat
17. Code Analyzer
18. Collaboration
19. Content Management System
20. Database Client
21. Database DBMS
22. Database JDBC Connection Pool
23. Database ORM
24. Development
25. EJB Server geronimo
26. EJB Server GlassFish
27. EJB Server JBoss 4.2.1
28. EJB Server resin 3.1.5
29. ERP CRM Financial
30. ESB
31. Forum
32. GIS
33. Graphic Library
34. Groupware
35. HTML Parser
36. IDE
37. IDE Eclipse
38. IDE Netbeans
39. Installer
40. Internationalization Localization
41. Inversion of Control
42. Issue Tracking
43. J2EE
44. JBoss
45. JMS
46. JMX
47. Library
48. Mail Clients
49. Net
50. Parser
51. PDF
52. Portal
53. Profiler
54. Project Management
55. Report
56. RSS RDF
57. Rule Engine
58. Science
59. Scripting
60. Search Engine
61. Security
62. Sevlet Container
63. Source Control
64. Swing Library
65. Template Engine
66. Test Coverage
67. Testing
68. UML
69. Web Crawler
70. Web Framework
71. Web Mail
72. Web Server
73. Web Services
74. Web Services apache cxf 2.0.1
75. Web Services AXIS2
76. Wiki Engine
77. Workflow Engines
78. XML
79. XML UI
Java
Java Tutorial
Java Open Source
Jar File Download
Java Articles
Java Products
Java by API
Photoshop Tutorials
Maya Tutorials
Flash Tutorials
3ds-Max Tutorials
Illustrator Tutorials
GIMP Tutorials
C# / C Sharp
C# / CSharp Tutorial
C# / CSharp Open Source
ASP.Net
ASP.NET Tutorial
JavaScript DHTML
JavaScript Tutorial
JavaScript Reference
HTML / CSS
HTML CSS Reference
C / ANSI-C
C Tutorial
C++
C++ Tutorial
Ruby
PHP
Python
Python Tutorial
Python Open Source
SQL Server / T-SQL
SQL Server / T-SQL Tutorial
Oracle PL / SQL
Oracle PL/SQL Tutorial
PostgreSQL
SQL / MySQL
MySQL Tutorial
VB.Net
VB.Net Tutorial
Flash / Flex / ActionScript
VBA / Excel / Access / Word
XML
XML Tutorial
Microsoft Office PowerPoint 2007 Tutorial
Microsoft Office Excel 2007 Tutorial
Microsoft Office Word 2007 Tutorial
Java Source Code / Java Documentation » Wiki Engine » JSPWiki » com.ecyrd.jspwiki.filters 
Source Cross Reference  Class Diagram Java Document (Java Doc) 


java.lang.Object
   com.ecyrd.jspwiki.filters.BasicPageFilter
      com.ecyrd.jspwiki.filters.SpamFilter

SpamFilter
public class SpamFilter extends BasicPageFilter (Code)
This is Herb, the JSPWiki spamfilter that can also do choke modifications. Parameters:
  • wordlist - Page name where the regexps are found. Use [{SET spamwords='regexp list separated with spaces'}] on that page. Default is "SpamFilterWordList".
  • blacklist - The name of an attachment containing the list of spam patterns, one per line. Default is "SpamFilterWordList/blacklist.txt"
  • errorpage - The page to which the user is redirected. Has a special variable $msg which states the reason. Default is "RejectedMessage".
  • pagechangesinminute - How many page changes are allowed/minute. Default is 5.
  • similarchanges - How many similar page changes are allowed before the host is banned. Default is 2. (since 2.4.72)
  • bantime - How long an IP address stays on the temporary ban list (default is 60 for 60 minutes).
  • maxurls - How many URLs can be added to the page before it is considered spam (default is 5)
  • akismet-apikey - The Akismet API key (see akismet.org)
  • ignoreauthenticated - If set to "true", all authenticated users are ignored and never caught in SpamFilter
  • captcha - Sets the captcha technology to use. Current allowed values are "none" and "asirra".
  • strategy - Sets the filtering strategy to use. If set to "eager", will stop at the first probable match, and won't consider any other tests. This is the default, as it's considerably lighter. If set to "score", will go through all of the tests and calculates a score for the spam, which is then compared to a filter level value.

Changes by admin users are ignored in any case.


since:
   2.1.112
author:
   Janne Jalkanen


Field Summary
final public static  StringPROP_AKISMET_API_KEY
    
final public static  StringPROP_BANTIME
    
final public static  StringPROP_BLACKLIST
    
final public static  StringPROP_CAPTCHA
    
final public static  StringPROP_ERRORPAGE
    
final public static  StringPROP_FILTERSTRATEGY
    
final public static  StringPROP_IGNORE_AUTHENTICATED
    
final public static  StringPROP_MAXURLS
    
final public static  StringPROP_PAGECHANGES
    
final public static  StringPROP_SIMILARCHANGES
    
final public static  StringPROP_WORDLIST
    
final public static  StringSTRATEGY_EAGER
    
final public static  StringSTRATEGY_SCORE
    
static  Loggerlog
    
static  Loggerspamlog
    


Method Summary
final public static  booleancheckHash(WikiContext context, PageContext pageContext)
     This method checks if the hash value is still valid, i.e.
public static  StringgetBotFieldName()
     Returns a static string which can be used to detect spambots which just wildly fill in all the fields.
final public static  StringgetHashFieldName(HttpServletRequest request)
    
final public static  StringgetSpamHash(WikiPage page, HttpServletRequest request)
     This method is used to calculate an unique code when submitting the page to detect edit conflicts.
public  voidinitialize(WikiEngine engine, Properties properties)
    
final public static  StringinsertInputFields(PageContext pageContext)
    
public  booleanisValidUserProfile(WikiContext context, UserProfile profile)
     Checks whether the UserProfile matches certain checks.
public  StringpreSave(WikiContext context, String content)
    

Field Detail
PROP_AKISMET_API_KEY
final public static String PROP_AKISMET_API_KEY(Code)



PROP_BANTIME
final public static String PROP_BANTIME(Code)



PROP_BLACKLIST
final public static String PROP_BLACKLIST(Code)



PROP_CAPTCHA
final public static String PROP_CAPTCHA(Code)



PROP_ERRORPAGE
final public static String PROP_ERRORPAGE(Code)



PROP_FILTERSTRATEGY
final public static String PROP_FILTERSTRATEGY(Code)



PROP_IGNORE_AUTHENTICATED
final public static String PROP_IGNORE_AUTHENTICATED(Code)



PROP_MAXURLS
final public static String PROP_MAXURLS(Code)



PROP_PAGECHANGES
final public static String PROP_PAGECHANGES(Code)



PROP_SIMILARCHANGES
final public static String PROP_SIMILARCHANGES(Code)



PROP_WORDLIST
final public static String PROP_WORDLIST(Code)



STRATEGY_EAGER
final public static String STRATEGY_EAGER(Code)



STRATEGY_SCORE
final public static String STRATEGY_SCORE(Code)



log
static Logger log(Code)



spamlog
static Logger spamlog(Code)





Method Detail
checkHash
final public static boolean checkHash(WikiContext context, PageContext pageContext) throws IOException(Code)
This method checks if the hash value is still valid, i.e. if it exists at all. This can occur in two cases: either this is a spam bot which is not adaptive, or it is someone who has been editing one page for too long, and their session has expired.

This method puts a redirect to the http response field to page "SessionExpired" and logs the incident in the spam log (it may or may not be spam, but it's rather likely that it is).
Parameters:
  context -
Parameters:
  pageContext - True, if hash is okay. False, if hash is not okay, and you need to redirect.
throws:
  IOException - If redirection fails
since:
   2.6




getBotFieldName
public static String getBotFieldName()(Code)
Returns a static string which can be used to detect spambots which just wildly fill in all the fields. A string



getHashFieldName
final public static String getHashFieldName(HttpServletRequest request)(Code)



getSpamHash
final public static String getSpamHash(WikiPage page, HttpServletRequest request)(Code)
This method is used to calculate an unique code when submitting the page to detect edit conflicts. It currently incorporates the last-modified date of the page, and the IP address of the submitter.
Parameters:
  page - The WikiPage under edit
Parameters:
  request - The HTTP Request
since:
   2.6 A hash value for this page and session



initialize
public void initialize(WikiEngine engine, Properties properties)(Code)



insertInputFields
final public static String insertInputFields(PageContext pageContext)(Code)



isValidUserProfile
public boolean isValidUserProfile(WikiContext context, UserProfile profile)(Code)
Checks whether the UserProfile matches certain checks.
Parameters:
  profile -
since:
   2.6.1



preSave
public String preSave(WikiContext context, String content) throws RedirectException(Code)



Fields inherited from com.ecyrd.jspwiki.filters.BasicPageFilter
protected WikiEngine m_engine(Code)(Java Doc)

Methods inherited from com.ecyrd.jspwiki.filters.BasicPageFilter
public void destroy(WikiEngine engine)(Code)(Java Doc)
public void initialize(WikiEngine engine, Properties properties) throws FilterException(Code)(Java Doc)
public void postSave(WikiContext wikiContext, String content) throws FilterException(Code)(Java Doc)
public String postTranslate(WikiContext wikiContext, String htmlContent) throws FilterException(Code)(Java Doc)
public String preSave(WikiContext wikiContext, String content) throws FilterException(Code)(Java Doc)
public String preTranslate(WikiContext wikiContext, String content) throws FilterException(Code)(Java Doc)

Methods inherited from java.lang.Object
native protected Object clone() throws CloneNotSupportedException(Code)(Java Doc)
public boolean equals(Object obj)(Code)(Java Doc)
protected void finalize() throws Throwable(Code)(Java Doc)
final native public Class getClass()(Code)(Java Doc)
native public int hashCode()(Code)(Java Doc)
final native public void notify()(Code)(Java Doc)
final native public void notifyAll()(Code)(Java Doc)
public String toString()(Code)(Java Doc)
final native public void wait(long timeout) throws InterruptedException(Code)(Java Doc)
final public void wait(long timeout, int nanos) throws InterruptedException(Code)(Java Doc)
final public void wait() throws InterruptedException(Code)(Java Doc)

www.java2java.com | Contact Us
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.