changeset 60:90d5e86c157d

new: auto refresh page when there's new version saved from Ext-Interface
author Zoe Hong <zhong@mpiwg-berlin.mpg.de>
date Wed, 25 May 2016 11:11:32 +0200
parents bc0219c2600b
children 2486846e61d5
files src/main/java/de/mpiwg/gazetteer/utils/DBService.java src/main/java/de/mpiwg/web/jsp/JSPProxy.java src/main/java/de/mpiwg/web/jsp/TopicListPage.java src/main/java/de/mpiwg/web/topicList/SortByDescription.java src/main/java/de/mpiwg/web/topicList/SortByLastModified.java src/main/java/de/mpiwg/web/topicList/SortByNameCh.java src/main/java/de/mpiwg/web/topicList/SortByNameEn.java src/main/java/de/mpiwg/web/topicList/SortByNamePinyin.java src/main/java/de/mpiwg/web/topicList/SortByTopicId.java src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByAdminType.java src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByBookId.java src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByBookName.java src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByDynasty.java src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentById.java src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByInx.java src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByLevel1.java src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByLevel2.java src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByPeriod.java src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByStartPage.java src/main/resources/hibernate.cfg.xml src/main/webapp/pages/branchPage.jsp src/main/webapp/pages/home.jsp src/main/webapp/pages/topicPage.jsp src/main/webapp/resources/js/proxyMethods.js
diffstat 24 files changed, 958 insertions(+), 499 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/gazetteer/utils/DBService.java	Mon May 09 16:02:32 2016 +0200
+++ b/src/main/java/de/mpiwg/gazetteer/utils/DBService.java	Wed May 25 11:11:32 2016 +0200
@@ -34,7 +34,7 @@
 	
 	// JDBC driver name and database URL
 	static final String JDBC_DRIVER = "com.mysql.jdbc.Driver";
-	static final String DB_URL = "jdbc:mysql://localhost/";
+	static final String DB_URL = "jdbc:mysql://localhost/";	// TODO: when move Gazetteer database to SBB, need to re-config this
 	
 	private static String SECTIONS_TABLE = "sections_index";
 
--- a/src/main/java/de/mpiwg/web/jsp/JSPProxy.java	Mon May 09 16:02:32 2016 +0200
+++ b/src/main/java/de/mpiwg/web/jsp/JSPProxy.java	Wed May 25 11:11:32 2016 +0200
@@ -328,7 +328,32 @@
 				} else if(StringUtils.equals(action, "createTopic")){
 					Long userId = getSessionBean().getUser().getId();
 					getSessionBean().getTopicListPage().createTopic(userId);	
-				} 	
+					
+				} else if(StringUtils.equals(action, "sortByTopicIdUp")) {
+					getSessionBean().getTopicListPage().sortByTopicIdUp();
+				} else if(StringUtils.equals(action, "sortByTopicIdDown")) {
+					getSessionBean().getTopicListPage().sortByTopicIdDown();
+				} else if(StringUtils.equals(action, "sortByNameEnUp")) {
+					getSessionBean().getTopicListPage().sortByNameEnUp();
+				} else if(StringUtils.equals(action, "sortByNameEnDown")) {
+					getSessionBean().getTopicListPage().sortByNameEnDown();
+				} else if(StringUtils.equals(action, "sortByNameChUp")) {
+					getSessionBean().getTopicListPage().sortByNameChUp();
+				} else if(StringUtils.equals(action, "sortByNameChDown")) {
+					getSessionBean().getTopicListPage().sortByNameChDown();
+				} else if(StringUtils.equals(action, "sortByNamePinyinUp")) {
+					getSessionBean().getTopicListPage().sortByNamePinyinUp();
+				} else if(StringUtils.equals(action, "sortByNamePinyinDown")) {
+					getSessionBean().getTopicListPage().sortByNamePinyinDown();
+				} else if(StringUtils.equals(action, "sortByDescriptionUp")) {
+					getSessionBean().getTopicListPage().sortByDescriptionUp();
+				} else if(StringUtils.equals(action, "sortByDescriptionDown")) {
+					getSessionBean().getTopicListPage().sortByDescriptionDown();
+				} else if(StringUtils.equals(action, "sortByLastModifiedUp")) {
+					getSessionBean().getTopicListPage().sortByLastModifiedUp();
+				} else if(StringUtils.equals(action, "sortByLastModifiedDown")) {
+					getSessionBean().getTopicListPage().sortByLastModifiedDown();
+				}  
 		
 					
 				return TopicListPage.page;
--- a/src/main/java/de/mpiwg/web/jsp/TopicListPage.java	Mon May 09 16:02:32 2016 +0200
+++ b/src/main/java/de/mpiwg/web/jsp/TopicListPage.java	Wed May 25 11:11:32 2016 +0200
@@ -12,6 +12,13 @@
 
 import de.mpiwg.gazetteer.bo.LGTopic;
 import de.mpiwg.gazetteer.utils.DataProvider;
+import de.mpiwg.web.fullTextSearch.SortContentByStartPage;
+import de.mpiwg.web.topicList.SortByDescription;
+import de.mpiwg.web.topicList.SortByLastModified;
+import de.mpiwg.web.topicList.SortByNameCh;
+import de.mpiwg.web.topicList.SortByNameEn;
+import de.mpiwg.web.topicList.SortByNamePinyin;
+import de.mpiwg.web.topicList.SortByTopicId;
 public class TopicListPage extends AbstractJSPPage{
 	
 	private static Logger logger = Logger.getLogger(TopicListPage.class);
@@ -189,15 +196,70 @@
 	
 
 	
-	// sort
-
+	// TODO sort 
+	public void sortByTopicIdUp() {
+		Collections.sort(this.completeTopicList, new SortByTopicId());
+		filter();
+	}
+	public void sortByTopicIdDown() {
+		Collections.sort(this.completeTopicList, new SortByTopicId());
+		Collections.reverse(this.completeTopicList);
+		filter();
+	}
+	
+	public void sortByLastModifiedUp() {
+		Collections.sort(this.completeTopicList, new SortByLastModified());
+		filter();
+	}
 	public void sortByLastModifiedDown() {
-		//Collections.sort(this.completeTopicList, new SortByLastModified());
-		//Collections.reverse(this.completeTopicList);
+		Collections.sort(this.completeTopicList, new SortByLastModified());
+		Collections.reverse(this.completeTopicList);
 		filter();
 	}
 	
+	public void sortByNameChUp() {
+		Collections.sort(this.completeTopicList, new SortByNameCh());
+		filter();
+	}
+	public void sortByNameChDown() {
+		Collections.sort(this.completeTopicList, new SortByNameCh());
+		Collections.reverse(this.completeTopicList);
+		filter();
+	}
 
+	public void sortByNameEnUp() {
+		Collections.sort(this.completeTopicList, new SortByNameEn());
+		filter();
+	}
+	
+	public void sortByNameEnDown() {
+		Collections.sort(this.completeTopicList, new SortByNameEn());
+		Collections.reverse(this.completeTopicList);
+		filter();
+	}
+	
+	public void sortByNamePinyinUp() {
+		Collections.sort(this.completeTopicList, new SortByNamePinyin());
+		filter();
+	}
+	
+	public void sortByNamePinyinDown() {
+		Collections.sort(this.completeTopicList, new SortByNamePinyin());
+		Collections.reverse(this.completeTopicList);
+		filter();
+	}
+	public void sortByDescriptionUp() {
+		Collections.sort(this.completeTopicList, new SortByDescription());
+		filter();
+	}
+	
+	public void sortByDescriptionDown() {
+		Collections.sort(this.completeTopicList, new SortByDescription());
+		Collections.reverse(this.completeTopicList);
+		filter();
+	}
+	
+	// ---- 
 
 	public List<LGTopic> getCompleteTopicList() {
 		return completeTopicList;
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/SortByDescription.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,15 @@
+package de.mpiwg.web.topicList;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.bo.LGTopic;
+
+public class SortByDescription implements Comparator<LGTopic>{
+	
+	public int compare(LGTopic o1, LGTopic o2) {
+		if(o1.getDescription() == null || o2.getDescription() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getDescription().compareTo(o2.getDescription());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/SortByLastModified.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,15 @@
+package de.mpiwg.web.topicList;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.bo.LGTopic;
+
+public class SortByLastModified implements Comparator<LGTopic>{
+	
+	public int compare(LGTopic o1, LGTopic o2) {
+		if(o1.getLastChangeDate() == null || o2.getLastChangeDate() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getLastChangeDate().compareTo(o2.getLastChangeDate());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/SortByNameCh.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,15 @@
+package de.mpiwg.web.topicList;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.bo.LGTopic;
+
+public class SortByNameCh implements Comparator<LGTopic>{
+	
+	public int compare(LGTopic o1, LGTopic o2) {
+		if(o1.getNameCh() == null || o2.getNameCh() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getNameCh().compareTo(o2.getNameCh());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/SortByNameEn.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,15 @@
+package de.mpiwg.web.topicList;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.bo.LGTopic;
+
+public class SortByNameEn implements Comparator<LGTopic>{
+	
+	public int compare(LGTopic o1, LGTopic o2) {
+		if(o1.getNameEn() == null || o2.getNameEn() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getNameEn().compareTo(o2.getNameEn());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/SortByNamePinyin.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,15 @@
+package de.mpiwg.web.topicList;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.bo.LGTopic;
+
+public class SortByNamePinyin implements Comparator<LGTopic>{
+	
+	public int compare(LGTopic o1, LGTopic o2) {
+		if(o1.getNamePinyin() == null || o2.getNamePinyin() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getNamePinyin().compareTo(o2.getNamePinyin());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/SortByTopicId.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,15 @@
+package de.mpiwg.web.topicList;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.bo.LGTopic;
+
+public class SortByTopicId implements Comparator<LGTopic>{
+	
+	public int compare(LGTopic o1, LGTopic o2) {
+		if(o1.getId() == null || o2.getId() == null){
+			return 1;
+		}
+		return o1.getId().compareTo(o2.getId());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByAdminType.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,16 @@
+package de.mpiwg.web.fullTextSearch;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.db.DBContents;
+
+
+public class SortContentByAdminType  implements Comparator<DBContents>{
+	
+	public int compare(DBContents o1, DBContents o2) {
+		if(o1.getSection() == null || o2.getSection() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getSection().getBook().getAdmin_type().compareTo(o2.getSection().getBook().getAdmin_type());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByBookId.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,15 @@
+package de.mpiwg.web.fullTextSearch;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.db.DBContents;
+
+public class SortContentByBookId implements Comparator<DBContents>{
+	
+	public int compare(DBContents o1, DBContents o2) {
+		if(o1.getSection() == null || o2.getSection() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getSection().getBook().getId().compareTo(o2.getSection().getBook().getId());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByBookName.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,16 @@
+package de.mpiwg.web.fullTextSearch;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.db.DBContents;
+import de.mpiwg.gazetteer.db.DBSection;
+
+public class SortContentByBookName implements Comparator<DBContents>{
+	
+	public int compare(DBContents o1, DBContents o2) {
+		if(o1.getSection() == null || o2.getSection() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getSection().getBook().getName().compareTo(o2.getSection().getBook().getName());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByDynasty.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,16 @@
+package de.mpiwg.web.fullTextSearch;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.db.DBContents;
+import de.mpiwg.gazetteer.db.DBSection;
+
+public class SortContentByDynasty implements Comparator<DBContents>{
+	
+	public int compare(DBContents o1, DBContents o2) {
+		if(o1.getSection() == null || o2.getSection() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getSection().getBook().getDynasty().compareTo(o2.getSection().getBook().getDynasty());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentById.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,12 @@
+package de.mpiwg.web.fullTextSearch;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.db.DBContents;
+
+public class SortContentById implements Comparator<DBContents>{
+	
+	public int compare(DBContents o1, DBContents o2) {
+		return o1.getId().compareTo(o2.getId());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByInx.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,16 @@
+package de.mpiwg.web.fullTextSearch;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.db.DBContents;
+
+
+public class SortContentByInx implements Comparator<DBContents>{
+	
+	public int compare(DBContents o1, DBContents o2) {
+		if(o1.getInx() == null || o2.getInx() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getInx().compareTo(o2.getInx());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByLevel1.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,16 @@
+package de.mpiwg.web.fullTextSearch;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.db.DBContents;
+import de.mpiwg.gazetteer.db.DBSection;
+
+public class SortContentByLevel1 implements Comparator<DBContents>{
+	
+	public int compare(DBContents o1, DBContents o2) {
+		if(o1.getSection() == null || o2.getSection() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getSection().getBook().getLevel1().compareTo(o2.getSection().getBook().getLevel1());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByLevel2.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,15 @@
+package de.mpiwg.web.fullTextSearch;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.db.DBContents;
+
+public class SortContentByLevel2 implements Comparator<DBContents>{
+	
+	public int compare(DBContents o1, DBContents o2) {
+		if(o1.getSection() == null || o2.getSection() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getSection().getBook().getLevel2().compareTo(o2.getSection().getBook().getLevel2());
+	}
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByPeriod.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,16 @@
+package de.mpiwg.web.fullTextSearch;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.db.DBContents;
+
+public class SortContentByPeriod implements Comparator<DBContents>{
+	
+	public int compare(DBContents o1, DBContents o2) {
+		if(o1.getSection() == null || o2.getSection() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getSection().getBook().getPeriod().compareTo(o2.getSection().getBook().getPeriod());
+	}
+
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/src/main/java/de/mpiwg/web/topicList/fullTextSearch/SortContentByStartPage.java	Wed May 25 11:11:32 2016 +0200
@@ -0,0 +1,17 @@
+package de.mpiwg.web.fullTextSearch;
+
+import java.util.Comparator;
+
+import de.mpiwg.gazetteer.db.DBContents;
+
+public class SortContentByStartPage implements Comparator<DBContents>{
+	
+	public int compare(DBContents o1, DBContents o2) {
+		if(o1.getSection() == null || o2.getSection() == null){
+			return o1.getId().compareTo(o2.getId());	
+		}
+		return o1.getSection().getStart_page().compareTo(o2.getSection().getStart_page());
+	}
+	
+	
+}
--- a/src/main/resources/hibernate.cfg.xml	Mon May 09 16:02:32 2016 +0200
+++ b/src/main/resources/hibernate.cfg.xml	Wed May 25 11:11:32 2016 +0200
@@ -14,6 +14,7 @@
 		<property name="hibernate.dialect">org.hibernate.dialect.MySQLDialect</property>
 		 -->
 		<property name="hibernate.connection.driver_class">com.mysql.jdbc.Driver</property>
+       
         <property name="hibernate.connection.url">jdbc:mysql://localhost/LGServices?characterEncoding=UTF-8</property>
         
         <property name="hibernate.connection.username">root</property>
--- a/src/main/webapp/pages/branchPage.jsp	Mon May 09 16:02:32 2016 +0200
+++ b/src/main/webapp/pages/branchPage.jsp	Wed May 25 11:11:32 2016 +0200
@@ -55,6 +55,23 @@
 			        dialog.dialog( "open" );
 			});	 
 		  });
+		  
+		  
+		  function updatePage() {
+				var text = getCookie();
+			    
+			    if (text == "1") {
+			        setCookie("0");
+			        setAction('forceReloadBranch', 'branchForm');
+
+			        document.forms['branchForm'].submit();
+			    }
+				
+			    setTimeout(updatePage, 1000);
+			}
+			updatePage();
+			
+		  
 	</script>
 	
 </head>
--- a/src/main/webapp/pages/home.jsp	Mon May 09 16:02:32 2016 +0200
+++ b/src/main/webapp/pages/home.jsp	Wed May 25 11:11:32 2016 +0200
@@ -4,13 +4,14 @@
 <%@page import="de.mpiwg.gazetteer.db.DBSection"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
 
-<jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean" scope="session" />
+<jsp:useBean id="sessionBean" class="de.mpiwg.web.jsp.SessionBean"
+	scope="session" />
 
 <html>
 
 <head>
-	<jsp:include page="../componentes/headContent.jsp"/>	
-	<script>
+<jsp:include page="../componentes/headContent.jsp" />
+<script>
 	
 		$(function() {
 			
@@ -252,58 +253,89 @@
 			
 		});
 		
+		
+		function updatePage() {
+			var text = getCookie();
+		    
+		    if (text == "1") {
+		        setCookie("0");
+		        setAction('forceReloadBranches', 'homeForm');
+
+		        document.forms['homeForm'].submit();
+		    }
+			
+		    setTimeout(updatePage, 1000);
+		}
+		updatePage();
+		
+		
+		
+		
 	</script>
 </head>
 
 <body>
 
-	<jsp:include page="../componentes/template.jsp"/>
-	
+	<jsp:include page="../componentes/template.jsp" />
+
 	<div id="dialogAddSectionToTopic" title="Add Section(s) into Topic:">
 		<div id="dialogAddSectionToTopicTable"></div>
 	</div>
-	
+
 	<div id="page">
-		
-		<% if(sessionBean.getUser() == null) { %>
-			<label class="subTitel">You must login!</label>
-		<% } else { 
-			
-			if (sessionBean.getHomePage().getCompleteBranchList() == null){ 
-				sessionBean.getHomePage().loadParameters(request, response);
-				//sessionBean.getHomePage().reloadBranches();
-			}
-			sessionBean.getHomePage().reloadBranches();
-		
+
+		<%
+			if (sessionBean.getUser() == null) {
+		%>
+		<label class="subTitel">You must login!</label>
+		<%
+			} else {
+
+				if (sessionBean.getHomePage().getCompleteBranchList() == null) {
+					sessionBean.getHomePage().loadParameters(request, response);
+					//sessionBean.getHomePage().reloadBranches();
+				}
+				sessionBean.getHomePage().reloadBranches();
+		%>
+
+		<%
+			if (sessionBean.getHomePage().getCompleteBranchList().isEmpty()) {
+		%>
+		<label class="subTitel">You have no task!</label>
+		<%
+			} else {
+	
 		%>
-		
-			
-		
-		
-		<% if(sessionBean.getHomePage().getCompleteBranchList().isEmpty()) { %>
-			<label class="subTitel">You have no task!</label>
-		<% } else { %>
-				
-			<form name="homeForm" method="post"
-				action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp" >
-				<input name="bean" type="hidden" value="homeBean" /> 
-				
-				<div class="subTitel">Your Tasks
-					<input type="image"
-						onclick="setAction('forceReloadBranches', 'homeForm');"
-						src="<%=sessionBean.getApplicationBean().getRefreshImage()%>" width="20" height="20"/>
-			
-					<p class="label">You have <%= sessionBean.getHomePage().getBranchNumber() %> tasks.</p>
-					<p class="label"><%= (StringUtils.isNotEmpty(sessionBean.getHomePage().getFilteringMessage())) ? sessionBean.getHomePage().getFilteringMessage() : ""%> </p>
-				</div>
-				<jsp:include page="../componentes/paginator.jsp">
-					<jsp:param name="formName" value="homeForm"/>
-				</jsp:include> 
-		
-				<div class="tableDiv double-scroll">
-					<table class="pageTable" >
-						<tr>
-							<!-- remove this to save space 
+
+		<form name="homeForm" method="post"
+			action="<%=sessionBean.getApplicationBean().getRootServer()%>/proxy.jsp">
+			<input name="bean" type="hidden" value="homeBean" />
+
+			<div class="subTitel">
+				Your Tasks <input type="image"
+					onclick="setAction('forceReloadBranches', 'homeForm');"
+					src="<%=sessionBean.getApplicationBean()
+							.getRefreshImage()%>"
+					width="20" height="20" />
+
+				<p class="label">
+					You have
+					<%=sessionBean.getHomePage().getBranchNumber()%>
+					tasks.
+				</p>
+				<p class="label"><%=(StringUtils.isNotEmpty(sessionBean.getHomePage()
+							.getFilteringMessage())) ? sessionBean
+							.getHomePage().getFilteringMessage() : ""%>
+				</p>
+			</div>
+			<jsp:include page="../componentes/paginator.jsp">
+				<jsp:param name="formName" value="homeForm" />
+			</jsp:include>
+
+			<div class="tableDiv double-scroll">
+				<table class="pageTable">
+					<tr>
+						<!-- remove this to save space 
 							<td>
 								<table class="sortTable">
 									<tr>
@@ -326,456 +358,513 @@
 								</table>
 							</td>
 							-->
-							<td>
-								<table class="sortTable">
-									<tr>
-										<td><label class="tableTitle">Book ID</label></td>
-										<td>
-											<table>
-												<tr><td>
-													<input type="image" 
-														onclick="setAction('sortByBookIdUp', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
-												</td></tr>
-												<tr><td>
-													<input type="image"
-														onclick="setAction('sortByBookIdDown', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
-												</td></tr>
-											</table>
-										</td>
-									</tr>
-									<tr>
-										<td>
-											<input type="text" name="bookIdFilter" value="<%= sessionBean.getHomePage().getBookIdFilter()%>" size="8"/>
-										</td>									
-										<td>
-											<input type="image"
-												onclick="setAction('filter', 'homeForm');"
-												src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/>
-										</td>							
-									</tr>
-								</table>
-							</td>
-							<td>
-								<table class="sortTable">
-									<tr>
-										<td><label class="tableTitle">Book Name</label></td>
-										<td>
-											<table>
-												<tr><td>
-													<input type="image" 
-														onclick="setAction('sortByBookNameUp', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
-												</td></tr>
-												<tr><td>
-													<input type="image"
-														onclick="setAction('sortByBookNameDown', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
-												</td></tr>
-											</table>
-										</td>
-									</tr>
-									<tr>
-										<td>
-											<input type="text" name="bookNameFilter" id="bookNameFilter" value="<%= sessionBean.getHomePage().getBookNameFilter()%>" size="8"/>
-										</td>									
-										<td>
-											<input type="image"
-												onclick="setAction('filter', 'homeForm');"
-												src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/>
-										</td>							
-									</tr>
-								</table>
-							</td>
-							
-							<td>
-								<table class="sortTable">
-									<tr>
-										<td><label class="tableTitle">Level 1</label></td>
-										<td>
-											<table>
-												<tr><td>
-													<input type="image" 
-														onclick="setAction('sortByLevel1Up', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
-												</td></tr>
-												<tr><td>
-													<input type="image"
-														onclick="setAction('sortByLevel1Down', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
-												</td></tr>
-											</table>
-										</td>
-									</tr>
-									<tr>
-										<td>
-											<input type="text" class="filterInput"  name="level1Filter" id="level1Filter" value="<%= sessionBean.getHomePage().getLevel1Filter()%>" size="8"/>
-										</td>									
-										<td>
-											<input type="image"
-												onclick="setAction('filter', 'homeForm');"
-												src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/>
-										</td>							
-									</tr>
-								</table>
-							</td>
-							<td>
-								<table class="sortTable">
-									<tr>
-										<td><label class="tableTitle">Level 2</label></td>
-										<td>
-											<table>
-												<tr><td>
-													<input type="image" 
-														onclick="setAction('sortByLevel2Up', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
-												</td></tr>
-												<tr><td>
-													<input type="image"
-														onclick="setAction('sortByLevel2Down', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
-												</td></tr>
-											</table>
-										</td>
-									</tr>
-									<tr>
-										<td>
-											<input type="text" name="level2Filter" id="level2Filter" value="<%= sessionBean.getHomePage().getLevel2Filter()%>" size="8"/>
-										</td>									
-										<td>
-											<input type="image"
-												onclick="setAction('filter', 'homeForm');"
-												src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/>
-										</td>							
-									</tr>
-								</table>
-							</td>
-							<td>
-								<table class="sortTable">
-									<tr>
-										<td><label class="tableTitle">Dynasty</label></td>
-										<td>
-											<table>
-												<tr><td>
-													<input type="image" 
-														onclick="setAction('sortByDynastyUp', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
-												</td></tr>
-												<tr><td>
-													<input type="image"
-														onclick="setAction('sortByDynastyDown', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
-												</td></tr>
-											</table>
-										</td>
-									</tr>
-									<tr>
-										<td>
-											<input type="text" name="dynastyFilter" id="dynastyFilter" value="<%= sessionBean.getHomePage().getDynastyFilter()%>" size="8"/>
-										</td>									
-										<td>
-											<input type="image"
-												onclick="setAction('filter', 'homeForm');"
-												src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/>
-										</td>							
-									</tr>
-								</table>
-							</td>
-							<td>
-								<table class="sortTable">
-									<tr>
-										<td><label class="tableTitle">Period</label></td>
-										<td>
-											<table>
-												<tr><td>
-													<input type="image" 
-														onclick="setAction('sortByPeriodUp', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
-												</td></tr>
-												<tr><td>
-													<input type="image"
-														onclick="setAction('sortByPeriodDown', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
-												</td></tr>
-											</table>
-										</td>
-									</tr>
-									<tr>
-										<td>
-											<input type="text" name="periodFilter" id="periodFilter" value="<%= sessionBean.getHomePage().getPeriodFilter()%>" size="8"/>
-										</td>									
-										<td>
-											<input type="image"
-												onclick="setAction('filter', 'homeForm');"
-												src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/>
-										</td>							
-									</tr>
-								</table>
-							</td>
-							<td>
-								<table class="sortTable">
-									<tr>
-										<td><label class="tableTitle">Admin Type</label></td>
-										<td>
-											<table>
-												<tr><td>
-													<input type="image" 
-														onclick="setAction('sortByAdminTypeUp', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
-												</td></tr>
-												<tr><td>
-													<input type="image"
-														onclick="setAction('sortByAdminTypeDown', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
-												</td></tr>
-											</table>
-										</td>
-									</tr>
-									<tr>
-										<td>
-											<input type="text" name="adminTypeFilter" id="adminTypeFilter" value="<%= sessionBean.getHomePage().getAdminTypeFilter()%>" size="8"/>
-										</td>									
-										<td>
-											<input type="image"
-												onclick="setAction('filter', 'homeForm');"
-												src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/>
-										</td>							
-									</tr>
-								</table>
-							</td>
-							<td>
-								<table class="sortTable">
-									<tr>
-										<td><label class="tableTitle">Section Name</label></td>
-										<td>
-											<table>
-												<tr><td>
-													<input type="image" 
-														onclick="setAction('sortBySectionNameUp', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
-												</td></tr>
-												<tr><td>
-													<input type="image"
-														onclick="setAction('sortBySectionNameDown', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
-												</td></tr>
-											</table>
-										</td>
-									</tr>
-									<tr>
-										<td>
-											<input type="text" name="sectionNameFilter" id="sectionNameFilter" value="<%= sessionBean.getHomePage().getSectionNameFilter()%>" size="8"/>
-										</td>									
-										<td>
-											<input type="image"
-												onclick="setAction('filter', 'homeForm');"
-												src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/>
-										</td>							
-									</tr>
-								</table>
-							</td>
-							<td>
-								<table class="sortTable">
-									<tr>
-										<td><label class="tableTitle">Pages</label></td>
-										<td>
-											<table>
-												<tr><td>
-													<input type="image" 
-														onclick="setAction('sortBySectionStartPageUp', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
-												</td></tr>
-												<tr><td>
-													<input type="image"
-														onclick="setAction('sortBySectionStartPageDown', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
-												</td></tr>
-											</table>
-										</td>
-									</tr>
-								</table>
-							</td>
-							<td>
-								<table class="sortTable">
-									<tr>
-										<td><label class="tableTitle">Label</label></td>
-										<td>
-											<table>
-												<tr><td>
-													<input type="image" 
-														onclick="setAction('sortByLabelUp', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
-												</td></tr>
-												<tr><td>
-													<input type="image"
-														onclick="setAction('sortByLabelDown', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
-												</td></tr>
-											</table>
-										</td>
-									</tr>
-									<tr>
-										<td>
-											<input type="text" name="labelFilter"  id="labelFilter" size="20" value="<%= sessionBean.getHomePage().getLabelFilter()%>" size="8"/>
-										</td>									
-										<td>
-											<input type="image"
-												onclick="setAction('filter', 'homeForm');"
-												src="<%=sessionBean.getApplicationBean().getFilterImage()%>"/>
-										</td>							
-									</tr>
-								</table>
-							</td>
-							<td><label class="tableTitle">Contributors</label></td>
-							<td>
-								<table class="sortTable">
-									<tr>
-										<td><label class="tableTitle">Last Saved</label></td>
-										<td>
-											<table>
-												<tr><td>
-													<input type="image" 
-														onclick="setAction('sortByLastModifiedUp', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
-												</td></tr>
-												<tr><td>
-													<input type="image"
-														onclick="setAction('sortByLastModifiedDown', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
-												</td></tr>
-											</table>
-										</td>
-									</tr>
-									
-								</table>
-							</td>
-							<td><label class="tableTitle">Load Text</label></td>
-							<td>
-								<table class="sortTable">
-									<tr>
-										<td><label class="tableTitle">Published in Dataverse</label></td>
-										<td>
-											<table>
-												<tr><td>
-													<input type="image" 
-														onclick="setAction('sortByPublishedInDataverseUp', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getUpImage()%>"/>										
-												</td></tr>
-												<tr><td>
-													<input type="image"
-														onclick="setAction('sortByPublishedInDataverseDown', 'homeForm');"
-														src="<%=sessionBean.getApplicationBean().getDownImage()%>"/>																				
-												</td></tr>
-											</table>
-										</td>
-									</tr>
-									
-								</table>
-							
-							</td>
-							
-							<td><label class="tableTitle">Manage</label></td>
-							<td><label class="tableTitle">Add to Topic</label></td>
-							<td><label class="tableTitle">Delete</label></td>
-						</tr>	
-						
-						<% for (LGBranch branch : sessionBean.getHomePage().getDisplayBranchList() ) {
-						%>
-						<tr>
-							<td><%=branch.getBook().getId() %></td>
-							<td><%=branch.getBook().getName() %></td>
-							<td><%=branch.getBook().getLevel1() %></td>	
-							<td><%=branch.getBook().getLevel2() %></td>
-							<td><%=branch.getBook().getDynasty() %></td>
-							<td><%=branch.getBook().getPeriod() %></td>
-							<td><%=branch.getBook().getAdmin_type() %></td>
-							<td><%=branch.getSection().getName() %> 
-								<% if (branch.isDeprecated()) { %>
-								<label style="color:red">*** This is a deprecated section ***</label>
-								<% } %>
-							</td>
-							<td><%=branch.getSection().getPages() %></td>
-							
-							<td><%=branch.getLabel() %></td>
-							<td>
-								<table style="width:120px;">
-								<% for(String contributor : branch.getContributorsNameList()) { %>
-									<tr><td><label><%= contributor %></label></td></tr>
-								<% } %>
-								</table>
-							</td>
-							<td><%=branch.getFomattedLastChange() %></td>
-							<td>
-								<a onclick="branchInExtractionInterface('<%=branch.getId() %>', '<%=branch.getCurrentLastFileId() %>', '<%=branch.getSectionId() %>', '<%=branch.getSection().getName() %>', '<%=branch.getBook().getId() %>', '<%=branch.getBook().getName() %>', '<%=sessionBean.getUser().getId() %>', '<%=sessionBean.getApplicationBean().getExtractionInterfaceUrl()%>');">
-									<img title="Show Task in Extraction Interface" src="<%=sessionBean.getApplicationBean().getShowImage()%>"/>
-								</a>
-							</td>
-							<!-- Dataverse -->
-							<td>
-								<%= (branch.isPublished()) ? "V":"" %>	
-							</td>
-							
-							<!-- Manage -->
-							<td>
-								<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/pages/branchPage.jsp?branchId=<%=branch.getId() %>" >
-									<img title="Manage the task" src="<%=sessionBean.getApplicationBean().getEditBranchImage()%>"/>
-								</a>
-							</td>
-							
-							<!-- Add to Topic -->
-							<td style="max-width:300px;">
-								<!-- existing topic -->
-								<% if(branch.getSection().getTopicSectionRelation() != null && !branch.getSection().getTopicSectionRelation().isEmpty()) { %>
-									<lable>Already in topic: </lable>
-									<table style="width:100%">		
-										<% for(LGTopicSectionRelation relation : branch.getSection().getTopicSectionRelation()) { %>
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Book ID</label></td>
+									<td>
+										<table>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByBookIdUp', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getUpImage()%>" />
+												</td>
+											</tr>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByBookIdDown', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getDownImage()%>" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+								<tr>
+									<td><input type="text" name="bookIdFilter"
+										value="<%=sessionBean.getHomePage().getBookIdFilter()%>"
+										size="8" /></td>
+									<td><input type="image"
+										onclick="setAction('filter', 'homeForm');"
+										src="<%=sessionBean.getApplicationBean().getFilterImage()%>" />
+									</td>
+								</tr>
+							</table>
+						</td>
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Book Name</label></td>
+									<td>
+										<table>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByBookNameUp', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getUpImage()%>" />
+												</td>
+											</tr>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByBookNameDown', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getDownImage()%>" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+								<tr>
+									<td><input type="text" name="bookNameFilter"
+										id="bookNameFilter"
+										value="<%=sessionBean.getHomePage().getBookNameFilter()%>"
+										size="8" /></td>
+									<td><input type="image"
+										onclick="setAction('filter', 'homeForm');"
+										src="<%=sessionBean.getApplicationBean().getFilterImage()%>" />
+									</td>
+								</tr>
+							</table>
+						</td>
+
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Level 1</label></td>
+									<td>
+										<table>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByLevel1Up', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getUpImage()%>" />
+												</td>
+											</tr>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByLevel1Down', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getDownImage()%>" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+								<tr>
+									<td><input type="text" class="filterInput"
+										name="level1Filter" id="level1Filter"
+										value="<%=sessionBean.getHomePage().getLevel1Filter()%>"
+										size="8" /></td>
+									<td><input type="image"
+										onclick="setAction('filter', 'homeForm');"
+										src="<%=sessionBean.getApplicationBean().getFilterImage()%>" />
+									</td>
+								</tr>
+							</table>
+						</td>
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Level 2</label></td>
+									<td>
+										<table>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByLevel2Up', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getUpImage()%>" />
+												</td>
+											</tr>
 											<tr>
-												<td>
-													<table style="width:100%; min-width:100px">
-													<tr><td><%=relation.getTopic().info() %></td></tr>
-													</table>
+												<td><input type="image"
+													onclick="setAction('sortByLevel2Down', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getDownImage()%>" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+								<tr>
+									<td><input type="text" name="level2Filter"
+										id="level2Filter"
+										value="<%=sessionBean.getHomePage().getLevel2Filter()%>"
+										size="8" /></td>
+									<td><input type="image"
+										onclick="setAction('filter', 'homeForm');"
+										src="<%=sessionBean.getApplicationBean().getFilterImage()%>" />
+									</td>
+								</tr>
+							</table>
+						</td>
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Dynasty</label></td>
+									<td>
+										<table>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByDynastyUp', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getUpImage()%>" />
+												</td>
+											</tr>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByDynastyDown', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getDownImage()%>" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+								<tr>
+									<td><input type="text" name="dynastyFilter"
+										id="dynastyFilter"
+										value="<%=sessionBean.getHomePage().getDynastyFilter()%>"
+										size="8" /></td>
+									<td><input type="image"
+										onclick="setAction('filter', 'homeForm');"
+										src="<%=sessionBean.getApplicationBean().getFilterImage()%>" />
+									</td>
+								</tr>
+							</table>
+						</td>
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Period</label></td>
+									<td>
+										<table>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByPeriodUp', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getUpImage()%>" />
 												</td>
-												<td style="max-width:150px">
-													
-													<a href="<%=sessionBean.getApplicationBean().getRootServer() %>/pages/topicPage.jsp?topicId=<%=relation.getTopicId() %>" >
-														<img title="Manage Topic" src="<%=sessionBean.getApplicationBean().getEditBranchImage()%>"/>
-													</a>												
-													
+											</tr>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByPeriodDown', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getDownImage()%>" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+								<tr>
+									<td><input type="text" name="periodFilter"
+										id="periodFilter"
+										value="<%=sessionBean.getHomePage().getPeriodFilter()%>"
+										size="8" /></td>
+									<td><input type="image"
+										onclick="setAction('filter', 'homeForm');"
+										src="<%=sessionBean.getApplicationBean().getFilterImage()%>" />
+									</td>
+								</tr>
+							</table>
+						</td>
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Admin Type</label></td>
+									<td>
+										<table>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByAdminTypeUp', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getUpImage()%>" />
+												</td>
+											</tr>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByAdminTypeDown', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getDownImage()%>" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+								<tr>
+									<td><input type="text" name="adminTypeFilter"
+										id="adminTypeFilter"
+										value="<%=sessionBean.getHomePage().getAdminTypeFilter()%>"
+										size="8" /></td>
+									<td><input type="image"
+										onclick="setAction('filter', 'homeForm');"
+										src="<%=sessionBean.getApplicationBean().getFilterImage()%>" />
+									</td>
+								</tr>
+							</table>
+						</td>
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Section Name</label></td>
+									<td>
+										<table>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortBySectionNameUp', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getUpImage()%>" />
+												</td>
+											</tr>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortBySectionNameDown', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getDownImage()%>" />
 												</td>
 											</tr>
-										<% } %>
-									</table>
-								<% } %>
-								
-								<img width="10" height="10" title="Add the section to Topic" src="<%=sessionBean.getApplicationBean().getPlusImage()%>" data-section-id="<%=branch.getSection().getId()%>" class="addSectionToTopic">
-					
-							</td>
-									
-							<!-- Delete -->
-							<td>
-								<input type="image" title="Delete it"
-									onclick="<%=sessionBean.getApplicationBean().getJSConfirmationDelete() %> deleteBranch('deleteBranch', 'homeForm', '<%=branch.getId() %>');" 
-									src="<%=sessionBean.getApplicationBean().getDeleteImage()%>"/>
-							</td>
-							
-					
-						</tr>
-						
-						<% } %>
-				
-					</table>
+										</table>
+									</td>
+								</tr>
+								<tr>
+									<td><input type="text" name="sectionNameFilter"
+										id="sectionNameFilter"
+										value="<%=sessionBean.getHomePage().getSectionNameFilter()%>"
+										size="8" /></td>
+									<td><input type="image"
+										onclick="setAction('filter', 'homeForm');"
+										src="<%=sessionBean.getApplicationBean().getFilterImage()%>" />
+									</td>
+								</tr>
+							</table>
+						</td>
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Pages</label></td>
+									<td>
+										<table>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortBySectionStartPageUp', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getUpImage()%>" />
+												</td>
+											</tr>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortBySectionStartPageDown', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getDownImage()%>" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+							</table>
+						</td>
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Label</label></td>
+									<td>
+										<table>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByLabelUp', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getUpImage()%>" />
+												</td>
+											</tr>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByLabelDown', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getDownImage()%>" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+								<tr>
+									<td><input type="text" name="labelFilter" id="labelFilter"
+										size="20"
+										value="<%=sessionBean.getHomePage().getLabelFilter()%>"
+										size="8" /></td>
+									<td><input type="image"
+										onclick="setAction('filter', 'homeForm');"
+										src="<%=sessionBean.getApplicationBean().getFilterImage()%>" />
+									</td>
+								</tr>
+							</table>
+						</td>
+						<td><label class="tableTitle">Contributors</label></td>
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Last Saved</label></td>
+									<td>
+										<table>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByLastModifiedUp', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getUpImage()%>" />
+												</td>
+											</tr>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByLastModifiedDown', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getDownImage()%>" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+
+							</table>
+						</td>
+						<td><label class="tableTitle">Load Text</label></td>
+						<td>
+							<table class="sortTable">
+								<tr>
+									<td><label class="tableTitle">Published in
+											Dataverse</label></td>
+									<td>
+										<table>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByPublishedInDataverseUp', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getUpImage()%>" />
+												</td>
+											</tr>
+											<tr>
+												<td><input type="image"
+													onclick="setAction('sortByPublishedInDataverseDown', 'homeForm');"
+													src="<%=sessionBean.getApplicationBean().getDownImage()%>" />
+												</td>
+											</tr>
+										</table>
+									</td>
+								</tr>
+
+							</table>
+
+						</td>
+
+						<td><label class="tableTitle">Manage</label></td>
+						<td><label class="tableTitle">Add to Topic</label></td>
+						<td><label class="tableTitle">Delete</label></td>
+					</tr>
 
-				</div>
-				
-				
-				<jsp:include page="../componentes/paginator.jsp">
-					<jsp:param name="formName" value="homeForm"/>
-				</jsp:include> 
-				
-			</form>
-		<% } %>
-		<% } %>
+					<%
+						for (LGBranch branch : sessionBean.getHomePage()
+										.getDisplayBranchList()) {
+					%>
+					<tr>
+						<td><%=branch.getBook().getId()%></td>
+						<td><%=branch.getBook().getName()%></td>
+						<td><%=branch.getBook().getLevel1()%></td>
+						<td><%=branch.getBook().getLevel2()%></td>
+						<td><%=branch.getBook().getDynasty()%></td>
+						<td><%=branch.getBook().getPeriod()%></td>
+						<td><%=branch.getBook().getAdmin_type()%></td>
+						<td><%=branch.getSection().getName()%> <%
+ 	if (branch.isDeprecated()) {
+ %>
+							<label style="color: red">*** This is a deprecated
+								section ***</label> <%
+ 	}
+ %></td>
+						<td><%=branch.getSection().getPages()%></td>
+
+						<td><%=branch.getLabel()%></td>
+						<td>
+							<table style="width: 120px;">
+								<%
+									for (String contributor : branch
+														.getContributorsNameList()) {
+								%>
+								<tr>
+									<td><label><%=contributor%></label></td>
+								</tr>
+								<%
+									}
+								%>
+							</table>
+						</td>
+						<td><%=branch.getFomattedLastChange()%></td>
+						<td><a
+							onclick="branchInExtractionInterface('<%=branch.getId()%>', '<%=branch.getCurrentLastFileId()%>', '<%=branch.getSectionId()%>', '<%=branch.getSection().getName()%>', '<%=branch.getBook().getId()%>', '<%=branch.getBook().getName()%>', '<%=sessionBean.getUser().getId()%>', '<%=sessionBean.getApplicationBean()
+								.getExtractionInterfaceUrl()%>');">
+								<img title="Show Task in Extraction Interface"
+								src="<%=sessionBean.getApplicationBean()
+								.getShowImage()%>" />
+						</a></td>
+						<!-- Dataverse -->
+						<td><%=(branch.isPublished()) ? "V" : ""%></td>
+
+						<!-- Manage -->
+						<td><a
+							href="<%=sessionBean.getApplicationBean()
+								.getRootServer()%>/pages/branchPage.jsp?branchId=<%=branch.getId()%>">
+								<img title="Manage the task"
+								src="<%=sessionBean.getApplicationBean()
+								.getEditBranchImage()%>" />
+						</a></td>
+
+						<!-- Add to Topic -->
+						<td style="max-width: 300px;">
+							<!-- existing topic --> <%
+ 	if (branch.getSection().getTopicSectionRelation() != null
+ 						&& !branch.getSection()
+ 								.getTopicSectionRelation().isEmpty()) {
+ %>
+							<lable>Already in topic: </lable>
+							<table style="width: 100%">
+								<%
+									for (LGTopicSectionRelation relation : branch
+															.getSection().getTopicSectionRelation()) {
+								%>
+								<tr>
+									<td>
+										<table style="width: 100%; min-width: 100px">
+											<tr>
+												<td><%=relation.getTopic().info()%></td>
+											</tr>
+										</table>
+									</td>
+									<td style="max-width: 150px"><a
+										href="<%=sessionBean.getApplicationBean()
+										.getRootServer()%>/pages/topicPage.jsp?topicId=<%=relation.getTopicId()%>">
+											<img title="Manage Topic"
+											src="<%=sessionBean.getApplicationBean()
+										.getEditBranchImage()%>" />
+									</a></td>
+								</tr>
+								<%
+									}
+								%>
+							</table> <%
+ 	}
+ %> <img width="10" height="10"
+							title="Add the section to Topic"
+							src="<%=sessionBean.getApplicationBean()
+								.getPlusImage()%>"
+							data-section-id="<%=branch.getSection().getId()%>"
+							class="addSectionToTopic">
+
+						</td>
+
+						<!-- Delete -->
+						<td><input type="image" title="Delete it"
+							onclick="<%=sessionBean.getApplicationBean()
+								.getJSConfirmationDelete()%> deleteBranch('deleteBranch', 'homeForm', '<%=branch.getId()%>');"
+							src="<%=sessionBean.getApplicationBean()
+								.getDeleteImage()%>" /></td>
+
+
+					</tr>
+
+					<%
+						}
+					%>
+
+				</table>
+
+			</div>
+
+
+			<jsp:include page="../componentes/paginator.jsp">
+				<jsp:param name="formName" value="homeForm" />
+			</jsp:include>
+
+		</form>
+		<%
+			}
+		%>
+		<%
+			}
+		%>
 	</div>
-	
+
 </body>
\ No newline at end of file
--- a/src/main/webapp/pages/topicPage.jsp	Mon May 09 16:02:32 2016 +0200
+++ b/src/main/webapp/pages/topicPage.jsp	Wed May 25 11:11:32 2016 +0200
@@ -60,7 +60,8 @@
 			$( "#addContributors" ).button().on( "click", function() {
 			        dialog.dialog( "open" );
 			});	 
-		  });
+		  }); 
+		  
 	</script>
 	
 </head>
--- a/src/main/webapp/resources/js/proxyMethods.js	Mon May 09 16:02:32 2016 +0200
+++ b/src/main/webapp/resources/js/proxyMethods.js	Wed May 25 11:11:32 2016 +0200
@@ -55,4 +55,23 @@
     input.value = userId;
     theForm.appendChild(input);  
 	setAction(action, formName);
-}
\ No newline at end of file
+}
+
+function setCookie(value) {
+    document.cookie = "saveTextToLGService=" + value + "; path=/LGServices/pages";
+    return true;
+}
+function getCookie() {
+    var cname = "saveTextToLGService=";
+    var ca = document.cookie.split(';');
+
+    for (var i=0; i < ca.length; i++) {
+        var c = ca[i];
+        while (c.charAt(0)==' ') c = c.substring(1,c.length);
+        if (c.indexOf(cname) == 0) {
+            return c.substring(cname.length, c.length);
+        }
+    }
+    return null;
+}
+