changeset 181:52aa06772336

fixed missingCodex function. moved some code from SessionBean up to MissingRelationsBean and PublicByAuthorBean.
author Robert Casties <casties@mpiwg-berlin.mpg.de>
date Wed, 13 Jun 2018 17:48:06 +0200
parents 0d31c8be7c31
children ef0949b8efc3
files src/main/java/de/mpiwg/itgroup/ismi/entry/beans/SessionBean.java src/main/java/de/mpiwg/itgroup/ismi/merge/MissingRelationsBean.java src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java src/main/webapp/clean/components/missingAuthor.xhtml src/main/webapp/clean/components/missingCodex.xhtml src/main/webapp/clean/components/missingText.xhtml src/main/webapp/clean/makeTextsPublic.xhtml src/main/webapp/clean/missingRelations.xhtml
diffstat 8 files changed, 65 insertions(+), 65 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/SessionBean.java	Wed Jun 13 14:57:13 2018 +0200
+++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/SessionBean.java	Wed Jun 13 17:48:06 2018 +0200
@@ -141,9 +141,6 @@
 	private String selectedTab = WITNESS_TAB;
 	private String selectedEventTab = WITNESS_STUDY_EVENT_TAB;
 	private String selectedAdvancedSearchTab = "01";
-	private String selectedPublicByAuthorTab = "aut";
-	private String selectedMissingRelationsTab = "aut";
-
 	private Long editFormCurrentEntId;
 
 	private boolean displayError = false;
@@ -660,17 +657,7 @@
 		this.redirect(null, url);
 	}
 	
-	public void listenerPublicByAuthorTabChange(ItemChangeEvent event) {
-		String url = "?formIndex=" + this.selectedPublicByAuthorTab;
-		this.redirect(null, url);
-	}
-	
-	public void listenerMissingRelationsTabChange(ItemChangeEvent event) {
-		String url = "?formIndex=" + this.selectedMissingRelationsTab;
-		this.redirect(null, url);
-	}
-	
-	protected void redirect(String redirectPath, String parameters){
+	public void redirect(String redirectPath, String parameters){
 		FacesContext fc = FacesContext.getCurrentInstance();
 		ExternalContext ec = fc.getExternalContext();
 		String contextPath = ec.getRequestContextPath();
@@ -1129,20 +1116,6 @@
 		this.publicByAuthor = publicByAuthor;
 	}
 
-	/**
-	 * @return the selectedPublicByAuthorTab
-	 */
-	public String getSelectedPublicByAuthorTab() {
-		return selectedPublicByAuthorTab;
-	}
-
-	/**
-	 * @param selectedPublicByAuthorTab the selectedPublicByAuthorTab to set
-	 */
-	public void setSelectedPublicByAuthorTab(String selectedPublicByAuthorTab) {
-		this.selectedPublicByAuthorTab = selectedPublicByAuthorTab;
-	}
-
 	public MissingRelationsBean getMissingRelations() {
 		return missingRelations;
 	}
@@ -1150,14 +1123,6 @@
 	public void setMissingRelations(MissingRelationsBean missingRelations) {
 		this.missingRelations = missingRelations;
 	}
-
-	public String getSelectedMissingRelationsTab() {
-		return selectedMissingRelationsTab;
-	}
-
-	public void setSelectedMissingRelationsTab(String selectedMissingRelationsTab) {
-		this.selectedMissingRelationsTab = selectedMissingRelationsTab;
-	}
 	
 	
 	
--- a/src/main/java/de/mpiwg/itgroup/ismi/merge/MissingRelationsBean.java	Wed Jun 13 14:57:13 2018 +0200
+++ b/src/main/java/de/mpiwg/itgroup/ismi/merge/MissingRelationsBean.java	Wed Jun 13 17:48:06 2018 +0200
@@ -6,6 +6,7 @@
 
 import org.apache.log4j.Logger;
 import org.mpi.openmind.repository.services.utils.RelationFilter;
+import org.richfaces.event.ItemChangeEvent;
 
 import de.mpiwg.itgroup.ismi.browse.EntityRepositoryBean;
 import de.mpiwg.itgroup.ismi.browse.FullEntityRepositoryBean;
@@ -17,7 +18,9 @@
 	
 	private static final long serialVersionUID = 1L;
 		
-	private FullEntityRepositoryBean browseBean;
+	protected FullEntityRepositoryBean browseBean;
+
+    protected String selectedTab = "aut";
 	
 	
 	public MissingRelationsBean(){
@@ -27,24 +30,18 @@
 	
 	public synchronized void reset(){
 		logger.info("MissingRelationsBean.reset()");
-	    browseBean = new FullEntityRepositoryBean();
-	    browseBean.setObjectClass(TEXT);
-	    
+	    browseBean = new FullEntityRepositoryBean();	    
         logger.info("MissingRelationsBean.reset() Done.");
 	}
 	
 	
-	public void actionReset() {
-	    reset();
-	}
-	
-
 	public void actionFindMissingAuthors() {
 		logger.debug("Start findMissingAuthors...");
 		List<RelationFilter> relFilters = new ArrayList<RelationFilter>();
 		/*
 		 * find TEXT without was_created_by PERSON relation
 		 */
+        browseBean = new FullEntityRepositoryBean();
 	    browseBean.setObjectClass(TEXT);
 	    RelationFilter relFilter = new RelationFilter();
 	    relFilter.relObjectClass = "was_created_by";
@@ -65,6 +62,7 @@
 		/*
 		 * find WITNESS without is_exemplar_of TEXT relation
 		 */
+        browseBean = new FullEntityRepositoryBean();
 	    browseBean.setObjectClass(WITNESS);
 	    RelationFilter relFilter = new RelationFilter();
 	    relFilter.relObjectClass = "is_exemplar_of";
@@ -85,6 +83,7 @@
 		/*
 		 * find WITNESS without is_part_of CODEX relation
 		 */
+		browseBean = new FullEntityRepositoryBean();
 	    browseBean.setObjectClass(WITNESS);
 	    RelationFilter relFilter = new RelationFilter();
 	    relFilter.relObjectClass = "is_part_of";
@@ -99,12 +98,23 @@
 		logger.debug("Done findMissingCodices.");
 	}
 	
-    /**
-     * @return the browseBean
-     */
     public EntityRepositoryBean getBrowseBean() {
         return browseBean;
     }
 
+    public void listenerTabChange(ItemChangeEvent event) {
+        reset();
+    	String url = "?formIndex=" + selectedTab;
+    	redirect(null, url);
+    }
+
+    public String getSelectedTab() {
+    	return selectedTab;
+    }
+
+    public void setSelectedTab(String selectedMissingRelationsTab) {
+    	selectedTab = selectedMissingRelationsTab;
+    }
+
 
 }
--- a/src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java	Wed Jun 13 14:57:13 2018 +0200
+++ b/src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java	Wed Jun 13 17:48:06 2018 +0200
@@ -13,6 +13,7 @@
 import org.mpi.openmind.repository.bo.Attribute;
 import org.mpi.openmind.repository.bo.Entity;
 import org.mpi.openmind.repository.bo.Relation;
+import org.richfaces.event.ItemChangeEvent;
 
 import de.mpiwg.itgroup.ismi.browse.EntityRepositoryBean;
 import de.mpiwg.itgroup.ismi.browse.FullEntityRepositoryBean;
@@ -24,7 +25,9 @@
 	private static Logger logger = Logger.getLogger(PublicByAuthorBean.class);
 	
 	private static final long serialVersionUID = 1L;
-	
+
+	protected String selectedTab = "aut";
+
 	protected String findAuthorName = "";
 	protected Long selectedPersonId = 0l;
 	protected Integer maxMamsNr = 0;
@@ -41,7 +44,7 @@
     protected Map<String,List<Entity>> subjectPrivateTexts;
     protected Map<String,Entity> subjectEntity;
 	
-	private FullEntityRepositoryBean browseBean;
+	protected FullEntityRepositoryBean browseBean;
 	
 	
 	public PublicByAuthorBean(){
@@ -119,7 +122,7 @@
      * update subjectTexts, subjectPublicTexts and subjectPrivateTexts.
      * 
      */
-    private void updateSubjectTexts() {
+    protected void updateSubjectTexts() {
         logger.debug("Start updateSubjectTexts...");
         subjectTexts = new HashMap<String,List<Entity>>();
         subjectPublicTexts = new HashMap<String,List<Entity>>();
@@ -233,7 +236,7 @@
         selectedPersonId = entity.getId();
         setSelectedPersonById();
         // switch tab
-        getSessionBean().setSelectedPublicByAuthorTab("autsub");
+        setSelectedTab("autsub");
         return null;
      }
 
@@ -358,6 +361,12 @@
         updateSubjectTexts();
         return null;
     }
+
+    
+    public void listenerTabChange(ItemChangeEvent event) {
+        String url = "?formIndex=" + selectedTab;
+        redirect(null, url);
+    }
     
 	/**
 	 * @return the findAuthorName
@@ -501,5 +510,20 @@
     	}
         return subjectEntity;
     }
+    
+    /**
+     * @return the selectedPublicByAuthorTab
+     */
+    public String getSelectedTab() {
+        return selectedTab;
+    }
+
+    /**
+     * @param selectedPublicByAuthorTab the selectedPublicByAuthorTab to set
+     */
+    public void setSelectedTab(String selectedPublicByAuthorTab) {
+        this.selectedTab = selectedPublicByAuthorTab;
+    }
+
 
 }
--- a/src/main/webapp/clean/components/missingAuthor.xhtml	Wed Jun 13 14:57:13 2018 +0200
+++ b/src/main/webapp/clean/components/missingAuthor.xhtml	Wed Jun 13 17:48:06 2018 +0200
@@ -9,6 +9,8 @@
 <body>
 	<ui:composition>
 
+        <h2 style="color:black">Texts without Author</h2>
+
 		<h:panelGrid columns="3" styleClass="displayPanel"
 			columnClasses="displayPanelColumn01,displayPanelColumn02">
 
@@ -26,7 +28,7 @@
 			<h:outputText
 				value="#{Session.missingRelations.browseBean.resultSummaryMsg}"
 				rendered="#{!empty Session.missingRelations.browseBean.resultSummaryMsg}"
-				styleClass="sumaryMsg" />
+				styleClass="summaryMsg" />
 
 			<h:column
 				rendered="#{!empty Session.missingRelations.browseBean.entities}">
--- a/src/main/webapp/clean/components/missingCodex.xhtml	Wed Jun 13 14:57:13 2018 +0200
+++ b/src/main/webapp/clean/components/missingCodex.xhtml	Wed Jun 13 17:48:06 2018 +0200
@@ -9,11 +9,13 @@
 <body>
 	<ui:composition>
 
+        <h2 style="color:black">Witnesses without Codex</h2>
+
 		<h:panelGrid columns="3" styleClass="displayPanel"
 			columnClasses="displayPanelColumn01,displayPanelColumn02">
 
             <a4j:commandButton value="show witnesses without codex"
-                actionListener="#{Session.missingRelations.actionFindMissingTexts}"
+                actionListener="#{Session.missingRelations.actionFindMissingCodices}"
                 render="showWitnessPanel2" />
             <h:outputText/>
             <h:outputText/>
@@ -26,7 +28,7 @@
 			<h:outputText
 				value="#{Session.missingRelations.browseBean.resultSummaryMsg}"
 				rendered="#{!empty Session.missingRelations.browseBean.resultSummaryMsg}"
-				styleClass="sumaryMsg" />
+				styleClass="summaryMsg" />
 
 			<h:column
 				rendered="#{!empty Session.missingRelations.browseBean.entities}">
--- a/src/main/webapp/clean/components/missingText.xhtml	Wed Jun 13 14:57:13 2018 +0200
+++ b/src/main/webapp/clean/components/missingText.xhtml	Wed Jun 13 17:48:06 2018 +0200
@@ -9,6 +9,8 @@
 <body>
 	<ui:composition>
 
+        <h2 style="color:black">Witnesses without Text</h2>
+
 		<h:panelGrid columns="3" styleClass="displayPanel"
 			columnClasses="displayPanelColumn01,displayPanelColumn02">
 
@@ -26,7 +28,7 @@
 			<h:outputText
 				value="#{Session.missingRelations.browseBean.resultSummaryMsg}"
 				rendered="#{!empty Session.missingRelations.browseBean.resultSummaryMsg}"
-				styleClass="sumaryMsg" />
+				styleClass="summaryMsg" />
 
 			<h:column
 				rendered="#{!empty Session.missingRelations.browseBean.entities}">
--- a/src/main/webapp/clean/makeTextsPublic.xhtml	Wed Jun 13 14:57:13 2018 +0200
+++ b/src/main/webapp/clean/makeTextsPublic.xhtml	Wed Jun 13 17:48:06 2018 +0200
@@ -21,8 +21,8 @@
 				styleClass="mainPanel">
 
 				<rich:tabPanel id="tabPanel"
-    				itemChangeListener="#{Session.listenerPublicByAuthorTabChange}"
-					activeItem="#{Session.selectedPublicByAuthorTab}">
+    				itemChangeListener="#{Session.publicByAuthor.listenerTabChange}"
+					activeItem="#{Session.publicByAuthor.selectedTab}">
 				
                     <rich:tab header="Find Author" name="aut">
                         <ui:include src="components/publicFindAuthor.xhtml" />
--- a/src/main/webapp/clean/missingRelations.xhtml	Wed Jun 13 14:57:13 2018 +0200
+++ b/src/main/webapp/clean/missingRelations.xhtml	Wed Jun 13 17:48:06 2018 +0200
@@ -20,8 +20,8 @@
 			<h:panelGrid columns="1" styleClass="mainPanel">
 
 				<rich:tabPanel id="tabPanel"
-					itemChangeListener="#{Session.listenerMissingRelationsTabChange}"
-					activeItem="#{Session.selectedMissingRelationsTab}">
+					itemChangeListener="#{Session.missingRelations.listenerTabChange}"
+					activeItem="#{Session.missingRelations.selectedTab}">
 
 					<rich:tab header="Missing Author" name="aut">
 						<ui:include src="components/missingAuthor.xhtml" />
@@ -36,11 +36,6 @@
 					</rich:tab>
 				</rich:tabPanel>
 
-				<a4j:commandButton value="reload all texts"
-					actionListener="#{Session.missingRelations.actionReset}"
-					render="mainPanel" />
-
-
 			</h:panelGrid>