Die Reiter in den Panels lassen sich jetzt aus der JSP heraus über display{}(boolean) Methoden abschalten, wobei {} durch die Bezeichnung des jeweiligen Reiters zu
ersetzen ist. So kann z.B. mit displayProjects(false) für ein SciOrganizationPanel die Anzeige des/der Reiter(s) für Projekte unterbunden werden. git-svn-id: https://svn.libreccm.org/ccm/trunk@879 8810af33-2d31-482b-a856-94f89814c4dfmaster
parent
80a3d1fd3c
commit
cd25420e23
|
|
@ -41,6 +41,9 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel {
|
|||
public static final String SHOW_CONTACTS = "contacts";
|
||||
public static final String SHOW_MEMBERS = "members";
|
||||
|
||||
private boolean displayContacts;
|
||||
private boolean displayMembers;
|
||||
|
||||
@Override
|
||||
protected String getDefaultForShowParam() {
|
||||
return SHOW_CONTACTS;
|
||||
|
|
@ -51,6 +54,22 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel {
|
|||
return GenericOrganizationalUnit.class;
|
||||
}
|
||||
|
||||
public boolean isDisplayContacts() {
|
||||
return displayContacts;
|
||||
}
|
||||
|
||||
public void setDisplayContacts(boolean displayContacts) {
|
||||
this.displayContacts = displayContacts;
|
||||
}
|
||||
|
||||
public boolean isDisplayMembers() {
|
||||
return displayMembers;
|
||||
}
|
||||
|
||||
public void setDisplayMembers(boolean displayMembers) {
|
||||
this.displayMembers = displayMembers;
|
||||
}
|
||||
|
||||
protected void generateContactsXML(GenericOrganizationalUnit orga,
|
||||
Element parent, PageState state) {
|
||||
GenericOrganizationalUnitContactCollection contacts;
|
||||
|
|
@ -232,11 +251,13 @@ public class GenericOrganizationalUnitPanel extends CompoundContentItemPanel {
|
|||
GenericOrganizationalUnit orga = (GenericOrganizationalUnit) item;
|
||||
|
||||
if ((orga.getContacts() != null)
|
||||
&& (orga.getContacts().size() > 0)) {
|
||||
&& (orga.getContacts().size() > 0)
|
||||
&& displayMembers) {
|
||||
availableData.newChildElement("contacts");
|
||||
}
|
||||
if ((orga.getPersons() != null)
|
||||
&& (orga.getPersons().size() > 0)) {
|
||||
&& (orga.getPersons().size() > 0)
|
||||
&& displayMembers) {
|
||||
availableData.newChildElement("members");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -54,6 +54,10 @@ public class SciDepartmentPanel extends SciOrganizationBasePanel {
|
|||
public static final String SHOW_PROJECTS_ONGOING = "projectsOngoing";
|
||||
public static final String SHOW_PROJECTS_FINISHED = "projectsFinished";
|
||||
public static final String SHOW_PUBLICATIONS = "publications";
|
||||
private boolean displayDescription;
|
||||
private boolean displaySubDepartments;
|
||||
private boolean displayProjects;
|
||||
private boolean displayPublications;
|
||||
|
||||
@Override
|
||||
protected String getDefaultForShowParam() {
|
||||
|
|
@ -65,6 +69,38 @@ public class SciDepartmentPanel extends SciOrganizationBasePanel {
|
|||
return SciDepartment.class;
|
||||
}
|
||||
|
||||
public boolean isDisplayDescription() {
|
||||
return displayDescription;
|
||||
}
|
||||
|
||||
public void setDisplayDescription(boolean displayDescription) {
|
||||
this.displayDescription = displayDescription;
|
||||
}
|
||||
|
||||
public boolean isDisplayProjects() {
|
||||
return displayProjects;
|
||||
}
|
||||
|
||||
public void setDisplayProjects(boolean displayProjects) {
|
||||
this.displayProjects = displayProjects;
|
||||
}
|
||||
|
||||
public boolean isDisplayPublications() {
|
||||
return displayPublications;
|
||||
}
|
||||
|
||||
public void setDisplayPublications(boolean displayPublications) {
|
||||
this.displayPublications = displayPublications;
|
||||
}
|
||||
|
||||
public boolean isDisplaySubDepartments() {
|
||||
return displaySubDepartments;
|
||||
}
|
||||
|
||||
public void setDisplaySubDepartments(boolean displaySubDepartments) {
|
||||
this.displaySubDepartments = displaySubDepartments;
|
||||
}
|
||||
|
||||
protected boolean hasMembers(final SciDepartment department,
|
||||
final List<String> filters) {
|
||||
if (department.getPersons() != null) {
|
||||
|
|
@ -412,48 +448,60 @@ public class SciDepartmentPanel extends SciOrganizationBasePanel {
|
|||
SciOrganizationConfig config = SciDepartment.getConfig();
|
||||
|
||||
if ((department.getDepartmentDescription() != null)
|
||||
&& !department.getDepartmentDescription().isEmpty()) {
|
||||
&& !department.getDepartmentDescription().isEmpty()
|
||||
&& displayDescription) {
|
||||
availableData.newChildElement("description");
|
||||
}
|
||||
if ((department.getContacts() != null)
|
||||
&& (department.getContacts().size() > 0)) {
|
||||
&& (department.getContacts().size() > 0)
|
||||
&& isDisplayContacts()) {
|
||||
availableData.newChildElement("contacts");
|
||||
}
|
||||
if ((department.getSubDepartments() != null)
|
||||
&& (department.getSubDepartments().size() > 0)) {
|
||||
&& (department.getSubDepartments().size() > 0)
|
||||
&& displaySubDepartments) {
|
||||
availableData.newChildElement("subDepartments");
|
||||
}
|
||||
if (config.getOrganizationMembersAllInOne()) {
|
||||
if (hasMembers(department, new LinkedList<String>())) {
|
||||
if (hasMembers(department, new LinkedList<String>())
|
||||
&& isDisplayMembers()) {
|
||||
availableData.newChildElement("members");
|
||||
}
|
||||
} else {
|
||||
if (hasMembers(department, getFiltersForActiveMembers())) {
|
||||
if (hasMembers(department, getFiltersForActiveMembers())
|
||||
&& isDisplayMembers()) {
|
||||
availableData.newChildElement("membersActive");
|
||||
}
|
||||
if (hasMembers(department, getFiltersForAssociatedMembers())) {
|
||||
if (hasMembers(department, getFiltersForAssociatedMembers())
|
||||
&& isDisplayMembers()) {
|
||||
availableData.newChildElement("membersAssociated");
|
||||
}
|
||||
if (hasMembers(department, getFiltersForFormerMembers())) {
|
||||
if (hasMembers(department, getFiltersForFormerMembers())
|
||||
&& isDisplayMembers()) {
|
||||
availableData.newChildElement("membersFormer");
|
||||
}
|
||||
}
|
||||
if (config.getOrganizationProjectsAllInOne()) {
|
||||
if (hasProjects(department, new LinkedList<String>())) {
|
||||
if (hasProjects(department, new LinkedList<String>())
|
||||
&& displayProjects) {
|
||||
availableData.newChildElement("projects");
|
||||
}
|
||||
} else {
|
||||
if (hasProjects(department, getFiltersForOngoingProjects())) {
|
||||
if (hasProjects(department, getFiltersForOngoingProjects())
|
||||
&& displayProjects) {
|
||||
availableData.newChildElement("projectsOngoing");
|
||||
}
|
||||
if (hasProjects(department, getFiltersForFinishedProjects())) {
|
||||
if (hasProjects(department, getFiltersForFinishedProjects())
|
||||
&& displayProjects) {
|
||||
availableData.newChildElement("projectsFinished");
|
||||
}
|
||||
}
|
||||
DataCollection publicationLinks =
|
||||
RelatedLink.getRelatedLinks(department,
|
||||
"SciDepartmentPublications");
|
||||
if ((publicationLinks != null) && (publicationLinks.size() > 0)) {
|
||||
if ((publicationLinks != null)
|
||||
&& (publicationLinks.size() > 0)
|
||||
&& displayPublications) {
|
||||
availableData.newChildElement("publications");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -61,6 +61,10 @@ public class SciOrganizationPanel extends SciOrganizationBasePanel {
|
|||
public static final String SHOW_PROJECTS_ONGOING = "projectsOngoing";
|
||||
public static final String SHOW_PROJECTS_FINISHED = "projectsFinished";
|
||||
public static final String SHOW_PUBLICATIONS = "publications";
|
||||
private boolean displayDescription = true;
|
||||
private boolean displayDepartments = true;
|
||||
private boolean displayProjects = true;
|
||||
private boolean displayPublications = true;
|
||||
|
||||
@Override
|
||||
protected String getDefaultForShowParam() {
|
||||
|
|
@ -72,6 +76,30 @@ public class SciOrganizationPanel extends SciOrganizationBasePanel {
|
|||
return SciOrganization.class;
|
||||
}
|
||||
|
||||
public boolean isDisplayDepartments() {
|
||||
return displayDepartments;
|
||||
}
|
||||
|
||||
public void setDisplayDepartments(boolean displayDepartments) {
|
||||
this.displayDepartments = displayDepartments;
|
||||
}
|
||||
|
||||
public boolean isDisplayDescription() {
|
||||
return displayDescription;
|
||||
}
|
||||
|
||||
public void setDisplayDescription(boolean displayDescription) {
|
||||
this.displayDescription = displayDescription;
|
||||
}
|
||||
|
||||
public boolean isDisplayProjects() {
|
||||
return displayProjects;
|
||||
}
|
||||
|
||||
public void setDisplayProjects(boolean displayProjects) {
|
||||
this.displayProjects = displayProjects;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @param orga
|
||||
|
|
@ -509,48 +537,60 @@ public class SciOrganizationPanel extends SciOrganizationBasePanel {
|
|||
config = SciOrganization.getConfig();
|
||||
|
||||
if ((orga.getOrganizationDescription() != null)
|
||||
&& !(orga.getOrganizationDescription().isEmpty())) {
|
||||
&& !(orga.getOrganizationDescription().isEmpty())
|
||||
&& displayDescription) {
|
||||
availableData.newChildElement("description");
|
||||
}
|
||||
if ((orga.getContacts() != null)
|
||||
&& (orga.getContacts().size() > 0)) {
|
||||
&& (orga.getContacts().size() > 0)
|
||||
&& isDisplayContacts()) {
|
||||
availableData.newChildElement("contacts");
|
||||
}
|
||||
if ((orga.getDepartments() != null)
|
||||
&& (orga.getDepartments().size() > 0)) {
|
||||
&& (orga.getDepartments().size() > 0)
|
||||
&& displayDepartments) {
|
||||
availableData.newChildElement("departments");
|
||||
}
|
||||
if (config.getOrganizationMembersAllInOne()) {
|
||||
if (hasMembers(orga, new LinkedList<String>())) {
|
||||
if (hasMembers(orga, new LinkedList<String>())
|
||||
&& isDisplayMembers()) {
|
||||
availableData.newChildElement("members");
|
||||
}
|
||||
} else {
|
||||
if (hasMembers(orga, getFiltersForActiveMembers())) {
|
||||
if (hasMembers(orga, getFiltersForActiveMembers())
|
||||
&& isDisplayMembers()) {
|
||||
availableData.newChildElement("membersActive");
|
||||
}
|
||||
if (hasMembers(orga, getFiltersForAssociatedMembers())) {
|
||||
if (hasMembers(orga, getFiltersForAssociatedMembers())
|
||||
&& isDisplayMembers()) {
|
||||
availableData.newChildElement("membersAssociated");
|
||||
}
|
||||
if (hasMembers(orga, getFiltersForFormerMembers())) {
|
||||
if (hasMembers(orga, getFiltersForFormerMembers())
|
||||
&& isDisplayMembers()) {
|
||||
availableData.newChildElement("membersFormer");
|
||||
}
|
||||
}
|
||||
if (config.getOrganizationProjectsAllInOne()) {
|
||||
if (hasProjects(orga, new LinkedList<String>())) {
|
||||
if (hasProjects(orga, new LinkedList<String>())
|
||||
&& displayProjects) {
|
||||
availableData.newChildElement("projects");
|
||||
}
|
||||
} else {
|
||||
if (hasProjects(orga, getFiltersForOngoingProjects())) {
|
||||
if (hasProjects(orga, getFiltersForOngoingProjects())
|
||||
&& displayProjects) {
|
||||
availableData.newChildElement("projectsOngoing");
|
||||
}
|
||||
if (hasProjects(orga, getFiltersForFinishedProjects())) {
|
||||
if (hasProjects(orga, getFiltersForFinishedProjects())
|
||||
&& displayProjects) {
|
||||
availableData.newChildElement("projectsFinished");
|
||||
}
|
||||
}
|
||||
DataCollection publicationLinks =
|
||||
RelatedLink.getRelatedLinks(orga,
|
||||
"SciOrganizationPublications");
|
||||
if ((publicationLinks != null) && (publicationLinks.size() > 0)) {
|
||||
if ((publicationLinks != null)
|
||||
&& (publicationLinks.size() > 0)
|
||||
&& displayPublications) {
|
||||
availableData.newChildElement("publications");
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -44,6 +44,9 @@ public class SciProjectPanel extends SciOrganizationBasePanel {
|
|||
public static final String SHOW_SUBPROJECTS_ONGOING = "subprojectsOngoing";
|
||||
public static final String SHOW_SUBPROJECTS_FINISHED = "subprojectsFinished";
|
||||
public static final String SHOW_PUBLICATIONS = "publications";
|
||||
private boolean displayDescription = true;
|
||||
private boolean displaySubProjects = true;
|
||||
private boolean displayPublications = true;
|
||||
|
||||
@Override
|
||||
protected String getDefaultForShowParam() {
|
||||
|
|
@ -55,6 +58,30 @@ public class SciProjectPanel extends SciOrganizationBasePanel {
|
|||
return SciProject.class;
|
||||
}
|
||||
|
||||
public boolean isDisplayDescription() {
|
||||
return displayDescription;
|
||||
}
|
||||
|
||||
public void setDisplayDescription(boolean displayDescription) {
|
||||
this.displayDescription = displayDescription;
|
||||
}
|
||||
|
||||
public boolean isDisplayPublications() {
|
||||
return displayPublications;
|
||||
}
|
||||
|
||||
public void setDisplayPublications(boolean displayPublications) {
|
||||
this.displayPublications = displayPublications;
|
||||
}
|
||||
|
||||
public boolean isDisplaySubProjects() {
|
||||
return displaySubProjects;
|
||||
}
|
||||
|
||||
public void setDisplaySubProjects(boolean displaySubProjects) {
|
||||
this.displaySubProjects = displaySubProjects;
|
||||
}
|
||||
|
||||
protected boolean hasMembers(final SciProject project,
|
||||
final List<String> filters) {
|
||||
if (project.getPersons() != null) {
|
||||
|
|
@ -206,36 +233,45 @@ public class SciProjectPanel extends SciOrganizationBasePanel {
|
|||
SciOrganizationConfig config = SciProject.getConfig();
|
||||
|
||||
if ((project.getProjectDescription() != null)
|
||||
&& !project.getProjectDescription().isEmpty()) {
|
||||
&& !project.getProjectDescription().isEmpty()
|
||||
&& displayDescription) {
|
||||
availableData.newChildElement("description");
|
||||
}
|
||||
if ((project.getContacts() != null)
|
||||
&& (project.getContacts().size() > 0)) {
|
||||
&& (project.getContacts().size() > 0)
|
||||
&& isDisplayContacts()) {
|
||||
availableData.newChildElement("contacts");
|
||||
}
|
||||
if ((project.getSubProjects() != null)
|
||||
&& (project.getSubProjects().size() > 0)) {
|
||||
&& (project.getSubProjects().size() > 0)
|
||||
&& displaySubProjects) {
|
||||
availableData.newChildElement("subProjects");
|
||||
}
|
||||
if (config.getProjectMembersAllInOne()) {
|
||||
if (hasMembers(project, new LinkedList<String>())) {
|
||||
if (hasMembers(project, new LinkedList<String>())
|
||||
&& isDisplayMembers()) {
|
||||
availableData.newChildElement("members");
|
||||
}
|
||||
} else {
|
||||
if (hasMembers(project, getFiltersForActiveMembers())) {
|
||||
if (hasMembers(project, getFiltersForActiveMembers())
|
||||
&& isDisplayMembers()) {
|
||||
availableData.newChildElement("activeMembers");
|
||||
}
|
||||
if (hasMembers(project, getFiltersForAssociatedMembers())) {
|
||||
if (hasMembers(project, getFiltersForAssociatedMembers())
|
||||
&& isDisplayMembers()) {
|
||||
availableData.newChildElement("associatedMembers");
|
||||
}
|
||||
if (hasMembers(project, getFiltersForFormerMembers())) {
|
||||
if (hasMembers(project, getFiltersForFormerMembers())
|
||||
&& isDisplayMembers()) {
|
||||
availableData.newChildElement("formerMembers");
|
||||
}
|
||||
}
|
||||
DataCollection publicationLinks =
|
||||
RelatedLink.getRelatedLinks(project,
|
||||
"SciProjectPublications");
|
||||
if ((publicationLinks != null) && (publicationLinks.size() > 0)) {
|
||||
if ((publicationLinks != null)
|
||||
&& (publicationLinks.size() > 0)
|
||||
&& displayPublications) {
|
||||
availableData.newChildElement("publications");
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue