// Path: src/main/java/uk/org/llgc/annotation/store/data/PageAnnoCount.java
// public class PageAnnoCount {
// 	protected int _count = 0;
//     // These three properties should really be a canvas object...
//     protected Canvas _canvas = null;
// 	protected String _pageId = "";
//     protected String _label = "";
//     protected String _shortId = "";
//     protected Manifest _manifest = null;
// 
// 	public PageAnnoCount(final Canvas pCanvas, final int pCount, final Manifest pManifest) {
// 		this.setCanvas(pCanvas);
// 		this.setCount(pCount);
//         this.setManifest(pManifest);
// 	}
// 
//     public Manifest getManifest() {
//         return _manifest;
//     }
// 
//     public void setManifest(final Manifest pManifest) {
//         _manifest = pManifest;
//     }
// 
// 	
// 	/**
// 	 * Get count.
// 	 *
// 	 * @return count as int.
// 	 */
// 	public int getCount() {
// 	    return _count;
// 	}
// 	
// 	/**
// 	 * Set count.
// 	 *
// 	 * @param count the value to set.
// 	 */
// 	public void setCount(final int pCount) {
// 	     _count = pCount;
// 	}
// 	
//     /**
//      * Get canvas.
//      *
//      * @return canvas as Canvas.
//      */
//     public Canvas getCanvas() {
//         return _canvas;
//     }
//     
//     /**
//      * Set canvas.
//      *
//      * @param canvas the value to set.
//      */
//     public void setCanvas(final Canvas pCanvas) {
//          _canvas = pCanvas;
//     }
// 
// 	public String toString() {
// 		return "Canvas=>" + _canvas.toString() + "\tCount=>" + _count;
// 	}
// }
// 
// Path: src/main/java/uk/org/llgc/annotation/store/adapters/StoreAdapter.java
// public interface StoreAdapter {
// 
// 	public void init(final AnnotationUtils pAnnoUtils);
// 
//     // CRUD annotations
// 	public Annotation addAnnotation(final Annotation pJson) throws IOException, IDConflictException, MalformedAnnotation;
// 	public Annotation updateAnnotation(final Annotation pJson) throws IOException, MalformedAnnotation;
// 	public Annotation getAnnotation(final String pId) throws IOException;
// 	public void deleteAnnotation(final String pAnnoId) throws IOException;
// 
// 	public AnnotationList addAnnotationList(final AnnotationList pJson) throws IOException, IDConflictException, MalformedAnnotation;
// 
//     // CRUD manifests
// 	public String indexManifest(final Manifest pManifest) throws IOException;
// 	public List<Manifest> getManifests() throws IOException;
// 	public List<Manifest> getSkeletonManifests() throws IOException;
// 	public String getManifestId(final String pShortId) throws IOException;
// 	public Manifest getManifest(final String pShortId) throws IOException;
// 	public Manifest getManifestForCanvas(final Canvas pCanvasId) throws IOException;
// 
//     // CRUD canvas
//     public Canvas resolveCanvas(final String pShortId) throws IOException;
//     public void storeCanvas(final Canvas pCanvas) throws IOException;
// 
//     // Search
// 	public IIIFSearchResults search(final SearchQuery pQuery) throws IOException;
// 	public AnnotationList getAnnotationsFromPage(final Canvas pPage) throws IOException;
// 
//     // Used in ListAnnotations can we get rid?
// 	public AnnotationList getAllAnnotations() throws IOException;
// 	public List<PageAnnoCount> listAnnoPages() throws IOException;
//     // Stats
// 	public List<PageAnnoCount> listAnnoPages(final Manifest pManifest) throws IOException;
// }


import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.io.File;
import java.io.FileReader;
import java.io.BufferedReader;
import com.github.jsonldjava.utils.JsonUtils;
import org.apache.jena.rdf.model.Model;
import java.util.Map;
import java.util.List;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import uk.org.llgc.annotation.store.data.PageAnnoCount;
import uk.org.llgc.annotation.store.adapters.StoreAdapter;
package uk.org.llgc.annotation.store;








public class ListAnnoPages extends HttpServlet {
	protected static Logger _logger = LogManager.getLogger(ListAnnoPages.class.getName()); 
	protected AnnotationUtils _annotationUtils = null;
	protected StoreAdapter _store = null;

	public void init(final ServletConfig pConfig) throws ServletException {
		super.init(pConfig);
		_annotationUtils = new AnnotationUtils(new File(super.getServletContext().getRealPath("/contexts")),StoreConfig.getConfig().getEncoder());
		_store = StoreConfig.getConfig().getStore();
		_store.init(_annotationUtils);
	}

	public void doGet(final HttpServletRequest pReq, final HttpServletResponse pRes) throws IOException {
// Path: src/main/java/uk/org/llgc/annotation/store/data/PageAnnoCount.java
// public class PageAnnoCount {
// 	protected int _count = 0;
//     // These three properties should really be a canvas object...
//     protected Canvas _canvas = null;
// 	protected String _pageId = "";
//     protected String _label = "";
//     protected String _shortId = "";
//     protected Manifest _manifest = null;
// 
// 	public PageAnnoCount(final Canvas pCanvas, final int pCount, final Manifest pManifest) {
// 		this.setCanvas(pCanvas);
// 		this.setCount(pCount);
//         this.setManifest(pManifest);
// 	}
// 
//     public Manifest getManifest() {
//         return _manifest;
//     }
// 
//     public void setManifest(final Manifest pManifest) {
//         _manifest = pManifest;
//     }
// 
// 	
// 	/**
// 	 * Get count.
// 	 *
// 	 * @return count as int.
// 	 */
// 	public int getCount() {
// 	    return _count;
// 	}
// 	
// 	/**
// 	 * Set count.
// 	 *
// 	 * @param count the value to set.
// 	 */
// 	public void setCount(final int pCount) {
// 	     _count = pCount;
// 	}
// 	
//     /**
//      * Get canvas.
//      *
//      * @return canvas as Canvas.
//      */
//     public Canvas getCanvas() {
//         return _canvas;
//     }
//     
//     /**
//      * Set canvas.
//      *
//      * @param canvas the value to set.
//      */
//     public void setCanvas(final Canvas pCanvas) {
//          _canvas = pCanvas;
//     }
// 
// 	public String toString() {
// 		return "Canvas=>" + _canvas.toString() + "\tCount=>" + _count;
// 	}
// }
// 
// Path: src/main/java/uk/org/llgc/annotation/store/adapters/StoreAdapter.java
// public interface StoreAdapter {
// 
// 	public void init(final AnnotationUtils pAnnoUtils);
// 
//     // CRUD annotations
// 	public Annotation addAnnotation(final Annotation pJson) throws IOException, IDConflictException, MalformedAnnotation;
// 	public Annotation updateAnnotation(final Annotation pJson) throws IOException, MalformedAnnotation;
// 	public Annotation getAnnotation(final String pId) throws IOException;
// 	public void deleteAnnotation(final String pAnnoId) throws IOException;
// 
// 	public AnnotationList addAnnotationList(final AnnotationList pJson) throws IOException, IDConflictException, MalformedAnnotation;
// 
//     // CRUD manifests
// 	public String indexManifest(final Manifest pManifest) throws IOException;
// 	public List<Manifest> getManifests() throws IOException;
// 	public List<Manifest> getSkeletonManifests() throws IOException;
// 	public String getManifestId(final String pShortId) throws IOException;
// 	public Manifest getManifest(final String pShortId) throws IOException;
// 	public Manifest getManifestForCanvas(final Canvas pCanvasId) throws IOException;
// 
//     // CRUD canvas
//     public Canvas resolveCanvas(final String pShortId) throws IOException;
//     public void storeCanvas(final Canvas pCanvas) throws IOException;
// 
//     // Search
// 	public IIIFSearchResults search(final SearchQuery pQuery) throws IOException;
// 	public AnnotationList getAnnotationsFromPage(final Canvas pPage) throws IOException;
// 
//     // Used in ListAnnotations can we get rid?
// 	public AnnotationList getAllAnnotations() throws IOException;
// 	public List<PageAnnoCount> listAnnoPages() throws IOException;
//     // Stats
// 	public List<PageAnnoCount> listAnnoPages(final Manifest pManifest) throws IOException;
// }


// Path: src/main/java/uk/org/llgc/annotation/store/ListAnnoPages.java
import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;
import java.io.IOException;
import java.io.File;
import java.io.FileReader;
import java.io.BufferedReader;
import com.github.jsonldjava.utils.JsonUtils;
import org.apache.jena.rdf.model.Model;
import java.util.Map;
import java.util.List;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import javax.servlet.ServletConfig;
import javax.servlet.ServletException;
import uk.org.llgc.annotation.store.data.PageAnnoCount;
import uk.org.llgc.annotation.store.adapters.StoreAdapter;

package uk.org.llgc.annotation.store;








public class ListAnnoPages extends HttpServlet {
	protected static Logger _logger = LogManager.getLogger(ListAnnoPages.class.getName()); 
	protected AnnotationUtils _annotationUtils = null;
	protected StoreAdapter _store = null;

	public void init(final ServletConfig pConfig) throws ServletException {
		super.init(pConfig);
		_annotationUtils = new AnnotationUtils(new File(super.getServletContext().getRealPath("/contexts")),StoreConfig.getConfig().getEncoder());
		_store = StoreConfig.getConfig().getStore();
		_store.init(_annotationUtils);
	}

	public void doGet(final HttpServletRequest pReq, final HttpServletResponse pRes) throws IOException {
		List<PageAnnoCount> tAnnotations = _store.listAnnoPages();