@@ -0,0 +1,3185 @@
+/*%0A * $Id: CoActionHtmlHashFilterFactory.java,v 1.1 2015-02-11 08:21:29 etenbrink Exp $%0A */%0A%0A/*%0A%0ACopyright (c) 2000-2015 Board of Trustees of Leland Stanford Jr. University,%0Aall rights reserved.%0A%0APermission is hereby granted, free of charge, to any person obtaining a copy%0Aof this software and associated documentation files (the %22Software%22), to deal%0Ain the Software without restriction, including without limitation the rights%0Ato use, copy, modify, merge, publish, distribute, sublicense, and/or sell%0Acopies of the Software, and to permit persons to whom the Software is%0Afurnished to do so, subject to the following conditions:%0A%0AThe above copyright notice and this permission notice shall be included in%0Aall copies or substantial portions of the Software.%0A%0ATHE SOFTWARE IS PROVIDED %22AS IS%22, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR%0AIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,%0AFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.  IN NO EVENT SHALL%0ASTANFORD UNIVERSITY BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,%0AWHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR%0AIN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.%0A%0AExcept as contained in this notice, the name of Stanford University shall not%0Abe used in advertising or otherwise to promote the sale, use or other dealings%0Ain this Software without prior written authorization from Stanford University.%0A%0A*/%0A%0Apackage org.lockss.plugin.coactionpublishing;%0A%0Aimport java.io.InputStream;%0Aimport java.io.Reader;%0A%0Aimport org.htmlparser.NodeFilter;%0Aimport org.htmlparser.filters.TagNameFilter;%0Aimport org.lockss.daemon.PluginException;%0Aimport org.lockss.filter.FilterUtil;%0Aimport org.lockss.filter.WhiteSpaceFilter;%0Aimport org.lockss.filter.html.*;%0Aimport org.lockss.plugin.ArchivalUnit;%0Aimport org.lockss.plugin.ojs2.OJS2HtmlFilterFactory;%0Aimport org.lockss.util.Logger;%0Aimport org.lockss.util.ReaderInputStream;%0A%0Apublic class CoActionHtmlHashFilterFactory extends OJS2HtmlFilterFactory %7B%0A  %0A  private static final Logger log = Logger.getLogger(CoActionHtmlHashFilterFactory.class);%0A  %0A  @Override%0A  public InputStream createFilteredInputStream(ArchivalUnit au,%0A                                               InputStream in,%0A                                               String encoding)%0A      throws PluginException %7B%0A    NodeFilter%5B%5D filters = new NodeFilter%5B%5D %7B%0A        HtmlNodeFilters.tagWithAttribute(%22div%22, %22id%22, %22bannerBar%22),%0A        HtmlNodeFilters.tagWithAttribute(%22div%22, %22id%22, %22coactionBar%22),%0A        HtmlNodeFilters.tagWithAttribute(%22div%22, %22id%22, %22pageFooter%22),%0A        HtmlNodeFilters.tagWithAttributeRegex(%22div%22, %22id%22, %22sidebar%22, true),%0A        HtmlNodeFilters.tagWithAttribute(%22div%22, %22id%22, %22alm%22),%0A        HtmlNodeFilters.tagWithAttribute(%22div%22, %22class%22, %22separator%22),%0A        HtmlNodeFilters.tagWithTextRegex(%22span%22, %22Metrics powered by.+PLOS ALM%22, true),%0A        new TagNameFilter(%22br%22),%0A    %7D;%0A    %0A    InputStream filtered = super.createFilteredInputStream(au, in, encoding, filters);%0A    Reader filteredReader = FilterUtil.getReader(filtered, encoding);%0A    return new ReaderInputStream(new WhiteSpaceFilter(filteredReader));%0A  %7D%0A%7D%0A

Add child filters for OJS2HtmlFilterFactory