changeset 178:ca83d67a2dc9

bugfix and nicer messages for PublicByAuthor feature.
author Robert Casties <casties@mpiwg-berlin.mpg.de>
date Fri, 08 Jun 2018 18:28:58 +0200
parents af1018d06443
children c9dec00f0f17
files src/main/java/de/mpiwg/itgroup/ismi/entry/beans/SessionBean.java src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java src/main/webapp/clean/components/publicAuthorSubjects.xhtml src/main/webapp/clean/components/publicFindAuthor.xhtml src/main/webapp/clean/makeTextsPublic.xhtml
diffstat 5 files changed, 20 insertions(+), 22 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/SessionBean.java	Fri Jun 08 17:03:35 2018 +0200
+++ b/src/main/java/de/mpiwg/itgroup/ismi/entry/beans/SessionBean.java	Fri Jun 08 18:28:58 2018 +0200
@@ -139,7 +139,7 @@
 	private String selectedTab = WITNESS_TAB;
 	private String selectedEventTab = WITNESS_STUDY_EVENT_TAB;
 	private String selectedAdvancedSearchTab = "01";
-	private String selectedPublicByAuthorTab = "01";
+	private String selectedPublicByAuthorTab = "aut";
 	
 
 	private Long editFormCurrentEntId;
--- a/src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java	Fri Jun 08 17:03:35 2018 +0200
+++ b/src/main/java/de/mpiwg/itgroup/ismi/merge/PublicByAuthorBean.java	Fri Jun 08 18:28:58 2018 +0200
@@ -49,7 +49,7 @@
 		this.reset();
 	}
 	
-	public void reset(){
+	public synchronized void reset(){
 		logger.info("PublicByAuthorBean.reset()");
 	    browseBean = new FullEntityRepositoryBean();
 	    browseBean.setObjectClass(PERSON);
@@ -237,6 +237,7 @@
      */
     public String actionMakeTextAndRelatedPublic() {
         Entity text = (Entity) getRequestBean("text");
+        logger.info("MAKE PUBLIC by text for text="+text.getOwnValue());
         List<String> textMsg = new ArrayList<String>();
         try {
             List<Entity> entities = PrivacityUtils.setTextAndMorePrivacity(text, true, textMsg, getWrapper());
@@ -245,11 +246,11 @@
         } catch (Exception e) {
             logger.error(e);
         }
-        logger.debug("MAKE TEXT PUBLIC");
         for (String msg : textMsg) {
             this.addGeneralMsg(msg);
             logger.debug(msg);
         }
+        addGeneralMsg("The text \""+text.getOwnValue()+"\" was made public!");            
         return null;
     }
     
@@ -260,7 +261,8 @@
      */
     public String actionMakePersonSubjectAndRelatedPublic() {
         String subject = (String) getRequestBean("subject");
-        logger.debug("MAKE SUBJECT PUBLIC");
+        logger.info("MAKE PUBLIC by author and subject for author="+selectedPerson.getOwnValue()+" and subject="+subject);
+        int pubCnt = 0;
         List<Entity> texts = selectedPersonSubjectMap.get(subject);
         for (Entity text : texts) {
             List<String> textMsg = new ArrayList<String>();
@@ -275,7 +277,9 @@
                 this.addGeneralMsg(msg);
                 logger.debug(msg);
             }
+            pubCnt += 1;
         }
+        addGeneralMsg(pubCnt+" texts with subject "+subject+" were made public!");            
         return null;
     }
     
@@ -286,7 +290,7 @@
      */
     public String actionMakeMamsSubjectAndRelatedPublic() {
         String subject = (String) getRequestBean("subject");
-        logger.debug("MAKE PUBLIC BY MAMS AND SUBJECT");
+        logger.info("MAKE PUBLIC by MAMS and subject for subject="+subject+" and maxMams="+maxMamsNr);
         if (maxMamsNr < 1) {
             addErrorMsg("MAMS number too small!");
             return null;
@@ -369,13 +373,6 @@
     }
 
     /**
-     * @return the selectedPersonId
-     */
-    public long getSelectedPersonId() {
-        return selectedPersonId;
-    }
-
-    /**
      * @return the selectedPerson
      */
     public Entity getSelectedPerson() {
@@ -399,11 +396,18 @@
     /**
      * @param selectedPersonId the selectedPersonId to set
      */
-    public void setSelectedPersonId(Long selectedPersonId) {
+    public void setSelectedPersonId(long selectedPersonId) {
         this.selectedPersonId = selectedPersonId;
     }
 
     /**
+     * @return the selectedPersonId
+     */
+    public long getSelectedPersonId() {
+        return selectedPersonId;
+    }
+
+    /**
      * @return the selectedPersonSubjects
      */
     public List<String> getSelectedPersonSubjects() {
--- a/src/main/webapp/clean/components/publicAuthorSubjects.xhtml	Fri Jun 08 17:03:35 2018 +0200
+++ b/src/main/webapp/clean/components/publicAuthorSubjects.xhtml	Fri Jun 08 18:28:58 2018 +0200
@@ -14,7 +14,7 @@
 
         <h:panelGrid id="setAuthorPanel" columns="1">
 
-        <h2 style="color:black; text-align:left">Author: #{Session.publicByAuthor.selectedPerson.ownValue}"</h2>
+        <h2 style="color:black; text-align:left">Author: #{Session.publicByAuthor.selectedPerson.ownValue}</h2>
 
 		<h:panelGrid columns="3" styleClass="displayPanel"
 			columnClasses="displayPanelColumn01,displayPanelColumn02">
--- a/src/main/webapp/clean/components/publicFindAuthor.xhtml	Fri Jun 08 17:03:35 2018 +0200
+++ b/src/main/webapp/clean/components/publicFindAuthor.xhtml	Fri Jun 08 18:28:58 2018 +0200
@@ -9,10 +9,6 @@
 <body>
 	<ui:composition>
 
-   <!-- <h:outputStylesheet name="/css/ismi-db/repository.css" /> -->
-            
-
-
 		<h:panelGrid columns="3" styleClass="displayPanel"
 			columnClasses="displayPanelColumn01,displayPanelColumn02">
 
@@ -31,13 +27,10 @@
 				actionListener="#{Session.publicByAuthor.browseBean.actionSearchByAttributes}"
 				render="selectPersonPanel" />
 
-
 		</h:panelGrid>
 
 		<h:panelGrid id="selectPersonPanel" columns="1"
-			style="margin-left: auto; margin-right: auto; text-align: center; width: 100%;"
-			>
-
+			style="margin-left: auto; margin-right: auto; text-align: center; width: 100%;">
 
 			<h:outputText
 				value="#{Session.publicByAuthor.browseBean.resultSummaryMsg}"
--- a/src/main/webapp/clean/makeTextsPublic.xhtml	Fri Jun 08 17:03:35 2018 +0200
+++ b/src/main/webapp/clean/makeTextsPublic.xhtml	Fri Jun 08 18:28:58 2018 +0200
@@ -21,6 +21,7 @@
 				styleClass="mainPanel">
 
 				<rich:tabPanel id="tabPanel"
+    				itemChangeListener="#{Session.listenerPublicByAuthorTabChange}"
 					activeItem="#{Session.selectedPublicByAuthorTab}">
 				
                     <rich:tab header="Find Author" name="aut">