// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java
// public class Session {
// 	private String id;
// 	private Integer user_id;
// 	private Date create_timestamp;
// 	private HashMap<String, Object> sessionMap;
// 	
// 	public String getId() {
// 		return id;
// 	}
// 	public void setId(String id) {
// 		this.id = id;
// 	}
// 	public Integer getUser_id() {
// 		return user_id;
// 	}
// 	public void setUser_id(Integer user_id) {
// 		this.user_id = user_id;
// 	}
// 	public Date getCreate_timestamp() {
// 		return create_timestamp;
// 	}
// 	public void setCreate_timestamp(Date create_timestamp) {
// 		this.create_timestamp = create_timestamp;
// 	}
// 
// 	public HashMap<String, Object> getSessionMap()
// 	{
// 		if (sessionMap == null)
// 		{
// 			sessionMap = new HashMap<String, Object>();
// 		}
// 		return sessionMap;
// 	}
// 	public void setSessionMap(HashMap<String, Object> sessionMap)
// 	{
// 		this.sessionMap = sessionMap;
// 	}
// 	
// }
// 
// Path: src/main/java/com/webpagebytes/wpbsample/utility/SampleFopService.java
// public class SampleFopService {
// 
// 	private static SampleFopService instance;
// 	private FopFactory fopFactory;
// 	private TransformerFactory transformerFactory;
// 	private static volatile Object lock = new Object();
// 	
// 	private SampleFopService()
// 	{
// 		transformerFactory = TransformerFactory.newInstance();
// 		fopFactory = FopFactory.newInstance();
// 	}
// 
// 	public static SampleFopService getInstance()
// 	{
// 		if (instance == null)
// 		{
// 			synchronized (lock)
// 			{
// 				if (null == instance)
// 				{
// 					instance = new SampleFopService();
// 				}
// 			}
// 		}
// 		return instance;
// 	}
// 	
// 	public void getContent(InputStream  is, String mimeType, OutputStream os) throws Exception
// 	{
// 		Source source = null;
// 		try
// 		{	
// 			Transformer transformer = transformerFactory.newTransformer(); // identity transformer
// 			source = new StreamSource(is);		
// 			Fop fop = fopFactory.newFop(mimeType, os);
// 			Result res = new SAXResult(fop.getDefaultHandler());
// 			transformer.transform(source, res);			
// 		} catch (Exception e)
// 		{
// 			throw e;
// 		}
// 	}
// 
// }


import com.webpagebytes.wpbsample.data.Session;
import com.webpagebytes.wpbsample.utility.SampleFopService;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
import org.apache.fop.apps.MimeConstants;
import com.webpagebytes.cms.WPBContentProvider;
import com.webpagebytes.cms.WPBForward;
import com.webpagebytes.cms.WPBModel;
import com.webpagebytes.cms.exception.WPBException;

/*
 *   Copyright 2015 Webpagebytes
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

package com.webpagebytes.wpbsample.controllers;





public class AccountStatementPDFController extends GenericController {


	public void initialize(WPBContentProvider contentProvider) {
		// TODO Auto-generated method stub
		super.initialize(contentProvider);
	}

	public void handleRequest(HttpServletRequest request,
			HttpServletResponse response, WPBModel model, WPBForward forward) throws WPBException {

// Path: src/main/java/com/webpagebytes/wpbsample/data/Session.java
// public class Session {
// 	private String id;
// 	private Integer user_id;
// 	private Date create_timestamp;
// 	private HashMap<String, Object> sessionMap;
// 	
// 	public String getId() {
// 		return id;
// 	}
// 	public void setId(String id) {
// 		this.id = id;
// 	}
// 	public Integer getUser_id() {
// 		return user_id;
// 	}
// 	public void setUser_id(Integer user_id) {
// 		this.user_id = user_id;
// 	}
// 	public Date getCreate_timestamp() {
// 		return create_timestamp;
// 	}
// 	public void setCreate_timestamp(Date create_timestamp) {
// 		this.create_timestamp = create_timestamp;
// 	}
// 
// 	public HashMap<String, Object> getSessionMap()
// 	{
// 		if (sessionMap == null)
// 		{
// 			sessionMap = new HashMap<String, Object>();
// 		}
// 		return sessionMap;
// 	}
// 	public void setSessionMap(HashMap<String, Object> sessionMap)
// 	{
// 		this.sessionMap = sessionMap;
// 	}
// 	
// }
// 
// Path: src/main/java/com/webpagebytes/wpbsample/utility/SampleFopService.java
// public class SampleFopService {
// 
// 	private static SampleFopService instance;
// 	private FopFactory fopFactory;
// 	private TransformerFactory transformerFactory;
// 	private static volatile Object lock = new Object();
// 	
// 	private SampleFopService()
// 	{
// 		transformerFactory = TransformerFactory.newInstance();
// 		fopFactory = FopFactory.newInstance();
// 	}
// 
// 	public static SampleFopService getInstance()
// 	{
// 		if (instance == null)
// 		{
// 			synchronized (lock)
// 			{
// 				if (null == instance)
// 				{
// 					instance = new SampleFopService();
// 				}
// 			}
// 		}
// 		return instance;
// 	}
// 	
// 	public void getContent(InputStream  is, String mimeType, OutputStream os) throws Exception
// 	{
// 		Source source = null;
// 		try
// 		{	
// 			Transformer transformer = transformerFactory.newTransformer(); // identity transformer
// 			source = new StreamSource(is);		
// 			Fop fop = fopFactory.newFop(mimeType, os);
// 			Result res = new SAXResult(fop.getDefaultHandler());
// 			transformer.transform(source, res);			
// 		} catch (Exception e)
// 		{
// 			throw e;
// 		}
// 	}
// 
// }


// Path: src/main/java/com/webpagebytes/wpbsample/controllers/AccountStatementPDFController.java
import com.webpagebytes.wpbsample.data.Session;
import com.webpagebytes.wpbsample.utility.SampleFopService;
import java.io.ByteArrayInputStream;
import java.io.ByteArrayOutputStream;
import java.io.OutputStream;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import org.apache.commons.io.IOUtils;
import org.apache.fop.apps.MimeConstants;
import com.webpagebytes.cms.WPBContentProvider;
import com.webpagebytes.cms.WPBForward;
import com.webpagebytes.cms.WPBModel;
import com.webpagebytes.cms.exception.WPBException;

/*
 *   Copyright 2015 Webpagebytes
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *      http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
*/

package com.webpagebytes.wpbsample.controllers;





public class AccountStatementPDFController extends GenericController {


	public void initialize(WPBContentProvider contentProvider) {
		// TODO Auto-generated method stub
		super.initialize(contentProvider);
	}

	public void handleRequest(HttpServletRequest request,
			HttpServletResponse response, WPBModel model, WPBForward forward) throws WPBException {

		Session session = getSession(request, response);
