changeset 146:29bd63f749c6

add Browse by Public.
author Robert Casties <casties@mpiwg-berlin.mpg.de>
date Mon, 10 Jul 2017 18:56:06 +0200
parents 62d5276ed785
children 1389c83028ef
files src/main/java/de/mpiwg/itgroup/ismi/browse/AbstractEntityRepositoryBean.java src/main/java/de/mpiwg/itgroup/ismi/browse/EntityRepositoryBean.java src/main/webapp/browse/entityRepository.xhtml src/main/webapp/templates/main_template.xhtml
diffstat 4 files changed, 40 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/de/mpiwg/itgroup/ismi/browse/AbstractEntityRepositoryBean.java	Mon Jul 10 15:54:54 2017 +0200
+++ b/src/main/java/de/mpiwg/itgroup/ismi/browse/AbstractEntityRepositoryBean.java	Mon Jul 10 18:56:06 2017 +0200
@@ -315,6 +315,24 @@
         }
     }
 	
+	public void searchByPublic() {
+		this.resultMode = MODE_ADVANCED;
+		this.setPage("");
+		this.currentEntities = new ArrayList<Entity>();
+		boolean isPublic = true;
+		this.entities = getWrapper().searchEntityByPublic(objectClass, isPublic);
+		this.resultSummaryMsg = "";
+
+		if (this.entities.size() > 0) {
+			this.advancedPaginator.setCurrentPage(0);
+			int entitiesCount = this.entities.size();
+			this.advancedPaginator.resetNumberOfPages(entitiesCount);
+			this.updateAdvancedEntities();
+		} else {
+			this.resultSummaryMsg = "No items were found!";
+		}
+	}
+	
 	public boolean isRenderedSearch(){
 		if(StringUtils.isNotEmpty(this.objectClass) && (
 				objectClass.equals(SUBJECT) ||
@@ -354,6 +372,17 @@
 		return GOTO_ENTITY_REPOSITORY;
 	}
 
+	public String actionSearchByPublic() {
+		try {
+			this.searchByPublic();	
+		} catch (Exception e) {
+			printInternalError(e);
+			logger.error(e.getMessage(), e);
+		}
+		
+		return GOTO_ENTITY_REPOSITORY;
+	}
+	
 	public boolean isAdvancedSearch() {
 		return advancedSearch;
 	}
--- a/src/main/java/de/mpiwg/itgroup/ismi/browse/EntityRepositoryBean.java	Mon Jul 10 15:54:54 2017 +0200
+++ b/src/main/java/de/mpiwg/itgroup/ismi/browse/EntityRepositoryBean.java	Mon Jul 10 18:56:06 2017 +0200
@@ -125,7 +125,6 @@
 	}
 	
 	
-
 	public String details() {
 		Entity selectedEntity = (Entity) getRequestBean("entity");
 		EntityDetailsBean bean = (EntityDetailsBean) getRequestBean(SESSION_BEAN_ENTITY_DETAILS);
--- a/src/main/webapp/browse/entityRepository.xhtml	Mon Jul 10 15:54:54 2017 +0200
+++ b/src/main/webapp/browse/entityRepository.xhtml	Mon Jul 10 18:56:06 2017 +0200
@@ -38,15 +38,19 @@
 					</h:panelGrid>
 					
 					<rich:tabPanel activeItem="#{EntityRepository.currentTab}" >
-					
+
 						<rich:tab header="Show all" name="Show all">
 							<a4j:commandButton value="Submit"
-								action="#{EntityRepository.actionShowAll}"
-								styleClass="button"
-								render="browseAttPanel"/>
-											
-            			</rich:tab>
-            			
+								action="#{EntityRepository.actionShowAll}" styleClass="button"
+								render="browseAttPanel" />
+						</rich:tab>
+
+                        <rich:tab header="Show public" name="Show public">
+                            <a4j:commandButton value="Submit"
+                                action="#{EntityRepository.actionSearchByPublic}" styleClass="button"
+                                render="browseAttPanel" />
+                        </rich:tab>
+
 						<rich:tab header="Search by attributes" name="Search by attributes">
 							<h:panelGrid id="browseAttPanel">
 								<h:panelGrid columns="2"
--- a/src/main/webapp/templates/main_template.xhtml	Mon Jul 10 15:54:54 2017 +0200
+++ b/src/main/webapp/templates/main_template.xhtml	Mon Jul 10 18:56:06 2017 +0200
@@ -195,9 +195,6 @@
 				
 			<h:outputLink rendered="#{Session.admin}"
 				value="#{ApplicationBean1.root}/imageServer/displayDigiList.xhtml">Image Server</h:outputLink>
-
-			<h:outputLink rendered="#{Session.admin}"
-				value="#{ApplicationBean1.root}/public/dynamicPageEditor.xhtml">Dynamic Page Editor</h:outputLink>
 			
 			<h:outputLink rendered="#{Session.admin}"
 				value="#{ApplicationBean1.root}/defs/defEditor.xhtml">Definition Editor</h:outputLink>