/*
 * $Id: JournalOfResearchPracticeHtmlFilterFactory.java,v 1.2 2010-05-24 17:17:09 edwardsb1 Exp $
 */
/*
 Copyright (c) 2000-2009 Board of Trustees of Leland Stanford Jr. University,
 all rights reserved.
 Permission is hereby granted, free of charge, to any person obtaining a copy
 of this software and associated documentation files (the "Software"), to deal
 in the Software without restriction, including without limitation the rights
 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
 copies of the Software, and to permit persons to whom the Software is
 furnished to do so, subject to the following conditions:
 The above copyright notice and this permission notice shall be included in
 all copies or substantial portions of the Software.
 THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
 IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
 FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL
 STANFORD UNIVERSITY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
 WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR
 IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 Except as contained in this notice, the name of Stanford University shall not
 be used in advertising or otherwise to promote the sale, use or other dealings
 in this Software without prior written authorization from Stanford University.
 */
package ca.athabascau.plugin.jrp;

import java.io.InputStream;

import org.htmlparser.NodeFilter;
import org.htmlparser.filters.*;
import org.lockss.daemon.PluginException;
import org.lockss.filter.html.*;
import org.lockss.plugin.*;


/**
 * @author edwardsb
 *
 */
public class JournalOfResearchPracticeHtmlFilterFactory extends org.lockss.plugin.ojs2.OJS2HtmlFilterFactory {

  /* @Override
   * @see org.lockss.plugin.FilterFactory#createFilteredInputStream(org.lockss.plugin.ArchivalUnit, java.io.InputStream, java.lang.String)
   */               
  public InputStream createFilteredInputStream(ArchivalUnit au, InputStream in,
      String encoding) {
    InputStream instr1;
    
    instr1 = super.createFilteredInputStream(au, in, encoding);
    
    NodeFilter[] filters = new NodeFilter[] {
        HtmlNodeFilters.tagWithAttribute("table", "id", "table1"),        
    };
    OrFilter orFilter = new OrFilter(filters);
    return new HtmlFilterInputStream(instr1,
                                   encoding,
                                   HtmlNodeFilterTransform.exclude(orFilter));
}

}

@@ -60,39 +60,39 @@
 v 1.
-2
+3
  201
-0-05-24 17:17:09 edwardsb1
+5-02-11 08:12:25 etenbrink
  Exp
@@ -127,10 +127,10 @@
 0-20
-09
+15
  Boa
@@ -1569,41 +1569,8 @@
 er;%0A
-import org.htmlparser.filters.*;%0A
 impo
@@ -1812,16 +1812,159 @@
 ctory %7B%0A
+  %0A  private static final NodeFilter%5B%5D filters = new NodeFilter%5B%5D %7B%0A      HtmlNodeFilters.tagWithAttribute(%22table%22, %22id%22, %22table1%22),%0A  %7D;%0A  %0A  
 %0A  /* @O
@@ -2115,31 +2115,28 @@
 g)%0A   */
-               
+%0A  @Override
 %0A  publi
@@ -2175,16 +2175,23 @@
 tStream(
+%0A      
 Archival
@@ -2214,22 +2214,16 @@
 ream in,
-%0A     
  String 
@@ -2235,43 +2235,64 @@
 ing)
- %7B%0A    InputStream instr1;%0A    %0A   
+%0A          throws PluginException %7B%0A    %0A    InputStream
  ins
@@ -2349,360 +2349,41 @@
 ding
-);%0A    %0A    NodeFilter%5B%5D filters = new NodeFilter%5B%5D %7B%0A        HtmlNodeFilters.tagWithAttribute(%22table%22, %22id%22, %22table1%22),        %0A    %7D;%0A    OrFilter orFilter = new OrFilter(filters);%0A    return new HtmlFilterInputStream(instr1,%0A                                   encoding,%0A                                   HtmlNodeFilterTransform.exclude(orFilter));%0A
+, filters);%0A    return instr1;%0A  
 %7D%0A%0A%7D

Refactor child plugin for updated OJS2HtmlFilterFactory