view src/main/java/de/mpiwg/web/jsp/ApplicationBean.java @ 21:5b1856cd6b4f

bug fixed: 1.TOC Done display issue 2.issue in firefox
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Tue, 23 Jun 2015 14:20:36 +0200
parents 3387d855a194
children ba9515f22897
line wrap: on
line source

package de.mpiwg.web.jsp;

import java.io.Serializable;

import org.apache.log4j.Logger;

import de.mpiwg.gazetteer.utils.PropertiesUtils;

public class ApplicationBean  implements Serializable{
	
	private static final long serialVersionUID = 804932192506497432L;

	private static Logger logger = Logger.getLogger(ApplicationBean.class);

	private static ApplicationBean instance;
	
	public static ApplicationBean getInstance(){
		if(instance == null){
			instance = new ApplicationBean();
		}
		return instance;
	}
	
	public ApplicationBean(){
		System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
		System.out.println("Starting Application Bean");
		System.out.println("%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%");
	}
	
	
	public String getExtractionInterfaceUrl(){
		String value = null;
		try {
			value = PropertiesUtils.getPropValue("extraction_interface");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return value;
	}
	
	public String getTocInterfaceUrl(){
		String value = null;
		try {
			value = PropertiesUtils.getPropValue("toc_interface");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return value;
	}
	
	public String getRootServer(){
		String value = null;
		try {
			value = PropertiesUtils.getPropValue("root_server");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return value;	
	}
	
	public String getDvnRootServer(){
		String value = null;
		try {
			value = PropertiesUtils.getPropValue("dvn_server");
		} catch (Exception e) {
			e.printStackTrace();
		}
		return value;	
	}
	
	public String getShowImage(){
		return getRootServer() + "/resources/images/show_16.png";
	}
	
	public String getEditImage(){
		return getRootServer() + "/resources/images/edit_16.png";
	}
	
	public String getPublishImage(){
		return getRootServer() + "/resources/images/publish_16.png";
	}
	
	public String getBranchDetailsImage(){
		return getRootServer() + "/resources/images/branch_details_16.png";
	}
	
	public String getNewBranchImage(){
		return getRootServer() + "/resources/images/new_branch_16.png";
	}
	
	public String getEditBranchImage(){
		return getRootServer() + "/resources/images/edit_branch_16.png";
	}
	
	public String getSearchImage(){
		return getRootServer() + "/resources/images/search_32.png";
	}
	
	public String getPaginatorFirst(){
		return getRootServer() + "/resources/images/arrow-first.gif";
	}
	
	public String getPaginatorFr(){
		return getRootServer() + "/resources/images/arrow-fr.gif";
	}
	
	public String getPaginatorPrevious(){
		return getRootServer() + "/resources/images/arrow-previous.gif";
	}
	
	public String getPaginatorNext(){
		return getRootServer() + "/resources/images/arrow-next.gif";
	}
	public String getPaginatorFf(){
		return getRootServer() + "/resources/images/arrow-ff.gif";
	}
	
	public String getPaginatorLast(){
		return getRootServer() + "/resources/images/arrow-last.gif";
	}
	
	public String getUpImage(){
		return getRootServer() + "/resources/images/up_16.png";
	}
	
	public String getFilterImage(){
		return getRootServer() + "/resources/images/filter_16.png";
	}
	
	public String getDownImage(){
		return getRootServer() + "/resources/images/down_16.png";
	}
	
	public String getDeleteImage(){
		return getRootServer() + "/resources/images/delete_16.png";
	}
	
	public String getMoreInfoImage(){
		return getRootServer() + "/resources/images/more_info_16.png";
	}
	
	public String getCheckboxCheckedImage(){
		return getRootServer() + "/resources/images/checkbox_checked.png";
	}
	public String getSaveImage(){
		return getRootServer() + "/resources/images/save.png";
	}
	;
	
	public String getCheckboxUncheckedImage(){
		return getRootServer() + "/resources/images/checkbox_unchecked.png";
	}
	
	public String getRefreshImage(){
		return getRootServer() + "/resources/images/refresh.ico";
	}
	
	public String getJSConfirmationDelete(){
		return "if(!confirm('Do you really want to delete this?')){ return false; };";
	}
	
	public String getJSConfirmationPublish(){
		return "if(!confirm('Do you really want to publish this?')){ return false; };";
	}
	
	public String getJSConfirmationSave(){
		return "if(!confirm('Do you really want to save this?')){ return false; };";
	}
}