Clover coverage report -
Coverage timestamp: Sun Nov 1 2009 23:08:24 UTC
file stats: LOC: 76   Methods: 2
NCLOC: 39   Classes: 1
 
 Source file Conditionals Statements Methods TOTAL
CollectionConfigurationViewer.java - 0% 0% 0%
coverage
 1    /*
 2    * Licensed to the Apache Software Foundation (ASF) under one or more
 3    * contributor license agreements. See the NOTICE file distributed with
 4    * this work for additional information regarding copyright ownership.
 5    * The ASF licenses this file to You under the Apache License, Version 2.0
 6    * (the "License"); you may not use this file except in compliance with
 7    * the License. You may obtain a copy of the License at
 8    *
 9    * http://www.apache.org/licenses/LICENSE-2.0
 10    *
 11    * Unless required by applicable law or agreed to in writing, software
 12    * distributed under the License is distributed on an "AS IS" BASIS,
 13    * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 14    * See the License for the specific language governing permissions and
 15    * limitations under the License.
 16    *
 17    * $Id: CollectionConfigurationViewer.java 711958 2008-11-06 20:12:54Z natalia $
 18    */
 19   
 20    package org.apache.xindice.webadmin.viewer.components;
 21   
 22    import java.io.IOException;
 23    import java.io.Writer;
 24   
 25    import javax.servlet.ServletException;
 26    import javax.servlet.http.HttpServletRequest;
 27    import javax.servlet.http.HttpServletResponse;
 28   
 29    import org.apache.xindice.core.Collection;
 30    import org.apache.xindice.util.ReadOnlyException;
 31    import org.apache.xindice.webadmin.viewer.HtmlCollectionViewer;
 32    import org.apache.xindice.webadmin.viewer.HtmlViewerComponent;
 33    import org.apache.xindice.xml.Xml2HtmlWriter;
 34    import org.apache.commons.logging.Log;
 35    import org.apache.commons.logging.LogFactory;
 36   
 37    /**
 38    * Xindice Html Viewer for Collection configuration.
 39    *
 40    * @author <a href="mailto:jmetzner@apache.org">Jan Metzner</a>
 41    * @version $Revision: 711958 $, $Date: 2008-11-06 20:12:54 +0000 (Thu, 06 Nov 2008) $
 42    */
 43    public class CollectionConfigurationViewer extends HtmlViewerComponent implements HtmlCollectionViewer {
 44   
 45    private static final Log log = LogFactory.getLog(CollectionConfigurationViewer.class);
 46   
 47  0 public void execute(HttpServletRequest req, HttpServletResponse res, Collection col)
 48    throws ServletException, IOException {
 49   
 50  0 String path = col.getCanonicalName();
 51  0 String title = "Collection Configuration for " + path;
 52   
 53  0 Writer output = startViewer(title, path, res);
 54  0 printStartTable(title, output);
 55  0 printStartSingleTableBox(output);
 56   
 57  0 try {
 58  0 Xml2HtmlWriter.write(col.getConfig().getElement(), output);
 59  0 printEndSingleTableBox(output);
 60  0 printEndTable(output);
 61    } catch (ReadOnlyException e) {
 62  0 log.error(e);
 63  0 output.write("Cannot read configuration: ");
 64  0 output.write(e.getMessage());
 65    }
 66   
 67  0 printEndSingleTableBox(output);
 68  0 printEndTable(output);
 69  0 finishViewer(output);
 70    }
 71   
 72  0 protected String getName() {
 73  0 return "config";
 74    }
 75   
 76    }