diff src/main/java/de/mpiwg/web/jsp/ApplicationBean.java @ 0:3e62083dbcbf

First commit. This project comes from LGServer. We removed the framework icefaces. Now, LGServices uses just JSP and jquery.
author "jurzua <jurzua@mpiwg-berlin.mpg.de>"
date Thu, 23 Apr 2015 15:46:01 +0200
parents
children 3387d855a194
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/jsp/ApplicationBean.java	Thu Apr 23 15:46:01 2015 +0200
@@ -0,0 +1,153 @@
+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 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; };";
+	}
+}