From cce7f68179ad2a54775cf1b38eec20593d974d10 Mon Sep 17 00:00:00 2001 From: jensp Date: Sun, 20 Nov 2011 10:39:58 +0000 Subject: [PATCH] Entfernen der obsoleten Module ccm-sci-types-organization und ccm-sci-types-organizationwithpublications aus dem trunk git-svn-id: https://svn.libreccm.org/ccm/trunk@1277 8810af33-2d31-482b-a856-94f89814c4df --- ccm-sci-types-organization/application.xml | 26 - .../arsdigita/content-types/SciDepartment.pdl | 165 ---- .../com/arsdigita/content-types/SciMember.pdl | 8 - .../content-types/SciOrganization.pdl | 169 ---- .../arsdigita/content-types/SciProject.pdl | 119 --- .../postgres-create.sql | 4 - .../cms/contenttypes/SciDepartment.xml | 65 -- .../arsdigita/cms/contenttypes/SciMember.xml | 37 - .../cms/contenttypes/SciOrganization.xml | 58 -- .../SciOrganizationDescription.jsp | 49 -- .../arsdigita/cms/contenttypes/SciProject.xml | 66 -- .../cms/contenttypes/scidepartment-item.jsp | 44 - .../cms/contenttypes/sciorganization-item.jsp | 44 - .../cms/contenttypes/sciproject-item.jsp | 44 - .../cms/contenttypes/SciDepartment.xml | 35 - .../arsdigita/cms/contenttypes/SciMember.xml | 25 - .../cms/contenttypes/SciOrganization.xml | 37 - .../arsdigita/cms/contenttypes/SciProject.xml | 33 - .../src/ccm-sci-types-organization.config | 5 - .../src/ccm-sci-types-organization.load | 26 - .../cms/contenttypes/SciDepartment.java | 620 -------------- .../SciDepartmentInitializer.java | 49 -- .../cms/contenttypes/SciDepartmentLoader.java | 73 -- .../SciDepartmentProjectsCollection.java | 157 ---- ...SciDepartmentSubDepartmentsCollection.java | 155 ---- .../arsdigita/cms/contenttypes/SciMember.java | 143 ---- .../contenttypes/SciMemberInitializer.java | 45 - .../cms/contenttypes/SciMemberLoader.java | 35 - .../SciMemberSciDepartmentsCollection.java | 75 -- .../SciMemberSciOrganizationsCollection.java | 77 -- .../SciMemberSciProjectsCollection.java | 75 -- .../cms/contenttypes/SciOrganization.java | 524 ------------ .../contenttypes/SciOrganizationConfig.java | 329 -------- ...SciOrganizationConfig_parameter.properties | 144 ---- .../SciOrganizationDepartmentsCollection.java | 156 ---- .../SciOrganizationInitializer.java | 51 -- .../contenttypes/SciOrganizationLoader.java | 77 -- .../SciOrganizationProjectsCollection.java | 157 ---- .../cms/contenttypes/SciProject.java | 496 ----------- .../SciProjectDepartmentsCollection.java | 154 ---- .../contenttypes/SciProjectInitializer.java | 49 -- .../SciProjectListXmlGenerator.java | 12 - .../cms/contenttypes/SciProjectLoader.java | 74 -- .../SciProjectOrganizationsCollection.java | 156 ---- .../SciProjectSubProjectsCollection.java | 155 ---- .../SciTypesOrganizationUpdate660to661.java | 65 -- .../ccm-sci-types-organization_entities.png | Bin 139120 -> 0 bytes .../ui/SciDepartmentDescriptionEditForm.java | 101 --- .../ui/SciDepartmentDescriptionStep.java | 84 -- .../SciDepartmentDescriptionUploadForm.java | 61 -- .../ui/SciDepartmentMemberAddForm.java | 53 -- .../ui/SciDepartmentMemberStep.java | 96 --- .../ui/SciDepartmentMemberTable.java | 39 - .../ui/SciDepartmentOrganizationForm.java | 115 --- .../ui/SciDepartmentOrganizationSheet.java | 295 ------- .../ui/SciDepartmentOrganizationStep.java | 65 -- .../contenttypes/ui/SciDepartmentPanel.java | 570 ------------- .../ui/SciDepartmentProjectAddForm.java | 127 --- .../ui/SciDepartmentProjectsStep.java | 65 -- .../ui/SciDepartmentProjectsTable.java | 383 --------- .../ui/SciDepartmentPropertiesStep.java | 159 ---- .../ui/SciDepartmentPropertyForm.java | 109 --- .../ui/SciDepartmentSubDepartmentAddForm.java | 131 --- .../ui/SciDepartmentSubDepartmentsStep.java | 62 -- .../ui/SciDepartmentSubDepartmentsTable.java | 382 --------- .../ui/SciDepartmentSuperDepartmentForm.java | 124 --- .../ui/SciDepartmentSuperDepartmentSheet.java | 282 ------- .../ui/SciDepartmentSuperDepartmentStep.java | 65 -- .../ui/SciMemberPropertiesStep.java | 98 --- .../ui/SciMemberPropertyForm.java | 88 -- .../ui/SciMemberSciDepartmentAddForm.java | 231 ----- .../ui/SciMemberSciDepartmentsStep.java | 70 -- .../ui/SciMemberSciDepartmentsTable.java | 352 -------- .../ui/SciMemberSciOrganizationAddForm.java | 234 ----- .../ui/SciMemberSciOrganizationsStep.java | 71 -- .../ui/SciMemberSciOrganizationsTable.java | 354 -------- .../ui/SciMemberSciProjectAddForm.java | 225 ----- .../ui/SciMemberSciProjectsStep.java | 70 -- .../ui/SciMemberSciProjectsTable.java | 352 -------- .../ui/SciOrganizationBasePanel.java | 796 ------------------ .../ui/SciOrganizationDepartmentAddForm.java | 132 --- .../ui/SciOrganizationDepartmentsStep.java | 64 -- .../ui/SciOrganizationDepartmentsTable.java | 382 --------- .../SciOrganizationDescriptionEditForm.java | 102 --- .../ui/SciOrganizationDescriptionStep.java | 83 -- .../SciOrganizationDescriptionUploadForm.java | 62 -- .../ui/SciOrganizationGlobalizationUtil.java | 41 - .../ui/SciOrganizationMemberAddForm.java | 58 -- .../ui/SciOrganizationMemberStep.java | 99 --- .../ui/SciOrganizationMemberTable.java | 40 - .../contenttypes/ui/SciOrganizationPanel.java | 594 ------------- .../ui/SciOrganizationProjectAddForm.java | 128 --- .../ui/SciOrganizationProjectsStep.java | 66 -- .../ui/SciOrganizationProjectsTable.java | 382 --------- .../ui/SciOrganizationPropertiesStep.java | 121 --- .../ui/SciOrganizationPropertyForm.java | 109 --- .../ui/SciOrganizationResources.properties | 232 ----- .../ui/SciOrganizationResources_de.properties | 232 ----- .../ui/SciProjectDepartmentAddForm.java | 127 --- .../ui/SciProjectDepartmentsStep.java | 60 -- .../ui/SciProjectDepartmentsTable.java | 373 -------- .../ui/SciProjectDescriptionEditForm.java | 143 ---- .../ui/SciProjectDescriptionStep.java | 94 --- .../ui/SciProjectDescriptionUploadForm.java | 58 -- .../ui/SciProjectMemberAddForm.java | 51 -- .../contenttypes/ui/SciProjectMemberStep.java | 96 --- .../ui/SciProjectMemberTable.java | 40 - .../ui/SciProjectOrganizationsAddForm.java | 122 --- .../ui/SciProjectOrganizationsStep.java | 61 -- .../ui/SciProjectOrganizationsTable.java | 381 --------- .../cms/contenttypes/ui/SciProjectPanel.java | 278 ------ .../ui/SciProjectPropertiesStep.java | 191 ----- .../ui/SciProjectPropertyForm.java | 134 --- .../ui/SciProjectSubProjectsTable.java | 379 --------- .../ui/SciProjectSubprojectAddForm.java | 130 --- .../ui/SciProjectSubprojectsStep.java | 64 -- .../ui/SciProjectSuperProjectSetForm.java | 121 --- .../ui/SciProjectSuperProjectSheet.java | 291 ------- .../ui/SciProjectSuperProjectStep.java | 62 -- ccm-sci-types-organization/src/empty.pdl.mf | 0 .../cms/contenttypes/SciDepartment.xsl | 19 - .../arsdigita/cms/contenttypes/SciMember.xsl | 20 - .../cms/contenttypes/SciOrganization.xsl | 19 - .../arsdigita/cms/contenttypes/SciProject.xsl | 19 - .../application.xml | 27 - .../SciDepartmentWithPublications.pdl | 50 -- .../SciOrganizationWithPublications.pdl | 123 --- .../SciProjectWithPublications.pdl | 50 -- .../postgres-create.sql | 4 - .../SciDepartmentWithPublications.xml | 65 -- .../SciOrganizationWithPublications.xml | 64 -- .../SciProjectWithPublications.xml | 65 -- .../scidepartment-with-publications-item.jsp | 44 - ...sciorganization-with-publications-item.jsp | 44 - .../sciproject-with-publications-item.jsp | 44 - .../SciDepartmentWithPublications.xml | 13 - .../SciOrganizationWithPublications.xml | 13 - .../SciProjectWithPublications.xml | 19 - ...-types-organizationwithpublications.config | 5 - ...ci-types-organizationwithpublications.load | 27 - .../ConvertRelatedPublicationLinks.java | 248 ------ .../PublicationSciDepartmentCollection.java | 43 - .../PublicationSciOrganizationCollection.java | 43 - .../PublicationSciProjectCollection.java | 43 - .../SciDepartmentPublicationsCollection.java | 41 - .../SciDepartmentWithPublications.java | 254 ------ ...DepartmentWithPublicationsInitializer.java | 73 -- .../SciDepartmentWithPublicationsLoader.java | 73 -- ...SciOrganizationPublicationsCollection.java | 44 - .../SciOrganizationWithPublications.java | 281 ------- ...SciOrganizationWithPublicationsConfig.java | 67 -- ...ithPublicationsConfig_parameter.properties | 20 - ...ganizationWithPublicationsInitializer.java | 74 -- ...SciOrganizationWithPublicationsLoader.java | 74 -- .../SciProjectPublicationsCollection.java | 40 - .../SciProjectWithPublications.java | 253 ------ ...SciProjectWithPublicationsInitializer.java | 73 -- .../SciProjectWithPublicationsLoader.java | 74 -- .../SciPublicationAuthorComparator.java | 58 -- .../SciPublicationTitleComparator.java | 43 - .../SciPublicationYearAscComparator.java | 30 - .../SciPublicationYearDescComparator.java | 28 - .../contenttypes/ZeSLanguageVersionFix.java | 511 ----------- .../ui/PublicationSciDepartmentAddForm.java | 133 --- .../ui/PublicationSciDepartmentStep.java | 59 -- .../ui/PublicationSciDepartmentTable.java | 278 ------ .../ui/PublicationSciOrganizationAddForm.java | 134 --- .../ui/PublicationSciOrganizationStep.java | 59 -- .../ui/PublicationSciOrganizationTable.java | 281 ------- .../ui/PublicationSciProjectAddForm.java | 131 --- .../ui/PublicationSciProjectStep.java | 60 -- .../ui/PublicationSciProjectTable.java | 279 ------ .../ui/SciDepartmentPublicationsAddForm.java | 126 --- .../ui/SciDepartmentPublicationsStep.java | 59 -- .../ui/SciDepartmentPublicationsTable.java | 281 ------- .../SciDepartmentWithPublicationsPanel.java | 411 --------- .../contenttypes/ui/SciMemberDemoPanel.java | 270 ------ .../SciOrganizationPublicationsAddForm.java | 125 --- .../ui/SciOrganizationPublicationsStep.java | 58 -- .../ui/SciOrganizationPublicationsTable.java | 279 ------ ...tionWithPublicationsGlobalizationUtil.java | 41 - .../SciOrganizationWithPublicationsPanel.java | 446 ---------- ...zationWithPublicationsResources.properties | 35 - ...ionWithPublicationsResources_de.properties | 35 - .../ui/SciProjectPublicationsAddForm.java | 125 --- .../ui/SciProjectPublicationsStep.java | 57 -- .../ui/SciProjectPublicationsTable.java | 276 ------ .../ui/SciProjectWithPublicationsPanel.java | 264 ------ .../src/empty.pdl.mf | 0 189 files changed, 25178 deletions(-) delete mode 100644 ccm-sci-types-organization/application.xml delete mode 100644 ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciDepartment.pdl delete mode 100644 ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciMember.pdl delete mode 100644 ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciOrganization.pdl delete mode 100644 ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciProject.pdl delete mode 100644 ccm-sci-types-organization/sql/ccm-sci-types-organization/postgres-create.sql delete mode 100644 ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciDepartment.xml delete mode 100644 ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml delete mode 100644 ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganization.xml delete mode 100644 ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganizationDescription.jsp delete mode 100644 ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProject.xml delete mode 100644 ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/scidepartment-item.jsp delete mode 100644 ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciorganization-item.jsp delete mode 100644 ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciproject-item.jsp delete mode 100644 ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciDepartment.xml delete mode 100644 ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml delete mode 100644 ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml delete mode 100644 ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciProject.xml delete mode 100644 ccm-sci-types-organization/src/ccm-sci-types-organization.config delete mode 100644 ccm-sci-types-organization/src/ccm-sci-types-organization.load delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartment.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentInitializer.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentLoader.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentProjectsCollection.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentSubDepartmentsCollection.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberInitializer.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciDepartmentsCollection.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciOrganizationsCollection.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciProjectsCollection.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganization.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig_parameter.properties delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationDepartmentsCollection.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationInitializer.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationLoader.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationProjectsCollection.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectDepartmentsCollection.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectInitializer.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectListXmlGenerator.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectLoader.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectOrganizationsCollection.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectSubProjectsCollection.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciTypesOrganizationUpdate660to661.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/doc-files/ccm-sci-types-organization_entities.png delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionUploadForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationSheet.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPanel.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentSheet.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciDepartmentAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciDepartmentsStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciDepartmentsTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciOrganizationAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciOrganizationsStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciOrganizationsTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciProjectAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciProjectsStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciProjectsTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationBasePanel.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionEditForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionUploadForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationGlobalizationUtil.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPanel.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertiesStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertyForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionEditForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionUploadForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPanel.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubProjectsTable.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectAddForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectsStep.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSetForm.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSheet.java delete mode 100644 ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectStep.java delete mode 100644 ccm-sci-types-organization/src/empty.pdl.mf delete mode 100644 ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciDepartment.xsl delete mode 100644 ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl delete mode 100644 ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciOrganization.xsl delete mode 100644 ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciProject.xsl delete mode 100644 ccm-sci-types-organizationwithpublications/application.xml delete mode 100644 ccm-sci-types-organizationwithpublications/pdl/com/arsdigita/content-types/SciDepartmentWithPublications.pdl delete mode 100644 ccm-sci-types-organizationwithpublications/pdl/com/arsdigita/content-types/SciOrganizationWithPublications.pdl delete mode 100644 ccm-sci-types-organizationwithpublications/pdl/com/arsdigita/content-types/SciProjectWithPublications.pdl delete mode 100644 ccm-sci-types-organizationwithpublications/sql/ccm-sci-types-organizationwithpublications/postgres-create.sql delete mode 100644 ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.xml delete mode 100644 ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.xml delete mode 100644 ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProjectWithPublications.xml delete mode 100644 ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/scidepartment-with-publications-item.jsp delete mode 100644 ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciorganization-with-publications-item.jsp delete mode 100644 ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciproject-with-publications-item.jsp delete mode 100644 ccm-sci-types-organizationwithpublications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.xml delete mode 100644 ccm-sci-types-organizationwithpublications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.xml delete mode 100644 ccm-sci-types-organizationwithpublications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciProjectWithPublications.xml delete mode 100644 ccm-sci-types-organizationwithpublications/src/ccm-sci-types-organizationwithpublications.config delete mode 100644 ccm-sci-types-organizationwithpublications/src/ccm-sci-types-organizationwithpublications.load delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ConvertRelatedPublicationLinks.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/PublicationSciDepartmentCollection.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/PublicationSciOrganizationCollection.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/PublicationSciProjectCollection.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentPublicationsCollection.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublicationsInitializer.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublicationsLoader.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationPublicationsCollection.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsConfig.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsConfig_parameter.properties delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsInitializer.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsLoader.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectPublicationsCollection.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublications.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublicationsInitializer.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublicationsLoader.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationAuthorComparator.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationTitleComparator.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationYearAscComparator.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationYearDescComparator.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ZeSLanguageVersionFix.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciDepartmentAddForm.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciDepartmentStep.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciDepartmentTable.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciOrganizationAddForm.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciOrganizationStep.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciOrganizationTable.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciProjectAddForm.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciProjectStep.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciProjectTable.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsAddForm.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsStep.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsTable.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentWithPublicationsPanel.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciMemberDemoPanel.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPublicationsAddForm.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPublicationsStep.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPublicationsTable.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsGlobalizationUtil.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsPanel.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsResources.properties delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsResources_de.properties delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsAddForm.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsStep.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsTable.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectWithPublicationsPanel.java delete mode 100644 ccm-sci-types-organizationwithpublications/src/empty.pdl.mf diff --git a/ccm-sci-types-organization/application.xml b/ccm-sci-types-organization/application.xml deleted file mode 100644 index 4527ba02b..000000000 --- a/ccm-sci-types-organization/application.xml +++ /dev/null @@ -1,26 +0,0 @@ - - - - - - - - - - - - - - - - - - - Content types for scientific organizations - - diff --git a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciDepartment.pdl b/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciDepartment.pdl deleted file mode 100644 index b756f4007..000000000 --- a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciDepartment.pdl +++ /dev/null @@ -1,165 +0,0 @@ -model com.arsdigita.cms.contenttypes; - -import com.arsdigita.kernel.ACSObject; -import com.arsdigita.cms.*; - -object type SciDepartment extends GenericOrganizationalUnit { - String[0..1] departmentShortDescription = ct_sciorga_departments.shortdescription VARCHAR(500); - String[0..1] departmentDescription = ct_sciorga_departments.description CLOB; - - reference key ( ct_sciorga_departments.department_id ); -} - -association { - SciDepartment[0..n] superDepartment = join ct_sciorga_departments.department_id - to ct_sciorga_departments_subdepartments_map.subdepartment_id, - join ct_sciorga_departments_subdepartments_map.department_id - to ct_sciorga_departments.department_id; - SciDepartment[0..n] subDepartments = join ct_sciorga_departments.department_id - to ct_sciorga_departments_subdepartments_map.department_id, - join ct_sciorga_departments_subdepartments_map.subdepartment_id - to ct_sciorga_departments.department_id; - - Integer[0..1] subDepartmentOrder = ct_sciorga_departments_subdepartments_map.subdepartments_order INTEGER; -} - -association { - SciDepartment[0..n] department = join ct_sciorga_projects.project_id - to ct_sciorga_departments_projects_map.project_id, - join ct_sciorga_departments_projects_map.department_id - to ct_sciorga_departments.department_id; - - SciProject[0..n] projects = join ct_sciorga_departments.department_id - to ct_sciorga_departments_projects_map.department_id, - join ct_sciorga_departments_projects_map.project_id - to ct_sciorga_projects.project_id; - - Integer[0..1] departmentOrder = ct_sciorga_departments_projects_map.departmentOrder INTEGER; - Integer[0..1] projectOrder = ct_sciorga_departments_projects_map.projectorder INTEGER; -} - -query getIdsOfContactsOfSciDepartment { - BigDecimal contactId; - - do { - select cms_organizationalunits_contact_map.contact_id - from cms_organizationalunits_contact_map - where cms_organizationalunits_contact_map.organizationalunit_id = :department - } map { - contactId = cms_organizationalunits_contact_map.contact_id; - } -} - -query getIdsOfSubDepartmentsOfSciDepartment { - BigDecimal subDepartmentId; - - do { - select ct_sciorga_departments_subdepartments_map.subdepartment_id - from ct_sciorga_departments_subdepartments_map - where ct_sciorga_departments_subdepartments_map.department_id = :department - } map { - subDepartmentId = ct_sciorga_departments_subdepartments_map.subdepartment_id; - } -} - -query getIdsOfMembersOfSciDepartment { - BigDecimal memberId; - - do { - select cms_organizationalunits_person_map.person_id - from cms_organizationalunits_person_map - where cms_organizationalunits_person_map.organizationalunit_id = :department - } map { - memberId = cms_organizationalunits_person_map.person_id; - } -} - -query getIdsOfActiveMembersOfSciDepartment { - BigDecimal memberId; - - do { - select cms_organizationalunits_person_map.person_id - from cms_organizationalunits_person_map - where cms_organizationalunits_person_map.organizationalunit_id = :department - and cms_organizationalunits_person_map.status = 'active' - } map { - memberId = cms_organizationalunits_person_map.person_id; - } -} - -query getIdsOfAssociatedMembersOfSciDepartment { - BigDecimal memberId; - - do { - select cms_organizationalunits_person_map.person_id - from cms_organizationalunits_person_map - where cms_organizationalunits_person_map.organizationalunit_id = :department - and cms_organizationalunits_person_map.status = 'associated' - } map { - memberId = cms_organizationalunits_person_map.personId; - } -} - -query getIdsOfFormerMembersOfSciDepartment { - BigDecimal memberId; - - do { - select cms_organizationalunits_person_map.person_id - from cms_organizationalunits_person_map - where cms_organizationalunits_person_map.organizationalunit_id = :department - and (cms_organizationalunits_person_map.status = 'former' or cms_organizationalunits_person_map.status = 'associatedFormer') - } map { - memberId = cms_organizationalunits_person_map.personId; - } -} - -query getIdsOfProjectsOfSciDepartment { - BigDecimal projectId; - - do { - select ct_sciorga_departments_projects_map.project_id - from ct_sciorga_departments_projects_map - where ct_sciorga_departments_projects_map.department_id = :department - } map { - projectId = ct_sciorga_departments_projects_map.project_id; - } -} - -query getIdsOfOngoingProjectsOfSciDepartment { - BigDecimal projectId; - - do { - select ct_sciorga_projects.project_id - from ct_sciorga_departments_projects_map - join ct_sciorga_projects on ct_sciorga_departments_projects_map.project_id = ct_sciorga_projects.project_id - where ct_sciorga_departments_projects_map.department_id = :department and ct_sciorga_projects.projectend >= ':today' - } map { - projectId = ct_sciorga_projects.project_id; - } -} - -query getIdsOfFinishedProjectsOfSciDepartment { - BigDecimal projectId; - - do { - select ct_sciorga_projects.project_id - from ct_sciorga_departments_projects_map - join ct_sciorga_projects on ct_sciorga_departments_projects_map.project_id = ct_sciorga_projects.project_id - where ct_sciorga_departments_projects_map.department_id = :department and ct_sciorga_projects.projectend < ':today' - } map { - projectId = ct_sciorga_projects.project_id; - } -} - -query getIdsOfPublicationLinksOfSciDepartment { - BigDecimal linkId; - - do { - select cms_related_links.related_link_id - from cms_related_links - where cms_related_links.owner_id = :department - and cms_related_links.link_list_name = 'SciDepartmentPublications' - } map { - linkId = cms_related_links.related_link_id; - } -} \ No newline at end of file diff --git a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciMember.pdl b/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciMember.pdl deleted file mode 100644 index 6f0128001..000000000 --- a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciMember.pdl +++ /dev/null @@ -1,8 +0,0 @@ -model com.arsdigita.cms.contenttypes; - -import com.arsdigita.kernel.ACSObject; -import com.arsdigita.cms.*; - -object type SciMember extends GenericPerson { - reference key ( ct_sciorga_members.member_id ); -} \ No newline at end of file diff --git a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciOrganization.pdl b/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciOrganization.pdl deleted file mode 100644 index 4a8502902..000000000 --- a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciOrganization.pdl +++ /dev/null @@ -1,169 +0,0 @@ -model com.arsdigita.cms.contenttypes; - -import com.arsdigita.kernel.ACSObject; -import com.arsdigita.cms.*; - -object type SciOrganization extends GenericOrganizationalUnit { - - String[0..1] organizationShortDescription = ct_sciorga_organizations.shortdescription VARCHAR(500); - String[0..1] organizationDescription = ct_sciorga_organizations.description CLOB; - - reference key ( ct_sciorga_organizations.organization_id ); -} - -association { - SciOrganization[0..n] organization = join ct_sciorga_departments.department_id - to ct_sciorga_organizations_departments_map.department_id, - join ct_sciorga_organizations_departments_map.organization_id - to ct_sciorga_organizations.organization_id; - - SciDepartment[0..n] departments = join ct_sciorga_organizations.organization_id - to ct_sciorga_organizations_departments_map.organization_id, - join ct_sciorga_organizations_departments_map.department_id - to ct_sciorga_departments.department_id; - - Integer[0..1] departmentOrder = ct_sciorga_organizations_departments_map.department_order INTEGER; - Integer[0..1] organizationOrder = ct_sciorga_organizations_departments_map.organization_order INTEGER; -} - -association { - SciOrganization[0..n] organization = join ct_sciorga_projects.project_id - to ct_sciorga_organizations_projects_map.project_id, - join ct_sciorga_organizations_projects_map.organization_id - to ct_sciorga_organizations.organization_id; - - SciProject[0..n] projects = join ct_sciorga_organizations.organization_id - to ct_sciorga_organizations_projects_map.organization_id, - join ct_sciorga_organizations_projects_map.project_id - to ct_sciorga_projects.project_id; - - Integer[0..1] projectOrder = ct_sciorga_organizations_projects_map.project_order INTEGER; - Integer[0..1] organizationOrder = ct_sciorga_organizations_projects_map.organization_order INTEGER; -} - -query getIdsOfContactsOfSciOrganization { - BigDecimal contactId; - - do { - select cms_organizationalunits_contact_map.contact_id - from cms_organizationalunits_contact_map - where cms_organizationalunits_contact_map.organizationalunit_id = :organization - } map { - contactId = cms_organizationalunits_contact_map.contact_id; - } -} - -query getIdsOfDepartmentsOfSciOrganization { - BigDecimal departmentId; - - do { - select ct_sciorga_organizations_departments_map.department_id - from ct_sciorga_organizations_departments_map - where ct_sciorga_organizations_departments_map.organization_id = :organization - } map { - departmentId = ct_sciorga_organizations_departments_map.department_id; - } -} - -query getIdsOfMembersOfSciOrganization { - BigDecimal memberId; - - do { - select cms_organizationalunits_person_map.person_id - from cms_organizationalunits_person_map - where cms_organizationalunits_person_map.organizationalunit_id = :organization - } map { - memberId = cms_organizationalunits_person_map.person_id; - } -} - -query getIdsOfActiveMembersOfSciOrganization { - BigDecimal memberId; - - do { - select cms_organizationalunits_person_map.person_id - from cms_organizationalunits_person_map - where cms_organizationalunits_person_map.organizationalunit_id = :organization - and cms_organizationalunits_person_map.status = 'active' - } map { - memberId = cms_organizationalunits_person_map.person_id; - } -} - -query getIdsOfAssociatedMembersOfSciOrganization { - BigDecimal memberId; - - do { - select cms_organizationalunits_person_map.person_id - from cms_organizationalunits_person_map - where cms_organizationalunits_person_map.organizationalunit_id = :organization - and cms_organizationalunits_person_map.status = 'associated' - } map { - memberId = cms_organizationalunits_person_map.personId; - } -} - -query getIdsOfFormerMembersOfSciOrganization { - BigDecimal memberId; - - do { - select cms_organizationalunits_person_map.person_id - from cms_organizationalunits_person_map - where cms_organizationalunits_person_map.organizationalunit_id = :organization - and (cms_organizationalunits_person_map.status = 'former' or cms_organizationalunits_person_map.status = 'associatedFormer') - } map { - memberId = cms_organizationalunits_person_map.personId; - } -} - -query getIdsOfProjectsOfSciOrganization { - BigDecimal projectId; - - do { - select ct_sciorga_organizations_projects_map.project_id - from ct_sciorga_organizations_projects_map - where ct_sciorga_organizations_projects_map.organization_id = :organization - } map { - projectId = ct_sciorga_organizations_projects_map.project_id; - } -} - -query getIdsOfOngoingProjectsOfSciOrganization { - BigDecimal projectId; - - do { - select ct_sciorga_projects.project_id - from ct_sciorga_organizations_projects_map - join ct_sciorga_projects on ct_sciorga_organizations_projects_map.project_id = ct_sciorga_projects.project_id - where ct_sciorga_organizations_projects_map.organization_id = :organization and ct_sciorga_projects.projectend >= ':today' - } map { - projectId = ct_sciorga_projects.project_id; - } -} - -query getIdsOfFinishedProjectsOfSciOrganization { - BigDecimal projectId; - - do { - select ct_sciorga_projects.project_id - from ct_sciorga_organizations_projects_map - join ct_sciorga_projects on ct_sciorga_organizations_projects_map.project_id = ct_sciorga_projects.project_id - where ct_sciorga_organizations_projects_map.organization_id = :organization and ct_sciorga_projects.projectend < ':today' - } map { - projectId = ct_sciorga_projects.project_id; - } -} - -query getIdsOfPublicationLinksOfSciOrganization { - BigDecimal linkId; - - do { - select cms_related_links.related_link_id - from cms_related_links - where cms_related_links.owner_id = :organization - and cms_related_links.link_list_name = 'SciOrganizationPublications' - } map { - linkId = cms_related_links.related_link_id; - } -} - diff --git a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciProject.pdl b/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciProject.pdl deleted file mode 100644 index ba6238d25..000000000 --- a/ccm-sci-types-organization/pdl/com/arsdigita/content-types/SciProject.pdl +++ /dev/null @@ -1,119 +0,0 @@ -model com.arsdigita.cms.contenttypes; - -import com.arsdigita.kernel.ACSObject; -import com.arsdigita.cms.*; - -object type SciProject extends GenericOrganizationalUnit { - - Date[0..1] projectbegin = ct_sciorga_projects.projectbegin DATE; - Date[0..1] projectend = ct_sciorga_projects.projectend DATE; - String[0..1] projectShortDesc = ct_sciorga_projects.shortdesc VARCHAR(500); - String[0..1] projectDescription = ct_sciorga_projects.description CLOB; - String[0..1] funding = ct_sciorga_projects.funding CLOB; - String[0..1] fundingVolume = ct_sciorga_projects.funding_volume VARCHAR(128); - - reference key ( ct_sciorga_projects.project_id ); -} - -association { - SciProject[0..n] superProject = join ct_sciorga_projects.project_id - to ct_sciorga_projects_subprojects_map.subproject_id, - join ct_sciorga_projects_subprojects_map.project_id - to ct_sciorga_projects.project_id; - - SciProject[0..n] subProjects = join ct_sciorga_projects.project_id - to ct_sciorga_projects_subprojects_map.project_id, - join ct_sciorga_projects_subprojects_map.subproject_id - to ct_sciorga_projects.project_id; - - Integer[0..1] subProjectOrder = ct_sciorga_projects_subprojects_map.subprojectorder INTEGER; - -} - -query getIdsOfContactsOfSciProject { - BigDecimal contactId; - - do { - select cms_organizationalunits_contact_map.contact_id - from cms_organizationalunits_contact_map - where cms_organizationalunits_contact_map.organizationalunit_id = :project - } map { - contactId = cms_organizationalunits_contact_map.contact_id; - } -} - -query getIdsOfSubProjectsOfSciProject { - BigDecimal projectId; - - do { - select ct_sciorga_projects_subprojects_map.subproject_id - from ct_sciorga_projects_subprojects_map - where ct_sciorga_projects_subprojects_map.project_id = :project - } map { - projectId = ct_sciorga_projects_subprojects_map.project_id; - } -} - -query getIdsOfMembersOfSciProject { - BigDecimal memberId; - - do { - select cms_organizationalunits_person_map.person_id - from cms_organizationalunits_person_map - where cms_organizationalunits_person_map.organizationalunit_id = :project - } map { - memberId = cms_organizationalunits_person_map.person_id; - } -} - -query getIdsOfActiveMembersOfSciProject { - BigDecimal memberId; - - do { - select cms_organizationalunits_person_map.person_id - from cms_organizationalunits_person_map - where cms_organizationalunits_person_map.organizationalunit_id = :project - and cms_organizationalunits_person_map.status = 'active' - } map { - memberId = cms_organizationalunits_person_map.person_id; - } -} - -query getIdsOfAssociatedMembersOfSciProject { - BigDecimal memberId; - - do { - select cms_organizationalunits_person_map.person_id - from cms_organizationalunits_person_map - where cms_organizationalunits_person_map.organizationalunit_id = :project - and cms_organizationalunits_person_map.status = 'associated' - } map { - memberId = cms_organizationalunits_person_map.personId; - } -} - -query getIdsOfFormerMembersOfSciProject { - BigDecimal memberId; - - do { - select cms_organizationalunits_person_map.cms_persons.person_id - from cms_organizationalunits_person_map - where cms_organizationalunits_person_map.organizationalunit_id = :project - and (cms_organizationalunits_person_map.status = 'former' or cms_organizationalunits_person_map.status = 'associatedFormer') - } map { - memberId = cms_organizationalunits_person_map.personId; - } -} - -query getIdsOfPublicationLinksOfSciProject { - BigDecimal linkId; - - do { - select cms_related_links.related_link_id - from cms_related_links - where cms_related_links.owner_id = :project - and cms_related_links.link_list_name = 'SciProjectPublications' - } map { - linkId = cms_related_links.related_link_id; - } -} \ No newline at end of file diff --git a/ccm-sci-types-organization/sql/ccm-sci-types-organization/postgres-create.sql b/ccm-sci-types-organization/sql/ccm-sci-types-organization/postgres-create.sql deleted file mode 100644 index 38716a0ca..000000000 --- a/ccm-sci-types-organization/sql/ccm-sci-types-organization/postgres-create.sql +++ /dev/null @@ -1,4 +0,0 @@ -begin; -\i ddl/postgres/create.sql -\i ddl/postgres/deferred.sql -end; \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciDepartment.xml b/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciDepartment.xml deleted file mode 100644 index a27473d4f..000000000 --- a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciDepartment.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml b/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml deleted file mode 100644 index d9d1004f1..000000000 --- a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganization.xml b/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganization.xml deleted file mode 100644 index 7b079d97c..000000000 --- a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganization.xml +++ /dev/null @@ -1,58 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganizationDescription.jsp b/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganizationDescription.jsp deleted file mode 100644 index 36bd83a39..000000000 --- a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganizationDescription.jsp +++ /dev/null @@ -1,49 +0,0 @@ - - - - - - - - - - - - long age = Navigation.getConfig().getIndexPageCacheLifetime(); - if (age == 0) { - DispatcherHelper.cacheDisable(response); - } else { - DispatcherHelper.cacheForWorld(response, (int)age); - } - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProject.xml b/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProject.xml deleted file mode 100644 index 858f2743f..000000000 --- a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProject.xml +++ /dev/null @@ -1,66 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/scidepartment-item.jsp b/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/scidepartment-item.jsp deleted file mode 100644 index c53ce0e63..000000000 --- a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/scidepartment-item.jsp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - NavigationModel model = new CMSNavigationModel(); - - - - - - - ((com.arsdigita.navigation.ui.category.Path)categoryPath) - .setModel(model); - - - - ((com.arsdigita.navigation.ui.category.Menu)categoryMenu) - .setModel(model); - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciorganization-item.jsp b/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciorganization-item.jsp deleted file mode 100644 index 8ef611dd3..000000000 --- a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciorganization-item.jsp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - NavigationModel model = new CMSNavigationModel(); - - - - - - - ((com.arsdigita.navigation.ui.category.Path)categoryPath) - .setModel(model); - - - - ((com.arsdigita.navigation.ui.category.Menu)categoryMenu) - .setModel(model); - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciproject-item.jsp b/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciproject-item.jsp deleted file mode 100644 index c7f8a2d93..000000000 --- a/ccm-sci-types-organization/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciproject-item.jsp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - NavigationModel model = new CMSNavigationModel(); - - - - - - - ((com.arsdigita.navigation.ui.category.Path)categoryPath) - .setModel(model); - - - - ((com.arsdigita.navigation.ui.category.Menu)categoryMenu) - .setModel(model); - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciDepartment.xml b/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciDepartment.xml deleted file mode 100644 index 618b776be..000000000 --- a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciDepartment.xml +++ /dev/null @@ -1,35 +0,0 @@ - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml b/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml deleted file mode 100644 index 6f1922be6..000000000 --- a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml +++ /dev/null @@ -1,25 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - diff --git a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml b/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml deleted file mode 100644 index e3903afea..000000000 --- a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml +++ /dev/null @@ -1,37 +0,0 @@ - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciProject.xml b/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciProject.xml deleted file mode 100644 index b37af9316..000000000 --- a/ccm-sci-types-organization/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciProject.xml +++ /dev/null @@ -1,33 +0,0 @@ - - - - - - - - - - - - - - --> - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organization/src/ccm-sci-types-organization.config b/ccm-sci-types-organization/src/ccm-sci-types-organization.config deleted file mode 100644 index 786bbc0dc..000000000 --- a/ccm-sci-types-organization/src/ccm-sci-types-organization.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - diff --git a/ccm-sci-types-organization/src/ccm-sci-types-organization.load b/ccm-sci-types-organization/src/ccm-sci-types-organization.load deleted file mode 100644 index 8ab3f7df3..000000000 --- a/ccm-sci-types-organization/src/ccm-sci-types-organization.load +++ /dev/null @@ -1,26 +0,0 @@ - - - -
-
-
- - - -
-
-
-
- - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartment.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartment.java deleted file mode 100644 index e8f521fea..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartment.java +++ /dev/null @@ -1,620 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.DataQuery; -import com.arsdigita.persistence.OID; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.util.Assert; -import java.math.BigDecimal; -import java.util.Calendar; -import java.util.GregorianCalendar; -import org.apache.log4j.Logger; - -/** - *

- * A class for representing departments of an organization. Adds two - * associations to {@link GenericOrganizationalUnit}: - *

- *
    - *
  • Subdepartments
  • - *
  • Projects
  • - *
- *

- * The subdepartments association links one instance of this class - * with another. - * The projects association links an department with projects. - *

- *

- * Also, there are two additional fields: - *

- *
    - *
  • shortDescription
  • - *
  • description
  • - *
- *

- * shortDescription takes a short text (maximum length 500 characters) - * about the department. For more detailed description, the description - * field can be used. - *

- *

- * There is an - * UML digram - * with an overview of the content types and their associations. Please not that - * the diagram show a design sketch and not the actually implemented classes. - *

- * - * @author Jens Pelzetter - * @see GenericOrganizationalUnit - * @see SciOrganization - * @see SciProject - */ -public class SciDepartment extends GenericOrganizationalUnit { - - private static final Logger logger = Logger.getLogger(SciDepartment.class); - public static final String DEPARTMENT_SHORT_DESCRIPTION = - "departmentShortDescription"; - public static final String DEPARTMENT_DESCRIPTION = "departmentDescription"; - public static final String ORGANIZATION = "organization"; - public static final String SUPER_DEPARTMENT = "superDepartment"; - public static final String SUBDEPARTMENTS = "subDepartments"; - public static final String SUBDEPARTMENT_ORDER = "subDepartmentOrder"; - public static final String PROJECTS = "projects"; - public static final String PROJECT_ORDER = "projectOrder"; - public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.contenttypes.SciDepartment"; - private static final SciOrganizationConfig s_config = - new SciOrganizationConfig(); - - static { - logger.debug("Static initalizer starting..."); - s_config.load(); - logger.debug("Static initalizer finished."); - } - - public enum MemberStatus { - - ALL, - ACTIVE, - ASSOCIATED, - FORMER - } - - public enum ProjectStatus { - - ALL, - ONGOING, - FINISHED - } - - public SciDepartment() { - this(BASE_DATA_OBJECT_TYPE); - } - - public SciDepartment(BigDecimal id) throws DataObjectNotFoundException { - this(new OID(BASE_DATA_OBJECT_TYPE, id)); - } - - public SciDepartment(OID oid) throws DataObjectNotFoundException { - super(oid); - } - - public SciDepartment(DataObject obj) { - super(obj); - } - - public SciDepartment(String type) { - super(type); - } - - public static final SciOrganizationConfig getConfig() { - return s_config; - } - - public String getDepartmentShortDescription() { - return (String) get(DEPARTMENT_SHORT_DESCRIPTION); - } - - public void setDepartmentShortDescription(String description) { - set(DEPARTMENT_SHORT_DESCRIPTION, description); - } - - public String getDepartmentDescription() { - return (String) get(DEPARTMENT_DESCRIPTION); - } - - public void setDepartmentDescription(String description) { - set(DEPARTMENT_DESCRIPTION, description); - } - - public SciDepartment getSuperDepartment() { - /*This is some sort of hack because if we define the - * relation in PDL with a multiplicity of 0..1 for the super department - * part, CCM crashes when trying to publish the item. So we have to - * define both parts of the association with 0..n in PDL. But we don't - * want more than one superior department per department. So we are - * retrieving the data collection and get the first element of it, and - * return this. - */ - DataCollection collection; - - collection = (DataCollection) get(SUPER_DEPARTMENT); - - if (0 == collection.size()) { - return null; - } else { - DataObject dobj; - - collection.next(); - dobj = collection.getDataObject(); - collection.close(); - - return (SciDepartment) DomainObjectFactory.newInstance(dobj); - } - } - - public void setSuperDepartment(SciDepartment department) { - /* Similar hack as in getSuperDepartment() above. Here, we are - * retrieving the data collection, removing the first (and only item) - * and put the new one in it. - * - */ - SciDepartment oldSuperDepartment; - - oldSuperDepartment = getSuperDepartment(); - if (oldSuperDepartment != null) { - remove(SUPER_DEPARTMENT, oldSuperDepartment); - } - - if (null != department) { - Assert.exists(department, SciDepartment.class); - DataObject link = add(SUPER_DEPARTMENT, department); - link.set(SUBDEPARTMENT_ORDER, - Integer.valueOf((int) department.getSubDepartments().size())); - link.save(); - } - } - - /*public boolean hasSuperDepartment() { - - - - }*/ - public SciOrganization getOrganization() { - DataCollection collection; - - collection = (DataCollection) get(ORGANIZATION); - - if (0 == collection.size()) { - return null; - } else { - DataObject dobj; - - collection.next(); - dobj = collection.getDataObject(); - collection.close(); - - return (SciOrganization) DomainObjectFactory.newInstance(dobj); - } - } - - public void setOrganization(SciOrganization orga) { - SciOrganization oldOrganization; - - oldOrganization = getOrganization(); - if (oldOrganization != null) { - remove(ORGANIZATION, oldOrganization); - } - - if (null != orga) { - Assert.exists(orga, SciOrganization.class); - DataObject link = add(ORGANIZATION, orga); - link.set(SciOrganization.DEPARTMENT_ORDER, - Integer.valueOf((int) orga.getDepartments().size())); - link.save(); - } - } - - public SciDepartmentSubDepartmentsCollection getSubDepartments() { - return new SciDepartmentSubDepartmentsCollection( - (DataCollection) get(SUBDEPARTMENTS)); - } - - public void addSubDepartment(SciDepartment subDepartment) { - Assert.exists(subDepartment, SciDepartment.class); - - DataObject link = add(SUBDEPARTMENTS, subDepartment); - - link.set(SUBDEPARTMENT_ORDER, Integer.valueOf((int) getSubDepartments(). - size())); - link.save(); - } - - public void removeSubDepartment(SciDepartment subDepartment) { - Assert.exists(subDepartment, SciDepartment.class); - - remove(SUBDEPARTMENTS, subDepartment); - } - - public SciDepartmentProjectsCollection getProjects() { - return new SciDepartmentProjectsCollection( - (DataCollection) get(PROJECTS)); - } - - public void addProject(SciProject project) { - Assert.exists(project, SciProject.class); - - DataObject link = add(PROJECTS, project); - - link.set(PROJECT_ORDER, - Integer.valueOf((int) getProjects().size())); - link.set(SciProject.DEPARTMENTS_ORDER, - Integer.valueOf((int) project.getDepartments().size())); - link.save(); - } - - public void removeProject(SciProject project) { - Assert.exists(project, SciProject.class); - - remove(PROJECTS, project); - } - - @Override - public boolean hasContacts() { - boolean result = false; - - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfContactsOfSciDepartment"); - query.setParameter("department", getID()); - - if (query.size() > 0) { - result = true; - } else { - result = false; - } - - query.close(); - - return result; - } - - public boolean hasSubDepartments() { - boolean result = false; - - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - query.setParameter("department", getID()); - - if (query.size() > 0) { - result = true; - } else { - result = false; - } - - query.close(); - - return result; - } - - /** - * - * @param merge Should I also look into the departments and return true - * if the organization or at least one of the departments has members? - * @return - */ - public boolean hasMembers(final boolean merge, final MemberStatus status) { - String queryName; - - switch (status) { - case ALL: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfMembersOfSciDepartment"; - break; - case ACTIVE: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfActiveMembersOfSciDepartment"; - break; - case ASSOCIATED: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfAssociatedMembersOfSciDepartment"; - break; - case FORMER: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfFormerMembersOfSciDepartment"; - break; - default: - queryName = ""; - break; - } - - DataQuery query = SessionManager.getSession().retrieveQuery(queryName); - query.setParameter("department", getID()); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery departmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - departmentsQuery.setParameter("department", getID()); - - if (query.size() > 0) { - BigDecimal departmentId; - boolean result = false; - while (departmentsQuery.next()) { - departmentId = (BigDecimal) departmentsQuery.get( - "subDepartmentId"); - result = hasMembers(departmentId, merge, status); - - if (result) { - break; - } - } - - departmentsQuery.close(); - return result; - } else { - departmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - private boolean hasMembers(final BigDecimal departmentId, - final boolean merge, - final MemberStatus status) { - String queryName; - - switch (status) { - case ALL: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfMembersOfSciDepartment"; - break; - case ACTIVE: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfActiveMembersOfSciDepartment"; - break; - case ASSOCIATED: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfAssociatedMembersOfDepartment"; - break; - case FORMER: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfFormerMembersOfSciDepartment"; - break; - default: - queryName = ""; - break; - } - - DataQuery query = SessionManager.getSession().retrieveQuery(queryName); - query.setParameter("department", departmentId); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subDepartmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - subDepartmentsQuery.setParameter("department", departmentId); - - if (query.size() > 0) { - BigDecimal subDepartmentId; - boolean result = false; - while (subDepartmentsQuery.next()) { - subDepartmentId = (BigDecimal) subDepartmentsQuery.get( - "subDepartmentId"); - result = hasMembers(subDepartmentId, merge, status); - - if (result) { - break; - } - } - - subDepartmentsQuery.close(); - return result; - } else { - subDepartmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - public boolean hasProjects(final boolean merge, - final ProjectStatus status) { - String queryName; - - switch (status) { - case ALL: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfProjectsOfSciDepartment"; - break; - case ONGOING: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfOngoingProjectsOfSciDepartment"; - break; - case FINISHED: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfFinishedProjectsOfSciDepartment"; - break; - default: - queryName = ""; - break; - } - - DataQuery query = SessionManager.getSession().retrieveQuery(queryName); - query.setParameter("department", getID()); - if (status != ProjectStatus.ALL) { - Calendar today = new GregorianCalendar(); - query.setParameter("today", - String.format("%d-%02d-%02d", - today.get(Calendar.YEAR), - today.get(Calendar.MONTH) + 1, - today.get(Calendar.DAY_OF_MONTH))); - } - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery departmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - departmentsQuery.setParameter("department", getID()); - - if (departmentsQuery.size() > 0) { - BigDecimal departmentId; - boolean result = false; - while (departmentsQuery.next()) { - departmentId = (BigDecimal) departmentsQuery.get( - "subDepartmentId"); - result = hasProjects(departmentId, merge, status); - - if (result) { - break; - } - } - - departmentsQuery.close(); - return result; - } else { - departmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - private boolean hasProjects(final BigDecimal departmentId, - final boolean merge, - final ProjectStatus status) { - String queryName; - - switch (status) { - case ALL: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfProjectsOfSciDepartment"; - break; - case ONGOING: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfOngoingProjectsOfSciDepartment"; - break; - case FINISHED: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfFinishedProjectsOfSciDepartment"; - break; - default: - queryName = ""; - break; - } - - DataQuery query = SessionManager.getSession().retrieveQuery(queryName); - query.setParameter("department", departmentId); - if (status != ProjectStatus.ALL) { - Calendar today = new GregorianCalendar(); - query.setParameter("today", - String.format("%d-%02d-%02d", - today.get(Calendar.YEAR), - today.get(Calendar.MONTH) + 1, - today.get(Calendar.DAY_OF_MONTH))); - - } - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subDepartmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - subDepartmentsQuery.setParameter("department", departmentId); - - if (query.size() > 0) { - BigDecimal subDepartmentId; - boolean result = false; - while (subDepartmentsQuery.next()) { - subDepartmentId = (BigDecimal) subDepartmentsQuery.get( - "subDepartmentId"); - result = hasProjects(subDepartmentId, merge, status); - - if (result) { - break; - } - } - - subDepartmentsQuery.close(); - return result; - } else { - subDepartmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - public boolean hasPublications() { - boolean result = false; - - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfPublicationLinksOfSciDepartment"); - query.setParameter("department", getID()); - - if (query.size() > 0) { - result = true; - } else { - result = false; - } - - query.close(); - - return result; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentInitializer.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentInitializer.java deleted file mode 100644 index 3d4964595..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentInitializer.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import org.apache.log4j.Logger; - -/** - * Initializer for {@link SciDepartment}. - * - * @author Jens Pelzetter - */ -public class SciDepartmentInitializer extends ContentTypeInitializer { - - private static final Logger s_log = Logger.getLogger( - SciDepartmentInitializer.class); - - public SciDepartmentInitializer() { - super("empty.pdl.mf", SciDepartment.BASE_DATA_OBJECT_TYPE); - } - - @Override - public String[] getStylesheets() { - return new String[]{ - "/static/content-types/com/arsdigita/cms/contenttypes/SciDepartment.xsl" - }; - } - - @Override - public String getTraversalXML() { - return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciDepartment.xml"; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentLoader.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentLoader.java deleted file mode 100644 index e72273cbf..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentLoader.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.lifecycle.LifecycleDefinition; -import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.ResourceParameter; -import com.arsdigita.workflow.simple.WorkflowTemplate; -import java.io.InputStream; - -/** - * Loader for {@link SciDepartment}. - * - * @author Jens Pelzetter - */ -public class SciDepartmentLoader extends AbstractContentTypeLoader { - - private ResourceParameter m_template; - private static final String[] TYPES = { - "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciDepartment.xml" - }; - - public SciDepartmentLoader() { - super(); - - m_template = new ResourceParameter( - "com.arsdigita.cms.contenttypes.SciDepartmentTemplate", - Parameter.REQUIRED, - "/WEB-INF/content-types/com/arsdigita/" - + "cms/contenttypes/scidepartment-item.jsp"); - - register(m_template); - } - - public String[] getTypes() { - return TYPES; - } - - @Override - protected void prepareSection(final ContentSection section, - final ContentType type, - final LifecycleDefinition lifecycle, - final WorkflowTemplate workflow) { - super.prepareSection(section, type, lifecycle, workflow); - - setDefaultTemplate("SciDepartment Item", - "scidepartment-item", - (InputStream) get(m_template), - section, - type, - lifecycle, - workflow); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentProjectsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentProjectsCollection.java deleted file mode 100644 index 7008b01a9..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentProjectsCollection.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import org.apache.log4j.Logger; - -/** - * Special domain collection for the projects of an department. - * - * @author Jens Pelzetter - * @see SciDepartment - * @see SciProject - */ -public class SciDepartmentProjectsCollection extends DomainCollection { - - public String ORDER = "projectOrder"; - public String LINKORDER = "link.projectOrder"; - private static final Logger s_log = - Logger.getLogger(SciDepartmentProjectsCollection.class); - - public SciDepartmentProjectsCollection(DataCollection dataCollection) { - super(dataCollection); - - m_dataCollection.addOrder(LINKORDER); - } - - public Integer getProjectOrder() { - return (Integer) m_dataCollection.get(LINKORDER); - } - - public void setProjectOrder(Integer order) { - DataObject link = (DataObject) this.get("link"); - - link.set(ORDER, order); - } - - public void swapWithNext(SciProject project) { - int currentPosition = 0; - int currentIndex = 0; - int nextIndex = 0; - - s_log.debug("Searching project..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getProjectOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getProjectOrder(): %d", - getProjectOrder())); - if (this.getProject().equals(project)) { - break; - } - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided project is not " - + "part of this collection.")); - } - - if (this.next()) { - nextIndex = this.getProjectOrder(); - } else { - throw new IllegalArgumentException( - "The provided project is the last " - + "in the collection, so there is no next object " - + "to swap with."); - } - - this.rewind(); - - while (this.getPosition() != currentPosition) { - this.next(); - } - - this.setProjectOrder(nextIndex); - this.next(); - this.setProjectOrder(currentIndex); - this.rewind(); - } - - public void swapWithPrevious(SciProject project) { - int previousPosition = 0; - int previousIndex = 0; - int currentPosition = 0; - int currentIndex = 0; - - s_log.debug("Searching project..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getProjectOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getProjectOrder(): %d", - getProjectOrder())); - if (this.getProject().equals(project)) { - break; - } - - previousPosition = currentPosition; - previousIndex = currentIndex; - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided project is not " - + "part of this collection.")); - } - - if (previousPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided project is the first one in this " - + "collection, so there is no previous one to switch " - + "with.")); - } - - this.rewind(); - while (this.getPosition() != previousPosition) { - this.next(); - } - - this.setProjectOrder(currentIndex); - this.next(); - this.setProjectOrder(previousIndex); - this.rewind(); - } - - public SciProject getProject() { - return new SciProject(m_dataCollection.getDataObject()); - } -} - diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentSubDepartmentsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentSubDepartmentsCollection.java deleted file mode 100644 index 816a7f883..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciDepartmentSubDepartmentsCollection.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import org.apache.log4j.Logger; - -/** - * Special domain collection for the subdepartments of a department. - * - * @author Jens Pelzetter - * @see SciDepartment - */ -public class SciDepartmentSubDepartmentsCollection extends DomainCollection { - - public String ORDER = "subDepartmentOrder"; - public String LINKORDER = "link.subDepartmentOrder"; - private static final Logger s_log = - Logger.getLogger(SciDepartmentSubDepartmentsCollection.class); - - public SciDepartmentSubDepartmentsCollection(DataCollection dataCollection) { - super(dataCollection); - - m_dataCollection.addOrder(LINKORDER); - } - - public Integer getSubDepartmentOrder() { - return (Integer) m_dataCollection.get(LINKORDER); - } - - public void setSubDepartmentOrder(Integer order) { - DataObject link = (DataObject) this.get("link"); - - link.set(ORDER, order); - } - - public void swapWithNext(SciDepartment department) { - int currentPosition = 0; - int currentIndex = 0; - int nextIndex = 0; - - s_log.debug("Searching department..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getSubDepartmentOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getDepartmentOrder(): %d", - getSubDepartmentOrder())); - if (this.getSubDepartment().equals(department)) { - break; - } - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided department is not " - + "part of this collection.")); - } - - if (this.next()) { - nextIndex = this.getSubDepartmentOrder(); - } else { - throw new IllegalArgumentException( - "The provided department is the last " - + "in the collection, so there is no next object " - + "to swap with."); - } - - this.rewind(); - - while (this.getPosition() != currentPosition) { - this.next(); - } - - this.setSubDepartmentOrder(nextIndex); - this.next(); - this.setSubDepartmentOrder(currentIndex); - this.rewind(); - } - - public void swapWithPrevious(SciDepartment department) { - int previousPosition = 0; - int previousIndex = 0; - int currentPosition = 0; - int currentIndex = 0; - - s_log.debug("Searching department..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getSubDepartmentOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getDepartmentOrder(): %d", - getSubDepartmentOrder())); - if (this.getSubDepartment().equals(department)) { - break; - } - - previousPosition = currentPosition; - previousIndex = currentIndex; - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided department is not " - + "part of this collection.")); - } - - if (previousPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided department is the first one in this " - + "collection, so there is no previous one to switch " - + "with.")); - } - - this.rewind(); - while (this.getPosition() != previousPosition) { - this.next(); - } - - this.setSubDepartmentOrder(currentIndex); - this.next(); - this.setSubDepartmentOrder(previousIndex); - this.rewind(); - } - - public SciDepartment getSubDepartment() { - return new SciDepartment(m_dataCollection.getDataObject()); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java deleted file mode 100644 index c64615130..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMember.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.OID; -import com.arsdigita.util.Assert; -import java.math.BigDecimal; -import org.apache.log4j.Logger; - -/** - * A concrete class extending {@link GenericPerson}. Does not add any new - * fields, it just makes the internal type GenericPerson usable - * without any other modules. - * - * @author Jens Pelzetter - */ -public class SciMember extends GenericPerson { - - private static final Logger logger = Logger.getLogger(SciMember.class); - public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.contenttypes.SciMember"; - private static final String ORGANIZATIONS = "organizationalunit"; - private static final String DEPARTMENTS = "organizationalunit"; - private static final String PROJECTS = "organizationalunit"; - private static final SciOrganizationConfig s_config = - new SciOrganizationConfig(); - - static { - logger.debug("Static initalizer starting..."); - s_config.load(); - logger.debug("Static initalizer starting..."); - } - - public SciMember() { - this(BASE_DATA_OBJECT_TYPE); - } - - public SciMember(BigDecimal id) throws DataObjectNotFoundException { - this(new OID(BASE_DATA_OBJECT_TYPE, id)); - } - - public SciMember(OID oid) throws DataObjectNotFoundException { - super(oid); - } - - public SciMember(DataObject dobj) { - super(dobj); - } - - public SciMember(String type) { - super(type); - } - - public SciMemberSciOrganizationsCollection getOrganizations() { - return new SciMemberSciOrganizationsCollection((DataCollection) get( - ORGANIZATIONS)); - } - - public void addOrganization(SciOrganization organization, - String role, - String status) { - Assert.exists(organization, SciOrganization.class); - - DataObject link = add(ORGANIZATIONS, organization); - - link.set(SciMemberSciOrganizationsCollection.MEMBER_ROLE, role); - link.set(SciMemberSciOrganizationsCollection.STATUS, status); - link.save(); - } - - public void removeOrganization(SciOrganization organization) { - Assert.exists(organization, SciOrganization.class); - - remove(ORGANIZATIONS, organization); - } - - public SciMemberSciDepartmentsCollection getDepartments() { - return new SciMemberSciDepartmentsCollection((DataCollection) get(DEPARTMENTS)); - } - - public void addDepartment(SciDepartment department, - String role, - String status) { - Assert.exists(department, SciDepartment.class); - - DataObject link = add(DEPARTMENTS, department); - - link.set(SciMemberSciDepartmentsCollection.MEMBER_ROLE, role); - link.set(SciMemberSciDepartmentsCollection.STATUS, status); - link.save(); - } - - public void removeDepartment(SciDepartment department) { - Assert.exists(department, SciDepartment.class); - - remove(DEPARTMENTS, department); - } - - public SciMemberSciProjectsCollection getProjects() { - return new SciMemberSciProjectsCollection((DataCollection) get(PROJECTS)); - } - - public void addProject(SciProject project, - String role, - String status) { - Assert.exists(project, SciProject.class); - - DataObject link = add(PROJECTS, project); - - link.set(SciMemberSciDepartmentsCollection.MEMBER_ROLE, role); - link.set(SciMemberSciDepartmentsCollection.STATUS, status); - link.save(); - } - - public void removeProject(SciProject project) { - Assert.exists(project, SciProject.class); - - remove(PROJECTS, project); - } - - public static SciOrganizationConfig getConfig() { - return s_config; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberInitializer.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberInitializer.java deleted file mode 100644 index ad25ccabd..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberInitializer.java +++ /dev/null @@ -1,45 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -/** - * Initializer for {@link SciMember} - * - * @author Jens Pelzetter - */ -public class SciMemberInitializer extends ContentTypeInitializer { - - public SciMemberInitializer() { - super("empty.pdl.mf", SciMember.BASE_DATA_OBJECT_TYPE); - } - - @Override - public String[] getStylesheets() { - return new String[]{ - "/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl" - }; - } - - @Override - public String getTraversalXML() { - return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciMember.xml"; - - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java deleted file mode 100644 index 0749a92c3..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberLoader.java +++ /dev/null @@ -1,35 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -/** - * Loader for {@link SciMember} - * - * @author Jens Pelzetter - */ -public class SciMemberLoader extends AbstractContentTypeLoader { - - private static final String[] TYPES = { - "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciMember.xml"}; - - @Override - public String[] getTypes() { - return TYPES; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciDepartmentsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciDepartmentsCollection.java deleted file mode 100644 index 87d0f566e..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciDepartmentsCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentType; -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; - -/** - * - * @author Jens Pelzetter - * @version $Id$ - */ -public class SciMemberSciDepartmentsCollection extends DomainCollection { - - public static final String LINK_MEMBER_ROLE = "link.role_name"; - public static final String LINK_STATUS = "link.status"; - public static final String MEMBER_ROLE = "role_name"; - public static final String STATUS = "status"; - - public SciMemberSciDepartmentsCollection(DataCollection dataCollection) { - super(dataCollection); - - m_dataCollection.addFilter(String.format("type = '%s'", - ContentType. - findByAssociatedObjectType(SciDepartment.class.getName()).getID(). - toString())); - - m_dataCollection.addOrder("title"); - } - - public String getRoleName() { - return (String) m_dataCollection.get(LINK_MEMBER_ROLE); - } - - public void setRoleName(String roleName) { - DataObject link = (DataObject) this.get("link"); - - link.set(MEMBER_ROLE, roleName); - } - - public String getStatus() { - return (String) m_dataCollection.get(LINK_STATUS); - } - - public void setStatus(String status) { - DataObject link = (DataObject) this.get("link"); - - link.set(STATUS, status); - } - - public SciDepartment getDepartment() { - return (SciDepartment) DomainObjectFactory.newInstance(m_dataCollection. - getDataObject()); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciOrganizationsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciOrganizationsCollection.java deleted file mode 100644 index bdace84a8..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciOrganizationsCollection.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentType; -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; - -/** - * - * @author Jens Pelzetter - * @version $Id$ - */ -public class SciMemberSciOrganizationsCollection extends DomainCollection { - - public static final String LINK_MEMBER_ROLE = "link.role_name"; - public static final String LINK_STATUS = "link.status"; - public static final String MEMBER_ROLE = "role_name"; - public static final String STATUS = "status"; - - public SciMemberSciOrganizationsCollection(DataCollection dataCollection) { - super(dataCollection); - - m_dataCollection.addFilter(String.format("type = '%s'", - ContentType. - findByAssociatedObjectType(SciOrganization.class.getName()). - getID().toString())); - - m_dataCollection.addOrder("title"); - } - - public String getRoleName() { - return (String) m_dataCollection.get(LINK_MEMBER_ROLE); - } - - public void setRoleName(String roleName) { - DataObject link = (DataObject) this.get("link"); - - link.set(MEMBER_ROLE, roleName); - } - - public String getStatus() { - return (String) m_dataCollection.get(LINK_STATUS); - } - - public void setStatus(String status) { - DataObject link = (DataObject) this.get("link"); - - link.set(STATUS, status); - } - - public SciOrganization getOrganization() { - return (SciOrganization) DomainObjectFactory.newInstance(m_dataCollection. - getDataObject()); - } - - -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciProjectsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciProjectsCollection.java deleted file mode 100644 index 36aab5820..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciMemberSciProjectsCollection.java +++ /dev/null @@ -1,75 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentType; -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; - -/** - * - * @author Jens Pelzetter - * @version $Id$ - */ -public class SciMemberSciProjectsCollection extends DomainCollection { - - public static final String LINK_MEMBER_ROLE = "link.role_name"; - public static final String LINK_STATUS = "link.status"; - public static final String MEMBER_ROLE = "role_name"; - public static final String STATUS = "status"; - - public SciMemberSciProjectsCollection(DataCollection dataCollection) { - super(dataCollection); - - m_dataCollection.addFilter(String.format("type = '%s'", - ContentType. - findByAssociatedObjectType(SciProject.class.getName()).getID(). - toString())); - - m_dataCollection.addOrder("title"); - } - - public String getRoleName() { - return (String) m_dataCollection.get(LINK_MEMBER_ROLE); - } - - public void setRoleName(String roleName) { - DataObject link = (DataObject) this.get("link"); - - link.set(MEMBER_ROLE, roleName); - } - - public String getStatus() { - return (String) m_dataCollection.get(LINK_STATUS); - } - - public void setStatus(String status) { - DataObject link = (DataObject) this.get("link"); - - link.set(STATUS, status); - } - - public SciProject getProject() { - return (SciProject) DomainObjectFactory.newInstance(m_dataCollection. - getDataObject()); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganization.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganization.java deleted file mode 100644 index 02f2b6d54..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganization.java +++ /dev/null @@ -1,524 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.DataQuery; -import com.arsdigita.persistence.OID; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.util.Assert; -import java.math.BigDecimal; -import java.util.Calendar; -import java.util.GregorianCalendar; -import org.apache.log4j.Logger; - -/** - *

- * A class for representing departments of an organization. Adds two - * associations to {@link GenericOrganizationalUnit}: - *

- *
    - *
  • departments
  • - *
  • projects
  • - *
- *

- * The departments association is used to link an organization with - * its departments. The project association can be used to link an - * organization with projects. - *

- *

- * Also, two fields are added. The shortDescription takes a string - * of 500 characters for a short description of the organization. An detailed - * description of the organization can be put into the description - * field. - *

- *

- * There is an - * UML digram - * with an overview of the content types and their associations. Please not that - * the diagram show a design sketch and not the actually implemented classes. - *

- * - * @author Jens Pelzetter - * @see GenericOrganizationalUnit - * @see SciDepartment - * @see SciProject - */ -public class SciOrganization extends GenericOrganizationalUnit { - - private static final Logger logger = Logger.getLogger(SciOrganization.class); - public static final String ORGANIZATION_SHORT_DESCRIPTION = - "organizationShortDescription"; - public static final String ORGANIZATION_DESCRIPTION = - "organizationDescription"; - public static final String DEPARTMENTS = "departments"; - public static final String DEPARTMENT_ORDER = "departmentOrder"; - public static final String PROJECTS = "projects"; - public static final String PROJECT_ORDER = "projectOrder"; - public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.contenttypes.SciOrganization"; - private static final SciOrganizationConfig s_config = - new SciOrganizationConfig(); - - static { - logger.debug("Static initalizer starting..."); - s_config.load(); - logger.debug("Static initalizer finished."); - } - - public enum MemberStatus { - - ALL, - ACTIVE, - ASSOCIATED, - FORMER - } - - public enum ProjectStatus { - - ALL, - ONGOING, - FINISHED - } - - public SciOrganization() { - this(BASE_DATA_OBJECT_TYPE); - } - - public SciOrganization(BigDecimal id) throws DataObjectNotFoundException { - this(new OID(BASE_DATA_OBJECT_TYPE, id)); - } - - public SciOrganization(OID oid) throws DataObjectNotFoundException { - super(oid); - } - - public SciOrganization(DataObject obj) { - super(obj); - } - - public SciOrganization(String type) { - super(type); - } - - public static SciOrganizationConfig getConfig() { - return s_config; - } - - public String getOrganizationShortDescription() { - return (String) get(ORGANIZATION_SHORT_DESCRIPTION); - } - - public void setOrganizationShortDescription(String description) { - set(ORGANIZATION_SHORT_DESCRIPTION, description); - } - - public String getOrganizationDescription() { - return (String) get(ORGANIZATION_DESCRIPTION); - } - - @Override - public boolean hasContacts() { - boolean result = false; - - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfContactsOfSciOrganization"); - query.setParameter("organization", getID()); - - if (query.size() > 0) { - result = true; - } else { - result = false; - } - - query.close(); - - return result; - } - - public boolean hasDepartments() { - boolean result = false; - - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfDepartmentsOfSciOrganization"); - query.setParameter("organization", getID()); - - if (query.size() > 0) { - result = true; - } else { - result = false; - } - - query.close(); - - return result; - } - - /** - * - * @param merge Should I also look into the departments and return true - * if the organization or at least one of the departments has members? - * @param status - * @return - */ - public boolean hasMembers(final boolean merge, final MemberStatus status) { - String queryName; - - switch (status) { - case ALL: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfMembersOfSciOrganization"; - break; - case ACTIVE: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfActiveMembersOfSciOrganization"; - break; - case ASSOCIATED: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfAssociatedMembersOfSciOrganization"; - break; - case FORMER: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfFormerMembersOfSciOrganization"; - break; - default: - queryName = ""; - break; - } - - DataQuery query = SessionManager.getSession().retrieveQuery(queryName); - query.setParameter("organization", getID()); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery departmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfDepartmentsOfSciOrganization"); - departmentsQuery.setParameter("organization", getID()); - - if (departmentsQuery.size() > 0) { - BigDecimal departmentId; - boolean result = false; - while (departmentsQuery.next()) { - departmentId = (BigDecimal) departmentsQuery.get( - "departmentId"); - result = hasMembers(departmentId, merge, status); - - if (result) { - break; - } - } - - departmentsQuery.close(); - return result; - } else { - departmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - private boolean hasMembers(final BigDecimal departmentId, - final boolean merge, - final MemberStatus status) { - String queryName; - - switch (status) { - case ALL: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfMembersOfSciDepartment"; - break; - case ACTIVE: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfActiveMembersOfSciDepartment"; - break; - case ASSOCIATED: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfAssociatedMembersOfSciDepartment"; - break; - case FORMER: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfFormerMembersOfSciDepartment"; - break; - default: - queryName = ""; - break; - } - - DataQuery query = SessionManager.getSession().retrieveQuery(queryName); - query.setParameter("department", departmentId); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subDepartmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - subDepartmentsQuery.setParameter("department", departmentId); - - if (query.size() > 0) { - BigDecimal subDepartmentId; - boolean result = false; - while (subDepartmentsQuery.next()) { - subDepartmentId = (BigDecimal) subDepartmentsQuery.get( - "subDepartmentId"); - result = hasMembers(subDepartmentId, merge, status); - - if (result) { - break; - } - } - - subDepartmentsQuery.close(); - return result; - } else { - subDepartmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - public boolean hasProjects(final boolean merge, - final ProjectStatus status) { - String queryName; - - switch (status) { - case ALL: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfProjectsOfSciOrganization"; - break; - case ONGOING: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfOngoingProjectsOfSciOrganization"; - break; - case FINISHED: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfFinishedProjectsOfSciOrganization"; - break; - default: - queryName = ""; - break; - } - - DataQuery query = SessionManager.getSession().retrieveQuery(queryName); - query.setParameter("organization", getID()); - if (status != ProjectStatus.ALL) { - Calendar today = new GregorianCalendar(); - query.setParameter("today", - String.format("%d-%02d-%02d", - today.get(Calendar.YEAR), - today.get(Calendar.MONTH) + 1, - today.get(Calendar.DAY_OF_MONTH))); - } - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery departmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfDepartmentsOfSciOrganization"); - departmentsQuery.setParameter("organization", getID()); - - if (departmentsQuery.size() > 0) { - BigDecimal departmentId; - boolean result = false; - while (departmentsQuery.next()) { - departmentId = (BigDecimal) departmentsQuery.get( - "departmentId"); - result = hasProjects(departmentId, merge, status); - - if (result) { - break; - } - } - - departmentsQuery.close(); - return result; - } else { - departmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - private boolean hasProjects(final BigDecimal departmentId, - final boolean merge, - final ProjectStatus status) { - String queryName; - - switch (status) { - case ALL: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfProjectsOfSciDepartment"; - break; - case ONGOING: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfOngoingProjectsOfSciDepartment"; - break; - case FINISHED: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfFinishedProjectsOfSciDepartment"; - break; - default: - queryName = ""; - break; - } - - DataQuery query = SessionManager.getSession().retrieveQuery(queryName); - query.setParameter("department", departmentId); - if (status != ProjectStatus.ALL) { - Calendar today = new GregorianCalendar(); - query.setParameter("today", - String.format("%d-%02d-%02d", - today.get(Calendar.YEAR), - today.get(Calendar.MONTH) + 1, - today.get(Calendar.DAY_OF_MONTH))); - - } - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subDepartmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - subDepartmentsQuery.setParameter("department", departmentId); - - if (subDepartmentsQuery.size() > 0) { - BigDecimal subDepartmentId; - boolean result = false; - while (subDepartmentsQuery.next()) { - subDepartmentId = (BigDecimal) subDepartmentsQuery.get( - "subDepartmentId"); - result = hasProjects(subDepartmentId, merge, status); - - if (result) { - break; - } - } - - subDepartmentsQuery.close(); - return result; - } else { - subDepartmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - /*public boolean hasPublications() { - boolean result = false; - - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfPublicationLinksOfSciOrganization"); - query.setParameter("organization", getID()); - - if (query.size() > 0) { - result = true; - } else { - result = false; - } - - query.close(); - - return result; - }*/ - - public void setOrganizationDescription(String description) { - set(ORGANIZATION_DESCRIPTION, description); - } - - public SciOrganizationDepartmentsCollection getDepartments() { - return new SciOrganizationDepartmentsCollection( - (DataCollection) get(DEPARTMENTS)); - } - - public void addDepartment(SciDepartment department) { - Assert.exists(department, SciDepartment.class); - - DataObject link = add(DEPARTMENTS, department); - - link.set(DEPARTMENT_ORDER, - Integer.valueOf((int) getDepartments().size())); - link.save(); - } - - public void removeDepartment(SciDepartment department) { - Assert.exists(department, SciDepartment.class); - - remove(DEPARTMENTS, department); - } - - public SciOrganizationProjectsCollection getProjects() { - return new SciOrganizationProjectsCollection( - (DataCollection) get(PROJECTS)); - } - - public void addProject(SciProject project) { - Assert.exists(project, SciProject.class); - - DataObject link = add(PROJECTS, project); - link.set(PROJECT_ORDER, Integer.valueOf((int) getProjects().size())); - link.set(SciProject.ORGANIZATIONS_ORDER, Integer.valueOf((int) project. - getOrganizations().size())); - link.save(); - } - - public void removeProject(SciProject project) { - Assert.exists(project, SciProject.class); - - remove(PROJECTS, project); - } - -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig.java deleted file mode 100644 index 110b93027..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig.java +++ /dev/null @@ -1,329 +0,0 @@ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.runtime.AbstractConfig; -import com.arsdigita.util.parameter.BooleanParameter; -import com.arsdigita.util.parameter.Parameter; - -/** - * Configuration class for the complete ccm-sci-types-organization-module. - * - * @author Jens Pelzetter - */ -public class SciOrganizationConfig extends AbstractConfig { - - private final Parameter m_organizationAddPersonHide; - private final Parameter m_organizationAddDepartmentHide; - private final Parameter m_organizationAddProjectHide; - private final Parameter m_organizationAddContactHide; - private final Parameter m_organizationMembersAllInOne; - private final Parameter m_organizationMembersMerge; - private final Parameter m_organizationProjectsAllInOne; - private final Parameter m_organizationProjectsMerge; - private final Parameter m_departmentAddPersonHide; - private final Parameter m_departmentAddSubDepartmentHide; - private final Parameter m_departmentAddProjectHide; - private final Parameter m_departmentSetOrganizationHide; - private final Parameter m_departmentSetSuperDepartmentHide; - private final Parameter m_departmentAddContactHide; - private final Parameter m_departmentPublicationsHide; - private final Parameter m_projectAddPersonHide; - private final Parameter m_projectAddOrganizationHide; - private final Parameter m_projectAddDepartmentHide; - private final Parameter m_projectAddSubProjectHide; - private final Parameter m_projectSetSuperProjectHide; - private final Parameter m_projectAddContactHide; - private final Parameter m_organizationDescriptionDhtml; - private final Parameter m_departmentDescriptionDhtml; - private final Parameter m_projectDescriptionDhtml; - private final Parameter m_projectFundingHide; - private final Parameter m_projectFundingDhtml; - private final Parameter m_projectFundingVolumeHide; - private final Parameter m_projectMaterialsHide; - private final Parameter m_projectMembersAllInOne; - private final Parameter m_projectMembersMerge; - - public SciOrganizationConfig() { - - m_organizationAddPersonHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.add_person_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_organizationAddDepartmentHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.add_department_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_organizationAddProjectHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.add_project_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_organizationAddContactHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.add_contact_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_organizationMembersAllInOne = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.members_all_in_one", - Parameter.REQUIRED, - Boolean.FALSE); - m_organizationMembersMerge = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.members_merge", - Parameter.REQUIRED, - Boolean.TRUE); - m_organizationProjectsAllInOne = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.projects_all_in_one", - Parameter.REQUIRED, - Boolean.FALSE); - m_organizationProjectsMerge = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.projects_merge", - Parameter.REQUIRED, - Boolean.TRUE); - m_departmentAddPersonHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.scidepartment.add_person_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_departmentAddSubDepartmentHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.scidepartment.add_subdepartment_hide", - Parameter.REQUIRED, - Boolean.TRUE); - m_departmentAddProjectHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.scidepartment.add_project_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_departmentSetOrganizationHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.scidepartment.organization_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_departmentSetSuperDepartmentHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.scidepartment.set_superdepartment_hide", - Parameter.REQUIRED, - Boolean.TRUE); - m_departmentAddContactHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.scidepartment.add_contact_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_departmentPublicationsHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.scidepartment.publications_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_projectAddPersonHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciproject.add_person_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_projectAddOrganizationHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciproject.add_organization_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_projectAddDepartmentHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciproject.add_department_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_projectAddSubProjectHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciproject.add_subproject_hide", - Parameter.REQUIRED, - Boolean.TRUE); - m_projectSetSuperProjectHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciproject.set_superproject_hide", - Parameter.REQUIRED, - Boolean.TRUE); - m_projectAddContactHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.add_project_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_organizationDescriptionDhtml = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.description_dhtml", - Parameter.REQUIRED, - Boolean.TRUE); - m_departmentDescriptionDhtml = new BooleanParameter( - "com.arsdigita.cms.contenttypes.scidepartment.description_dhtml", - Parameter.REQUIRED, - Boolean.TRUE); - m_projectDescriptionDhtml = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciproject.description_dhtml", - Parameter.REQUIRED, - Boolean.TRUE); - - m_projectFundingHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciproject.funding_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_projectFundingDhtml = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciproject.funding_dhtml", - Parameter.REQUIRED, - Boolean.FALSE); - m_projectFundingVolumeHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciproject.funding_volume_hide", - Parameter.REQUIRED, - Boolean.FALSE); - m_projectMaterialsHide = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciproject.materials_hide", - Parameter.REQUIRED, - Boolean.FALSE); - - m_projectMembersAllInOne = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciproject.members_all_in_one", - Parameter.REQUIRED, - Boolean.TRUE); - m_projectMembersMerge = new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciproject.members_merge", - Parameter.REQUIRED, - Boolean.FALSE); - - register(m_organizationAddPersonHide); - register(m_organizationAddDepartmentHide); - register(m_organizationAddProjectHide); - register(m_organizationMembersAllInOne); - register(m_organizationMembersMerge); - register(m_organizationProjectsAllInOne); - register(m_organizationProjectsMerge); - - register(m_departmentAddPersonHide); - register(m_departmentAddSubDepartmentHide); - register(m_departmentAddProjectHide); - register(m_departmentSetOrganizationHide); - register(m_departmentSetSuperDepartmentHide); - register(m_departmentPublicationsHide); - - register(m_projectAddPersonHide); - register(m_projectAddOrganizationHide); - register(m_projectAddDepartmentHide); - register(m_projectAddSubProjectHide); - register(m_projectSetSuperProjectHide); - - register(m_organizationDescriptionDhtml); - register(m_departmentDescriptionDhtml); - register(m_projectDescriptionDhtml); - - register(m_organizationAddContactHide); - register(m_departmentAddContactHide); - register(m_projectAddContactHide); - - register(m_projectFundingHide); - register(m_projectFundingVolumeHide); - register(m_projectFundingDhtml); - register(m_projectMaterialsHide); - - register(m_projectMembersAllInOne); - register(m_projectMembersMerge); - - loadInfo(); - } - - public final boolean getOrganizationAddPersonHide() { - return (Boolean) get(m_organizationAddPersonHide); - } - - public final boolean getOrganizationAddDepartmentHide() { - return (Boolean) get(m_organizationAddDepartmentHide); - } - - public final boolean getOrganizationAddProjectHide() { - return (Boolean) get(m_organizationAddProjectHide); - } - - public final boolean getOrganizationAddContactHide() { - return (Boolean) get(m_organizationAddContactHide); - } - - public final boolean getOrganizationMembersAllInOne() { - return (Boolean) get(m_organizationMembersAllInOne); - } - - public final boolean getOrganizationMembersMerge() { - return (Boolean) get(m_organizationMembersMerge); - } - - public final boolean getOrganizationProjectsAllInOne() { - return (Boolean) get(m_organizationProjectsAllInOne); - } - - public final boolean getOrganizationProjectsMerge() { - return (Boolean) get(m_organizationProjectsMerge); - } - - public final boolean getDepartmentAddPersonHide() { - return (Boolean) get(m_departmentAddPersonHide); - } - - public final boolean getDepartmentAddSubDepartmentHide() { - return (Boolean) get(m_departmentAddSubDepartmentHide); - } - - public final boolean getDepartmentAddProjectHide() { - return (Boolean) get(m_departmentAddProjectHide); - } - - public final boolean getDepartmentSetOrganizationHide() { - return (Boolean) get(m_departmentSetOrganizationHide); - } - - public final boolean getDepartmentSetSuperDepartmentHide() { - return (Boolean) get(m_departmentSetSuperDepartmentHide); - } - - public final boolean getDepartmentAddContactHide() { - return (Boolean) get(m_departmentAddContactHide); - } - - public final boolean getDepartmentPublicationsHide() { - return (Boolean) get(m_departmentPublicationsHide); - } - - public final boolean getProjectAddPersonHide() { - return (Boolean) get(m_projectAddPersonHide); - } - - public final boolean getProjectAddOrganizationHide() { - return (Boolean) get(m_projectAddOrganizationHide); - } - - public final boolean getProjectAddDepartmentHide() { - return (Boolean) get(m_projectAddDepartmentHide); - } - - public final boolean getProjectAddSubProjectHide() { - return (Boolean) get(m_projectAddSubProjectHide); - } - - public final boolean getProjectSetSuperProjectHide() { - return (Boolean) get(m_projectSetSuperProjectHide); - } - - public final boolean getProjectAddContactHide() { - return (Boolean) get(m_projectAddContactHide); - } - - public final boolean getOrganizationDescriptionDhtml() { - return (Boolean) get(m_organizationDescriptionDhtml); - } - - public final boolean getDepartmentDescriptionDhtml() { - return (Boolean) get(m_departmentDescriptionDhtml); - } - - public final boolean getProjectDescriptionDhtml() { - return (Boolean) get(m_projectDescriptionDhtml); - } - - public final boolean getProjectFundingHide() { - return (Boolean) get(m_projectFundingHide); - } - - public final boolean getProjectFundingDhtml() { - return (Boolean) get(m_projectFundingDhtml); - } - - public final boolean getProjectFundingVolumeHide() { - return (Boolean) get(m_projectFundingVolumeHide); - } - - public final boolean getProjectMaterialsHide() { - return (Boolean) get(m_projectMaterialsHide); - } - - public final boolean getProjectMembersAllInOne() { - return (Boolean) get(m_projectMembersAllInOne); - } - - public final boolean getProjectMembersMerge() { - return (Boolean) get(m_projectMembersMerge); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig_parameter.properties b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig_parameter.properties deleted file mode 100644 index 257f09b04..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationConfig_parameter.properties +++ /dev/null @@ -1,144 +0,0 @@ -com.arsdigita.cms.contenttypes.sciorganization.add_person_hide.title = Hide the persons add step of SciOrganization -com.arsdigita.cms.contenttypes.sciorganization.add_person_hide.purpose = Hide the persons add step of SciOrganization -com.arsdigita.cms.contenttypes.sciorganization.add_person_hide.example = false -com.arsdigita.cms.contenttypes.sciorganization.add_person_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciorganization.add_department_hide.title = Hide the department add step of SciOrganization -com.arsdigita.cms.contenttypes.sciorganization.add_department_hide.purpose = Hide the department add step of SciOrganization -com.arsdigita.cms.contenttypes.sciorganization.add_department_hide.example = false -com.arsdigita.cms.contenttypes.sciorganization.add_department_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciorganization.add_project_hide.title = Hide the project add step of SciOrganization -com.arsdigita.cms.contenttypes.sciorganization.add_project_hide.purpose = Hide the project add step of SciOrganization -com.arsdigita.cms.contenttypes.sciorganization.add_project_hide.example = false -com.arsdigita.cms.contenttypes.sciorganization.add_project_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciorganization.add_contact_hide.title = Hide the contact add step of SciOrganization -com.arsdigita.cms.contenttypes.sciorganization.add_contact_hide.purpose = Hide the contact add step of SciOrganization -com.arsdigita.cms.contenttypes.sciorganization.add_contact_hide.example = false -com.arsdigita.cms.contenttypes.sciorganization.add_contact_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciorganization.members_all_in_one.title = Members All-in-one -com.arsdigita.cms.contenttypes.sciorganization.members_all_in_one.purpose = Show all members (active, associated and former) in one instead in three seprated lists -com.arsdigita.cms.contenttypes.sciorganization.members_all_in_one.example = false -com.arsdigita.cms.contenttypes.sciorganization.members_all_in_one.format = [boolean] - -com.arsdigita.cms.contenttypes.sciorganization.members_merge.title = Merge members -com.arsdigita.cms.contenttypes.sciorganization.members_merge.purpose = Merge members from all departments and the organization into one list (or three list, for each status) -com.arsdigita.cms.contenttypes.sciorganization.members_merge.example = true -com.arsdigita.cms.contenttypes.sciorganization.members_merge.format = [boolean] - -com.arsdigita.cms.contenttypes.sciorganization.projects_all_in_one.title = Project All-in-one -com.arsdigita.cms.contenttypes.sciorganization.projects_all_in_one.purpose = Show all projects (ongoing and finished) in one instead of two seperated lists. -com.arsdigita.cms.contenttypes.sciorganization.projects_all_in_one.example = false -com.arsdigita.cms.contenttypes.sciorganization.projects_all_in_one.format = [boolean] - -com.arsdigita.cms.contenttypes.sciorganization.projects_merge.title = Merge projects -com.arsdigita.cms.contenttypes.sciorganization.projects_merge.purpose = Merge all projects from the organization and its departments into one list (or two list for ongoing and finished projects) -com.arsdigita.cms.contenttypes.sciorganization.projects_merge.examle = true -com.arsdigita.cms.contenttypes.sciorganization.projects_merge.format = [boolean] - -com.arsdigita.cms.contenttypes.scidepartment.add_person_hide.title = Hide the person add step of SciDepartment -com.arsdigita.cms.contenttypes.scidepartment.add_person_hide.purpose = Hide the person add step of SciDepartment -com.arsdigita.cms.contenttypes.scidepartment.add_person_hide.example = false -com.arsdigita.cms.contenttypes.scidepartment.add_person_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.scidepartment.add_subdepartment_hide.title = Hide the subdepartment add step of SciDepartment -com.arsdigita.cms.contenttypes.scidepartment.add_subdepartment_hide.purpose = Hide the subdepartment add step of SciDepartment -com.arsdigita.cms.contenttypes.scidepartment.add_subdepartment_hide.example = true -com.arsdigita.cms.contenttypes.scidepartment.add_subdepartment_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.scidepartment.set_organization_hide.title = Hide the organization set step of SciDepartment -com.arsdigita.cms.contenttypes.scidepartment.set_organization_hide.purpose = Hide the organization set step of SciDepartment -com.arsdigita.cms.contenttypes.scidepartment.set_organization_hide.example = false -com.arsdigita.cms.contenttypes.scidepartment.set_organization_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.scidepartment.set_superdepartment_hide.title = Hide the superdepartment set step of SciDepartment -com.arsdigita.cms.contenttypes.scidepartment.set_superdepartment_hide.purpose = Hide the superdepartment set step of SciDepartment -com.arsdigita.cms.contenttypes.scidepartment.set_superdepartment_hide.example = false -com.arsdigita.cms.contenttypes.scidepartment.set_superdepartment_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.scidepartment.add_contact_hide.title = Hide the contact add step of Scidepartment -com.arsdigita.cms.contenttypes.scidepartment.add_contact_hide.purpose = Hide the contact add step of Scidepartment -com.arsdigita.cms.contenttypes.scidepartment.add_contact_hide.example = false -com.arsdigita.cms.contenttypes.scidepartment.add_contact_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciproject.add_person_hide.title = Hide the person add step of SciProject -com.arsdigita.cms.contenttypes.sciproject.add_person_hide.purpose = Hide the person add step of SciProject -com.arsdigita.cms.contenttypes.sciproject.add_person_hide.example = false -com.arsdigita.cms.contenttypes.sciproject.add_person_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciproject.add_organization_hide.title = Hide the organization add step of SciProject -com.arsdigita.cms.contenttypes.sciproject.add_organization_hide.purpose = Hide the organization add step of SciProject -com.arsdigita.cms.contenttypes.sciproject.add_organization_hide.example = false -com.arsdigita.cms.contenttypes.sciproject.add_organization_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciproject.add_department_hide.title = Hide the department add step of SciProject -com.arsdigita.cms.contenttypes.sciproject.add_department_hide.purpose Hide the department add step of SciProject -com.arsdigita.cms.contenttypes.sciproject.add_department_hide.example = false -com.arsdigita.cms.contenttypes.sciproject.add_department_hide = [boolean] - -com.arsdigita.cms.contenttypes.sciproject.add_subproject_hide.title = Hide the subproject add step of SciProject -com.arsdigita.cms.contenttypes.sciproject.add_subproject_hide.purpose = Hide the subproject add step of SciProject -com.arsdigita.cms.contenttypes.sciproject.add_subproject_hide.example = true -com.arsdigita.cms.contenttypes.sciproject.add_subproject_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciproject.set_superproject_hide.title = Hide the superproject add step of SciProject -com.arsdigita.cms.contenttypes.sciproject.set_superproject_hide.purpose = Hide the superprojecft add step of SciProject -com.arsdigita.cms.contenttypes.sciproject.set_superproject_hide.example = true -com.arsdigita.cms.contenttypes.sciproject.set_superproject_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciorganization.description_dhtml.title = Toggles the DHTML for the description of SciOrganization -com.arsdigita.cms.contenttypes.sciorganization.description_dhtml.purpose = Toggles the DHTML for the description of SciOrganization -com.arsdigita.cms.contenttypes.sciorganization.description_dhtml.example = true -com.arsdigita.cms.contenttypes.sciorganization.description_dhtml.format = [boolean] - -com.arsdigita.cms.contenttypes.scidepartment.description_dhtml.title = Toggles the DHTML for the description of SciDepartment -com.arsdigita.cms.contenttypes.scidepartment.description_dhtml.purpose = Toggles the DHTML for the description of SciDepartment -com.arsdigita.cms.contenttypes.scidepartment.description_dhtml.example = true -com.arsdigita.cms.contenttypes.scidepartment.description_dhtml = [boolean] - -com.arsdigita.cms.contenttypes.sciproject.description_dhtml.title = Toggles the DHTML for the description of SciProject -com.arsdigita.cms.contenttypes.sciproject.description_dhtml.purpose = Toggles the DHTML for the description of SciProject -com.arsdigita.cms.contenttypes.sciproject.description_dhtml.example = true -com.arsdigita.cms.contenttypes.sciproject.description_dhtml.format = [boolean] - -com.arsdigita.cms.contenttypes.sciproject.add_contact_hide.title = Hide the contact add step of Sciproject -com.arsdigita.cms.contenttypes.sciproject.add_contact_hide.purpose = Hide the contact add step of Sciproject -com.arsdigita.cms.contenttypes.sciproject.add_contact_hide.example = false -com.arsdigita.cms.contenttypes.sciproject.add_contact_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciproject.funding_hide.title = Hide funding text input -com.arsdigita.cms.contenttypes.sciproject.funding_hide.purpose = Hide the funding text input -com.arsdigita.cms.contenttypes.sciproject.funding_hide.example = false -com.arsdigita.cms.contenttypes.sciproject.funding_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciproject.funding_volume_hide.title = Hide funding_volume text input -com.arsdigita.cms.contenttypes.sciproject.funding_volume_hide.purpose = Hide the funding_volume text input -com.arsdigita.cms.contenttypes.sciproject.funding_volume_hide.example = true -com.arsdigita.cms.contenttypes.sciproject.funding_volume_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciproject.funding_dhtml.title = Toggles the DHTML editor for funding -com.arsdigita.cms.contenttypes.sciproject.funding_dhtml.purpose = Toggles the DHTML editor for funding -com.arsdigita.cms.contenttypes.sciproject.funding_dhtml.example = false -com.arsdigita.cms.contenttypes.sciproject.funding_dhtml.format = [boolean] - -com.arsdigita.cms.contenttypes.sciproject.materials_hide.title = Hides the step for linking materials with a project -com.arsdigita.cms.contenttypes.sciproject.materials_hide.purpose = Hides the step for linking materials with a project -com.arsdigita.cms.contenttypes.sciproject.materials_hide.example = false -com.arsdigita.cms.contenttypes.sciproject.materials_hide.format = [boolean] - -com.arsdigita.cms.contenttypes.sciproject.members_all_in_one.title = Members All-in-one -com.arsdigita.cms.contenttypes.sciproject.members_all_in_one.purpose = Show all members (active, associated and former) in one instead in three separated lists -com.arsdigita.cms.contenttypes.sciproject.members_all_in_one.example = true -com.arsdigita.cms.contenttypes.sciproject.members_all_in_one.format = [boolean] - -com.arsdigita.cms.contenttypes.sciorganization.members_merge.title = Merge members -com.arsdigita.cms.contenttypes.sciorganization.members_merge.purpose = Merge members from all subproject into one list (or three list, for each status) -com.arsdigita.cms.contenttypes.sciorganization.members_merge.example = false -com.arsdigita.cms.contenttypes.sciorganization.members_merge.format = [boolean] - -com.arsdigita.cms.contenttypes.scidepartment.publications_hide.title = Hides the step for linking publications with a department -com.arsdigita.cms.contenttypes.scidepartment.publications_hide.purpose = Hides the step for linking publications with a department -com.arsdigita.cms.contenttypes.scidepartment.publications_hide.example = false -com.arsdigita.cms.contenttypes.scidepartment.publications_hide.format = [boolean] diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationDepartmentsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationDepartmentsCollection.java deleted file mode 100644 index fbac5a36f..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationDepartmentsCollection.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import org.apache.log4j.Logger; - -/** - * Special domain collection for the departments of an organization. - * - * @author Jens Pelzetter - * @see SciOrganization - * @see SciDepartment - */ -public class SciOrganizationDepartmentsCollection extends DomainCollection { - - public String ORDER = "departmentOrder"; - public String LINKORDER = "link.departmentOrder"; - private static final Logger s_log = - Logger.getLogger(SciOrganizationDepartmentsCollection.class); - - public SciOrganizationDepartmentsCollection(DataCollection dataCollection) { - super(dataCollection); - - m_dataCollection.addOrder(LINKORDER); - } - - public Integer getDepartmentOrder() { - return (Integer) m_dataCollection.get(LINKORDER); - } - - public void setDepartmentOrder(Integer order) { - DataObject link = (DataObject) this.get("link"); - - link.set(ORDER, order); - } - - public void swapWithNext(SciDepartment department) { - int currentPosition = 0; - int currentIndex = 0; - int nextIndex = 0; - - s_log.debug("Searching department..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getDepartmentOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getDepartmentOrder(): %d", - getDepartmentOrder())); - if (this.getDepartment().equals(department)) { - break; - } - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided department is not " - + "part of this collection.")); - } - - if (this.next()) { - nextIndex = this.getDepartmentOrder(); - } else { - throw new IllegalArgumentException( - "The provided department is the last " - + "in the collection, so there is no next object " - + "to swap with."); - } - - this.rewind(); - - while (this.getPosition() != currentPosition) { - this.next(); - } - - this.setDepartmentOrder(nextIndex); - this.next(); - this.setDepartmentOrder(currentIndex); - this.rewind(); - } - - public void swapWithPrevious(SciDepartment department) { - int previousPosition = 0; - int previousIndex = 0; - int currentPosition = 0; - int currentIndex = 0; - - s_log.debug("Searching department..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getDepartmentOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getDepartmentOrder(): %d", - getDepartmentOrder())); - if (this.getDepartment().equals(department)) { - break; - } - - previousPosition = currentPosition; - previousIndex = currentIndex; - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided department is not " - + "part of this collection.")); - } - - if (previousPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided department is the first one in this " - + "collection, so there is no previous one to switch " - + "with.")); - } - - this.rewind(); - while (this.getPosition() != previousPosition) { - this.next(); - } - - this.setDepartmentOrder(currentIndex); - this.next(); - this.setDepartmentOrder(previousIndex); - this.rewind(); - } - - public SciDepartment getDepartment() { - return new SciDepartment(m_dataCollection.getDataObject()); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationInitializer.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationInitializer.java deleted file mode 100644 index be48223c4..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationInitializer.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import org.apache.log4j.Logger; - -/** - * Initalizer for {@link SciOrganization} - * - * @author Jens Pelzetter - */ -public class SciOrganizationInitializer extends ContentTypeInitializer { - - private static final Logger s_log = Logger.getLogger( - SciOrganizationInitializer.class); - - public SciOrganizationInitializer() { - super("ccm-sci-types-organization.pdl.mf", - SciOrganization.BASE_DATA_OBJECT_TYPE); - } - - @Override - public String[] getStylesheets() { - return new String[]{ - "/static/content-types/com/arsdigita/cms/contenttypes/SciOrganization.xsl" - }; - } - - @Override - public String getTraversalXML() { - return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganization.xml"; - - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationLoader.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationLoader.java deleted file mode 100644 index f6ea5a8a7..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationLoader.java +++ /dev/null @@ -1,77 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.lifecycle.LifecycleDefinition; -import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.ResourceParameter; -import com.arsdigita.workflow.simple.WorkflowTemplate; -import java.io.InputStream; - -/** - * Loader for {@link SciOrganization} - * - * @author Jens Pelzetter - */ -public class SciOrganizationLoader extends AbstractContentTypeLoader { - - private ResourceParameter m_template; - - public SciOrganizationLoader() { - super(); - - m_template = new ResourceParameter( - "com.arsdigita.cms.contenttypes.SciOrganizationTemplate", - Parameter.REQUIRED, - "/WEB-INF/content-types/com/arsdigita/" - + "cms/contenttypes/sciorganization-item.jsp"); - - register(m_template); - - } - - private static final String[] TYPES = { - "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/" - + "SciOrganization.xml" - }; - - @Override - public String[] getTypes() { - return TYPES; - } - - @Override - protected void prepareSection(final ContentSection section, - final ContentType type, - final LifecycleDefinition lifecycle, - final WorkflowTemplate workflow) { - super.prepareSection(section, type, lifecycle, workflow); - - setDefaultTemplate("SciOrganization Item", - "sciorganization-item", - (InputStream) get(m_template), - section, - type, - lifecycle, - workflow); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationProjectsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationProjectsCollection.java deleted file mode 100644 index ea99039f6..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciOrganizationProjectsCollection.java +++ /dev/null @@ -1,157 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import org.apache.log4j.Logger; - -/** - * Special domain collection for the projects of an organization. - * - * @author Jens Pelzetter - * @see SciOrganization - * @see SciProject - */ -public class SciOrganizationProjectsCollection extends DomainCollection { - - public String ORDER = "projectOrder"; - public String LINKORDER = "link.projectOrder"; - private static final Logger s_log = - Logger.getLogger(SciOrganizationProjectsCollection.class); - - public SciOrganizationProjectsCollection(DataCollection dataCollection) { - super(dataCollection); - - m_dataCollection.addOrder(LINKORDER); - } - - public Integer getProjectOrder() { - return (Integer) m_dataCollection.get(LINKORDER); - } - - public void setProjectOrder(Integer order) { - DataObject link = (DataObject) this.get("link"); - - link.set(ORDER, order); - } - - public void swapWithNext(SciProject project) { - int currentPosition = 0; - int currentIndex = 0; - int nextIndex = 0; - - s_log.debug("Searching project..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getProjectOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getProjectOrder(): %d", - getProjectOrder())); - if (this.getProject().equals(project)) { - break; - } - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided project is not " - + "part of this collection.")); - } - - if (this.next()) { - nextIndex = this.getProjectOrder(); - } else { - throw new IllegalArgumentException( - "The provided project is the last " - + "in the collection, so there is no next object " - + "to swap with."); - } - - this.rewind(); - - while (this.getPosition() != currentPosition) { - this.next(); - } - - this.setProjectOrder(nextIndex); - this.next(); - this.setProjectOrder(currentIndex); - this.rewind(); - } - - public void swapWithPrevious(SciProject project) { - int previousPosition = 0; - int previousIndex = 0; - int currentPosition = 0; - int currentIndex = 0; - - s_log.debug("Searching project..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getProjectOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getProjectOrder(): %d", - getProjectOrder())); - if (this.getProject().equals(project)) { - break; - } - - previousPosition = currentPosition; - previousIndex = currentIndex; - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided project is not " - + "part of this collection.")); - } - - if (previousPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided project is the first one in this " - + "collection, so there is no previous one to switch " - + "with.")); - } - - this.rewind(); - while (this.getPosition() != previousPosition) { - this.next(); - } - - this.setProjectOrder(currentIndex); - this.next(); - this.setProjectOrder(previousIndex); - this.rewind(); - } - - public SciProject getProject() { - return new SciProject(m_dataCollection.getDataObject()); - } -} - diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java deleted file mode 100644 index 784f6f260..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProject.java +++ /dev/null @@ -1,496 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.DataQuery; -import com.arsdigita.persistence.OID; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.util.Assert; -import java.math.BigDecimal; -import java.util.Date; -import org.apache.log4j.Logger; - -/** - *

- * The class represents a (scientific) project. It extends - * {@link GenericOrganizationalUnit} and adds a relation for subprojects and - * some fields for additional information: - *

- *
- *
projectBegin
- *
The begin of the project
- *
projectEnd
- *
The end of the project
- *
shortDescription
- *
A short description (500 characters) of the project
- *
description
- *
A description of the project/
- *
funding
- *
A text about the funding of the project
- *
fundingVolume
- *
Volume of the funding - *
- *

- * Also, the class has some methods the access the associations defined by - * {@link SciOrganization} and {@link SciDepartment} with - * SciProject. - *

- *

- * There is an - * UML digram - * with an overview of the content types and their associations. Please not that - * the diagram show a design sketch and not the actually implemented classes. - *

- * - * @author Jens Pelzetter - * @see GenericOrganizationalUnit - * @see SciOrganization - * @see SciDepartment - */ -public class SciProject extends GenericOrganizationalUnit { - - public static final String BEGIN = "projectbegin"; - public static final String END = "projectend"; - public static final String PROJECT_SHORT_DESCRIPTION = "projectShortDesc"; - public static final String PROJECT_DESCRIPTION = "projectDescription"; - public static final String FUNDING = "funding"; - public static final String FUNDING_VOLUME = "fundingVolume"; - public static final String SUBPROJECTS = "subProjects"; - public static final String SUBPROJECT_ORDER = "subProjectOrder"; - public static final String ORGANIZATIONS = "organization"; - public static final String ORGANIZATIONS_ORDER = "organizationOrder"; - public static final String SUPER_PROJECT = "superProject"; - public static final String DEPARTMENTS = "department"; - public static final String DEPARTMENTS_ORDER = "departmentOrder"; - public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.contenttypes.SciProject"; - private static final SciOrganizationConfig s_config = - new SciOrganizationConfig(); - private static final Logger logger = Logger.getLogger(SciProject.class); - - static { - logger.debug("Static initalizer starting..."); - s_config.load(); - logger.debug("Static initalizer finished."); - } - - public enum MemberStatus { - - ALL, - ACTIVE, - ASSOCIATED, - FORMER - } - - public enum ProjectStatus { - - ALL, - ONGOING, - FINISHED - } - - public SciProject() { - super(BASE_DATA_OBJECT_TYPE); - } - - public SciProject(BigDecimal id) throws DataObjectNotFoundException { - this(new OID(BASE_DATA_OBJECT_TYPE, id)); - } - - public SciProject(OID oid) { - super(oid); - } - - public SciProject(DataObject obj) { - super(obj); - } - - public SciProject(String type) { - super(type); - } - - public static SciOrganizationConfig getConfig() { - return s_config; - } - - public Date getBegin() { - return (Date) get(BEGIN); - } - - public void setBegin(Date begin) { - set(BEGIN, begin); - } - - public Date getEnd() { - return (Date) get(END); - } - - public void setEnd(Date end) { - set(END, end); - } - - public String getProjectShortDescription() { - return (String) get(PROJECT_SHORT_DESCRIPTION); - } - - public void setProjectShortDescription(String shortDesc) { - set(PROJECT_SHORT_DESCRIPTION, shortDesc); - } - - public String getProjectDescription() { - return (String) get(PROJECT_DESCRIPTION); - } - - public void setProjectDescription(String description) { - set(PROJECT_DESCRIPTION, description); - } - - public String getFunding() { - return (String) get(FUNDING); - } - - public void setFunding(String funding) { - set(FUNDING, funding); - } - - public String getFundingVolume() { - return (String) get(FUNDING_VOLUME); - } - - public void setFundingVolume(String fundingVolume) { - set(FUNDING_VOLUME, fundingVolume); - } - - public SciProjectSubProjectsCollection getSubProjects() { - return new SciProjectSubProjectsCollection( - (DataCollection) get(SUBPROJECTS)); - } - - public void addSubProject(SciProject project) { - Assert.exists(project, SciProject.class); - - DataObject link = add(SUBPROJECTS, project); - - link.set(SUBPROJECT_ORDER, - Integer.valueOf((int) getSubProjects().size())); - link.save(); - } - - public void removeSubProject(SciProject project) { - Assert.exists(project, SciProject.class); - - logger.debug(String.format("Removing subproject %s", - project.getTitle())); - remove(SUBPROJECTS, project); - } - - public SciProjectOrganizationsCollection getOrganizations() { - return new SciProjectOrganizationsCollection((DataCollection) get( - ORGANIZATIONS)); - } - - public void addOrganization(SciOrganization orga) { - Assert.exists(orga, SciOrganization.class); - - DataObject link = add(ORGANIZATIONS, orga); - - link.set(ORGANIZATIONS_ORDER, - Integer.valueOf((int) getOrganizations().size())); - link.set(SciOrganization.PROJECT_ORDER, - Integer.valueOf((int) orga.getProjects().size())); - link.save(); - } - - public void removeOrganization(SciOrganization orga) { - Assert.exists(orga, SciOrganization.class); - - remove(ORGANIZATIONS, orga); - } - - public boolean hasOrganizations() { - return !this.getOrganizations().isEmpty(); - } - - public SciProjectDepartmentsCollection getDepartments() { - return new SciProjectDepartmentsCollection((DataCollection) get( - DEPARTMENTS)); - } - - public void addDepartment(SciDepartment department) { - Assert.exists(department, SciDepartment.class); - - DataObject link = add(DEPARTMENTS, department); - - link.set(DEPARTMENTS_ORDER, - Integer.valueOf((int) getDepartments().size())); - link.save(); - } - - public void removeDepartment(SciDepartment department) { - Assert.exists(department, SciDepartment.class); - - remove(DEPARTMENTS, department); - } - - public boolean hasDepartments() { - return !this.getDepartments().isEmpty(); - } - - public SciProject getSuperProject() { - DataCollection collection; - - collection = (DataCollection) get(SUPER_PROJECT); - - if (0 == collection.size()) { - logger.debug(String.format("Project %s has NO super project...", - getTitle())); - return null; - } else { - DataObject dobj; - - logger.debug(String.format("Project %s has a super project...", - getTitle())); - collection.next(); - dobj = collection.getDataObject(); - collection.close(); - - return new SciProject(dobj); - } - } - - public void setSuperProject(SciProject superProject) { - SciProject oldSuperProject; - - oldSuperProject = getSuperProject(); - if (oldSuperProject != null) { - logger.debug("Removing old super project..."); - remove(SUPER_PROJECT, oldSuperProject); - } - - if (superProject != null) { - Assert.exists(superProject, SciProject.class); - logger.debug("Setting new super project..."); - DataObject link = add(SUPER_PROJECT, superProject); - - link.set(SUBPROJECT_ORDER, - Integer.valueOf((int) superProject.getSubProjects().size())); - link.save(); - } - } - - @Override - public boolean hasContacts() { - boolean result = false; - - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfContactsOfSciProject"); - query.setParameter("project", getID()); - - if (query.size() > 0) { - result = true; - } else { - result = false; - } - - query.close(); - - return result; - } - - public boolean hasSubProjects() { - boolean result = false; - - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubProjectsOfSciProject"); - query.setParameter("project", getID()); - - if (query.size() > 0) { - result = true; - } else { - result = false; - } - - query.close(); - - return result; - } - - /** - * - * @param merge Should I also look into the projects and return true - * if the organization or at least one of the projects has members? - * @return - */ - public boolean hasMembers(final boolean merge, final MemberStatus status) { - String queryName; - - switch (status) { - case ALL: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfMembersOfSciProject"; - break; - case ACTIVE: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfActiveMembersOfSciProject"; - break; - case ASSOCIATED: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfAssociatedMembersOfSciProject"; - break; - case FORMER: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfFormerMembersOfSciProject"; - break; - default: - queryName = ""; - break; - } - - DataQuery query = SessionManager.getSession().retrieveQuery(queryName); - query.setParameter("project", getID()); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery projectsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubProjectsOfSciProject"); - projectsQuery.setParameter("project", getID()); - - if (query.size() > 0) { - BigDecimal projectId; - boolean result = false; - while (projectsQuery.next()) { - projectId = (BigDecimal) projectsQuery.get( - "projectId"); - result = hasMembers(projectId, merge, status); - - if (result) { - break; - } - } - - projectsQuery.close(); - return result; - } else { - projectsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - private boolean hasMembers(final BigDecimal projectId, - final boolean merge, - final MemberStatus status) { - String queryName; - - switch (status) { - case ALL: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfMembersOfSciProject"; - break; - case ACTIVE: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfActiveMembersOfSciProject"; - break; - case ASSOCIATED: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfAssociatedMembersOfProject"; - break; - case FORMER: - queryName = - "com.arsdigita.cms.contenttypes.getIdsOfFormerMembersOfSciProject"; - break; - default: - queryName = ""; - break; - } - - DataQuery query = SessionManager.getSession().retrieveQuery(queryName); - query.setParameter("project", projectId); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subProjectsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubProjectsOfSciProject"); - subProjectsQuery.setParameter("project", projectId); - - if (query.size() > 0) { - BigDecimal subprojectId; - boolean result = false; - while (subProjectsQuery.next()) { - subprojectId = (BigDecimal) subProjectsQuery.get( - "projectId"); - result = hasMembers(subprojectId, merge, status); - - if (result) { - break; - } - } - - subProjectsQuery.close(); - return result; - } else { - subProjectsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - /*public boolean hasPublications() { - boolean result = false; - - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfPublicationLinksOfSciProject"); - query.setParameter("project", getID()); - - if (query.size() > 0) { - result = true; - } else { - result = false; - } - - query.close(); - - return result; - }*/ -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectDepartmentsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectDepartmentsCollection.java deleted file mode 100644 index d681845d4..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectDepartmentsCollection.java +++ /dev/null @@ -1,154 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import org.apache.log4j.Logger; - -/** - * Special domain collection for the departments involved in a project. - * - * @author Jens Pelzetter - */ -public class SciProjectDepartmentsCollection extends DomainCollection { - - public String ORDER = "departmentOrder"; - public String LINKORDER = "link.departmentOrder"; - public static final Logger s_log = Logger.getLogger( - SciProjectDepartmentsCollection.class); - - public SciProjectDepartmentsCollection(DataCollection dataCollection) { - super(dataCollection); - - m_dataCollection.addOrder(LINKORDER); - } - - public Integer getDepartmentOrder() { - return (Integer) m_dataCollection.get(LINKORDER); - } - - public void setDepartmentOrder(Integer order) { - DataObject link = (DataObject) this.get("link"); - - link.set(ORDER, order); - } - - public void swapWithNext(SciDepartment department) { - int currentPosition = 0; - int currentIndex = 0; - int nextIndex = 0; - - s_log.debug("Searching department..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getDepartmentOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getDepartmentOrder(): %d", - getDepartmentOrder())); - if (this.getDepartment().equals(department)) { - break; - } - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided subproject is not " - + "part of this collection.")); - } - - if (this.next()) { - nextIndex = this.getDepartmentOrder(); - } else { - throw new IllegalArgumentException( - "The provided subproject is the last " - + "in the collection, so there is no next object " - + "to swap with."); - } - - this.rewind(); - - while (this.getPosition() != currentPosition) { - this.next(); - } - - this.setDepartmentOrder(nextIndex); - this.next(); - this.setDepartmentOrder(currentIndex); - this.rewind(); - } - - public void swapWithPrevious(SciDepartment department) { - int previousPosition = 0; - int previousIndex = 0; - int currentPosition = 0; - int currentIndex = 0; - - s_log.debug("Searching organization..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getDepartmentOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getDepartmentOrder(): %d", - getDepartmentOrder())); - if (this.getDepartment().equals(department)) { - break; - } - - previousPosition = currentPosition; - previousIndex = currentIndex; - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided organization is not " - + "part of this collection.")); - } - - if (previousPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided organization is the first one in this " - + "collection, so there is no previous one to switch " - + "with.")); - } - - this.rewind(); - while (this.getPosition() != previousPosition) { - this.next(); - } - - this.setDepartmentOrder(currentIndex); - this.next(); - this.setDepartmentOrder(previousIndex); - this.rewind(); - } - - public SciDepartment getDepartment() { - return new SciDepartment(m_dataCollection.getDataObject()); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectInitializer.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectInitializer.java deleted file mode 100644 index 55bd79f81..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectInitializer.java +++ /dev/null @@ -1,49 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import org.apache.log4j.Logger; - -/** - * Initializer for {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectInitializer extends ContentTypeInitializer { - - private static final Logger s_log = Logger.getLogger( - SciProjectInitializer.class); - - public SciProjectInitializer() { - super("empty.pdl.mf", SciProject.BASE_DATA_OBJECT_TYPE); - } - - @Override - public String[] getStylesheets() { - return new String[]{ - "/static/content-types/com/arsdigita/cms/contenttypes/SciProject.xsl" - }; - } - - @Override - public String getTraversalXML() { - return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciProject.xml"; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectListXmlGenerator.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectListXmlGenerator.java deleted file mode 100644 index d24a36b14..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectListXmlGenerator.java +++ /dev/null @@ -1,12 +0,0 @@ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.dispatcher.SimpleXMLGenerator; - -/** - * - * @author Jens Pelzetter - * @version $Id$ - */ -public class SciProjectListXmlGenerator extends SimpleXMLGenerator { - -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectLoader.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectLoader.java deleted file mode 100644 index 7f9339dc8..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectLoader.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.lifecycle.LifecycleDefinition; -import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.ResourceParameter; -import com.arsdigita.workflow.simple.WorkflowTemplate; -import java.io.InputStream; - -/** - * Loader for {@link SciProject} - * - * @author Jens Pelzetter - */ -public class SciProjectLoader extends AbstractContentTypeLoader { - - private ResourceParameter m_template; - private static final String[] TYPES = { - "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProject.xml" - }; - - public SciProjectLoader() { - super(); - - m_template = new ResourceParameter( - "com.arsdigita.cms.contenttypes.SciProjectTemplate", - Parameter.REQUIRED, - "/WEB-INF/content-types/com/arsdigita/" - + "cms/contenttypes/sciproject-item.jsp"); - - register(m_template); - } - - @Override - public String[] getTypes() { - return TYPES; - } - - @Override - protected void prepareSection(final ContentSection section, - final ContentType type, - final LifecycleDefinition lifecycle, - final WorkflowTemplate workflow) { - super.prepareSection(section, type, lifecycle, workflow); - - setDefaultTemplate("SciProject Item", - "sciproject-item", - (InputStream) get(m_template), - section, - type, - lifecycle, - workflow); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectOrganizationsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectOrganizationsCollection.java deleted file mode 100644 index f1c9509d4..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectOrganizationsCollection.java +++ /dev/null @@ -1,156 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import org.apache.log4j.Logger; - -/** - * Special domain collection for the organization involved in a project. - * - * @author Jens Pelzetter - */ -public class SciProjectOrganizationsCollection extends DomainCollection { - - public String ORDER = "organizationOrder"; - public String LINKORDER = "link.organizationOrder"; - private static final Logger s_log = - Logger.getLogger( - SciProjectSubProjectsCollection.class); - - public SciProjectOrganizationsCollection(DataCollection dataCollection) { - super(dataCollection); - - m_dataCollection.addOrder(LINKORDER); - } - - public Integer getOrganizationOrder() { - return (Integer) m_dataCollection.get(LINKORDER); - } - - public void setOrganizationOrder(Integer order) { - DataObject link = (DataObject) this.get("link"); - - link.set(ORDER, order); - } - - public void swapWithNext(SciOrganization orga) { - int currentPosition = 0; - int currentIndex = 0; - int nextIndex = 0; - - s_log.debug("Searching organization..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getOrganizationOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getOrganizationOrder(): %d", - getOrganizationOrder())); - if (this.getOrganization().equals(orga)) { - break; - } - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided subproject is not " - + "part of this collection.")); - } - - if (this.next()) { - nextIndex = this.getOrganizationOrder(); - } else { - throw new IllegalArgumentException( - "The provided subproject is the last " - + "in the collection, so there is no next object " - + "to swap with."); - } - - this.rewind(); - - while (this.getPosition() != currentPosition) { - this.next(); - } - - this.setOrganizationOrder(nextIndex); - this.next(); - this.setOrganizationOrder(currentIndex); - this.rewind(); - } - - public void swapWithPrevious(SciOrganization orga) { - int previousPosition = 0; - int previousIndex = 0; - int currentPosition = 0; - int currentIndex = 0; - - s_log.debug("Searching organization..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getOrganizationOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getOrganizationOrder(): %d", - getOrganizationOrder())); - if (this.getOrganization().equals(orga)) { - break; - } - - previousPosition = currentPosition; - previousIndex = currentIndex; - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided organization is not " - + "part of this collection.")); - } - - if (previousPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided organization is the first one in this " - + "collection, so there is no previous one to switch " - + "with.")); - } - - this.rewind(); - while (this.getPosition() != previousPosition) { - this.next(); - } - - this.setOrganizationOrder(currentIndex); - this.next(); - this.setOrganizationOrder(previousIndex); - this.rewind(); - } - - public SciOrganization getOrganization() { - return new SciOrganization(m_dataCollection.getDataObject()); - } - -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectSubProjectsCollection.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectSubProjectsCollection.java deleted file mode 100644 index 8bc8bd1d2..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciProjectSubProjectsCollection.java +++ /dev/null @@ -1,155 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import org.apache.log4j.Logger; - -/** - * Special domain collection for the suprojects of a project. - * - * @author Jens Pelzetter - */ -public class SciProjectSubProjectsCollection extends DomainCollection { - - public String ORDER = "subProjectOrder"; - public String LINKORDER = "link.subProjectOrder"; - private static final Logger s_log = - Logger.getLogger( - SciProjectSubProjectsCollection.class); - - public SciProjectSubProjectsCollection(DataCollection dataCollection) { - super(dataCollection); - - m_dataCollection.addOrder(LINKORDER); - } - - public Integer getSubProjectOrder() { - return (Integer) m_dataCollection.get(LINKORDER); - } - - public void setSubProjectOrder(Integer order) { - DataObject link = (DataObject) this.get("link"); - - link.set(ORDER, order); - } - - public void swapWithNext(SciProject subproject) { - int currentPosition = 0; - int currentIndex = 0; - int nextIndex = 0; - - s_log.debug("Searching subproject..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getSubProjectOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getSubProjectOrder(): %d", - getSubProjectOrder())); - if (this.getSubProject().equals(subproject)) { - break; - } - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided subproject is not " - + "part of this collection.")); - } - - if (this.next()) { - nextIndex = this.getSubProjectOrder(); - } else { - throw new IllegalArgumentException( - "The provided subproject is the last " - + "in the collection, so there is no next object " - + "to swap with."); - } - - this.rewind(); - - while (this.getPosition() != currentPosition) { - this.next(); - } - - this.setSubProjectOrder(nextIndex); - this.next(); - this.setSubProjectOrder(currentIndex); - this.rewind(); - } - - public void swapWithPrevious(SciProject subproject) { - int previousPosition = 0; - int previousIndex = 0; - int currentPosition = 0; - int currentIndex = 0; - - s_log.debug("Searching subproject..."); - this.rewind(); - while (this.next()) { - currentPosition = this.getPosition(); - currentIndex = this.getSubProjectOrder(); - s_log.debug(String.format("Position: %d(%d)/%d", currentPosition, - currentIndex, this.size())); - s_log.debug(String.format("getSubProjectOrder(): %d", - getSubProjectOrder())); - if (this.getSubProject().equals(subproject)) { - break; - } - - previousPosition = currentPosition; - previousIndex = currentIndex; - } - - if (currentPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided subproject is not " - + "part of this collection.")); - } - - if (previousPosition == 0) { - throw new IllegalArgumentException( - String.format( - "The provided subproject is the first one in this " - + "collection, so there is no previous one to switch " - + "with.")); - } - - this.rewind(); - while (this.getPosition() != previousPosition) { - this.next(); - } - - this.setSubProjectOrder(currentIndex); - this.next(); - this.setSubProjectOrder(previousIndex); - this.rewind(); - } - - public SciProject getSubProject() { - return new SciProject(m_dataCollection.getDataObject()); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciTypesOrganizationUpdate660to661.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciTypesOrganizationUpdate660to661.java deleted file mode 100644 index 8ac333357..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/SciTypesOrganizationUpdate660to661.java +++ /dev/null @@ -1,65 +0,0 @@ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.installer.xml.XMLContentTypeHandler; -import com.arsdigita.kernel.Kernel; -import com.arsdigita.kernel.KernelExcursion; -import com.arsdigita.persistence.Session; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.TransactionContext; -import com.arsdigita.xml.XML; - -/** - * Updates the authoring steps of SciOrganization, SciDepartment and - * SciProject to reflect the changes made in version 6.6.1 (PWI SVN - * revision 887). - * - * @author Jens Pelzetter - * @version $Id$ - */ -public class SciTypesOrganizationUpdate660to661 { - - private static final String SCI_ORGANIZATION = - "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganization.xml"; - private static final String SCI_DEPARTMENT = - "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciDepartment.xml"; - private static final String SCI_PROJECT = - "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProject.xml"; - - public static void main(String[] args) { - final com.arsdigita.runtime.Runtime runtime = - new com.arsdigita.runtime.Runtime(); - runtime.startup(); - - final Session session = SessionManager.getSession(); - final TransactionContext tc = session.getTransactionContext(); - - try { - tc.beginTxn(); - new KernelExcursion() { - - @Override - protected void excurse() { - setEffectiveParty(Kernel.getSystemParty()); - - /* - * Reload content type definitions from XML config to add - * new authoring steps. - */ - XMLContentTypeHandler handler = new XMLContentTypeHandler(); - XML.parseResource(SCI_ORGANIZATION, handler); - XML.parseResource(SCI_DEPARTMENT, handler); - XML.parseResource(SCI_PROJECT, handler); - } - }.run(); - session.flushAll(); - tc.commitTxn(); - } catch (Exception ex) { - System.out.println("Exception ocurred during update: "); - ex.printStackTrace(System.out); - } finally { - if (tc.inTxn()) { - tc.abortTxn(); - } - } - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/doc-files/ccm-sci-types-organization_entities.png b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/doc-files/ccm-sci-types-organization_entities.png deleted file mode 100644 index 5ac626f36314e2ff2c0fd8cf5fc22b7aa3a8f0f6..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 139120 zcmeFZXEdB`+ctcPL`#&A5D^5?gCv6JGA_OM=+POycOzONT11OZbfX)+CDD5wy+mgi zqu0T^My~6A@8@~$_x<~QYkl9omOnF=ne#aIx^3GoR9R7qkl--^004wC(toJ}0BH>X zU~k~v0svq&H`o^d04!%!DG*RH@MIGJ0DK2&ZD#-=Hp2X1<%{N70RVvOBBLOIJ56wp zn1h%o&qv|y;b*^-k$T;Q-@z&@A2IGgva&?2k-OKPzNHA!Dz-`jDLl**we|Z zZ~SaiWtS@t+vrB|-Rp}q?9YndWNrMe$tKD4&7A($_wS1lx}P(ieSYe`cGBtR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ZU)e;l7vwGd+qA=AZ$Sryn7NEgDb9PfeAT`4%aJG-T)@$bCtSN!+f3$gnr z`$gR0P_>JTzW)4FgSYQrmqz#x*ZpQpCextK!OPoa9aEBNltwHi2}T5JJ&*ha)B-Z5s{vb&P`0b!m)B2c7r}3Jwxki zrl6p(d~6>uaZ+Gk;5<#-rTu>(K!ju9m5q+7J%LDKERPgDI6mySqFI`MBWOb)klWH{ zo8W2u_pChsX_^FfE`bAi8JREU(~aQ|^oTJbQIY`jHX80p77zRJL%SE^+S?q%>mVy9 z*M55VgrqrqvE?zrf=J_1QBm!_220joJr#DFQhdAhr-vknD_6=t?o2;Vx~K8)W7Dtr iACl+)e|!qfIKuEF7%rHA<28X{5fzernj`qq?f(Gtfa6X8 diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java deleted file mode 100644 index edc9a4796..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionEditForm.java +++ /dev/null @@ -1,101 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.form.TextArea; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.ui.CMSDHTMLEditor; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Edit form for the description of a SciDepartment. - * - * @author Jens Pelzetter - * @see SciDepartment - */ -public class SciDepartmentDescriptionEditForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - public SciDepartmentDescriptionEditForm(ItemSelectionModel itemModel) { - super("scidepartmentEditDescForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.description"))); - ParameterModel descParam = new StringParameter( - SciDepartment.DEPARTMENT_DESCRIPTION); - TextArea desc; - if (SciDepartment.getConfig().getDepartmentDescriptionDhtml()) { - desc = new CMSDHTMLEditor(descParam); - } else { - desc = new TextArea(descParam); - } - desc.setCols(75); - desc.setRows(25); - add(desc); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - FormData data = fse.getFormData(); - SciDepartment department = (SciDepartment) getItemSelectionModel(). - getSelectedObject(state); - - data.put(SciDepartment.DEPARTMENT_DESCRIPTION, - department.getDepartmentDescription()); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - FormData data = fse.getFormData(); - SciDepartment department = (SciDepartment) getItemSelectionModel(). - getSelectedObject(state); - - if ((department != null) && getSaveCancelSection().getSaveButton(). - isSelected(state)) { - department.setDepartmentDescription((String) data.get( - SciDepartment.DEPARTMENT_DESCRIPTION)); - - department.save(); - - init(fse); - } - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java deleted file mode 100644 index 9914e3e6d..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionStep.java +++ /dev/null @@ -1,84 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; - -/** - * EditStep for the description of a SciDepartment. - * - * @author Jens Pelzetter - * @see SciDepartment - */ -public class SciDepartmentDescriptionStep extends SimpleEditStep { - - private String EDIT_DEPARTMENT_DESC_SHEET_NAME = "editDepartmentDesc"; - private String UPLOAD_DEPARTMENT_DESC_SHEET_NAME = "uploadDepartmentDesc"; - - public SciDepartmentDescriptionStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciDepartmentDescriptionStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm editDescForm = - new SciDepartmentDescriptionEditForm(itemModel); - add(EDIT_DEPARTMENT_DESC_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.edit_desc").localize(), - new WorkflowLockedComponentAccess(editDescForm, itemModel), - editDescForm.getSaveCancelSection().getCancelButton()); - - SciDepartmentDescriptionUploadForm uploadDescForm = - new SciDepartmentDescriptionUploadForm( - itemModel); - add(UPLOAD_DEPARTMENT_DESC_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.upload_desc").localize(), - new WorkflowLockedComponentAccess(uploadDescForm, itemModel), - uploadDescForm.getSaveCancelSection().getCancelButton()); - - setDisplayComponent( - getSciDepartmentDescSheet(itemModel)); - } - - public static Component getSciDepartmentDescSheet( - ItemSelectionModel itemModel) { - DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( - itemModel); - - sheet.add(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.desc"), - SciDepartment.DEPARTMENT_DESCRIPTION); - - return sheet; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionUploadForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionUploadForm.java deleted file mode 100644 index b5fe10dda..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentDescriptionUploadForm.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.globalization.GlobalizedMessage; - -/** - * Upload form for the description of a SciDepartment. - * - * @author Jens Pelzetter - * @see SciDepartment - * @see AbstractTextUploadForm - */ -public class SciDepartmentDescriptionUploadForm extends AbstractTextUploadForm { - - public SciDepartmentDescriptionUploadForm(ItemSelectionModel itemModel) { - super(itemModel); - } - - @Override - public GlobalizedMessage getLabelText() { - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.description.upload"); - } - - @Override - public GlobalizedMessage getMimeTypeLabel() { - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.description.upload.mimetype"); - } - - @Override - public void setText(ItemSelectionModel itemModel, - PageState state, - String text) { - SciDepartment department = (SciDepartment) itemModel.getSelectedObject( - state); - department.setDepartmentDescription(text); - department.save(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberAddForm.java deleted file mode 100644 index 06fe7b42a..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberAddForm.java +++ /dev/null @@ -1,53 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.contenttypes.GenericPerson; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; - -/** - * Form for adding members to a SciDepartment. This form overwrites - * the {@link GenericOrganizationalUnitPersonAddForm#getPersonType()} - * to limit the selectable type for adding to {@link SciMember}. - * - * @author Jens Pelzetter - * @see SciDepartment - * @see SciMember - * @see GenericOrganizationalUnitPersonAddForm - */ -public class SciDepartmentMemberAddForm - extends GenericOrganizationalUnitPersonAddForm { - - public SciDepartmentMemberAddForm(ItemSelectionModel itemModel, - GenericOrganizationalUnitPersonSelector personSelector) { - super(itemModel, personSelector); - } - - @Override - protected String getPersonType() { - return GenericPerson.class.getName(); - } - - @Override - protected String getRoleAttributeName() { - return "SciDepartmentRole"; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberStep.java deleted file mode 100644 index 48b3894b4..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberStep.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.GenericPerson; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * Edit step for adding members to a SciDepartment. - * - * @author Jens Pelzetter - */ -public class SciDepartmentMemberStep - extends SimpleEditStep - implements GenericOrganizationalUnitPersonSelector { - - private static final String ADD_MEMBER_SHEET_NAME = "addMember"; - private GenericPerson selectedPerson; - private String selectedPersonRole; - private String selectedPersonStatus; - - public SciDepartmentMemberStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciDepartmentMemberStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addMemberSheet = - new SciDepartmentMemberAddForm(itemModel, - this); - add(ADD_MEMBER_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.add_member").localize(), - new WorkflowLockedComponentAccess(addMemberSheet, itemModel), - addMemberSheet.getSaveCancelSection().getCancelButton()); - - SciDepartmentMemberTable memberTable = new SciDepartmentMemberTable( - itemModel, - this); - setDisplayComponent(memberTable); - } - - public GenericPerson getSelectedPerson() { - return selectedPerson; - } - - public void setSelectedPerson(final GenericPerson selectedPerson) { - this.selectedPerson = selectedPerson; - } - - public String getSelectedPersonRole() { - return selectedPersonRole; - } - - public void setSelectedPersonRole(final String selectedPersonRole) { - this.selectedPersonRole = selectedPersonRole; - } - - public String getSelectedPersonStatus() { - return selectedPersonStatus; - } - - public void setSelectedPersonStatus(final String selectedPersonStatus) { - this.selectedPersonStatus = selectedPersonStatus; - } - - public void showEditComponent(PageState state) { - showComponent(state, ADD_MEMBER_SHEET_NAME); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberTable.java deleted file mode 100644 index 19a8ef255..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentMemberTable.java +++ /dev/null @@ -1,39 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; - -/** - * - * @author Jens Pelzetter - */ -public class SciDepartmentMemberTable extends GenericOrganizationalUnitPersonsTable { - - public SciDepartmentMemberTable(ItemSelectionModel itemModel, - GenericOrganizationalUnitPersonSelector personSelector) { - super(itemModel, personSelector); - } - - @Override - protected String getRoleAttributeName() { - return "SciDepartmentRole"; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationForm.java deleted file mode 100644 index d4e217d95..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationForm.java +++ /dev/null @@ -1,115 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Form for setting the superior organization of an SciDepartment. - * - * @author Jens Pelzetter - * @see SciDepartment - * @see SciOrganization - */ -public class SciDepartmentOrganizationForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget m_itemSearch; - private final String ITEM_SEARCH = "departmentOrga"; - - public SciDepartmentOrganizationForm(ItemSelectionModel itemModel) { - super("DepartmentOrganizationForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_organization"))); - m_itemSearch = new ItemSearchWidget(ITEM_SEARCH, - ContentType. - findByAssociatedObjectType(SciOrganization.class.getName())); - add(m_itemSearch); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciDepartment department = (SciDepartment) getItemSelectionModel(). - getSelectedObject(state); - - if (this.getSaveCancelSection().getSaveButton().isSelected(state)) { - SciOrganization orga = (SciOrganization) data.get(ITEM_SEARCH); - - orga = (SciOrganization) orga.getContentBundle().getInstance(department.getLanguage()); - - department.setOrganization(orga); - //department.setOrganization((SciOrganization) data.get(ITEM_SEARCH)); - } - - init(fse); - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.organization.add.no_organization_selected")); - - return; - } - - SciDepartment department = (SciDepartment) getItemSelectionModel(). - getSelectedObject(state); - - SciOrganization orga = (SciOrganization) data.get(ITEM_SEARCH); - - if (!(orga.getContentBundle().hasInstance(department.getLanguage()))) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.organization.add.no_suitable_language_variant")); - } - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationSheet.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationSheet.java deleted file mode 100644 index 6f141fe20..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationSheet.java +++ /dev/null @@ -1,295 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; -import org.apache.log4j.Logger; - -/** - * Sheet for showing the superior organization of a SciDepartment. - * - * @author Jens Pelzetter - * @see SciDepartment - * @see SciOrganization - */ -public class SciDepartmentOrganizationSheet - extends Table - implements TableActionListener { - - private static final Logger logger = - Logger.getLogger( - SciDepartmentOrganizationSheet.class); - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private ItemSelectionModel m_itemModel; - - public SciDepartmentOrganizationSheet(ItemSelectionModel itemModel) { - super(); - m_itemModel = itemModel; - - setEmptyView( - new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.organization_none"))); - - TableColumnModel colModel = getColumnModel(); - colModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.organization").localize(), - TABLE_COL_EDIT)); - colModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.organization.remove").localize(), - TABLE_COL_DEL)); - - setModelBuilder( - new SciDepartmentOrganizationSheetModelBuilder(itemModel)); - colModel.get(0).setCellRenderer(new EditCellRenderer()); - colModel.get(1).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - } - - private class SciDepartmentOrganizationSheetModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel m_itemModel; - - public SciDepartmentOrganizationSheetModelBuilder( - ItemSelectionModel itemModel) { - m_itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject(state); - return new SciDepartmentOrganizationSheetModel(table, - state, - department); - } - } - - private class SciDepartmentOrganizationSheetModel - implements TableModel { - - private Table m_table; - private SciOrganization m_orga; - private boolean m_done; - - public SciDepartmentOrganizationSheetModel(Table table, - PageState state, - SciDepartment department) { - m_table = table; - m_orga = department.getOrganization(); - if (m_orga == null) { - m_done = false; - } else { - m_done = true; - } - } - - public int getColumnCount() { - return m_table.getColumnModel().size(); - } - - public boolean nextRow() { - boolean ret; - - if (m_done) { - ret = true; - m_done = false; - } else { - ret = false; - } - - return ret; - } - - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return m_orga.getTitle(); - case 1: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.organization.remove"). - localize(); - default: - return null; - } - } - - public Object getKeyAt(int columnIndex) { - return m_orga.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.EDIT_ITEM, - department); - - if (canEdit) { - SciOrganization organization; - try { - organization = new SciOrganization((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - logger.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = new Link(String.format("%s (%s)", - value.toString(), - organization.getLanguage()), - resolver.generateItemURL(state, - organization, - section, - organization. - getVersion())); - - return link; - } else { - SciOrganization organization; - try { - organization = new SciOrganization((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - logger.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - Label label = new Label( - String.format("%s (%s)", - value.toString(), - organization.getLanguage())); - return label; - } - - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.DELETE_ITEM, - department); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "sciorganization.ui.department.organization." - + "confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - @Override - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - SciDepartment department = - (SciDepartment) m_itemModel.getSelectedObject( - state); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { - department.setOrganization(null); - } - } - - @Override - public void headSelected(TableActionEvent event) { - //Nothing to do - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationStep.java deleted file mode 100644 index 1b168b372..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentOrganizationStep.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * Step for setting the superior organization of a SciDepartment. - * - * @author Jens Pelzetter - * @see SciDepartment - * @see SciOrganization - */ -public class SciDepartmentOrganizationStep extends SimpleEditStep { - - private String SET_DEPARTMENT_ORGANIZATION_STEP = - "setDepartmentOrganization"; - - public SciDepartmentOrganizationStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciDepartmentOrganizationStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm setOrgaForm = - new SciDepartmentOrganizationForm(itemModel); - add(SET_DEPARTMENT_ORGANIZATION_STEP, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.setOrganization").localize(), - new WorkflowLockedComponentAccess(setOrgaForm, itemModel), - setOrgaForm.getSaveCancelSection().getCancelButton()); - - SciDepartmentOrganizationSheet sheet = - new SciDepartmentOrganizationSheet( - itemModel); - setDisplayComponent(sheet); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPanel.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPanel.java deleted file mode 100644 index 3526895d3..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPanel.java +++ /dev/null @@ -1,570 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitPersonCollection; -import com.arsdigita.cms.contenttypes.GenericPerson; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciDepartmentProjectsCollection; -import com.arsdigita.cms.contenttypes.SciDepartmentSubDepartmentsCollection; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.SciOrganizationConfig; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.ui.panels.Filter; -import com.arsdigita.cms.contenttypes.ui.panels.TextFilter; -import com.arsdigita.xml.Element; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.servlet.http.HttpServletRequest; -import org.apache.log4j.Logger; - -/** - * - * @author Jens Pelzetter - */ -public class SciDepartmentPanel extends SciOrganizationBasePanel { - - private static final Logger s_log = Logger.getLogger( - SciDepartmentPanel.class); - public static final String SHOW_DESCRIPTION = "description"; - public static final String SHOW_MEMBERS_ACTIVE = "membersActive"; - public static final String SHOW_MEMBERS_ASSOCIATED = "membersAssociated"; - public static final String SHOW_MEMBERS_FORMER = "membersFormer"; - public static final String SHOW_SUBDEPARTMENTS = "subdepartments"; - public static final String SHOW_PROJECTS = "projects"; - public static final String SHOW_PROJECTS_ONGOING = "projectsOngoing"; - public static final String SHOW_PROJECTS_FINISHED = "projectsFinished"; - private static final String TITLE = "title"; - private String show; - private boolean displayDescription = true; - private boolean displaySubDepartments = true; - private boolean displayProjects = true; - private Map projectFilters = - new LinkedHashMap(); - - public SciDepartmentPanel() { - projectFilters.put(TITLE, new TextFilter(TITLE, TITLE)); - } - - @Override - protected String getDefaultShowParam() { - return SHOW_DESCRIPTION; - } - - @Override - protected Class getAllowedClass() { - 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 isDisplaySubDepartments() { - return displaySubDepartments; - } - - public void setDisplaySubDepartments(boolean displaySubDepartments) { - this.displaySubDepartments = displaySubDepartments; - } - - protected boolean hasMembers(final SciDepartment department) { - return department.hasMembers(SciDepartment.getConfig(). - getOrganizationMembersMerge(), - SciDepartment.MemberStatus.ALL); - } - - protected boolean hasActiveMembers(final SciDepartment department) { - return department.hasMembers(SciDepartment.getConfig(). - getOrganizationMembersMerge(), - SciDepartment.MemberStatus.ACTIVE); - } - - protected boolean hasAssociatedMembers(final SciDepartment department) { - return department.hasMembers(SciDepartment.getConfig(). - getOrganizationMembersMerge(), - SciDepartment.MemberStatus.ASSOCIATED); - } - - protected boolean hasFormerMembers(final SciDepartment department) { - return department.hasMembers(SciDepartment.getConfig(). - getOrganizationMembersMerge(), - SciDepartment.MemberStatus.FORMER); - } - - protected boolean hasProjects(final SciDepartment department) { - return department.hasProjects(SciDepartment.getConfig(). - getOrganizationProjectsMerge(), - SciDepartment.ProjectStatus.ALL); - } - - protected boolean hasOngoingProjects(final SciDepartment department) { - return department.hasProjects(SciDepartment.getConfig(). - getOrganizationProjectsMerge(), - SciDepartment.ProjectStatus.ONGOING); - } - - protected boolean hasFinishedProjects(final SciDepartment department) { - return department.hasProjects(SciDepartment.getConfig(). - getOrganizationProjectsMerge(), - SciDepartment.ProjectStatus.FINISHED); - } - - protected void generateSubDepartmentsXML(final SciDepartment department, - final Element parent, - final PageState state) { - SciDepartmentSubDepartmentsCollection subDepartments; - subDepartments = department.getSubDepartments(); - subDepartments.addOrder("link.subDepartmentOrder asc"); - - long pageNumber = getPageNumber(state); - - Element subDepartmentsElem = parent.newChildElement("subDepartments"); - - long pageCount = getPageCount(subDepartments.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, subDepartments.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - createPaginatorElement( - parent, pageNumber, pageCount, begin, end, count, - subDepartments.size()); - subDepartments.setRange((int) begin + 1, (int) end + 1); - - while (subDepartments.next()) { - SciDepartment subDepartment; - subDepartment = subDepartments.getSubDepartment(); - - Element subDepartmentElem = subDepartmentsElem.newChildElement( - "department"); - subDepartmentElem.addAttribute("order", - Integer.toString(subDepartments. - getSubDepartmentOrder())); - subDepartmentElem.addAttribute("oid", subDepartment.getOID(). - toString()); - - Element title = subDepartmentElem.newChildElement("title"); - title.setText(subDepartment.getTitle()); - - if ((subDepartment.getAddendum() != null) - && !(subDepartment.getAddendum().isEmpty())) { - Element addendum = subDepartmentElem.newChildElement("addendum"); - addendum.setText(subDepartment.getAddendum()); - } - - if ((subDepartment.getDepartmentShortDescription() != null) - && !(subDepartment.getDepartmentShortDescription().isEmpty())) { - Element shortDesc = subDepartmentElem.newChildElement( - "shortDescription"); - shortDesc.setText(subDepartment.getDepartmentShortDescription()); - } - - GenericOrganizationalUnitPersonCollection heads; - heads = subDepartment.getPersons(); - heads.addFilter(("link.role_name = 'head'")); - heads.addOrder("surname asc, givenname asc"); - - if (heads.size() > 0) { - Element headsElem = subDepartmentElem.newChildElement("heads"); - - while (heads.next()) { - Element headElem = headsElem.newChildElement("head"); - Element titlePre = headElem.newChildElement("titlePre"); - titlePre.setText(heads.getTitlePre()); - Element givenName = headElem.newChildElement("givenname"); - givenName.setText(heads.getGivenName()); - Element surname = headElem.newChildElement("surname"); - surname.setText(heads.getSurname()); - Element titlePost = headElem.newChildElement("titlePost"); - titlePost.setText(heads.getTitlePost()); - } - } - - GenericOrganizationalUnitContactCollection contacts; - contacts = subDepartment.getContacts(); - if (contacts.size() > 0) { - Element contactsElem = subDepartmentElem.newChildElement( - "contacts"); - - while (contacts.next()) { - generateContactXML(contacts.getContactType(), - contacts.getPerson(), - contacts.getContactEntries(), - contacts.getAddress(), - contactsElem, - state, - Integer.toString( - contacts.getContactOrder()), - true); - } - } - } - } - - protected void generateMembersXML(final SciDepartment department, - final Element parent, - final PageState state, - final List filters) { - if (SciDepartment.getConfig().getOrganizationMembersMerge()) { - List members; - members = new LinkedList(); - GenericOrganizationalUnitPersonCollection departmentMembers; - departmentMembers = department.getPersons(); - for (String filter : filters) { - departmentMembers.addFilter(filter); - } - - SciDepartmentSubDepartmentsCollection subDepartments; - subDepartments = department.getSubDepartments(); - - while (departmentMembers.next()) { - addMember(departmentMembers, - members); - } - - mergeMembers(subDepartments, members, filters); - - Collections.sort(members, new MemberListItemComparator()); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(members.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, members.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - createPaginatorElement( - parent, pageNumber, pageCount, begin, end, count, members. - size()); - List membersToShow = members.subList((int) begin, - (int) end); - - Element membersElem = parent.newChildElement("members"); - - for (MemberListItem memberItem : membersToShow) { - generateMemberXML(memberItem, - membersElem, - memberItem.getRole(), - memberItem.getStatus(), - state); - } - } else { - GenericOrganizationalUnitPersonCollection departmentMembers; - departmentMembers = department.getPersons(); - for (String filter : filters) { - departmentMembers.addFilter(filter); - } - - List members = new LinkedList(); - - while (departmentMembers.next()) { - addMember(departmentMembers, - members); - } - - Collections.sort(members, new MemberListItemComparator()); - - long pageNumber = getPageNumber(state); - - Element membersElem = parent.newChildElement("members"); - - long pageCount = getPageCount(members.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, members.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - createPaginatorElement( - parent, pageNumber, pageCount, begin, end, count, members. - size()); - List membersToShow = members.subList((int) begin, - (int) end); - - for (MemberListItem memberItem : membersToShow) { - generateMemberXML(memberItem, - membersElem, - memberItem.getRole(), - memberItem.getStatus(), - state); - } - } - } - - protected void generateProjectFiltersXml( - final List projects, - final Element element) { - final Element filterElement = element.newChildElement("filters"); - - for (Map.Entry filterEntry : projectFilters.entrySet()) { - filterEntry.getValue().generateXml(filterElement); - } - } - - protected void applyProjectFilters( - final List filters, - final HttpServletRequest request) { - //Get parameters from HTTP request - for (Map.Entry filterEntry : projectFilters.entrySet()) { - String value = request.getParameter( - filterEntry.getValue().getLabel()); - - if ((value != null) && !(value.trim().isEmpty())) { - filterEntry.getValue().setValue(value); - } - } - } - - protected void generateProjectsXML(final SciDepartment department, - final Element parent, - final PageState state, - final List filters) { - Element controls = parent.newChildElement("filterControls"); - controls.addAttribute("customName", "sciDepartmentProjects"); - controls.addAttribute("show", show); - - if (SciDepartment.getConfig().getOrganizationProjectsMerge()) { - List projects; - projects = new LinkedList(); - SciDepartmentProjectsCollection departmentProjects; - departmentProjects = department.getProjects(); - - applyProjectFilters(filters, state.getRequest()); - if ((filters != null) - && !(filters.isEmpty())) { - for (String filter : filters) { - departmentProjects.addFilter(filter); - } - } - - SciDepartmentSubDepartmentsCollection subDepartments; - subDepartments = department.getSubDepartments(); - - while (departmentProjects.next()) { - projects.add(departmentProjects.getProject()); - } - - mergeProjects(subDepartments, projects, filters); - - Set projectsSet; - List projectsWithoutDoubles; - projectsSet = new HashSet(projects); - projectsWithoutDoubles = new LinkedList(projectsSet); - - Collections.sort(projectsWithoutDoubles, new SciProjectComparator()); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(projectsWithoutDoubles.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, projectsWithoutDoubles.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - generateProjectFiltersXml(projectsWithoutDoubles, controls); - createPaginatorElement(parent, - pageNumber, - pageCount, - begin, - end, - count, - projectsWithoutDoubles.size()); - List projectsToShow = - projectsWithoutDoubles.subList((int) begin, - (int) end); - - Element projectsElem = parent.newChildElement("projects"); - for (SciProject project : projectsToShow) { - generateProjectXML(project, projectsElem, state); - } - } else { - SciDepartmentProjectsCollection departmentProjects; - departmentProjects = department.getProjects(); - - if ((filters != null) - && !(filters.isEmpty())) { - for (String filter : filters) { - departmentProjects.addFilter(filter); - } - } - - List projects = new LinkedList(); - - while (departmentProjects.next()) { - projects.add(departmentProjects.getProject()); - } - - Collections.sort(projects, new SciProjectComparator()); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(projects.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, projects.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - generateProjectFiltersXml(projects, controls); - createPaginatorElement( - parent, pageNumber, pageCount, begin, end, count, projects. - size()); - List projectsToShow = projects.subList((int) begin, - (int) end); - - Element projectsElem = parent.newChildElement("projects"); - for (SciProject project : projectsToShow) { - generateProjectXML(project, projectsElem, state); - } - } - } - - @Override - protected void generateAvailableDataXml(final GenericOrganizationalUnit orga, - final Element element, - final PageState state) { - final SciOrganizationConfig config = SciOrganization.getConfig(); - - SciDepartment department = (SciDepartment) orga; - - if ((department.getDepartmentDescription() != null) - && !department.getDepartmentDescription().isEmpty() - && displayDescription) { - element.newChildElement("description"); - } - if (department.hasContacts() - && isDisplayContacts()) { - element.newChildElement("contacts"); - } - if (department.hasSubDepartments() - && displaySubDepartments) { - element.newChildElement("subDepartments"); - } - if (config.getOrganizationMembersAllInOne()) { - if (hasMembers(department) - && isDisplayMembers()) { - element.newChildElement("members"); - } - } else { - if (hasActiveMembers(department) - && isDisplayMembers()) { - element.newChildElement("membersActive"); - } - if (hasAssociatedMembers(department) - && isDisplayMembers()) { - element.newChildElement("membersAssociated"); - } - if (hasFormerMembers(department) - && isDisplayMembers()) { - element.newChildElement("membersFormer"); - } - } - if (config.getOrganizationProjectsAllInOne()) { - if (hasProjects(department) - && displayProjects) { - element.newChildElement("projects"); - } - } else { - if (hasOngoingProjects(department) - && displayProjects) { - element.newChildElement("projectsOngoing"); - } - if (hasFinishedProjects(department) - && displayProjects) { - element.newChildElement("projectsFinished"); - } - } - } - - @Override - protected void generateDataXml(GenericOrganizationalUnit orga, - Element element, - PageState state) { - show = getShowParam(state); - - SciDepartment department = (SciDepartment) orga; - - if (SHOW_DESCRIPTION.equals(show)) { - String desc; - desc = department.getDepartmentDescription(); - - Element description = element.newChildElement("description"); - description.setText(desc); - } else if (SHOW_CONTACTS.equals(show)) { - generateContactsXML(department, element, state); - } else if (SHOW_MEMBERS.equals(show)) { - generateMembersXML(department, element, state, - new LinkedList()); - } else if (SHOW_MEMBERS_ACTIVE.equals(show)) { - generateMembersXML(department, element, state, - getFiltersForActiveMembers()); - } else if (SHOW_MEMBERS_ASSOCIATED.equals(show)) { - generateMembersXML(department, element, state, - getFiltersForAssociatedMembers()); - } else if (SHOW_MEMBERS_FORMER.equals(show)) { - generateMembersXML(department, element, state, - getFiltersForFormerMembers()); - } else if (SHOW_PROJECTS.equals(show)) { - generateProjectsXML(department, element, state, - new LinkedList()); - } else if (SHOW_PROJECTS_ONGOING.equals(show)) { - generateProjectsXML(department, element, state, - getFiltersForOngoingProjects()); - } else if (SHOW_PROJECTS_FINISHED.equals(show)) { - generateProjectsXML(department, element, state, - getFiltersForFinishedProjects()); - } else if (SHOW_SUBDEPARTMENTS.equals(show)) { - generateSubDepartmentsXML(department, element, state); - } - } - - /*@Override - public void generateXML(ContentItem item, - Element element, - PageState state) { - Element content = generateBaseXML(item, element, state); - - Element availableData = content.newChildElement("availableData"); - - SciDepartment department = (SciDepartment) item; - - generateAvailableDataXml(department, availableData, state); - - generateDataXml(department, content, state); - }*/ -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectAddForm.java deleted file mode 100644 index ddab81c50..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectAddForm.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciDepartmentProjectsCollection; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Form for linking an {@link SciDepartment} with a {@link SciProject}. - * - * @author Jens Pelzetter - * @see SciDepartment - * @see SciProject - */ -public class SciDepartmentProjectAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget m_itemSearch; - private final String ITEM_SEARCH = "projects"; - - public SciDepartmentProjectAddForm(ItemSelectionModel itemModel) { - super("ProjectsAddForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label((String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_project").localize())); - m_itemSearch = new ItemSearchWidget( - ITEM_SEARCH, - ContentType.findByAssociatedObjectType( - SciProject.class.getName())); - add(m_itemSearch); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciDepartment department = (SciDepartment) getItemSelectionModel(). - getSelectedObject(state); - - if (!(this.getSaveCancelSection().getCancelButton(). - isSelected(state))) { - SciProject project = (SciProject) data.get(ITEM_SEARCH); - project = (SciProject) project.getContentBundle().getInstance(department. - getLanguage()); - - department.addProject(project); - } - - init(fse); - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_project.no_project_selected")); - return; - } - - SciDepartment department = (SciDepartment) getItemSelectionModel(). - getSelectedObject(state); - SciProject project = (SciProject) data.get(ITEM_SEARCH); - if (!(project.getContentBundle().hasInstance(department.getLanguage()))) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_project.no_suitable_language_variant")); - return; - } - - project = (SciProject) project.getContentBundle().getInstance(department. - getLanguage()); - SciDepartmentProjectsCollection projects = department.getProjects(); - projects.addFilter(String.format("id = %s", project.getID().toString())); - if (projects.size() > 0) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_project.already_added")); - } - - projects.close(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java deleted file mode 100644 index 4f9b3065e..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsStep.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * Step for linking {@link SciDepartment}s with {@link SciProject}s. - * - * @author Jens Pelzetter - * @see SciDepartment - * @see SciProject - */ -public class SciDepartmentProjectsStep extends SimpleEditStep { - - private String ADD_PROJECT_SHEET_NAME = "addProject"; - - public SciDepartmentProjectsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciDepartmentProjectsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addProjectSheet = - new SciDepartmentProjectAddForm(itemModel); - add(ADD_PROJECT_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.add_project").localize(), - new WorkflowLockedComponentAccess(addProjectSheet, itemModel), - addProjectSheet.getSaveCancelSection().getCancelButton()); - - SciDepartmentProjectsTable projectsTable = - new SciDepartmentProjectsTable( - itemModel); - setDisplayComponent(projectsTable); - - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTable.java deleted file mode 100644 index 1056dca74..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentProjectsTable.java +++ /dev/null @@ -1,383 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import java.math.BigDecimal; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciDepartmentProjectsCollection; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import org.apache.log4j.Logger; - -/** - * Table for showing all {@link SciProject}s linked with a {@link SciDepartment} - * - * @author Jens Pelzetter - * @see SciDepartment - * @see SciProject - */ -public class SciDepartmentProjectsTable - extends Table - implements TableActionListener { - - private final Logger s_log = Logger.getLogger( - SciDepartmentProjectsTable.class); - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private final String TABLE_COL_UP = "table_col_up"; - private final String TABLE_COL_DOWN = "table_col_down"; - private ItemSelectionModel m_itemModel; - - public SciDepartmentProjectsTable(ItemSelectionModel itemModel) { - super(); - m_itemModel = itemModel; - - setEmptyView( - new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.projects.none"))); - - TableColumnModel colModel = getColumnModel(); - colModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.project").localize(), - TABLE_COL_EDIT)); - colModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.project.remove").localize(), - TABLE_COL_DEL)); - /*colModel.add(new TableColumn( - 2, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.project.up").localize(), - TABLE_COL_UP)); - colModel.add(new TableColumn( - 3, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.project.down").localize(), - TABLE_COL_DOWN));*/ - - setModelBuilder( - new SciDepartmentProjectsTableModelBuilder(itemModel)); - - colModel.get(0).setCellRenderer(new EditCellRenderer()); - colModel.get(1).setCellRenderer(new DeleteCellRenderer()); - //colModel.get(2).setCellRenderer(new UpCellRenderer()); - //colModel.get(3).setCellRenderer(new DownCellRenderer()); - - addTableActionListener(this); - } - - private class SciDepartmentProjectsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel m_itemModel; - - public SciDepartmentProjectsTableModelBuilder( - ItemSelectionModel itemModel) { - m_itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject(state); - return new SciDepartmentProjectsTableModel(table, - state, - department); - } - } - - private class SciDepartmentProjectsTableModel - implements TableModel { - - private Table m_table; - private SciDepartmentProjectsCollection m_projects; - private SciProject m_project; - - public SciDepartmentProjectsTableModel(Table table, - PageState state, - SciDepartment department) { - m_table = table; - m_projects = department.getProjects(); - } - - @Override - public int getColumnCount() { - return m_table.getColumnModel().size(); - } - - @Override - public boolean nextRow() { - boolean ret; - - if ((m_projects != null) && m_projects.next()) { - m_project = m_projects.getProject(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - @Override - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return m_project.getTitle(); - case 1: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.project.remove"). - localize(); - case 2: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.project.up"). - localize(); - case 3: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.project.down"). - localize(); - default: - return null; - } - } - - @Override - public Object getKeyAt(int columnIndex) { - return m_project.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.EDIT_ITEM, - department); - - if (canEdit) { - SciProject project; - try { - project = new SciProject((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - - } - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = - new Link(String.format("%s (%s)", - value.toString(), - project.getLanguage()), - resolver.generateItemURL(state, - project, - section, - project.getVersion())); - - return link; - } else { - SciProject project; - try { - project = new SciProject((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - - } - Label label = new Label(String.format("%s (%s)", - value.toString(), - project.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.DELETE_ITEM, - department); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "sciorganization.ui.department.project." - + "confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - private class UpCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - if (0 == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.project.up"). - localize()); - return link; - } - } - } - - private class DownCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject( - state); - SciDepartmentProjectsCollection projects = - department.getProjects(); - - if ((projects.size() - 1) == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.project.down"). - localize()); - return link; - } - } - } - - @Override - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - SciProject project = new SciProject( - new BigDecimal(event.getRowKey().toString())); - - SciDepartment department = - (SciDepartment) m_itemModel.getSelectedObject(state); - - SciDepartmentProjectsCollection projects = - department.getProjects(); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { - department.removeProject(project); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) { - projects.swapWithPrevious(project); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) { - projects.swapWithNext(project); - } - } - - @Override - public void headSelected(TableActionEvent event) { - //Nothing to do. - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java deleted file mode 100644 index 04419d42f..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertiesStep.java +++ /dev/null @@ -1,159 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.Label; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ContentTypeCollection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciOrganizationConfig; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicPageForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; - -/** - * Step for editing a {@link SciDepartment}. - * - * @author Jens Pelzetter - * @see SciDepartment - */ -public class SciDepartmentPropertiesStep - extends GenericOrganizationalUnitPropertiesStep { - - public SciDepartmentPropertiesStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - super(itemModel, parent); - } - - public static Component getSciDepartmentPropertySheet( - ItemSelectionModel itemModel) { - DomainObjectPropertySheet sheet = - (DomainObjectPropertySheet) GenericOrganizationalUnitPropertiesStep. - getGenericOrganizationalUnitPropertySheet(itemModel); - - sheet.add(SciOrganizationGlobalizationUtil.globalize( - "sciorganizations.ui.department.shortdescription"), - SciDepartment.DEPARTMENT_SHORT_DESCRIPTION); - - return sheet; - } - - @Override - protected void addBasicProperties(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - SimpleEditStep basicProperties = new SimpleEditStep(itemModel, - parent, - EDIT_SHEET_NAME); - - BasicPageForm editBasicSheet = - new SciDepartmentPropertyForm(itemModel, this); - - basicProperties.add(EDIT_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.edit_basic_properties"). - localize(), - new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), - editBasicSheet.getSaveCancelSection(). - getCancelButton()); - - basicProperties.setDisplayComponent( - getSciDepartmentPropertySheet(itemModel)); - - getSegmentedPanel().addSegment( - new Label((String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.basic_properties").localize()), - basicProperties); - } - - @Override - protected void addSteps(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - //super.addSteps(itemModel, parent); - - SciOrganizationConfig config; - config = SciDepartment.getConfig(); - - if (!config.getDepartmentAddContactHide()) { - addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel, - parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.contacts")); - } - - /* - if (!config.getDepartmentAddPersonHide()) { - addStep(new SciDepartmentMemberStep(itemModel, - parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.members")); - } - */ - - /* - if (!config.getDepartmentAddSubDepartmentHide()) { - addStep(new SciDepartmentSubDepartmentsStep(itemModel, parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.subdepartments")); - } - */ - - if (!config.getDepartmentSetSuperDepartmentHide()) { - addStep(new SciDepartmentSuperDepartmentStep(itemModel, parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.superdepartment")); - } - - /* - if (!config.getDepartmentAddProjectHide()) { - addStep(new SciDepartmentProjectsStep(itemModel, parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.projects")); - } - */ - - if (!config.getDepartmentSetOrganizationHide()) { - addStep(new SciDepartmentOrganizationStep(itemModel, parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.organization")); - } - - /* - ContentTypeCollection contentTypes = ContentType.getAllContentTypes(); - contentTypes.addFilter("associatedObjectType = :type").set( - "type", - "com.arsdigita.cms.contenttypes.Publication"); - if ((!config.getDepartmentPublicationsHide()) - && (contentTypes.size() > 0)) { - /* - * Must add this step manually since the basic class is not - * SimpleEditStep... - */ - /* getSegmentedPanel().addSegment(new Label(SciOrganizationGlobalizationUtil. - globalize("sciorganization.ui.department.publications")), - new SciDepartmentPublicationsStep( - itemModel, parent)); - }*/ - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java deleted file mode 100644 index 6ab2f7dad..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPropertyForm.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.form.TextArea; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.bebop.parameters.StringInRangeValidationListener; -import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; - -/** - * Form for editing the basic properties of a {@link SciDepartment}. - * - * @author Jens Pelzetter - * @see SciDepartment - */ -public class SciDepartmentPropertyForm - extends GenericOrganizationalUnitPropertyForm - implements FormProcessListener, - FormInitListener { - - public static final String ID = "SciDepartmentEdit"; - - public SciDepartmentPropertyForm(ItemSelectionModel itemModel) { - this(itemModel, null); - } - - public SciDepartmentPropertyForm(ItemSelectionModel itemModel, - SciDepartmentPropertiesStep step) { - super(itemModel, step); - addSubmissionListener(this); - } - - @Override - public void addWidgets() { - super.addWidgets(); - - Label descLabel = new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganizations.ui.department.shortdescription")); - add(descLabel); - ParameterModel descParam = new StringParameter( - SciDepartment.DEPARTMENT_SHORT_DESCRIPTION); - TextArea desc = new TextArea(descParam); - desc.addValidationListener(new StringInRangeValidationListener(0, 500)); - desc.setCols(75); - desc.setRows(5); - add(desc); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - super.init(fse); - - FormData data = fse.getFormData(); - SciDepartment department = (SciDepartment) super.initBasicWidgets(fse); - - data.put(SciDepartment.DEPARTMENT_SHORT_DESCRIPTION, - department.getDepartmentShortDescription()); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - super.process(fse); - - FormData data = fse.getFormData(); - SciDepartment department = - (SciDepartment) super.processBasicWidgets(fse); - - if ((department != null) && getSaveCancelSection().getSaveButton(). - isSelected(fse.getPageState())) { - department.setDepartmentShortDescription( - (String) data.get(SciDepartment.DEPARTMENT_SHORT_DESCRIPTION)); - - department.save(); - - init(fse); - } - } - - @Override - protected String getTitleLabel() { - return (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganizations.ui.department.title").localize(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentAddForm.java deleted file mode 100644 index 24db08526..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentAddForm.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciDepartmentSubDepartmentsCollection; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Form for adding subdepartments to a {@link SciDepartment}. - * - * @author Jens Pelzetter - * @see SciDepartment - */ -public class SciDepartmentSubDepartmentAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget m_itemSearch; - private final String ITEM_SEARCH = "subdepartments"; - - public SciDepartmentSubDepartmentAddForm(ItemSelectionModel itemModel) { - super("SubDepartmentsAddForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_subdepartment"))); - m_itemSearch = new ItemSearchWidget( - ITEM_SEARCH, - ContentType.findByAssociatedObjectType(SciDepartment.class. - getName())); - add(m_itemSearch); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciDepartment department = (SciDepartment) getItemSelectionModel(). - getSelectedObject(state); - - if (!(this.getSaveCancelSection().getCancelButton(). - isSelected(state))) { - SciDepartment subDepartment = (SciDepartment) data.get(ITEM_SEARCH); - subDepartment = (SciDepartment) subDepartment.getContentBundle(). - getInstance(department.getLanguage()); - - department.addSubDepartment(subDepartment); - } - - init(fse); - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_subdepartment.no_department_selected")); - return; - } - - SciDepartment department = (SciDepartment) getItemSelectionModel(). - getSelectedObject(state); - SciDepartment subDepartment = (SciDepartment) data.get(ITEM_SEARCH); - if (!(subDepartment.getContentBundle().hasInstance(department.getLanguage()))) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_subdepartment.no_suitable_language_variant")); - return; - } - - subDepartment = (SciDepartment) subDepartment.getContentBundle().getInstance(department.getLanguage()); - - if (department.getID().equals(subDepartment.getID())) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_subdepartment.adding_to_itself")); - return; - } - - SciDepartmentSubDepartmentsCollection subDepartments = department.getSubDepartments(); - subDepartments.addFilter(String.format("id = %s", subDepartment.getID().toString())); - if (subDepartments.size() > 0) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_subdepartment.already_added")); - } - - subDepartments.close(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java deleted file mode 100644 index 07e8b62cc..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsStep.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * Step for adding subdepartments to a {@link SciDepartment}. - * - * @author Jens Pelzetter - * @see SciDepartment - */ -public class SciDepartmentSubDepartmentsStep extends SimpleEditStep { - - private String ADD_SUBDEPARTMENT_SHEET_NAME = "addSubDepartment"; - - public SciDepartmentSubDepartmentsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciDepartmentSubDepartmentsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addSubDepartmentSheet = - new SciDepartmentSubDepartmentAddForm(itemModel); - add(ADD_SUBDEPARTMENT_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.add_subdepartment").localize(), - new WorkflowLockedComponentAccess(addSubDepartmentSheet, itemModel), - addSubDepartmentSheet.getSaveCancelSection().getCancelButton()); - - SciDepartmentSubDepartmentsTable subdepartmentTable = - new SciDepartmentSubDepartmentsTable( - itemModel); - setDisplayComponent(subdepartmentTable); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsTable.java deleted file mode 100644 index c491e6ab1..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSubDepartmentsTable.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciDepartmentSubDepartmentsCollection; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; -import org.apache.log4j.Logger; - -/** - * Table for showing the subdepartments of a {@link SciDepartment}. - * - * @author Jens Pelzetter - * @see SciDepartment - */ -public class SciDepartmentSubDepartmentsTable - extends Table - implements TableActionListener { - - private final Logger s_log = Logger.getLogger( - SciDepartmentSubDepartmentsTable.class); - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private final String TABLE_COL_UP = "table_col_up"; - private final String TABLE_COL_DOWN = "table_col_down"; - private ItemSelectionModel m_itemModel; - - public SciDepartmentSubDepartmentsTable(ItemSelectionModel itemModel) { - super(); - m_itemModel = itemModel; - - setEmptyView( - new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.subdepartments.none"))); - - TableColumnModel colModel = getColumnModel(); - colModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.subdepartment").localize(), - TABLE_COL_EDIT)); - colModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.subdepartment.remove").localize(), - TABLE_COL_DEL)); - colModel.add(new TableColumn( - 2, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.subdepartment.up").localize(), - TABLE_COL_UP)); - colModel.add(new TableColumn( - 3, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.subdepartment.down").localize(), - TABLE_COL_DOWN)); - - setModelBuilder( - new SciDepartmentSubDepartmentsTableModelBuilder(itemModel)); - - colModel.get(0).setCellRenderer(new EditCellRenderer()); - colModel.get(1).setCellRenderer(new DeleteCellRenderer()); - colModel.get(2).setCellRenderer(new UpCellRenderer()); - colModel.get(3).setCellRenderer(new DownCellRenderer()); - - addTableActionListener(this); - } - - private class SciDepartmentSubDepartmentsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel m_itemModel; - - public SciDepartmentSubDepartmentsTableModelBuilder( - ItemSelectionModel itemModel) { - m_itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject(state); - return new SciDepartmentSubDepartmentsTableModel(table, - state, - department); - } - } - - private class SciDepartmentSubDepartmentsTableModel - implements TableModel { - - private Table m_table; - private SciDepartmentSubDepartmentsCollection m_subdepartments; - private SciDepartment m_subdepartment; - - private SciDepartmentSubDepartmentsTableModel(Table table, - PageState state, - SciDepartment department) { - m_table = table; - m_subdepartments = department.getSubDepartments(); - } - - @Override - public int getColumnCount() { - return m_table.getColumnModel().size(); - } - - @Override - public boolean nextRow() { - boolean ret; - - if ((m_subdepartments != null) && m_subdepartments.next()) { - m_subdepartment = m_subdepartments.getSubDepartment(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - @Override - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return m_subdepartment.getTitle(); - case 1: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.subdepartment.remove"). - localize(); - case 2: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.subdepartment.up"). - localize(); - case 3: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.subdepartment.down"). - localize(); - default: - return null; - } - } - - @Override - public Object getKeyAt(int columnIndex) { - return m_subdepartment.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.EDIT_ITEM, - department); - - if (canEdit) { - SciDepartment subDepartment; - try { - subDepartment = new SciDepartment( - (BigDecimal) key); - } catch (ObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = new Link(String.format("%s (%s)", - value.toString(), - subDepartment.getLanguage()), - resolver.generateItemURL(state, - subDepartment, - section, - subDepartment. - getVersion())); - - return link; - - - } else { - SciDepartment subDepartment; - try { - subDepartment = new SciDepartment( - (BigDecimal) key); - } catch (ObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - Label label = new Label(String.format("%s (%s)", - value.toString(), - subDepartment.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.DELETE_ITEM, - department); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "sciorganization.ui.department.subdepartment." - + ".confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - private class UpCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - if (0 == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.subdepartment.up"). - localize()); - return link; - } - } - } - - private class DownCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject(state); - SciDepartmentSubDepartmentsCollection subDepartments = - department.getSubDepartments(); - - if ((subDepartments.size() - 1) == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.subdepartment.down"). - localize()); - return link; - } - } - } - - @Override - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - SciDepartment subdepartment = new SciDepartment( - new BigDecimal(event.getRowKey().toString())); - - SciDepartment department = - (SciDepartment) m_itemModel.getSelectedObject(state); - - SciDepartmentSubDepartmentsCollection subdepartments = - department.getSubDepartments(); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { - department.removeSubDepartment(subdepartment); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) { - subdepartments.swapWithPrevious(subdepartment); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) { - subdepartments.swapWithNext(subdepartment); - } - } - - @Override - public void headSelected(TableActionEvent event) { - //Nothing to do. - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentForm.java deleted file mode 100644 index 04cac9c04..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentForm.java +++ /dev/null @@ -1,124 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Form for setting the superior department of a {@link SciDepartment}. - * - * @author Jens Pelzetter - * @see SciDepartment - */ -public class SciDepartmentSuperDepartmentForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget m_itemSearch; - private final String ITEM_SEARCH = "superdepartment"; - - public SciDepartmentSuperDepartmentForm(ItemSelectionModel itemModel) { - super("SuperDepartmentSetForm", itemModel); - } - - @Override - public void addWidgets() { - add(new Label((String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_superdepartment"). - localize())); - m_itemSearch = new ItemSearchWidget( - ITEM_SEARCH, - ContentType.findByAssociatedObjectType( - SciDepartment.class.getName())); - add(m_itemSearch); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciDepartment department = (SciDepartment) getItemSelectionModel(). - getSelectedObject(state); - - if ((this.getSaveCancelSection().getSaveButton().isSelected(state))) { - SciDepartment superDepartment = - (SciDepartment) data.get(ITEM_SEARCH); - superDepartment = (SciDepartment) superDepartment.getContentBundle(). - getInstance(department.getLanguage()); - - department.setSuperDepartment(superDepartment); - } - - init(fse); - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_superdepartment.no_department_selected")); - return; - } - - SciDepartment department = (SciDepartment) getItemSelectionModel(). - getSelectedObject(state); - SciDepartment superDepartment = - (SciDepartment) data.get(ITEM_SEARCH); - if (!(superDepartment.getContentBundle().hasInstance(department. - getLanguage()))) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_superdepartment.no_suitable_language_variant")); - return; - } - - superDepartment = (SciDepartment) superDepartment.getContentBundle(). - getInstance(department.getLanguage()); - if (superDepartment.getID().equals(department.getID())) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.select_superdepartment.same_department")); - return; - } - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentSheet.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentSheet.java deleted file mode 100644 index 453032dd1..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentSheet.java +++ /dev/null @@ -1,282 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; - -/** - * Sheet for showing the superior department of a {@link SciDepartment}. - * - * @author Jens Pelzetter - * @see SciDepartment - */ -public class SciDepartmentSuperDepartmentSheet - extends Table - implements TableActionListener { - - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private ItemSelectionModel m_itemModel; - - public SciDepartmentSuperDepartmentSheet(ItemSelectionModel itemModel) { - super(); - m_itemModel = itemModel; - - setEmptyView( - new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.superdepartment_none"))); - - TableColumnModel colModel = getColumnModel(); - colModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.superdepartment").localize(), - TABLE_COL_EDIT)); - colModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.superdepartment.remove").localize(), - TABLE_COL_DEL)); - - setModelBuilder( - new SciDepartmentSuperDepartmentSheetModelBuilder(itemModel)); - colModel.get(0).setCellRenderer(new EditCellRenderer()); - colModel.get(1).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - } - - private class SciDepartmentSuperDepartmentSheetModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel m_itemModel; - - public SciDepartmentSuperDepartmentSheetModelBuilder( - ItemSelectionModel itemModel) { - m_itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject(state); - return new SciDepartmentSuperDepartmentSheetModel(table, - state, - department); - } - } - - private class SciDepartmentSuperDepartmentSheetModel - implements TableModel { - - private Table m_table; - private SciDepartment m_superDepartment; - private boolean m_done; - - public SciDepartmentSuperDepartmentSheetModel(Table table, - PageState state, - SciDepartment department) { - m_table = table; - m_superDepartment = department.getSuperDepartment(); - if (m_superDepartment == null) { - m_done = false; - } else { - m_done = true; - } - } - - @Override - public int getColumnCount() { - return m_table.getColumnModel().size(); - } - - @Override - public boolean nextRow() { - boolean ret; - - if (m_done) { - ret = true; - m_done = false; - } else { - ret = false; - } - - return ret; - } - - @Override - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return m_superDepartment.getTitle(); - case 1: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.superdepartment.remove"). - localize(); - default: - return null; - } - } - - @Override - public Object getKeyAt(int columnIndex) { - return m_superDepartment.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, Object value, - boolean isSelected, - Object key, - int row, - int column) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciDepartment department = (SciDepartment) m_itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.EDIT_ITEM, - department); - - if (canEdit) { - SciDepartment subDepartment; - try { - subDepartment = new SciDepartment((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = new Link(String.format("%s (%s)", - value.toString(), - subDepartment.getLanguage()), - resolver.generateItemURL(state, - subDepartment, - section, - subDepartment. - getVersion())); - - return link; - } else { - SciDepartment subDepartment; - try { - subDepartment = new SciDepartment((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - Label label = new Label( - String.format("%s (%s)", - value.toString(), - subDepartment.getLanguage())); - return label; - } - - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, Object value, - boolean isSelected, - Object key, - int row, - int column) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciDepartment project = (SciDepartment) m_itemModel. - getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.DELETE_ITEM, - project); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "sciorganization.ui.department.superdepartment." - + ".confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - SciDepartment department = - (SciDepartment) m_itemModel.getSelectedObject( - state); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { - department.setSuperDepartment(null); - } - } - - public void headSelected(TableActionEvent event) { - //Noting to do - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentStep.java deleted file mode 100644 index cbd532251..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentSuperDepartmentStep.java +++ /dev/null @@ -1,65 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * Step for setting the superior department of a {@link SciDepartment}. - * - * @author Jens Pelzetter - * @see SciDepartment - */ -public class SciDepartmentSuperDepartmentStep extends SimpleEditStep { - - private String SET_SUPER_DEPARTMENT_STEP = "setSuperDepartment"; - - public SciDepartmentSuperDepartmentStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciDepartmentSuperDepartmentStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm setSuperDepartmentForm = - new SciDepartmentSuperDepartmentForm(itemModel); - add(SET_SUPER_DEPARTMENT_STEP, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.department.setSuperDepartment").localize(), - new WorkflowLockedComponentAccess(setSuperDepartmentForm, - itemModel), - setSuperDepartmentForm.getSaveCancelSection(). - getCancelButton()); - - SciDepartmentSuperDepartmentSheet sheet = - new SciDepartmentSuperDepartmentSheet( - itemModel); - setDisplayComponent(sheet); - - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java deleted file mode 100644 index c801f9a20..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertiesStep.java +++ /dev/null @@ -1,98 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.SegmentedPanel; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.GenericPerson; -import com.arsdigita.cms.contenttypes.SciMember; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicPageForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; - -/** - * Step for editing the basic properties of an {@link SciMember}. - * - * @author Jens Pelzetter - * @see SciMember - * @see GenericPerson - */ -public class SciMemberPropertiesStep extends SimpleEditStep { - - public static final String EDIT_SHEET_NAME = "edit"; - private SegmentedPanel segmentedPanel; - - public SciMemberPropertiesStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - super(itemModel, parent); - - segmentedPanel = new SegmentedPanel(); - setDefaultEditKey(EDIT_SHEET_NAME); - - SimpleEditStep basicProperties = new SimpleEditStep(itemModel, - parent, - EDIT_SHEET_NAME); - - BasicPageForm editSheet; - editSheet = new SciMemberPropertyForm(itemModel, this); - basicProperties.add(EDIT_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.member.edit_basic_properties").localize(), - new WorkflowLockedComponentAccess(editSheet, - itemModel), - editSheet.getSaveCancelSection().getCancelButton()); - - basicProperties.setDisplayComponent(getSciMemberPropertySheet(itemModel)); - - segmentedPanel.addSegment(new Label((String) SciOrganizationGlobalizationUtil. - globalize("scimember.ui.basic_properties").localize()), - basicProperties); - - segmentedPanel.addSegment(new Label((String) SciOrganizationGlobalizationUtil. - globalize("scimember.ui.organizations").localize()), - new SciMemberSciOrganizationsStep(itemModel, - parent)); - - segmentedPanel.addSegment(new Label((String) SciOrganizationGlobalizationUtil. - globalize("scimember.ui.departments").localize()), - new SciMemberSciDepartmentsStep(itemModel, - parent)); - - segmentedPanel.addSegment(new Label((String) SciOrganizationGlobalizationUtil. - globalize("scimember.ui.projects").localize()), - new SciMemberSciProjectsStep(itemModel, - parent)); - - setDisplayComponent(segmentedPanel); - } - - public static Component getSciMemberPropertySheet( - ItemSelectionModel itemModel) { - DomainObjectPropertySheet sheet; - - sheet = (DomainObjectPropertySheet) GenericPersonPropertiesStep. - getGenericPersonPropertySheet(itemModel); - - return sheet; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java deleted file mode 100644 index b6a17e674..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberPropertyForm.java +++ /dev/null @@ -1,88 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.event.FormSubmissionListener; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.GenericPerson; -import com.arsdigita.cms.contenttypes.SciMember; - -/** - * Form for editing the basic properties of a {@link SciMember}. This form - * extends the form for editing the basic properties of {@link GenericPerson}. - * - * @author Jens Pelzetter - * @see SciMember - * @see GenericPerson - * @see GenericPersonPropertyForm - */ -public class SciMemberPropertyForm - extends GenericPersonPropertyForm - implements FormInitListener, - FormSubmissionListener { - - /*private static final Logger logger = - Logger.getLogger(SciMemberPropertyForm.class); - private SciMemberPropertiesStep m_step; - private CheckboxGroup m_associated; - private CheckboxGroup m_former;*/ - - public SciMemberPropertyForm(ItemSelectionModel itemModel) { - this(itemModel, null); - } - - public SciMemberPropertyForm(ItemSelectionModel itemModel, - SciMemberPropertiesStep step) { - super(itemModel); - //m_step = step; - } - - @Override - protected void addWidgets() { - super.addWidgets(); - } - - @Override - public void init(FormSectionEvent fse) { - super.init(fse); - - FormData data = fse.getFormData(); - SciMember member = (SciMember) super.initBasicWidgets(fse); - } - - @Override - public void process(FormSectionEvent fse) { - super.process(fse); - - PageState state = fse.getPageState(); - SciMember member = (SciMember) super.processBasicWidgets(fse); - - if ((member != null) && getSaveCancelSection().getSaveButton(). - isSelected(fse.getPageState())) { - - member.save(); - - init(fse); - } - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciDepartmentAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciDepartmentAddForm.java deleted file mode 100644 index 8fcc5d91b..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciDepartmentAddForm.java +++ /dev/null @@ -1,231 +0,0 @@ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.event.FormSubmissionListener; -import com.arsdigita.bebop.form.Option; -import com.arsdigita.bebop.form.SingleSelect; -import com.arsdigita.bebop.parameters.NotNullValidationListener; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.RelationAttribute; -import com.arsdigita.cms.RelationAttributeCollection; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciMember; -import com.arsdigita.cms.contenttypes.SciMemberSciDepartmentsCollection; -import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.globalization.GlobalizationHelper; - -/** - * - * @author Jens Pelzetter - * @version $Id$ - */ -public class SciMemberSciDepartmentAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener, - FormSubmissionListener { - - private ItemSearchWidget itemSearch; - private final String ITEM_SEARCH = "sciMemberDepartment"; - private SciMemberSciDepartmentsStep step; - private Label selectedDepartmentNameLabel; - - public SciMemberSciDepartmentAddForm(ItemSelectionModel itemModel, - SciMemberSciDepartmentsStep step) { - super("sciMemberDepartmentAddForm", itemModel); - this.step = step; - } - - @Override - public void addWidgets() { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.department.select_department"))); - itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. - findByAssociatedObjectType(SciDepartment.class.getName())); - add(itemSearch); - - selectedDepartmentNameLabel = new Label(""); - add(selectedDepartmentNameLabel); - - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.person.role"))); - ParameterModel roleParam = - new StringParameter( - SciMemberSciDepartmentsCollection.MEMBER_ROLE); - SingleSelect roleSelect = new SingleSelect(roleParam); - roleSelect.addValidationListener(new NotNullValidationListener()); - roleSelect.addOption( - new Option("", - new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.ui.select_one").localize()))); - RelationAttributeCollection roles = new RelationAttributeCollection( - "SciDepartmentRole"); - roles.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale(). - getLanguage()); - while (roles.next()) { - RelationAttribute role; - role = roles.getRelationAttribute(); - roleSelect.addOption(new Option(role.getKey(), role.getName())); - } - add(roleSelect); - - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.person.status"))); - ParameterModel statusModel = - new StringParameter( - SciMemberSciDepartmentsCollection.STATUS); - SingleSelect statusSelect = new SingleSelect(statusModel); - statusSelect.addValidationListener(new NotNullValidationListener()); - statusSelect.addOption(new Option("", - new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.ui.select_one").localize()))); - RelationAttributeCollection statusColl = - new RelationAttributeCollection( - "GenericOrganizationalUnitMemberStatus"); - statusColl.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale(). - getLanguage()); - while (statusColl.next()) { - RelationAttribute status; - status = statusColl.getRelationAttribute(); - statusSelect.addOption(new Option(status.getKey(), status.getName())); - } - add(statusSelect); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - - SciDepartment department; - String role; - String status; - - department = step.getSelectedDepartment(); - role = step.getSelectedDepartmentRole(); - status = step.getSelectedDepartmentStatus(); - - if (department == null) { - itemSearch.setVisible(state, true); - selectedDepartmentNameLabel.setVisible(state, false); - } else { - data.put(ITEM_SEARCH, department); - data.put(SciMemberSciDepartmentsCollection.MEMBER_ROLE, role); - data.put(SciMemberSciDepartmentsCollection.STATUS, status); - - itemSearch.setVisible(state, false); - selectedDepartmentNameLabel.setVisible(state, true); - selectedDepartmentNameLabel.setLabel(department.getTitle(), state); - } - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciMember member = (SciMember) getItemSelectionModel().getSelectedObject( - state); - - if (this.getSaveCancelSection().getSaveButton().isSelected(state)) { - SciDepartment department; - department = step.getSelectedDepartment(); - - if (department == null) { - SciDepartment departmentToAdd = (SciDepartment) data.get( - ITEM_SEARCH); - departmentToAdd = (SciDepartment) departmentToAdd. - getContentBundle().getInstance( - member.getLanguage()); - - member.addDepartment(departmentToAdd, - (String) data.get( - SciMemberSciDepartmentsCollection.MEMBER_ROLE), - (String) data.get( - SciMemberSciDepartmentsCollection.STATUS)); - } else { - SciMemberSciDepartmentsCollection departments; - - departments = member.getDepartments(); - - while (departments.next()) { - if (departments.getDepartment().equals(department)) { - break; - } - } - - departments.setRoleName((String) data.get( - SciMemberSciDepartmentsCollection.MEMBER_ROLE)); - departments.setStatus((String) data.get( - SciMemberSciDepartmentsCollection.STATUS)); - - step.setSelectedDepartment(null); - step.setSelectedDepartmentRole(null); - step.setSelectedDepartmentStatus(null); - - departments.close(); - } - - init(fse); - } - } - - @Override - public void submitted(FormSectionEvent fse) throws FormProcessException { - if (getSaveCancelSection().getCancelButton().isSelected( - fse.getPageState())) { - step.setSelectedDepartment(null); - step.setSelectedDepartmentRole(null); - step.setSelectedDepartmentStatus(null); - - init(fse); - } - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.department.select_department.no_department_selected")); - return; - } - - SciMember member = (SciMember) getItemSelectionModel().getSelectedObject( - state); - SciDepartment department = (SciDepartment) data.get(ITEM_SEARCH); - if (!(department.getContentBundle().hasInstance(member.getLanguage()))) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.department.select_department.no_suitable_language_variant")); - return; - } - - department = (SciDepartment) department.getContentBundle().getInstance(member. - getLanguage()); - SciMemberSciDepartmentsCollection departments = member.getDepartments(); - departments.addFilter(String.format("id = %s", department.getID().toString())); - if (departments.size() > 0) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.department.select_department.already_added")); - } - - departments.close(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciDepartmentsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciDepartmentsStep.java deleted file mode 100644 index 22fd17c4f..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciDepartmentsStep.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * - * @author Jens Pelzetter - * @version $Id$ - */ -public class SciMemberSciDepartmentsStep extends SimpleEditStep { - - private String MEMBER_ADD_DEPARTMENT_SHEET_NAME = "memberAddDepartment"; - private SciDepartment selectedDepartment; - private String selectedDepartmentRole; - private String selectedDepartmentStatus; - - public SciMemberSciDepartmentsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciMemberSciDepartmentsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addDepartmentForm = new SciMemberSciDepartmentAddForm(itemModel, this); - add(MEMBER_ADD_DEPARTMENT_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize("scimember.ui.department.add").localize(), - new WorkflowLockedComponentAccess(addDepartmentForm, itemModel), - addDepartmentForm.getSaveCancelSection().getCancelButton()); - - setDisplayComponent(new SciMemberSciDepartmentsTable(itemModel, this)); - } - - protected SciDepartment getSelectedDepartment() { - return selectedDepartment; - } - - protected void setSelectedDepartment(SciDepartment selectedDepartment) { - this.selectedDepartment = selectedDepartment; - } - - protected String getSelectedDepartmentRole() { - return selectedDepartmentRole; - } - - protected void setSelectedDepartmentRole(String selectedDepartmentRole) { - this.selectedDepartmentRole = selectedDepartmentRole; - } - - protected String getSelectedDepartmentStatus() { - return selectedDepartmentStatus; - } - - protected void setSelectedDepartmentStatus(String selectedDepartmentStatus) { - this.selectedDepartmentStatus = selectedDepartmentStatus; - } - - protected void showEditComponent(PageState state) { - showComponent(state, MEMBER_ADD_DEPARTMENT_SHEET_NAME); - } - -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciDepartmentsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciDepartmentsTable.java deleted file mode 100644 index e8c0fbe00..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciDepartmentsTable.java +++ /dev/null @@ -1,352 +0,0 @@ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.RelationAttributeCollection; -import com.arsdigita.cms.contenttypes.SciMember; -import com.arsdigita.cms.contenttypes.SciMemberSciDepartmentsCollection; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; -import org.apache.log4j.Logger; - -/** - * - * @author Jens Pelzetter - */ -public class SciMemberSciDepartmentsTable - extends Table - implements TableActionListener { - - private static final Logger logger = Logger.getLogger( - SciMemberSciDepartmentsTable.class); - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_EDIT_LINK = "table_col_edit_link"; - private final String TABLE_COL_DEL = "table_col_del"; - private final String TABLE_COL_UP = "table_col_up"; - private final String TABLE_COL_DOWN = "table_col_down"; - private ItemSelectionModel itemModel; - private SciMemberSciDepartmentsStep step; - - public SciMemberSciDepartmentsTable(ItemSelectionModel itemModel, - SciMemberSciDepartmentsStep step) { - super(); - this.itemModel = itemModel; - this.step = step; - - setEmptyView(new Label(SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.departments.none"))); - - TableColumnModel columnModel = getColumnModel(); - columnModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.department").localize(), - TABLE_COL_EDIT)); - columnModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.department.role").localize())); - columnModel.add(new TableColumn( - 2, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.department.status").localize())); - columnModel.add(new TableColumn( - 3, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.department.edit").localize(), - TABLE_COL_EDIT_LINK)); - columnModel.add(new TableColumn( - 4, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.department.remove").localize(), - TABLE_COL_DEL)); - - setModelBuilder( - new SciMemberSciDepartmentsTableModelBuilder(itemModel)); - columnModel.get(0).setCellRenderer(new EditCellRenderer()); - columnModel.get(3).setCellRenderer(new EditLinkCellRenderer()); - columnModel.get(4).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - } - - private class SciMemberSciDepartmentsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - public SciMemberSciDepartmentsTableModelBuilder( - ItemSelectionModel itemModel) { - SciMemberSciDepartmentsTable.this.itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciMember member = (SciMember) itemModel.getSelectedObject(state); - return new SciMemberSciDepartmentsTableModel(table, - state, - member); - } - } - - private class SciMemberSciDepartmentsTableModel implements TableModel { - - private Table table; - private SciMemberSciDepartmentsCollection departments; - private SciDepartment department; - - public SciMemberSciDepartmentsTableModel(Table table, - PageState state, - SciMember member) { - this.table = table; - this.departments = member.getDepartments(); - } - - @Override - public int getColumnCount() { - return table.getColumnModel().size(); - } - - @Override - public boolean nextRow() { - boolean ret; - - if ((departments != null) && departments.next()) { - department = departments.getDepartment(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - @Override - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return department.getTitle(); - case 1: - RelationAttributeCollection role = - new RelationAttributeCollection( - "SciDepartmentRole", - departments.getRoleName()); - if (role.next()) { - String roleName = role.getName(); - role.close(); - return roleName; - } else { - return ContenttypesGlobalizationUtil.globalize( - "cms.ui.unknownRole").localize(); - } - case 2: - RelationAttributeCollection status = - new RelationAttributeCollection( - "GenericOrganizationalUnitMemberStatus", - departments.getStatus()); - if (status.next()) { - String statusName = status.getName(); - status.close(); - return statusName; - } else { - return ContenttypesGlobalizationUtil.globalize( - "cms.ui.unknownStatus").localize(); - } - case 3: - return SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.departments.edit_assoc").localize(); - case 4: - return SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.departments.remove").localize(); - default: - return null; - } - } - - @Override - public Object getKeyAt(int columnIndex) { - return department.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - SciMember member = (SciMember) itemModel.getSelectedObject(state); - - boolean canEdit = securityManager.canAccess(state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - member); - - if (canEdit) { - SciDepartment department; - try { - department = new SciDepartment((BigDecimal) key); - } catch (DataObjectNotFoundException ex) { - logger.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = new Link(String.format("%s (%s)", - value.toString(), - department.getLanguage()), - resolver.generateItemURL(state, - department, - section, - department. - getVersion())); - return link; - } else { - SciDepartment department; - try { - department = new SciDepartment((BigDecimal) key); - } catch (DataObjectNotFoundException ex) { - logger.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - Label label = new Label(String.format("%s (%s)", - value.toString(), - department.getLanguage())); - return label; - } - } - } - - private class EditLinkCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { - com.arsdigita.cms.SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciMember member = (SciMember) itemModel.getSelectedObject(state); - - boolean canEdit = securityManager.canAccess(state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - member); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - SciMember member = (SciMember) itemModel.getSelectedObject(state); - - boolean canEdit = securityManager.canAccess(state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - member); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "scimember.ui.department." - + "confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - @Override - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - SciDepartment department = new SciDepartment(new BigDecimal(event. - getRowKey().toString())); - - SciMember member = (SciMember) itemModel.getSelectedObject(state); - - SciMemberSciDepartmentsCollection departments = member.getDepartments(); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (TABLE_COL_EDIT.equals(column.getHeaderKey().toString())) { - } else if (TABLE_COL_EDIT_LINK.equals( - column.getHeaderKey().toString())) { - while (departments.next()) { - if (departments.getDepartment().equals(department)) { - break; - } - } - step.setSelectedDepartment(departments.getDepartment()); - step.setSelectedDepartmentRole(departments.getRoleName()); - step.setSelectedDepartmentStatus(departments.getStatus()); - - departments.close(); - - step.showEditComponent(state); - } else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) { - member.removeDepartment(department); - } - } - - @Override - public void headSelected(TableActionEvent event) { - //Nothing to do - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciOrganizationAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciOrganizationAddForm.java deleted file mode 100644 index 5c607021f..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciOrganizationAddForm.java +++ /dev/null @@ -1,234 +0,0 @@ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.event.FormSubmissionListener; -import com.arsdigita.bebop.form.Option; -import com.arsdigita.bebop.form.SingleSelect; -import com.arsdigita.bebop.parameters.NotNullValidationListener; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.RelationAttribute; -import com.arsdigita.cms.RelationAttributeCollection; -import com.arsdigita.cms.contenttypes.SciMember; -import com.arsdigita.cms.contenttypes.SciMemberSciOrganizationsCollection; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.globalization.GlobalizationHelper; - -/** - * - * @author Jens Pelzetter - */ -public class SciMemberSciOrganizationAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener, - FormSubmissionListener { - - private ItemSearchWidget itemSearch; - private final String ITEM_SEARCH = "sciMemberOrganization"; - private SciMemberSciOrganizationsStep step; - private Label selectedOrganizationNameLabel; - - public SciMemberSciOrganizationAddForm(ItemSelectionModel itemModel, - SciMemberSciOrganizationsStep step) { - super("sciMemberOrganizationAddForm", itemModel); - this.step = step; - - } - - @Override - protected void addWidgets() { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organization.select_organization"))); - itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. - findByAssociatedObjectType(SciOrganization.class.getName())); - add(itemSearch); - - selectedOrganizationNameLabel = new Label(""); - add(selectedOrganizationNameLabel); - - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.person.role"))); - ParameterModel roleParam = - new StringParameter( - SciMemberSciOrganizationsCollection.MEMBER_ROLE); - SingleSelect roleSelect = new SingleSelect(roleParam); - roleSelect.addValidationListener(new NotNullValidationListener()); - roleSelect.addOption( - new Option("", - new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.ui.select_one").localize()))); - RelationAttributeCollection roles = new RelationAttributeCollection( - "SciOrganizationRole"); - roles.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale(). - getLanguage()); - while (roles.next()) { - RelationAttribute role; - role = roles.getRelationAttribute(); - roleSelect.addOption(new Option(role.getKey(), role.getName())); - } - add(roleSelect); - - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.person.status"))); - ParameterModel statusModel = - new StringParameter( - SciMemberSciOrganizationsCollection.STATUS); - SingleSelect statusSelect = new SingleSelect(statusModel); - statusSelect.addValidationListener(new NotNullValidationListener()); - statusSelect.addOption(new Option("", - new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.ui.select_one").localize()))); - RelationAttributeCollection statusColl = - new RelationAttributeCollection( - "GenericOrganizationalUnitMemberStatus"); - statusColl.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale(). - getLanguage()); - while (statusColl.next()) { - RelationAttribute status; - status = statusColl.getRelationAttribute(); - statusSelect.addOption(new Option(status.getKey(), status.getName())); - } - add(statusSelect); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - - SciOrganization orga; - String role; - String status; - - orga = step.getSelectedOrganization(); - role = step.getSelectedOrganizationRole(); - status = step.getSelectedOrganizationStatus(); - - if (orga == null) { - itemSearch.setVisible(state, true); - selectedOrganizationNameLabel.setVisible(state, false); - } else { - data.put(ITEM_SEARCH, orga); - data.put(SciMemberSciOrganizationsCollection.MEMBER_ROLE, role); - data.put(SciMemberSciOrganizationsCollection.STATUS, status); - - itemSearch.setVisible(state, false); - selectedOrganizationNameLabel.setVisible(state, true); - selectedOrganizationNameLabel.setLabel(orga.getTitle(), state); - } - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciMember member = (SciMember) getItemSelectionModel().getSelectedObject( - state); - - if (this.getSaveCancelSection().getSaveButton().isSelected(state)) { - - SciOrganization orga; - orga = step.getSelectedOrganization(); - - if (orga == null) { - SciOrganization orgaToAdd = (SciOrganization) data.get( - ITEM_SEARCH); - orgaToAdd = (SciOrganization) orgaToAdd.getContentBundle(). - getInstance(member.getLanguage()); - - member.addOrganization(orga, - (String) data.get( - SciMemberSciOrganizationsCollection.MEMBER_ROLE), - (String) data.get( - SciMemberSciOrganizationsCollection.STATUS)); - } else { - SciMemberSciOrganizationsCollection orgas; - - orgas = member.getOrganizations(); - - while (orgas.next()) { - if (orgas.getOrganization().equals(orga)) { - break; - } - } - - orgas.setRoleName((String) data.get( - SciMemberSciOrganizationsCollection.MEMBER_ROLE)); - orgas.setStatus((String) data.get( - SciMemberSciOrganizationsCollection.STATUS)); - - step.setSelectedOrganization(null); - step.setSelectedOrganizationRole(null); - step.setSelectedOrganizationStatus(null); - - orgas.close(); - } - - init(fse); - } - } - - @Override - public void submitted(FormSectionEvent fse) throws FormProcessException { - if (getSaveCancelSection().getCancelButton().isSelected( - fse.getPageState())) { - step.setSelectedOrganization(null); - step.setSelectedOrganizationRole(null); - step.setSelectedOrganizationStatus(null); - - init(fse); - } - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organization.select_organization.no_orga_selected")); - return; - } - - SciMember member = (SciMember) getItemSelectionModel().getSelectedObject( - state); - SciOrganization orga = (SciOrganization) data.get( - ITEM_SEARCH); - if (!(orga.getContentBundle().hasInstance(member.getLanguage()))) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organization.select_organization.no_suitable_language_variant")); - return; - } - - orga = (SciOrganization) orga.getContentBundle().getInstance(member. - getLanguage()); - SciMemberSciOrganizationsCollection organizations = member. - getOrganizations(); - organizations.addFilter(String.format("id = %s", - orga.getID().toString())); - if (organizations.size() > 0) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organization.select_organization.already_added")); - } - - organizations.close(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciOrganizationsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciOrganizationsStep.java deleted file mode 100644 index 6650bcb9e..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciOrganizationsStep.java +++ /dev/null @@ -1,71 +0,0 @@ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * - * @author Jens Pelzetter - */ -public class SciMemberSciOrganizationsStep extends SimpleEditStep { - - private String MEMBER_ADD_ORGANIZATION_SHEET_NAME = "memberAddOrganization"; - private SciOrganization selectedOrganization; - private String selectedOrganizationRole; - private String selectedOrganizationStatus; - - public SciMemberSciOrganizationsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciMemberSciOrganizationsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addOrganizationForm = new SciMemberSciOrganizationAddForm( - itemModel, - this); - add(MEMBER_ADD_ORGANIZATION_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organization.add").localize(), - new WorkflowLockedComponentAccess(addOrganizationForm, itemModel), - addOrganizationForm.getSaveCancelSection().getCancelButton()); - - setDisplayComponent(new SciMemberSciOrganizationsTable(itemModel, this)); - } - - protected SciOrganization getSelectedOrganization() { - return selectedOrganization; - } - - protected void setSelectedOrganization(SciOrganization organization) { - this.selectedOrganization = organization; - } - - protected String getSelectedOrganizationRole() { - return selectedOrganizationRole; - } - - protected void setSelectedOrganizationRole(String role) { - this.selectedOrganizationRole = role; - } - - protected String getSelectedOrganizationStatus() { - return selectedOrganizationStatus; - } - - protected void setSelectedOrganizationStatus(String status) { - this.selectedOrganizationStatus = status; - } - - protected void showEditComponent(PageState state) { - showComponent(state, MEMBER_ADD_ORGANIZATION_SHEET_NAME); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciOrganizationsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciOrganizationsTable.java deleted file mode 100644 index ca2915382..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciOrganizationsTable.java +++ /dev/null @@ -1,354 +0,0 @@ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.RelationAttributeCollection; -import com.arsdigita.cms.contenttypes.SciMember; -import com.arsdigita.cms.contenttypes.SciMemberSciOrganizationsCollection; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; -import org.apache.log4j.Logger; - -/** - * - * @author Jens Pelzetter - */ -public class SciMemberSciOrganizationsTable - extends Table - implements TableActionListener { - - private static final Logger logger = Logger.getLogger( - SciMemberSciOrganizationsTable.class); - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_EDIT_LINK = "table_col_edit_link"; - private final String TABLE_COL_DEL = "table_col_del"; - private final String TABLE_COL_UP = "table_col_up"; - private final String TABLE_COL_DOWN = "table_col_down"; - private ItemSelectionModel itemModel; - private SciMemberSciOrganizationsStep step; - - public SciMemberSciOrganizationsTable(ItemSelectionModel itemModel, - SciMemberSciOrganizationsStep step) { - super(); - this.itemModel = itemModel; - this.step = step; - - setEmptyView(new Label(SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organizations.none"))); - - TableColumnModel columnModel = getColumnModel(); - columnModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organization").localize(), - TABLE_COL_EDIT)); - columnModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organization.role").localize())); - columnModel.add(new TableColumn( - 2, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organization.status").localize())); - columnModel.add(new TableColumn( - 3, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organization.edit").localize(), - TABLE_COL_EDIT_LINK)); - columnModel.add(new TableColumn( - 4, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organization.remove").localize(), - TABLE_COL_DEL)); - - setModelBuilder( - new SciMemberSciOrganizationsTableModelBuilder(itemModel)); - columnModel.get(0).setCellRenderer(new EditCellRenderer()); - columnModel.get(3).setCellRenderer(new EditLinkCellRenderer()); - columnModel.get(4).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - } - - private class SciMemberSciOrganizationsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - public SciMemberSciOrganizationsTableModelBuilder( - ItemSelectionModel itemModel) { - SciMemberSciOrganizationsTable.this.itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciMember member = (SciMember) itemModel.getSelectedObject(state); - return new SciMemberSciOrganizationsTableModel(table, - state, - member); - } - } - - private class SciMemberSciOrganizationsTableModel implements TableModel { - - private Table table; - private SciMemberSciOrganizationsCollection organizations; - private SciOrganization organization; - - public SciMemberSciOrganizationsTableModel(Table table, - PageState state, - SciMember member) { - this.table = table; - this.organizations = member.getOrganizations(); - } - - @Override - public int getColumnCount() { - return table.getColumnModel().size(); - } - - @Override - public boolean nextRow() { - boolean ret; - - if ((organizations != null) && organizations.next()) { - organization = organizations.getOrganization(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - @Override - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return organization.getTitle(); - case 1: - RelationAttributeCollection role = - new RelationAttributeCollection( - "SciOrganizationRole", - organizations.getRoleName()); - if (role.next()) { - String roleName = role.getName(); - role.close(); - return roleName; - } else { - return ContenttypesGlobalizationUtil.globalize( - "cms.ui.unknownRole").localize(); - } - case 2: - RelationAttributeCollection status = - new RelationAttributeCollection( - "GenericOrganizationalUnitMemberStatus", - organizations.getStatus()); - if (status.next()) { - String statusName = status.getName(); - status.close(); - return statusName; - } else { - return ContenttypesGlobalizationUtil.globalize( - "cms.ui.unknownStatus").localize(); - } - case 3: - return SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organizations.edit_assoc").localize(); - case 4: - return SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.organizations.remove").localize(); - default: - return null; - } - } - - @Override - public Object getKeyAt(int columnIndex) { - return organization.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - SciMember member = (SciMember) itemModel.getSelectedObject(state); - - boolean canEdit = securityManager.canAccess(state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - member); - - if (canEdit) { - SciOrganization organization; - try { - organization = new SciOrganization((BigDecimal) key); - } catch (DataObjectNotFoundException ex) { - logger.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = new Link(String.format("%s (%s)", - value.toString(), - organization.getLanguage()), - resolver.generateItemURL(state, - organization, - section, - organization. - getVersion())); - return link; - } else { - SciOrganization organization; - try { - organization = new SciOrganization((BigDecimal) key); - } catch (DataObjectNotFoundException ex) { - logger.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - Label label = new Label(String.format("%s (%s)", - value.toString(), - organization.getLanguage())); - return label; - } - } - } - - private class EditLinkCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { - com.arsdigita.cms.SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciMember member = (SciMember) itemModel.getSelectedObject(state); - - boolean canEdit = securityManager.canAccess(state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - member); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - SciMember member = (SciMember) itemModel.getSelectedObject(state); - - boolean canEdit = securityManager.canAccess(state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - member); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "scimember.ui.organization." - + "confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - @Override - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - SciOrganization organization = new SciOrganization(new BigDecimal(event. - getRowKey().toString())); - - SciMember member = (SciMember) itemModel.getSelectedObject(state); - - SciMemberSciOrganizationsCollection organizations = member. - getOrganizations(); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (TABLE_COL_EDIT.equals(column.getHeaderKey().toString())) { - } else if (TABLE_COL_EDIT_LINK.equals( - column.getHeaderKey().toString())) { - while (organizations.next()) { - if (organizations.getOrganization().equals(organization)) { - break; - } - } - step.setSelectedOrganization(organizations.getOrganization()); - step.setSelectedOrganizationRole(organizations.getRoleName()); - step.setSelectedOrganizationStatus(organizations.getStatus()); - - organizations.close(); - - step.showEditComponent(state); - } else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) { - member.removeOrganization(organization); - } - } - - @Override - public void headSelected(TableActionEvent event) { - //Nothing to do - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciProjectAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciProjectAddForm.java deleted file mode 100644 index 355853e8f..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciProjectAddForm.java +++ /dev/null @@ -1,225 +0,0 @@ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.event.FormSubmissionListener; -import com.arsdigita.bebop.form.Option; -import com.arsdigita.bebop.form.SingleSelect; -import com.arsdigita.bebop.parameters.NotNullValidationListener; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.RelationAttribute; -import com.arsdigita.cms.RelationAttributeCollection; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.SciMember; -import com.arsdigita.cms.contenttypes.SciMemberSciProjectsCollection; -import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.globalization.GlobalizationHelper; - -/** - * - * @author Jens Pelzetter - * @version $Id$ - */ -public class SciMemberSciProjectAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener, - FormSubmissionListener { - - private ItemSearchWidget itemSearch; - private final String ITEM_SEARCH = "sciMemberProject"; - private SciMemberSciProjectsStep step; - private Label selectedProjectNameLabel; - - public SciMemberSciProjectAddForm(ItemSelectionModel itemModel, - SciMemberSciProjectsStep step) { - super("sciMemberProjectAddForm", itemModel); - this.step = step; - } - - @Override - public void addWidgets() { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.project.select_project"))); - itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. - findByAssociatedObjectType(SciProject.class.getName())); - add(itemSearch); - - selectedProjectNameLabel = new Label(""); - add(selectedProjectNameLabel); - - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.person.role"))); - ParameterModel roleParam = - new StringParameter( - SciMemberSciProjectsCollection.MEMBER_ROLE); - SingleSelect roleSelect = new SingleSelect(roleParam); - roleSelect.addValidationListener(new NotNullValidationListener()); - roleSelect.addOption( - new Option("", - new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.ui.select_one").localize()))); - RelationAttributeCollection roles = new RelationAttributeCollection( - "SciProjectRole"); - roles.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale(). - getLanguage()); - while (roles.next()) { - RelationAttribute role; - role = roles.getRelationAttribute(); - roleSelect.addOption(new Option(role.getKey(), role.getName())); - } - add(roleSelect); - - add(new Label(ContenttypesGlobalizationUtil.globalize( - "cms.contenttypes.ui.genericorgaunit.person.status"))); - ParameterModel statusModel = - new StringParameter( - SciMemberSciProjectsCollection.STATUS); - SingleSelect statusSelect = new SingleSelect(statusModel); - statusSelect.addValidationListener(new NotNullValidationListener()); - statusSelect.addOption(new Option("", - new Label((String) ContenttypesGlobalizationUtil. - globalize("cms.ui.select_one").localize()))); - RelationAttributeCollection statusColl = - new RelationAttributeCollection( - "GenericOrganizationalUnitMemberStatus"); - statusColl.addLanguageFilter(GlobalizationHelper.getNegotiatedLocale(). - getLanguage()); - while (statusColl.next()) { - RelationAttribute status; - status = statusColl.getRelationAttribute(); - statusSelect.addOption(new Option(status.getKey(), status.getName())); - } - add(statusSelect); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - - SciProject project; - String role; - String status; - - project = step.getSelectedProject(); - role = step.getSelectedProjectRole(); - status = step.getSelectedProjectStatus(); - - if (project == null) { - itemSearch.setVisible(state, true); - selectedProjectNameLabel.setVisible(state, false); - } else { - data.put(ITEM_SEARCH, project); - data.put(SciMemberSciProjectsCollection.MEMBER_ROLE, role); - data.put(SciMemberSciProjectsCollection.STATUS, status); - - itemSearch.setVisible(state, false); - selectedProjectNameLabel.setVisible(state, true); - selectedProjectNameLabel.setLabel(project.getTitle(), state); - } - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciMember member = (SciMember) getItemSelectionModel().getSelectedObject( - state); - - if (this.getSaveCancelSection().getSaveButton().isSelected(state)) { - SciProject project; - project = step.getSelectedProject(); - - if (project == null) { - SciProject projectToAdd = (SciProject) data.get(ITEM_SEARCH); - projectToAdd = (SciProject) projectToAdd.getContentBundle(). - getInstance(member.getLanguage()); - - member.addProject(projectToAdd, - (String) data.get( - SciMemberSciProjectsCollection.MEMBER_ROLE), - (String) data.get( - SciMemberSciProjectsCollection.STATUS)); - } else { - SciMemberSciProjectsCollection projects; - - projects = member.getProjects(); - - while (projects.next()) { - if (projects.getProject().equals(project)) { - break; - } - } - - projects.setRoleName((String) data.get( - SciMemberSciProjectsCollection.MEMBER_ROLE)); - projects.setStatus((String) data.get( - SciMemberSciProjectsCollection.STATUS)); - - step.setSelectedProject(null); - step.setSelectedProjectRole(null); - step.setSelectedProjectStatus(null); - - projects.close(); - } - - init(fse); - } - } - - @Override - public void submitted(FormSectionEvent fse) throws FormProcessException { - if (getSaveCancelSection().getCancelButton().isSelected( - fse.getPageState())) { - step.setSelectedProject(null); - step.setSelectedProjectRole(null); - step.setSelectedProjectStatus(null); - - init(fse); - } - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError(SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.project.select_project.no_project_selected")); - return; - } - - SciMember member = (SciMember) getItemSelectionModel().getSelectedObject( - state); - SciProject project = (SciProject) data.get(ITEM_SEARCH); - if (!(project.getContentBundle().hasInstance(member.getLanguage()))) { - data.addError(SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.project.select_project.no_suitable_language_variant")); - return; - } - - project = (SciProject) project.getContentBundle().getInstance(member.getLanguage()); - SciMemberSciProjectsCollection projects = member.getProjects(); - projects.addFilter(String.format("id = %s", project.getID().toString())); - if (projects.size() > 0) { - data.addError(SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.project.select_project.already_added")); - } - - projects.close(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciProjectsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciProjectsStep.java deleted file mode 100644 index 81d277702..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciProjectsStep.java +++ /dev/null @@ -1,70 +0,0 @@ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * - * @author Jens Pelzetter - * @version $Id$ - */ -public class SciMemberSciProjectsStep extends SimpleEditStep { - - private String MEMBER_ADD_project_SHEET_NAME = "memberAddproject"; - private SciProject selectedProject; - private String selectedProjectRole; - private String selectedProjectStatus; - - public SciMemberSciProjectsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciMemberSciProjectsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addprojectForm = new SciMemberSciProjectAddForm(itemModel, this); - add(MEMBER_ADD_project_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize("scimember.ui.project.add").localize(), - new WorkflowLockedComponentAccess(addprojectForm, itemModel), - addprojectForm.getSaveCancelSection().getCancelButton()); - - setDisplayComponent(new SciMemberSciProjectsTable(itemModel, this)); - } - - protected SciProject getSelectedProject() { - return selectedProject; - } - - protected void setSelectedProject(SciProject selectedProject) { - this.selectedProject = selectedProject; - } - - protected String getSelectedProjectRole() { - return selectedProjectRole; - } - - protected void setSelectedProjectRole(String selectedProjectRole) { - this.selectedProjectRole = selectedProjectRole; - } - - protected String getSelectedProjectStatus() { - return selectedProjectStatus; - } - - protected void setSelectedProjectStatus(String selectedProjectStatus) { - this.selectedProjectStatus = selectedProjectStatus; - } - - protected void showEditComponent(PageState state) { - showComponent(state, MEMBER_ADD_project_SHEET_NAME); - } - -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciProjectsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciProjectsTable.java deleted file mode 100644 index 58c9bc001..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciMemberSciProjectsTable.java +++ /dev/null @@ -1,352 +0,0 @@ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.RelationAttributeCollection; -import com.arsdigita.cms.contenttypes.SciMember; -import com.arsdigita.cms.contenttypes.SciMemberSciProjectsCollection; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; -import org.apache.log4j.Logger; - -/** - * - * @author Jens Pelzetter - */ -public class SciMemberSciProjectsTable - extends Table - implements TableActionListener { - - private static final Logger logger = Logger.getLogger( - SciMemberSciProjectsTable.class); - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_EDIT_LINK = "table_col_edit_link"; - private final String TABLE_COL_DEL = "table_col_del"; - private final String TABLE_COL_UP = "table_col_up"; - private final String TABLE_COL_DOWN = "table_col_down"; - private ItemSelectionModel itemModel; - private SciMemberSciProjectsStep step; - - public SciMemberSciProjectsTable(ItemSelectionModel itemModel, - SciMemberSciProjectsStep step) { - super(); - this.itemModel = itemModel; - this.step = step; - - setEmptyView(new Label(SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.projects.none"))); - - TableColumnModel columnModel = getColumnModel(); - columnModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.project").localize(), - TABLE_COL_EDIT)); - columnModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.project.role").localize())); - columnModel.add(new TableColumn( - 2, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.project.status").localize())); - columnModel.add(new TableColumn( - 3, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.project.edit").localize(), - TABLE_COL_EDIT_LINK)); - columnModel.add(new TableColumn( - 4, - SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.project.remove").localize(), - TABLE_COL_DEL)); - - setModelBuilder( - new SciMemberSciProjectsTableModelBuilder(itemModel)); - columnModel.get(0).setCellRenderer(new EditCellRenderer()); - columnModel.get(3).setCellRenderer(new EditLinkCellRenderer()); - columnModel.get(4).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - } - - private class SciMemberSciProjectsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - public SciMemberSciProjectsTableModelBuilder( - ItemSelectionModel itemModel) { - SciMemberSciProjectsTable.this.itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciMember member = (SciMember) itemModel.getSelectedObject(state); - return new SciMemberSciProjectsTableModel(table, - state, - member); - } - } - - private class SciMemberSciProjectsTableModel implements TableModel { - - private Table table; - private SciMemberSciProjectsCollection projects; - private SciProject project; - - public SciMemberSciProjectsTableModel(Table table, - PageState state, - SciMember member) { - this.table = table; - this.projects = member.getProjects(); - } - - @Override - public int getColumnCount() { - return table.getColumnModel().size(); - } - - @Override - public boolean nextRow() { - boolean ret; - - if ((projects != null) && projects.next()) { - project = projects.getProject(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - @Override - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return project.getTitle(); - case 1: - RelationAttributeCollection role = - new RelationAttributeCollection( - "SciProjectRole", - projects.getRoleName()); - if (role.next()) { - String roleName = role.getName(); - role.close(); - return roleName; - } else { - return ContenttypesGlobalizationUtil.globalize( - "cms.ui.unknownRole").localize(); - } - case 2: - RelationAttributeCollection status = - new RelationAttributeCollection( - "GenericOrganizationalUnitMemberStatus", - projects.getStatus()); - if (status.next()) { - String statusName = status.getName(); - status.close(); - return statusName; - } else { - return ContenttypesGlobalizationUtil.globalize( - "cms.ui.unknownStatus").localize(); - } - case 3: - return SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.projects.edit_assoc").localize(); - case 4: - return SciOrganizationGlobalizationUtil.globalize( - "scimember.ui.projects.remove").localize(); - default: - return null; - } - } - - @Override - public Object getKeyAt(int columnIndex) { - return project.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - SciMember member = (SciMember) itemModel.getSelectedObject(state); - - boolean canEdit = securityManager.canAccess(state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - member); - - if (canEdit) { - SciProject project; - try { - project = new SciProject((BigDecimal) key); - } catch (DataObjectNotFoundException ex) { - logger.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = new Link(String.format("%s (%s)", - value.toString(), - project.getLanguage()), - resolver.generateItemURL(state, - project, - section, project. - getVersion())); - return link; - } else { - SciProject project; - try { - project = new SciProject((BigDecimal) key); - } catch (DataObjectNotFoundException ex) { - logger.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - Label label = new Label(String.format("%s (%s)", - value.toString(), - project.getLanguage())); - return label; - } - } - } - - private class EditLinkCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { - com.arsdigita.cms.SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciMember member = (SciMember) itemModel.getSelectedObject(state); - - boolean canEdit = securityManager.canAccess(state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - member); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - SciMember member = (SciMember) itemModel.getSelectedObject(state); - - boolean canEdit = securityManager.canAccess(state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - member); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "scimember.ui.project." - + "confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - @Override - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - SciProject project = new SciProject(new BigDecimal(event.getRowKey(). - toString())); - - SciMember member = (SciMember) itemModel.getSelectedObject(state); - - SciMemberSciProjectsCollection projects = member.getProjects(); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (TABLE_COL_EDIT.equals(column.getHeaderKey().toString())) { - } else if (TABLE_COL_EDIT_LINK.equals( - column.getHeaderKey().toString())) { - while (projects.next()) { - if (projects.getProject().equals(project)) { - break; - } - } - step.setSelectedProject(projects.getProject()); - step.setSelectedProjectRole(projects.getRoleName()); - step.setSelectedProjectStatus(projects.getStatus()); - - projects.close(); - - step.showEditComponent(state); - } else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) { - member.removeProject(project); - } - } - - @Override - public void headSelected(TableActionEvent event) { - //Nothing to do - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationBasePanel.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationBasePanel.java deleted file mode 100644 index 5c41927ad..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationBasePanel.java +++ /dev/null @@ -1,796 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitPersonCollection; -import com.arsdigita.cms.contenttypes.GenericPerson; -import com.arsdigita.cms.contenttypes.GenericPersonContactCollection; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciDepartmentProjectsCollection; -import com.arsdigita.cms.contenttypes.SciDepartmentSubDepartmentsCollection; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.OID; -import com.arsdigita.xml.Element; -import java.util.Calendar; -import java.util.Collections; -import java.util.Comparator; -import java.util.Date; -import java.util.GregorianCalendar; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; -import org.apache.log4j.Logger; - -/** - * Base class for all panels of the sci-types-organization module. The panels - * are displaying the information of an organization type ( - * SciOrganization, SciDepartment, - * SciProject) similar to the MultiPartArticle. For - * each information, e.g. members, there is a link, which replaces the - * information shown. To use this as an index item, a special template is - * necessary. An example of such a template can be found in the ccm-zes-aplaws - * module. - * - * @see SciOrganizationPanel - * @see SciDepartmentPanel - * @see SciProjectPanel - * @author Jens Pelzetter - */ -public abstract class SciOrganizationBasePanel - extends GenericOrganizationalUnitPanel { - - private final static Logger s_log = Logger.getLogger( - SciOrganizationBasePanel.class); - - protected class MemberListItem { - - private OID oid; - private String surname; - private String givenName; - private String titlePre; - private String titlePost; - private Date birthdate; - private String gender; - private DataCollection contacts; - //private GenericPerson member; - private String role; - private String status; - - public MemberListItem(final GenericPerson member, - final String role, - final String status) { - /*this.member = member; - this.role = role; - this.status = status;*/ - this(member.getOID(), - member.getSurname(), - member.getGivenName(), - member.getTitlePre(), - member.getTitlePost(), - member.getBirthdate(), - member.getGender(), - null, - role, - status); - - } - - public MemberListItem(final OID oid, - final String surname, - final String givenName, - final String titlePre, - final String titlePost, - final Date birthdate, - final String gender, - final DataCollection contacts, - final String role, - final String status) { - this.oid = oid; - this.surname = surname; - this.givenName = givenName; - this.titlePre = titlePre; - this.titlePost = titlePost; - this.birthdate = birthdate; - this.gender = gender; - this.contacts = contacts; - this.role = role; - this.status = status; - } - - /*public GenericPerson getMember() { - return member; - }*/ - public OID getOID() { - return oid; - } - - public Date getBirthdate() { - return birthdate; - } - - public DataCollection getContacts() { - return contacts; - } - - public String getGender() { - return gender; - } - - public String getGivenName() { - return givenName; - } - - public String getSurname() { - return surname; - } - - public String getTitlePost() { - return titlePost; - } - - public String getTitlePre() { - return titlePre; - } - - public String getRole() { - return role; - } - - public String getStatus() { - return status; - } - - /*@Override - public boolean equals(Object obj) { - if (obj instanceof MemberListItem) { - MemberListItem other = (MemberListItem) obj; - - return member.equals(other.getMember()); - } else { - return false; - } - }*/ - @Override - public boolean equals(Object obj) { - if (obj == null) { - return false; - } - if (getClass() != obj.getClass()) { - return false; - } - final MemberListItem other = (MemberListItem) obj; - if ((this.surname == null) ? (other.surname != null) - : !this.surname.equals(other.surname)) { - return false; - } - if ((this.givenName == null) ? (other.givenName != null) - : !this.givenName.equals(other.givenName)) { - return false; - } - if ((this.titlePre == null) ? (other.titlePre != null) - : !this.titlePre.equals(other.titlePre)) { - return false; - } - if ((this.titlePost == null) ? (other.titlePost != null) - : !this.titlePost.equals(other.titlePost)) { - return false; - } - if (this.birthdate != other.birthdate && (this.birthdate == null - || !this.birthdate.equals( - other.birthdate))) { - return false; - } - if ((this.gender == null) ? (other.gender != null) - : !this.gender.equals(other.gender)) { - return false; - } - if ((this.role == null) ? (other.role != null) - : !this.role.equals(other.role)) { - return false; - } - if ((this.status == null) ? (other.status != null) - : !this.status.equals(other.status)) { - return false; - } - return true; - } - - /*@Override - public int hashCode() { - return member.hashCode(); - }*/ - @Override - public int hashCode() { - int hash = 3; - hash = - 41 * hash + (this.surname != null ? this.surname.hashCode() : 0); - hash = - 41 * hash + (this.givenName != null ? this.givenName.hashCode() : 0); - hash = - 41 * hash + (this.titlePre != null ? this.titlePre.hashCode() : 0); - hash = - 41 * hash + (this.titlePost != null ? this.titlePost.hashCode() : 0); - hash = - 41 * hash + (this.birthdate != null ? this.birthdate.hashCode() : 0); - hash = - 41 * hash + (this.gender != null ? this.gender.hashCode() : 0); - hash = 41 * hash + (this.role != null ? this.role.hashCode() : 0); - hash = - 41 * hash + (this.status != null ? this.status.hashCode() : 0); - return hash; - } - } - - protected class MemberListItemComparator - implements Comparator { - - public int compare(MemberListItem member1, MemberListItem member2) { - int result = 0; - - /*result = - member1.getMember().getSurname().compareToIgnoreCase(member2. - getMember(). - getSurname()); - - if (result == 0) { - result = member1.getMember().getGivenName().compareTo( - member2.getMember().getGivenName()); - }*/ - - result = - member1.getSurname().compareToIgnoreCase(member2.getSurname()); - - if (result == 0) { - result = - member1.getGivenName().compareTo(member2.getGivenName()); - } - - return result; - } - } - - protected class SciProjectComparator implements Comparator { - - public int compare(SciProject project1, SciProject project2) { - /*int result = 0; - - if (project1.getBegin() == null) { - return -1; - } else if (project2.getBegin() == null) { - return 1; - } else { - result = project1.getBegin().compareTo(project2.getBegin()); - } - - if (result == 0) { - if (project1.getEnd() == null) { - return -1; - } else if (project2.getEnd() == null) { - return 1; - } else if ((project1.getEnd() == null) && (project2.getEnd() - == null)) { - return 0; - } else { - result = project1.getEnd().compareTo(project2.getEnd()); - } - } - - return result;*/ - - return project1.getTitle().compareTo(project2.getTitle()); - } - } - - protected List getFiltersForActiveMembers() { - List filters; - filters = new LinkedList(); - - filters.add("link.status = 'active'"); - - return filters; - } - - protected List getFiltersForAssociatedMembers() { - List filters; - filters = new LinkedList(); - - filters.add("link.status = 'associated'"); - - return filters; - } - - protected List getFiltersForFormerAssociatedMembers() { - List filters; - filters = new LinkedList(); - - filters.add("link.status = 'associatedFormer'"); - - return filters; - } - - protected List getFiltersForFormerMembers() { - List filters; - filters = new LinkedList(); - - //filters.add("link.status = 'former'"); - filters.add("lower(link.status) like lower('%former%')"); - - return filters; - } - - protected List getFiltersForOngoingProjects() { - List filters; - Calendar today; - - filters = new LinkedList(); - today = new GregorianCalendar(); - filters.add(String.format( - "(projectbegin IS NOT null) AND (projectend > '%d-%02d-%02d' OR projectend IS null)", - today.get(java.util.Calendar.YEAR), - today.get(java.util.Calendar.MONTH) - + 1, - today.get(java.util.Calendar.DAY_OF_MONTH))); - return filters; - } - - protected List getFiltersForFinishedProjects() { - List filters; - Calendar today; - - filters = new LinkedList(); - today = new GregorianCalendar(); - filters.add(String.format("projectend <= '%d-%02d-%02d'", - today.get(java.util.Calendar.YEAR), - today.get(java.util.Calendar.MONTH) - + 1, - today.get(java.util.Calendar.DAY_OF_MONTH))); - return filters; - } - - protected void generateMemberXML(final MemberListItem person, - final Element parent, - final String roleName, - final String status, - final PageState state) { - Element memberElem = parent.newChildElement("member"); - - memberElem.addAttribute("role", roleName); - memberElem.addAttribute("status", status); - memberElem.addAttribute("oid", person.getOID().toString()); - - //Element title = memberElem.newChildElement("title"); - //title.setText(person.getTitle()); - - if ((person.getTitlePre() != null) - && !person.getTitlePre().isEmpty()) { - Element titlePre = memberElem.newChildElement("titlePre"); - titlePre.setText(person.getTitlePre()); - } - - Element surname = memberElem.newChildElement("surname"); - surname.setText(person.getSurname()); - - Element givenName = memberElem.newChildElement("givenname"); - givenName.setText(person.getGivenName()); - - if ((person.getTitlePost() != null) - && !person.getTitlePost().isEmpty()) { - Element titlePost = memberElem.newChildElement("titlePost"); - titlePost.setText(person.getTitlePost()); - } - - if ((person.getContacts() != null) - && (person.getContacts().size() > 0)) { - GenericPersonContactCollection contacts; - contacts = new GenericPersonContactCollection(person.getContacts()); - - Element contactsElem = - memberElem.newChildElement("contacts"); - - while (contacts.next()) { - generateContactXML( - contacts.getContactType(), - contacts.getPerson(), - contacts.getContactEntries(), - contacts.getAddress(), - contactsElem, - state, - contacts.getContactOrder(), - false); - } - } - } - - @Deprecated - protected void generateMemberXML(final GenericPerson person, - final Element parent, - final String roleName, - final String status, - final PageState state) { - Element memberElem = parent.newChildElement("member"); - - memberElem.addAttribute("role", roleName); - memberElem.addAttribute("status", status); - memberElem.addAttribute("oid", person.getOID().toString()); - - Element title = memberElem.newChildElement("title"); - title.setText(person.getTitle()); - - if ((person.getTitlePre() != null) - && !person.getTitlePre().isEmpty()) { - Element titlePre = memberElem.newChildElement("titlePre"); - titlePre.setText(person.getTitlePre()); - } - - Element surname = memberElem.newChildElement("surname"); - surname.setText(person.getSurname()); - - Element givenName = memberElem.newChildElement("givenname"); - givenName.setText(person.getGivenName()); - - if ((person.getTitlePost() != null) - && !person.getTitlePost().isEmpty()) { - Element titlePost = memberElem.newChildElement("titlePost"); - titlePost.setText(person.getTitlePost()); - } - - if ((person.getContacts() != null) - && (person.getContacts().size() > 0)) { - GenericPersonContactCollection contacts; - contacts = person.getContacts(); - - Element contactsElem = - memberElem.newChildElement("contacts"); - - while (contacts.next()) { - generateContactXML( - contacts.getContactType(), - contacts.getPerson(), - contacts.getContactEntries(), - contacts.getAddress(), - contactsElem, - state, - contacts.getContactOrder(), - false); - } - } - } - - protected void addMember( - final GenericOrganizationalUnitPersonCollection persons, - final List members) { - addMember(persons.getOID(), - persons.getSurname(), - persons.getGivenName(), - persons.getTitlePre(), - persons.getTitlePost(), - persons.getBirthdate(), - persons.getGender(), - persons.getContacts(), - persons.getRoleName(), - persons.getStatus(), - members); - } - - private void addMember(final OID oid, - final String surname, - final String givenName, - final String titlePre, - final String titlePost, - final Date birthdate, - final String gender, - final DataCollection contacts, - final String role, - final String status, - final List members) { - MemberListItem listItem = new MemberListItem(oid, - surname, - givenName, - titlePre, - titlePost, - birthdate, - gender, - contacts, - role, - status); - - if (!members.contains(listItem)) { - members.add(listItem); - } - } - - @Deprecated - protected void addMember(final GenericPerson person, - final String roleName, - final String status, - final List members) { - MemberListItem listItem = new MemberListItem(person, roleName, status); - - if (!members.contains(listItem)) { - members.add(listItem); - } - } - - protected void mergeMembers( - final SciDepartmentSubDepartmentsCollection subDepartments, - final List members, - final List filters) { - while (subDepartments.next()) { - SciDepartment subDepartment = subDepartments.getSubDepartment(); - GenericOrganizationalUnitPersonCollection departmentMembers; - departmentMembers = subDepartment.getPersons(); - for (String filter : filters) { - departmentMembers.addFilter(filter); - } - - while (departmentMembers.next()) { - addMember(departmentMembers.getOID(), - departmentMembers.getSurname(), - departmentMembers.getGivenName(), - departmentMembers.getTitlePre(), - departmentMembers.getTitlePost(), - departmentMembers.getBirthdate(), - departmentMembers.getGender(), - null, - departmentMembers.getRoleName(), - departmentMembers.getStatus(), - members); - } - - SciDepartmentSubDepartmentsCollection subSubDepartments; - subSubDepartments = subDepartment.getSubDepartments(); - - if ((subSubDepartments != null) - && (subSubDepartments.size() > 0)) { - mergeMembers(subSubDepartments, members, filters); - } - } - } - - protected void generateMembersListXML(final List members, - final Element parent, - final PageState state) { - Set membersSet; - List membersWithoutDoubles; - membersSet = new HashSet(members); - membersWithoutDoubles = new LinkedList(membersSet); - - Collections.sort(membersWithoutDoubles, new MemberListItemComparator()); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(membersWithoutDoubles.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, membersWithoutDoubles.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - createPaginatorElement( - parent, pageNumber, pageCount, begin, end, count, - membersWithoutDoubles.size()); - List membersWithoutDoublesToShow = - membersWithoutDoubles.subList((int) begin, - (int) end); - - Element membersWithoutDoublesElem = parent.newChildElement( - "members"); - - for (MemberListItem memberItem : membersWithoutDoublesToShow) { - generateMemberXML(memberItem, - membersWithoutDoublesElem, - memberItem.getRole(), - memberItem.getStatus(), - state); - } - } - - protected void generateProjectXML(final SciProject project, - final Element parent, - final PageState state) { - Element projectElem = parent.newChildElement("project"); - projectElem.addAttribute("oid", project.getOID().toString()); - - Element title = projectElem.newChildElement("title"); - title.setText(project.getTitle()); - - Element beginElem = projectElem.newChildElement("projectbegin"); - - if ((project.getAddendum() != null) - && !(project.getAddendum().isEmpty())) { - Element addendum = projectElem.newChildElement("addendum"); - addendum.setText(project.getAddendum()); - } - - if ((project.getProjectShortDescription() != null) - && !(project.getProjectShortDescription().isEmpty())) { - Element shortDesc = projectElem.newChildElement("shortDescription"); - shortDesc.setText(project.getProjectShortDescription()); - } - - GenericOrganizationalUnitPersonCollection members; - members = project.getPersons(); - members.addOrder("surname asc, givenname asc"); - - if (members.size() > 0) { - Element membersElem = projectElem.newChildElement("members"); - - while (members.next()) { - generateMemberXML(new MemberListItem(members.getOID(), - members.getSurname(), - members.getGivenName(), - members.getTitlePre(), - members.getTitlePost(), - members.getBirthdate(), - members.getGender(), - null, members.getRoleName(), - members.getStatus()), - membersElem, - members.getRoleName(), - members.getStatus(), - state); - } - } - - GenericOrganizationalUnitContactCollection contacts; - contacts = project.getContacts(); - - if (contacts.size() > 0) { - Element contactsElem = projectElem.newChildElement("contacts"); - - while (contacts.next()) { - generateContactXML(contacts.getContactType(), - contacts.getPerson(), - contacts.getContactEntries(), - contacts.getAddress(), - contactsElem, - state, - Integer.toString(contacts.getContactOrder()), - true); - } - } - } - - protected void mergeProjects( - final SciDepartmentSubDepartmentsCollection subDepartments, - final List projects, - final List filters) { - while (subDepartments.next()) { - SciDepartmentProjectsCollection departmentProjects; - departmentProjects = subDepartments.getSubDepartment().getProjects(); - - if ((filters != null) - && !(filters.isEmpty())) { - for (String filter : filters) { - departmentProjects.addFilter(filter); - } - } - - while (departmentProjects.next()) { - projects.add(departmentProjects.getProject()); - } - - SciDepartmentSubDepartmentsCollection subSubDepartments; - subSubDepartments = subDepartments.getSubDepartment(). - getSubDepartments(); - - if ((subSubDepartments != null) - && subSubDepartments.size() > 0) { - mergeProjects(subSubDepartments, projects, filters); - } - } - } - /** - * Create the XML for the list of publications, using the special - * RelatedLinks passed by the caller. To avoid a dependency to the - * sci-publications module, we are using only methods from - * {@link DataObject}, {@link DomainObject}, {@link DataCollection} and - * {@link DomainCollection}. - * - * @param links Links to the publications - * @param parent The parent XML element for the XML created by this method - * @param state The current page state. - */ - /* protected void generatePublicationsXML(final DataCollection links, - final Element parent, - final PageState state) { - RelatedLink link; - ContentItem publication; - List publications; - - publications = new ArrayList(); - - while (links.next()) { - link = new RelatedLink(links.getDataObject()); - publication = link.getTargetItem(); - - publications.add(publication); - } - - Collections.sort(publications, new Comparator() { - - public int compare(ContentItem o1, ContentItem o2) { - Integer year1; - Integer year2; - - if ((o1 == null) && o2 == null) { - return 0; - } else if ((o1 == null) && (o2 != null)) { - return -1; - } else if ((o1 != null) && o2 == null) { - return 1; - } - - year1 = (Integer) o1.get("yearOfPublication"); - year2 = (Integer) o2.get("yearOfPublication"); - - - if (year1.compareTo(year2) - == 0) { - String title1; - String title2; - - title1 = (String) o1.get("title"); - title2 = (String) o2.get("title"); - - return title1.compareTo(title2); - } else { - return (year1.compareTo(year2)) * -1; - } - } - }); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(publications.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, publications.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - createPaginatorElement(parent, pageNumber, pageCount, begin, end, count, - end); - List publicationsToShow = publications.subList((int) begin, - (int) end); - - for (ContentItem pub : publicationsToShow) { - generatePublicationXML(pub, parent, state); - } - } - - protected void generatePublicationXML(final ContentItem publication, - final Element parent, - final PageState state) { - Element publicationElem; - ContentItemXMLRenderer renderer; - - if (publication == null) { - return; - } - - publicationElem = parent.newChildElement("publications"); - - renderer = new ContentItemXMLRenderer(publicationElem); - renderer.setWrapAttributes(true); - - renderer.walk(publication, SimpleXMLGenerator.class.getName()); - }*/ -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentAddForm.java deleted file mode 100644 index 5d3b68713..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentAddForm.java +++ /dev/null @@ -1,132 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.SciOrganizationDepartmentsCollection; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Form for linking {@link SciOrganization}s with {@link SciDepartment}s. - * - * @author Jens Pelzetter - * @see SciOrganization - * @see SciDepartment - */ -public class SciOrganizationDepartmentAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget m_itemSearch; - private final String ITEM_SEARCH = "departments"; - - public SciOrganizationDepartmentAddForm(ItemSelectionModel itemModel) { - super("DepartmentsAddForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label((String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.select_department").localize())); - m_itemSearch = new ItemSearchWidget( - ITEM_SEARCH, - ContentType.findByAssociatedObjectType( - SciDepartment.class.getName())); - add(m_itemSearch); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciOrganization orga = (SciOrganization) getItemSelectionModel(). - getSelectedObject(state); - - if (!(this.getSaveCancelSection().getCancelButton(). - isSelected(state))) { - SciDepartment department = (SciDepartment) data.get(ITEM_SEARCH); - - department = (SciDepartment) department.getContentBundle(). - getInstance(orga.getLanguage()); - - orga.addDepartment(department); - //orga.addDepartment((SciDepartment) data.get(ITEM_SEARCH)); - } - - init(fse); - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.department.add.no_department_selected")); - - return; - } - - SciOrganization orga = (SciOrganization) getItemSelectionModel(). - getSelectedObject(state); - - SciDepartment department = (SciDepartment) data.get(ITEM_SEARCH); - if (!(department.getContentBundle().hasInstance(orga.getLanguage()))) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.department.add.no_suitable_language_variant")); - - return; - } - - department = (SciDepartment) department.getContentBundle().getInstance(orga. - getLanguage()); - SciOrganizationDepartmentsCollection departments = orga.getDepartments(); - departments.addFilter(String.format("id = %s", - department.getID().toString())); - if (departments.size() > 0) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.department.add.already_added")); - } - - departments.close(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsStep.java deleted file mode 100644 index 9b87f25d9..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsStep.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * Step for adding {@link SciDepartment}s to a {@link SciOrganization}. - * - * @author Jens Pelzetter - * @see SciDepartment - * @see SciOrganization - */ -public class SciOrganizationDepartmentsStep extends SimpleEditStep { - - private String ADD_DEPARTMENT_SHEET_NAME = "addDepartment"; - - public SciOrganizationDepartmentsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciOrganizationDepartmentsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addDepartmentSheet = - new SciOrganizationDepartmentAddForm(itemModel); - add(ADD_DEPARTMENT_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.add_department").localize(), - new WorkflowLockedComponentAccess(addDepartmentSheet, itemModel), - addDepartmentSheet.getSaveCancelSection().getCancelButton()); - - SciOrganizationDepartmentsTable departmentTable = - new SciOrganizationDepartmentsTable( - itemModel); - setDisplayComponent(departmentTable); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsTable.java deleted file mode 100644 index a8bd06228..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDepartmentsTable.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.SciOrganizationDepartmentsCollection; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; -import org.apache.log4j.Logger; - -/** - * Table for showing the {@link SciDepartment}s linked to a - * {@link SciOrganization}. - * - * @author Jens Pelzetter - * @see SciOrganization - * @see SciDepartment - */ -public class SciOrganizationDepartmentsTable - extends Table - implements TableActionListener { - - private final Logger s_log = Logger.getLogger( - SciOrganizationDepartmentsTable.class); - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private final String TABLE_COL_UP = "table_col_up"; - private final String TABLE_COL_DOWN = "table_col_down"; - private ItemSelectionModel m_itemModel; - - public SciOrganizationDepartmentsTable(ItemSelectionModel itemModel) { - super(); - m_itemModel = itemModel; - - setEmptyView( - new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.departments.none"))); - - TableColumnModel colModel = getColumnModel(); - colModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.department").localize(), - TABLE_COL_EDIT)); - colModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.department.remove").localize(), - TABLE_COL_DEL)); - colModel.add(new TableColumn( - 2, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.department.up").localize(), - TABLE_COL_UP)); - colModel.add(new TableColumn( - 3, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.department.down").localize(), - TABLE_COL_DOWN)); - - setModelBuilder( - new SciOrganizationDepartmentsTableModelBuilder(itemModel)); - - colModel.get(0).setCellRenderer(new EditCellRenderer()); - colModel.get(1).setCellRenderer(new DeleteCellRenderer()); - colModel.get(2).setCellRenderer(new UpCellRenderer()); - colModel.get(3).setCellRenderer(new DownCellRenderer()); - - addTableActionListener(this); - } - - private class SciOrganizationDepartmentsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel m_itemModel; - - public SciOrganizationDepartmentsTableModelBuilder( - ItemSelectionModel itemModel) { - m_itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciOrganization orga = (SciOrganization) m_itemModel. - getSelectedObject(state); - return new SciOrganizationDepartmentsTableModel(table, - state, - orga); - } - } - - private class SciOrganizationDepartmentsTableModel - implements TableModel { - - private Table m_table; - private SciOrganizationDepartmentsCollection m_departments; - private SciDepartment m_department; - - private SciOrganizationDepartmentsTableModel(Table table, - PageState state, - SciOrganization orga) { - m_table = table; - m_departments = orga.getDepartments(); - } - - @Override - public int getColumnCount() { - return m_table.getColumnModel().size(); - } - - @Override - public boolean nextRow() { - boolean ret; - - if ((m_departments != null) && m_departments.next()) { - m_department = m_departments.getDepartment(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - @Override - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return m_department.getTitle(); - case 1: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.department.remove"). - localize(); - case 2: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.department.up"). - localize(); - case 3: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.department.down"). - localize(); - default: - return null; - } - } - - @Override - public Object getKeyAt(int columnIndex) { - return m_department.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciOrganization orga = (SciOrganization) m_itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.EDIT_ITEM, - orga); - - if (canEdit) { - SciDepartment department; - try { - department = new SciDepartment((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = new Link(String.format("%s (%s)", - value.toString(), - department.getLanguage()), - resolver.generateItemURL(state, - department, - section, - department. - getVersion())); - - return link; - } else { - SciDepartment department; - try { - department = new SciDepartment((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - Label label = new Label(String.format("%s (%s)", - value.toString(), - department.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciOrganization orga = (SciOrganization) m_itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.DELETE_ITEM, - orga); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "sciorganization.ui.organization.department." - + "confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - private class UpCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - if (0 == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.department.up"). - localize()); - return link; - } - } - } - - private class DownCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - SciOrganization orga = (SciOrganization) m_itemModel. - getSelectedObject(state); - SciOrganizationDepartmentsCollection departments = orga. - getDepartments(); - - if ((departments.size() - 1) == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.department.down"). - localize()); - return link; - } - } - } - - @Override - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - SciDepartment department = new SciDepartment( - new BigDecimal(event.getRowKey().toString())); - - SciOrganization orga = - (SciOrganization) m_itemModel.getSelectedObject(state); - - SciOrganizationDepartmentsCollection departments = - orga.getDepartments(); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { - orga.removeDepartment(department); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) { - departments.swapWithPrevious(department); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) { - departments.swapWithNext(department); - } - } - - @Override - public void headSelected(TableActionEvent event) { - //Nothing to do. - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionEditForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionEditForm.java deleted file mode 100644 index 756017bfd..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionEditForm.java +++ /dev/null @@ -1,102 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.form.TextArea; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.ui.CMSDHTMLEditor; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Form for editing the description of a {@link SciOrganization}. - * - * @author Jens Pelzetter - * @see SciOrganization - */ -public class SciOrganizationDescriptionEditForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - public SciOrganizationDescriptionEditForm(ItemSelectionModel itemModel) { - super("sciorganizationEditDescForm", itemModel); - } - - @Override - public void addWidgets() { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.description"))); - ParameterModel descParam = new StringParameter( - SciOrganization.ORGANIZATION_DESCRIPTION); - TextArea desc; - if (SciOrganization.getConfig().getOrganizationDescriptionDhtml()) { - desc = new CMSDHTMLEditor(descParam); - } else { - desc = new TextArea(descParam); - } - desc.setCols(75); - desc.setRows(25); - add(desc); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - FormData data = fse.getFormData(); - SciOrganization orga = (SciOrganization) getItemSelectionModel(). - getSelectedObject(state); - - data.put(SciOrganization.ORGANIZATION_DESCRIPTION, - orga.getOrganizationDescription()); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - FormData data = fse.getFormData(); - - SciOrganization orga = (SciOrganization) getItemSelectionModel(). - getSelectedObject(state); - - if ((orga != null) && this.getSaveCancelSection().getSaveButton(). - isSelected(state)) { - orga.setOrganizationDescription((String) data.get( - SciOrganization.ORGANIZATION_DESCRIPTION)); - - orga.save(); - - init(fse); - } - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionStep.java deleted file mode 100644 index 38f97e067..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionStep.java +++ /dev/null @@ -1,83 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; - -/** - * Step for editing the description of a {@link SciOrganization}. - * - * @author Jens Pelzetter - * @see SciOrganization - */ -public class SciOrganizationDescriptionStep extends SimpleEditStep { - - private String EDIT_ORGANIZATION_DESC_SHEET_NAME = "editOrganizationDesc"; - private String UPLOAD_ORGANIZATION_DESC_SHEET_NAME = - "uploadOrganizationDesc"; - - public SciOrganizationDescriptionStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciOrganizationDescriptionStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm editDescForm = - new SciOrganizationDescriptionEditForm(itemModel); - add(EDIT_ORGANIZATION_DESC_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.edit_desc").localize(), - new WorkflowLockedComponentAccess(editDescForm, itemModel), - editDescForm.getSaveCancelSection().getCancelButton()); - - SciOrganizationDescriptionUploadForm uploadDescForm = - new SciOrganizationDescriptionUploadForm(itemModel); - add(UPLOAD_ORGANIZATION_DESC_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.upload_desc").localize(), - new WorkflowLockedComponentAccess(uploadDescForm, itemModel), - uploadDescForm.getSaveCancelSection().getCancelButton()); - - setDisplayComponent(getSciOrganizationEditDescSheet(itemModel)); - } - - public static Component getSciOrganizationEditDescSheet( - ItemSelectionModel itemModel) { - DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( - itemModel); - - sheet.add(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.desc"), - SciOrganization.ORGANIZATION_DESCRIPTION); - - return sheet; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionUploadForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionUploadForm.java deleted file mode 100644 index 8c5bc5c5f..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationDescriptionUploadForm.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.globalization.GlobalizedMessage; - -/** - * Form for uploading the description of a {@link SciOrganization}. - * - * @author Jens Pelzetter - * @see SciOrganization - * @see AbstractTextUploadForm - */ -public class SciOrganizationDescriptionUploadForm - extends AbstractTextUploadForm { - - public SciOrganizationDescriptionUploadForm(ItemSelectionModel itemModel) { - super(itemModel); - } - - @Override - public GlobalizedMessage getLabelText() { - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.description.upload"); - } - - @Override - public GlobalizedMessage getMimeTypeLabel() { - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.description.upload.mimetype"); - } - - @Override - public void setText(ItemSelectionModel itemModel, - PageState state, - String text) { - SciOrganization orga = (SciOrganization) itemModel.getSelectedObject( - state); - orga.setOrganizationDescription(text); - orga.save(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationGlobalizationUtil.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationGlobalizationUtil.java deleted file mode 100644 index ab5f89a26..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationGlobalizationUtil.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.globalization.GlobalizedMessage; - -/** - * GlobalizationUtil for the ccm-sci-types-organization module. - * - * @author Jens Pelzetter - */ -public class SciOrganizationGlobalizationUtil { - - public static final String BUNDLE_NAME = "com.arsdigita.cms.contenttypes.ui.SciOrganizationResources"; - - public static GlobalizedMessage globalize(String key) { - return new GlobalizedMessage(key, BUNDLE_NAME); - } - - public static GlobalizedMessage globalize(String key, Object[] args) { - return new GlobalizedMessage(key, BUNDLE_NAME, args); - } - -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberAddForm.java deleted file mode 100644 index 26312d167..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberAddForm.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.GenericPerson; -import com.arsdigita.cms.contenttypes.SciMember; -import com.arsdigita.cms.contenttypes.SciOrganization; - -/** - * Form for linking members with a {@link SciOrganization}. The form overwrites - * the {@link GenericOrganizationalUnitPersonAddForm#getPersonType()} to limit - * the selectable person type to {@link SciMember}. - * - * @author Jens Pelzetter - * @see SciOrganization - * @see SciMember - * @see GenericPerson - * @see GenericOrganizationalUnitPersonAddForm - */ -public class SciOrganizationMemberAddForm - extends GenericOrganizationalUnitPersonAddForm { - - public SciOrganizationMemberAddForm( - ItemSelectionModel itemModel, - GenericOrganizationalUnitPersonSelector personSelector) { - super(itemModel, personSelector); - } - - @Override - protected String getPersonType() { - return GenericPerson.class.getName(); - } - - @Override - protected String getRoleAttributeName() { - return "SciOrganizationRole"; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberStep.java deleted file mode 100644 index 9486098e3..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberStep.java +++ /dev/null @@ -1,99 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.GenericPerson; -import com.arsdigita.cms.contenttypes.SciMember; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * Step for adding and removing member form a {@link SciOrganization}. - * - * @author Jens Pelzetter - * @see SciOrganizationMemberAddForm - * @see SciMember - * @see SciOrganization - */ -public class SciOrganizationMemberStep - extends SimpleEditStep - implements GenericOrganizationalUnitPersonSelector { - - public static final String ADD_MEMBER_SHEET_NAME = "addMember"; - private GenericPerson selectedPerson; - private String selectedPersonRole; - private String selectedPersonStatus; - - public SciOrganizationMemberStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciOrganizationMemberStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addMemberSheet = - new SciOrganizationMemberAddForm(itemModel, this); - add(ADD_MEMBER_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.orgnization.add_member").localize(), - new WorkflowLockedComponentAccess(addMemberSheet, itemModel), - addMemberSheet.getSaveCancelSection().getCancelButton()); - - SciOrganizationMemberTable memberTable = new SciOrganizationMemberTable( - itemModel, this); - setDisplayComponent(memberTable); - } - - public GenericPerson getSelectedPerson() { - return selectedPerson; - } - - public void setSelectedPerson(final GenericPerson selectedPerson) { - this.selectedPerson = selectedPerson; - } - - public String getSelectedPersonRole() { - return selectedPersonRole; - } - - public void setSelectedPersonRole(final String selectedPersonRole) { - this.selectedPersonRole = selectedPersonRole; - } - - public String getSelectedPersonStatus() { - return selectedPersonStatus; - } - - public void setSelectedPersonStatus(final String selectedPersonStatus) { - this.selectedPersonStatus = selectedPersonStatus; - } - - public void showEditComponent(final PageState state) { - showComponent(state, ADD_MEMBER_SHEET_NAME); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberTable.java deleted file mode 100644 index a8fd810d3..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationMemberTable.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; - -/** - * - * @author Jens Pelzetter - */ -public class SciOrganizationMemberTable extends GenericOrganizationalUnitPersonsTable { - - public SciOrganizationMemberTable(ItemSelectionModel itemModel, - GenericOrganizationalUnitPersonSelector personSelector) { - super(itemModel, personSelector); - } - - @Override - protected String getRoleAttributeName() { - return "SciOrganizationRole"; - } - -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPanel.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPanel.java deleted file mode 100644 index 877d02af7..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPanel.java +++ /dev/null @@ -1,594 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitContactCollection; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitPersonCollection; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciDepartmentProjectsCollection; -import com.arsdigita.cms.contenttypes.SciDepartmentSubDepartmentsCollection; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.SciOrganizationConfig; -import com.arsdigita.cms.contenttypes.SciOrganizationDepartmentsCollection; -import com.arsdigita.cms.contenttypes.SciOrganizationProjectsCollection; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.ui.panels.Filter; -import com.arsdigita.cms.contenttypes.ui.panels.TextFilter; -import com.arsdigita.xml.Element; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.servlet.http.HttpServletRequest; -import org.apache.log4j.Logger; - -/** - * Panel for rendering the properties of a SciOrganization. The property to show - * is selected via the show parameter. - * - * @author Jens Pelzetter - */ -public class SciOrganizationPanel extends SciOrganizationBasePanel { - - private static final Logger s_log = Logger.getLogger( - SciOrganizationPanel.class); - public static final String SHOW_DESCRIPTION = "description"; - public static final String SHOW_MEMBERS_ACTIVE = "membersActive"; - public static final String SHOW_MEMBERS_ASSOCIATED = "membersAssociated"; - public static final String SHOW_MEMBERS_FORMER = "membersFormer"; - public static final String SHOW_DEPARTMENTS = "departments"; - public static final String SHOW_PROJECTS = "projects"; - public static final String SHOW_PROJECTS_ONGOING = "projectsOngoing"; - public static final String SHOW_PROJECTS_FINISHED = "projectsFinished"; - private static final String TTILE = "title"; - private String show; - private boolean displayDescription = true; - private boolean displayDepartments = true; - private boolean displayProjects = true; - private final Map projectFilters = - new LinkedHashMap(); - - public SciOrganizationPanel() { - projectFilters.put(TTILE, new TextFilter(TTILE, TTILE)); - } - - @Override - protected String getDefaultShowParam() { - return SHOW_DESCRIPTION; - } - - @Override - protected Class getAllowedClass() { - 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; - } - - protected boolean hasMembers(final SciOrganization orga) { - return orga.hasMembers(true, SciOrganization.MemberStatus.ALL); - } - - protected boolean hasActiveMembers(final SciOrganization orga) { - return orga.hasMembers(true, SciOrganization.MemberStatus.ACTIVE); - } - - protected boolean hasAssociatedMembers(final SciOrganization orga) { - return orga.hasMembers(true, SciOrganization.MemberStatus.ASSOCIATED); - } - - protected boolean hasFormerMembers(final SciOrganization orga) { - return orga.hasMembers(true, SciOrganization.MemberStatus.FORMER); - } - - protected boolean hasProjects(final SciOrganization orga) { - return orga.hasProjects(SciOrganization.getConfig(). - getOrganizationProjectsMerge(), - SciOrganization.ProjectStatus.ALL); - } - - protected boolean hasOngoingProjects(final SciOrganization orga) { - return orga.hasProjects(SciOrganization.getConfig(). - getOrganizationProjectsMerge(), - SciOrganization.ProjectStatus.ONGOING); - } - - protected boolean hasFinishedProjects(final SciOrganization orga) { - return orga.hasProjects(SciOrganization.getConfig(). - getOrganizationProjectsMerge(), - SciOrganization.ProjectStatus.FINISHED); - } - - protected void generateDepartmentsXML(final SciOrganization orga, - final Element parent, - final PageState state) { - SciOrganizationDepartmentsCollection departments; - departments = orga.getDepartments(); - departments.addOrder("link.departmentOrder asc"); - - long pageNumber = getPageNumber(state); - - Element departmentsElem = parent.newChildElement("departments"); - - long pageCount = getPageCount(departments.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, departments.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - createPaginatorElement( - parent, pageNumber, pageCount, begin, end, count, departments. - size()); - departments.setRange((int) begin + 1, (int) end + 1); - - while (departments.next()) { - SciDepartment department; - department = departments.getDepartment(); - - Element departmentElem = departmentsElem.newChildElement( - "department"); - departmentElem.addAttribute("order", Integer.toString(departments. - getDepartmentOrder())); - departmentElem.addAttribute("oid", department.getOID().toString()); - - Element title = departmentElem.newChildElement("title"); - title.setText(department.getTitle()); - - if ((department.getAddendum() != null) - && !(department.getAddendum().isEmpty())) { - Element addendum = departmentElem.newChildElement("addendum"); - addendum.setText(department.getAddendum()); - } - - if ((department.getDepartmentShortDescription() != null) - && !(department.getDepartmentShortDescription().isEmpty())) { - Element shortDesc = departmentElem.newChildElement( - "shortDescription"); - shortDesc.setText(department.getDepartmentShortDescription()); - } - - GenericOrganizationalUnitPersonCollection heads; - heads = department.getPersons(); - heads.addFilter("link.role_name = 'head' and link.status = 'active'"); - heads.addOrder("surname asc, givenname asc"); - - if (heads.size() > 0) { - Element headsElem = departmentElem.newChildElement("heads"); - - while (heads.next()) { - Element headElem = headsElem.newChildElement("head"); - Element titlePre = headElem.newChildElement("titlePre"); - titlePre.setText(heads.getTitlePre()); - Element givenName = headElem.newChildElement("givenname"); - givenName.setText(heads.getGivenName()); - Element surname = headElem.newChildElement("surname"); - surname.setText(heads.getSurname()); - Element titlePost = headElem.newChildElement("titlePost"); - titlePost.setText(heads.getTitlePost()); - } - } - - GenericOrganizationalUnitContactCollection contacts; - contacts = department.getContacts(); - if (contacts.size() > 0) { - Element contactsElem = - departmentElem.newChildElement("contacts"); - - while (contacts.next()) { - generateContactXML(contacts.getContactType(), - contacts.getPerson(), - contacts.getContactEntries(), - contacts.getAddress(), - contactsElem, - state, - Integer.toString( - contacts.getContactOrder()), - true); - } - } - } - } - - protected void mergeMembers( - final SciOrganizationDepartmentsCollection departments, - final List members, - final List filters) { - - while (departments.next()) { - SciDepartment department = departments.getDepartment(); - GenericOrganizationalUnitPersonCollection departmentsMembers; - departmentsMembers = department.getPersons(); - for (String filter : filters) { - departmentsMembers.addFilter(filter); - } - - while (departmentsMembers.next()) { - addMember(departmentsMembers, - members); - } - - SciDepartmentSubDepartmentsCollection subDepartments; - subDepartments = department.getSubDepartments(); - - - if ((subDepartments != null) - && subDepartments.size() > 0) { - mergeMembers(subDepartments, members, filters); - } - } - } - - protected void generateMembersXML(final SciOrganization orga, - final Element parent, - final PageState state, - final List filters) { - if (SciOrganization.getConfig().getOrganizationMembersMerge()) { - long begin = System.currentTimeMillis(); - List members; - members = new LinkedList(); - GenericOrganizationalUnitPersonCollection orgaMembers; - orgaMembers = orga.getPersons(); - for (String filter : filters) { - orgaMembers.addFilter(filter); - } - - SciOrganizationDepartmentsCollection departments; - departments = orga.getDepartments(); - - while (orgaMembers.next()) { - addMember(orgaMembers, - members); - } - - mergeMembers(departments, members, filters); - - generateMembersListXML(members, parent, state); - System.out.printf("Members XML generated in %d ms\n", System.currentTimeMillis() - begin); - } else { - GenericOrganizationalUnitPersonCollection orgaMembers; - orgaMembers = orga.getPersons(); - for (String filter : filters) { - orgaMembers.addFilter(filter); - } - List members = new LinkedList(); - - while (orgaMembers.next()) { - addMember(orgaMembers, - members); - } - - generateMembersListXML(members, parent, state); - } - } - - protected void mergeProjects( - final SciOrganizationDepartmentsCollection departments, - final List projects, - final List filters, - final PageState state) { - - while (departments.next()) { - SciDepartmentProjectsCollection departmentProjects; - departmentProjects = departments.getDepartment().getProjects(); - - if ((filters != null) - && !(filters.isEmpty())) { - for (String filter : filters) { - departmentProjects.addFilter(filter); - } - } - - while (departmentProjects.next()) { - projects.add(departmentProjects.getProject()); - } - - SciDepartmentSubDepartmentsCollection subDepartments; - subDepartments = departments.getDepartment().getSubDepartments(); - - if ((subDepartments != null) - && subDepartments.size() > 0) { - mergeProjects(subDepartments, projects, filters); - } - } - } - - protected void generateProjectsXML(final SciOrganization orga, - final Element parent, - final PageState state, - final List filters) { - Element controls = parent.newChildElement("filterControls"); - controls.addAttribute("customName", "sciOrganizationProjects"); - controls.addAttribute("show", show); - - if (SciOrganization.getConfig().getOrganizationProjectsMerge()) { - List projects; - projects = new LinkedList(); - SciOrganizationProjectsCollection orgaProjects; - orgaProjects = orga.getProjects(); - - applyProjectFilters(filters, state.getRequest()); - if ((filters != null) - && !(filters.isEmpty())) { - for (String filter : filters) { - orgaProjects.addFilter(filter); - } - } - - SciOrganizationDepartmentsCollection departments; - departments = orga.getDepartments(); - - while (orgaProjects.next()) { - projects.add(orgaProjects.getProject()); - } - - mergeProjects(departments, projects, filters, state); - - Set projectsSet; - List projectsWithoutDoubles; - projectsSet = new HashSet(projects); - projectsWithoutDoubles = new LinkedList(projectsSet); - - Collections.sort(projectsWithoutDoubles, new SciProjectComparator()); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(projectsWithoutDoubles.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, projectsWithoutDoubles.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - generateProjectFiltersXml(projectsWithoutDoubles, controls); - createPaginatorElement( - parent, pageNumber, pageCount, begin, end, count, - projectsWithoutDoubles.size()); - List projectsWithoutDoublesToShow = - projectsWithoutDoubles.subList((int) begin, - (int) end); - - Element projectsWithoutDoublesElem = parent.newChildElement( - "projects"); - for (SciProject project : projectsWithoutDoublesToShow) { - generateProjectXML(project, projectsWithoutDoublesElem, state); - } - } else { - SciOrganizationProjectsCollection orgaProjects; - orgaProjects = orga.getProjects(); - - applyProjectFilters(filters, state.getRequest()); - if ((filters != null) - && !(filters.isEmpty())) { - for (String filter : filters) { - orgaProjects.addFilter(filter); - } - } - - List projects = new LinkedList(); - - while (orgaProjects.next()) { - projects.add(orgaProjects.getProject()); - } - - Collections.sort(projects, new SciProjectComparator()); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(projects.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, projects.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - generateProjectFiltersXml(projects, controls); - createPaginatorElement( - parent, pageNumber, pageCount, begin, end, count, projects. - size()); - List projectsToShow = projects.subList((int) begin, - (int) end); - - Element projectsElem = parent.newChildElement("projects"); - for (SciProject project : projectsToShow) { - generateProjectXML(project, projectsElem, state); - } - } - } - - protected void generateProjectFiltersXml( - final List projects, - final Element element) { - final Element filterElement = element.newChildElement("filters"); - - for (Map.Entry filterEntry : projectFilters.entrySet()) { - filterEntry.getValue().generateXml(filterElement); - } - } - - protected void applyProjectFilters( - final List filters, - final HttpServletRequest request) { - //Get parameters from HTTP request - for (Map.Entry filterEntry : projectFilters.entrySet()) { - String value = request.getParameter( - filterEntry.getValue().getLabel()); - - if ((value != null) && !(value.trim().isEmpty())) { - filterEntry.getValue().setValue(value); - } - } - - //Apply filters to DomainCollection - final StringBuilder filterBuilder = new StringBuilder(); - for (Map.Entry filterEntry : projectFilters.entrySet()) { - if ((filterEntry.getValue().getFilter() == null) - || (filterEntry.getValue().getFilter().isEmpty())) { - continue; - } - - if (filterBuilder.length() > 0) { - filterBuilder.append(" AND "); - } - filterBuilder.append(filterEntry.getValue().getFilter()); - s_log.debug(String.format("filters: %s", filterBuilder)); - if (filterBuilder.length() > 0) { - filters.add(filterBuilder.toString()); - } - } - } - - @Override - protected void generateAvailableDataXml(final GenericOrganizationalUnit orga, - final Element element, - final PageState state) { - SciOrganizationConfig config; - config = SciOrganization.getConfig(); - - SciOrganization organization = (SciOrganization) orga; - - if ((organization.getOrganizationDescription() != null) - && !(organization.getOrganizationDescription().isEmpty()) - && displayDescription) { - element.newChildElement("description"); - } - if (organization.hasContacts() - && isDisplayContacts()) { - element.newChildElement("contacts"); - } - if (organization.hasDepartments() - && displayDepartments) { - element.newChildElement("departments"); - } - if (config.getOrganizationMembersAllInOne()) { - if (hasMembers(organization) - && isDisplayMembers()) { - element.newChildElement("members"); - } - } else { - if (hasActiveMembers(organization) - && isDisplayMembers()) { - element.newChildElement("membersActive"); - } - if (hasAssociatedMembers(organization) - && isDisplayMembers()) { - element.newChildElement("membersAssociated"); - } - if (hasFormerMembers(organization) - && isDisplayMembers()) { - element.newChildElement("membersFormer"); - } - } - if (config.getOrganizationProjectsAllInOne()) { - if (hasProjects(organization) - && displayProjects) { - element.newChildElement("projects"); - } - } else { - if (hasOngoingProjects(organization) - && displayProjects) { - element.newChildElement("projectsOngoing"); - } - if (hasFinishedProjects(organization) - && displayProjects) { - element.newChildElement("projectsFinished"); - } - } - } - - @Override - protected void generateDataXml(final GenericOrganizationalUnit orga, - final Element element, - final PageState state) { - show = getShowParam(state); - - SciOrganization organization = (SciOrganization) orga; - - if (SHOW_DESCRIPTION.equals(show)) { - String desc; - desc = organization.getOrganizationDescription(); - - Element description = element.newChildElement("description"); - description.setText(desc); - } else if (SHOW_CONTACTS.equals(show)) { - generateContactsXML(organization, element, state); - } else if (SHOW_DEPARTMENTS.equals(show)) { - generateDepartmentsXML(organization, element, state); - } else if (SHOW_MEMBERS.equals(show)) { - generateMembersXML(organization, element, state, - new LinkedList()); - } else if (SHOW_MEMBERS_ACTIVE.equals(show)) { - generateMembersXML(organization, element, state, - getFiltersForActiveMembers()); - } else if (SHOW_MEMBERS_ASSOCIATED.equals(show)) { - generateMembersXML(organization, element, state, - getFiltersForAssociatedMembers()); - } else if (SHOW_MEMBERS_FORMER.equals(show)) { - generateMembersXML(organization, element, state, - getFiltersForFormerMembers()); - } else if (SHOW_PROJECTS.equals(show)) { - generateProjectsXML(organization, element, state, - new LinkedList()); - } else if (SHOW_PROJECTS_ONGOING.equals(show)) { - generateProjectsXML( - organization, element, state, getFiltersForOngoingProjects()); - } else if (SHOW_PROJECTS_FINISHED.equals(show)) { - generateProjectsXML( - organization, element, state, - getFiltersForFinishedProjects()); - } - } - - /*@Override - public void generateXML(ContentItem item, - Element element, - PageState state) { - Element content = generateBaseXML(item, element, state); - - SciOrganization orga = (SciOrganization) item; - Element availableData = content.newChildElement("availableData"); - - generateAvailableDataXml(orga, availableData, state); - - generateDataXml(orga, content, state); - }*/ -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectAddForm.java deleted file mode 100644 index 61aedfc6e..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectAddForm.java +++ /dev/null @@ -1,128 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.SciOrganizationProjectsCollection; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Form for linking projects with a {@link SciOrganization}. - * - * @author Jens Pelzetter - * @see SciOrganizationProjectAddForm - * @see SciOrganization - * @see SciProject - */ -public class SciOrganizationProjectAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget m_itemSearch; - private final String ITEM_SEARCH = "projects"; - - public SciOrganizationProjectAddForm(ItemSelectionModel itemModel) { - super("ProjectsAddForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label((String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.select_project").localize())); - m_itemSearch = new ItemSearchWidget( - ITEM_SEARCH, - ContentType.findByAssociatedObjectType( - SciProject.class.getName())); - add(m_itemSearch); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciOrganization orga = (SciOrganization) getItemSelectionModel(). - getSelectedObject(state); - - if (!(this.getSaveCancelSection().getCancelButton(). - isSelected(state))) { - SciProject project = (SciProject) data.get(ITEM_SEARCH); - project = (SciProject) project.getContentBundle().getInstance(orga. - getLanguage()); - - orga.addProject(project); - } - - init(fse); - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.select_project.no_project_selected")); - return; - } - - SciOrganization orga = (SciOrganization) getItemSelectionModel(). - getSelectedObject(state); - SciProject project = (SciProject) data.get(ITEM_SEARCH); - if (!(project.getContentBundle().hasInstance(orga.getLanguage()))) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.select_project.no_suitable_language_variant")); - return; - } - - project = (SciProject) project.getContentBundle().getInstance(orga. - getLanguage()); - SciOrganizationProjectsCollection projects = orga.getProjects(); - projects.addFilter(String.format("id = %s", project.getID().toString())); - if (projects.size() > 0) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.select_project.already_added")); - } - - projects.close(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsStep.java deleted file mode 100644 index 25d1d4c03..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsStep.java +++ /dev/null @@ -1,66 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * Step for adding and removing links from a {@link SciOrganization} to a - * {@link SciProject}. - * - * @author Jens Pelzetter - * @see SciOrganizationProjectAddForm - * @see SciOrganization - * @see SciProject - */ -public class SciOrganizationProjectsStep extends SimpleEditStep { - - private String ADD_PROJECT_SHEET_NAME = "addProject"; - - public SciOrganizationProjectsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciOrganizationProjectsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addProjectSheet = - new SciOrganizationProjectAddForm(itemModel); - add(ADD_PROJECT_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.add_project").localize(), - new WorkflowLockedComponentAccess(addProjectSheet, itemModel), - addProjectSheet.getSaveCancelSection().getCancelButton()); - - SciOrganizationProjectsTable projectsTable = - new SciOrganizationProjectsTable( - itemModel); - setDisplayComponent(projectsTable); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsTable.java deleted file mode 100644 index bd151d675..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationProjectsTable.java +++ /dev/null @@ -1,382 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import java.math.BigDecimal; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.SciOrganizationProjectsCollection; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import org.apache.log4j.Logger; - -/** - * Table for showing the links between a {@link SciOrganization} and - * {@link SciProject}s. - * - * @author Jens Pelzetter - * @see SciOrganization - * @see SciProject - */ -public class SciOrganizationProjectsTable - extends Table - implements TableActionListener { - - private final Logger s_log = Logger.getLogger( - SciOrganizationProjectsTable.class); - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private final String TABLE_COL_UP = "table_col_up"; - private final String TABLE_COL_DOWN = "table_col_down"; - private ItemSelectionModel m_itemModel; - - public SciOrganizationProjectsTable(ItemSelectionModel itemModel) { - super(); - m_itemModel = itemModel; - - setEmptyView( - new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.projects.none"))); - - TableColumnModel colModel = getColumnModel(); - colModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.project").localize(), - TABLE_COL_EDIT)); - colModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.project.remove").localize(), - TABLE_COL_DEL)); - /*colModel.add(new TableColumn( - 2, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.project.up").localize(), - TABLE_COL_UP)); - colModel.add(new TableColumn( - 3, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.project.down").localize(), - TABLE_COL_DOWN));*/ - - setModelBuilder( - new SciOrganizationProjectsTableModelBuilder(itemModel)); - - colModel.get(0).setCellRenderer(new EditCellRenderer()); - colModel.get(1).setCellRenderer(new DeleteCellRenderer()); - //colModel.get(2).setCellRenderer(new UpCellRenderer()); - //colModel.get(3).setCellRenderer(new DownCellRenderer()); - - addTableActionListener(this); - } - - private class SciOrganizationProjectsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel m_itemModel; - - public SciOrganizationProjectsTableModelBuilder( - ItemSelectionModel itemModel) { - m_itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciOrganization orga = (SciOrganization) m_itemModel. - getSelectedObject(state); - return new SciOrganizationProjectsTableModel(table, - state, - orga); - } - } - - private class SciOrganizationProjectsTableModel - implements TableModel { - - private Table m_table; - private SciOrganizationProjectsCollection m_projects; - private SciProject m_project; - - public SciOrganizationProjectsTableModel(Table table, - PageState state, - SciOrganization orga) { - m_table = table; - m_projects = orga.getProjects(); - } - - @Override - public int getColumnCount() { - return m_table.getColumnModel().size(); - } - - @Override - public boolean nextRow() { - boolean ret; - - if ((m_projects != null) && m_projects.next()) { - m_project = m_projects.getProject(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - @Override - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return m_project.getTitle(); - case 1: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.project.remove"). - localize(); - case 2: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.project.up"). - localize(); - case 3: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.project.down"). - localize(); - default: - return null; - } - } - - @Override - public Object getKeyAt(int columnIndex) { - return m_project.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciOrganization orga = (SciOrganization) m_itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.EDIT_ITEM, - orga); - - if (canEdit) { - SciProject project; - try { - project = new SciProject((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = - new Link(String.format("%s (%s)", - value.toString(), - project.getLanguage()), - resolver.generateItemURL(state, - project, - section, - project.getVersion())); - - return link; - - } else { - SciProject project; - try { - project = new SciProject((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - Label label = new Label(String.format("%s (%s)", - value.toString(), - project.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciOrganization orga = (SciOrganization) m_itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.DELETE_ITEM, - orga); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "sciorganization.ui.organization.project." - + "confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - private class UpCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - if (0 == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.project.up"). - localize()); - return link; - } - } - } - - private class DownCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - SciOrganization orga = (SciOrganization) m_itemModel. - getSelectedObject(state); - SciOrganizationProjectsCollection projects = orga.getProjects(); - - if ((projects.size() - 1) == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.project.down"). - localize()); - return link; - } - } - } - - @Override - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - SciProject project = new SciProject( - new BigDecimal(event.getRowKey().toString())); - - SciOrganization orga = - (SciOrganization) m_itemModel.getSelectedObject(state); - - SciOrganizationProjectsCollection projects = - orga.getProjects(); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { - orga.removeProject(project); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) { - projects.swapWithPrevious(project); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) { - projects.swapWithNext(project); - } - } - - @Override - public void headSelected(TableActionEvent event) { - //Nothing to do. - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertiesStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertiesStep.java deleted file mode 100644 index a2affc2c5..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertiesStep.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.Label; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.SciOrganizationConfig; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicPageForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; - -/** - * Step for editing the basic properties of a {@link SciOrganization}. - * - * @author Jens Pelzetter - */ -public class SciOrganizationPropertiesStep - extends GenericOrganizationalUnitPropertiesStep { - - public SciOrganizationPropertiesStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - super(itemModel, parent); - } - - @Override - protected void addBasicProperties(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - SimpleEditStep basicProperties = new SimpleEditStep(itemModel, - parent, - EDIT_SHEET_NAME); - - BasicPageForm editBasicSheet = - new SciOrganizationPropertyForm(itemModel, this); - - basicProperties.add(EDIT_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.edit_basic_sheet").localize(), - new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), - editBasicSheet.getSaveCancelSection(). - getCancelButton()); - - basicProperties.setDisplayComponent( - getSciOrganizationPropertySheet(itemModel)); - - getSegmentedPanel().addSegment( - new Label((String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.basic_properties"). - localize()), - basicProperties); - } - - @Override - protected void addSteps(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - //super.addSteps(itemModel, parent); - - SciOrganizationConfig config; - config = SciOrganization.getConfig(); - - if (!config.getOrganizationAddContactHide()) { - addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel, - parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.contacts")); - } - - /* This steps are now separate steps in the left box. - if (!config.getOrganizationAddPersonHide()) { - addStep(new SciOrganizationMemberStep(itemModel, - parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization_members")); - } - - if (!config.getOrganizationAddDepartmentHide()) { - addStep(new SciOrganizationDepartmentsStep(itemModel, parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.departments")); - } - - if (!config.getOrganizationAddProjectHide()) { - addStep(new SciOrganizationProjectsStep(itemModel, parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.organization.projects")); - }*/ - } - - public static Component getSciOrganizationPropertySheet( - ItemSelectionModel itemModel) { - DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) GenericOrganizationalUnitPropertiesStep. - getGenericOrganizationalUnitPropertySheet(itemModel); - - sheet.add(SciOrganizationGlobalizationUtil.globalize( - "sciorganizations.ui.organization.shortdescription"), - SciOrganization.ORGANIZATION_SHORT_DESCRIPTION); - - return sheet; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertyForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertyForm.java deleted file mode 100644 index 37e17077a..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPropertyForm.java +++ /dev/null @@ -1,109 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.event.FormSubmissionListener; -import com.arsdigita.bebop.form.TextArea; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.bebop.parameters.StringInRangeValidationListener; -import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciOrganization; - -/** - * Form for editing the basic properties of a {@link SciOrganization}. - * - * @author Jens Pelzetter - */ -public class SciOrganizationPropertyForm - extends GenericOrganizationalUnitPropertyForm - implements FormProcessListener, - FormInitListener, - FormSubmissionListener { - - public static final String ID = "SciOrganizationEdit"; - - public SciOrganizationPropertyForm(ItemSelectionModel itemModel) { - this(itemModel, null); - } - - public SciOrganizationPropertyForm(ItemSelectionModel itemModel, - SciOrganizationPropertiesStep step) { - super(itemModel, step); - addSubmissionListener(this); - } - - @Override - protected void addWidgets() { - super.addWidgets(); - - Label descLabel = new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganizations.ui.organization.shortdescription")); - add(descLabel); - ParameterModel descParam = new StringParameter( - SciOrganization.ORGANIZATION_SHORT_DESCRIPTION); - TextArea desc = new TextArea(descParam); - desc.addValidationListener(new StringInRangeValidationListener(0, 500)); - desc.setCols(75); - desc.setRows(5); - add(desc); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - super.init(fse); - - FormData data = fse.getFormData(); - SciOrganization orga = (SciOrganization) super.initBasicWidgets(fse); - - data.put(SciOrganization.ORGANIZATION_SHORT_DESCRIPTION, - orga.getOrganizationShortDescription()); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - super.process(fse); - - FormData data = fse.getFormData(); - SciOrganization organization = (SciOrganization) super. - processBasicWidgets(fse); - - if ((organization != null) && getSaveCancelSection().getSaveButton(). - isSelected(fse.getPageState())) { - - organization.setOrganizationShortDescription((String) data.get( - SciOrganization.ORGANIZATION_SHORT_DESCRIPTION)); - - organization.save(); - } - } - - @Override - public String getTitleLabel() { - return (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganizations.ui.organization.title").localize(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties deleted file mode 100644 index 836c6ffce..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources.properties +++ /dev/null @@ -1,232 +0,0 @@ -sciorganization.ui.project.subprojects.none=No subprojects found -sciorganization.ui.project.subproject=Subproject -sciorganization.ui.project.subproject.remove=Remove subproject -sciorganization.ui.project.subproject.up=Up -sciorganization.ui.project.subproject.down=Down -sciorganization.ui.project.subproject.confirm_remove=Are you sure to remove this department? -sciorganization.ui.project.select_subproject=Select project to add as subproject -sciorganization.ui.member.edit_basic_properties=Edit basic properties -sciorganization.ui.member.associatedMember=Associated member? -sciorganization.ui.member.formerMember=Former member? -sciorganization.ui.project.edit_desc=Edit description -sciorganization.ui.project.upload_desc=Upload description -sciorganization.ui.project.desc=Project description -sciorganization.ui.project.funding=Funding -sciorganization.ui.organization.add_department=Add department -sciorganization.ui.department.add_project=Add project -sciorganization.ui.organization.add_project=Add project -sciorganization.ui.department.edit_basic_properties=Edit basic properties -sciorganization.ui.department.basic_properties=Basic properties -sciorganization.ui.organization.edit_basic_sheet=Basic properties -sciorganization.ui.organization.basic_properties=Basic properties -sciorganization.ui.project.begin=Start of project -sciorganization.ui.project.end=End of project -sciorganization.ui.project.shortdesc=Short description -sciorganization.ui.project.edit_basic_sheet=Basic properties -sciorganization.ui.project.basic_properties=Basis properties -sciorganization.ui.department.add_subdepartment=Add subdepartment -sciorganization.ui.organization.departments.none=No departments found -sciorganization.ui.organization.department=Department -sciorganization.ui.organization.department.remove=Remove department -sciorganization.ui.organization.department.up=Up -sciorganization.ui.organization.department.down=Down -sciorganization.ui.organization.department.confirm_remove=Are you sure to remove this department? -sciorganization.ui.department.projects.none=No projects found -sciorganization.ui.department.project=Project -sciorganization.ui.department.project.remove=Remove project -sciorganization.ui.department.project.up=Up -sciorganization.ui.department.project.down=Down -sciorganization.ui.department.project.confirm_remove=Are you sure to remove this project? -sciorganization.ui.organization.select_department=Select department to add -sciorganization.ui.organization.projects.none=No projects found -sciorganization.ui.organization.project=Project -sciorganization.ui.organization.project.remove=Remove project -sciorganization.ui.organization.project.up=Up -sciorganization.ui.organization.project.down=Down -sciorganization.ui.organization.project.confirm_remove=Are you sure to remove this project? -sciorganization.ui.project.addSubProject=Add subproject -sciorganization.ui.department.select_project=Select project to add -sciorganization.ui.organization.select_project=Select project to add -sciorganization.ui.department.subdepartments.none=No subdepartments found -sciorganization.ui.department.subdepartment=Subdepartment -sciorganization.ui.department.subdepartment.remove=Remove subdepartment -sciorganization.ui.department.subdepartment.up=Up -sciorganization.ui.department.subdepartment.down=Down -sciorganization.ui.department.subdepartment.confirm_remove=Are you sure to remove this subdepartment? -sciorganizations.ui.department.shortdescription=Short description -sciorganizations.ui.organization.shortdescription=Short description -sciorganization.ui.department.select_subdepartment=Select subdepartment to add -sciorganization.ui.department.add_member=Add member -sciorganizations.ui.project.shortdesc=Short description -sciorganization.ui.project.addDepartment=Add involved department -sciorganization.ui.project.addOrga=Add involved organization -sciorganization.ui.project.departments.none=No involved departments found -sciorganization.ui.project.department=Involved department -sciorganization.ui.project.department.remove=Remove involved department -sciorganization.ui.project.department.up=Up -sciorganization.ui.project.department.down=Down -sciorganization.ui.project.organization.confirm_remove=Are you sure to remove this involved organization? -sciorganization.ui.project.select_organization=Select organization to add -sciorganization.ui.project.organization.none=No involved organizations found -sciorganization.ui.project.organization=Involved organization -sciorganization.ui.project.organization.remove=Remove involved organization -sciorganization.ui.project.organization.up=Up -sciorganization.ui.project.organization.down=Down -sciorganization.ui.project.select_department=Select department to add -sciorganization.ui.project.superproject_none=No superior project found -sciorganization.ui.project.superproject=Superior project -sciorganization.ui.project.superproject.remove=Remove superior project -sciorganization.ui.project.superproject.confirm_remove=Are you sure to remove this superior project? -sciorganization.ui.department.select_superdepartment=Superior department -sciorganization.ui.project.setSuperProject=Set superior project -sciorganization.ui.project.description.upload=Upload project description -sciorganization.ui.project.description.upload.mimetype=Type of file -sciorganization.ui.organization.edit_desc=Edit description -sciorganization.ui.organization.upload_desc=Upload description -sciorganization.ui.organization.desc=Description -sciorganization.ui.organization.description=Description -sciorganization.ui.organization.description.upload=Upload description -sciorganization.ui.organization.description.upload.mimetype=Type of file -sciorganization.ui.project.select_superproject=Select superior project -sciorganization.ui.department.setSuperDepartment=Set superior department -sciorganization.ui.department.superdepartment_none=No superior department found -sciorganization.ui.department.superdepartment=Superior department -sciorganization.ui.department.superdepartment.remove=Remove superior department -sciorganization.ui.department.superdepartment.confirm_remove=Are you sure to remove the superior department? -sciorganization.ui.department.setOrganization=Set organization -sciorganization.ui.department.select_organization=Select organization -sciorganization.ui.department.organization_none=No assigned organization found -sciorganization.ui.department.organization=Organization -sciorganization.ui.department.organization.remove=Remove assigned organization -sciorganization.ui.department.organization.confirm_remove=Are you sure sure to remove to assigned organization? -sciorganization.ui.department.edit_desc=Edit description -sciorganization.ui.department.upload_desc=Upload description -sciorganization.ui.department.desc=Description -sciorganization.ui.department.description=Description -sciorganization.ui.department.description.upload=Upload description -sciorganization.ui.department.description.upload.mimetype=Type of file -sciorganization.ui.orgnization.add_member=Add member -sciorganization.ui.member.yes=Yes -sciorganization.ui.member.no=No -sciorganization.ui.organization.contacts=Contacts -sciorganization.ui.organization_members=Members of the organization -sciorganization.ui.organization.departments=Departments -sciorganization.ui.organization.projects=Projects -sciorganization.ui.organizsation_description.title=Description -sciorganization.ui.organization.properties.title=Properties -sciorganization.ui.organization.description.title=Description -sciorganization.ui.department.properties.title=Properties -sciorganization.ui.department.contacts=Contacts -sciorganization.ui.department.members=Members of the department -sciorganization.ui.department.subdepartments=Subdivisions -sciorganization.ui.department.projects=Projects of the department -sciorganization.ui.department.description.title=Description -sciorganization.ui.project_properties.title=Properties -sciorganization.ui.project.edit_basic_properties=Edit basic properties -sciorganization.ui.project.contacts=Contacts -sciorganization.ui.project.members=Members of the project -sciorganization.ui.project.subprojects=Subprojects -sciorganization.ui.project.organizations=Involved organizations -sciorganization.ui.project.departments=Involved departments -sciorganization.ui.project.publications=Publications of the project -sciorganization.ui.project_description.title=Description -sciorganization.ui.project.add_member\ =Add member -sciorganization.ui.project.subproject..confirm_remove=Are you sure to remove this subproject? -sciorganization.ui.project.superproject..confirm_remove=Are you sure to remove the superior project? -sciorganization.ui.project.add_member=Add member -sciorganization.ui.department.publications=Publications of the department -sciorganizations.ui.department.title=Name of the department -sciorganizations.ui.organization.title=Name of the organization -sciorganizations.ui.project.title=Name of the project -sciorganization.ui.project.funding_volume=Volume of funding -scimember.ui.basic_properties=Basic properties -scimember.ui.organization=Organization -scimember.ui.organization.role=Role -scimember.ui.organization.status=Status -scimember.ui.organization.edit=Edit -scimember.ui.organization.remove=Remove -scimember.ui.organizations.edit_assoc=Edit association -scimember.ui.organizations.remove=Remove assoication -scimember.ui.organization.add=Add member to organization -scimember.ui.organization.select_organization=Organization -scimember.ui.organization.confirm_remove=Do you really want to remove this association? -scimember.ui.departments=Departments -scimember.ui.projects=Projects -scimember.ui.organizations=Organizations -scimember.ui.department=Department -scimember.ui.department.role=Role -scimember.ui.department.status=Status -scimember.ui.department.edit=Edit -scimember.ui.department.remove=Remove -scimember.ui.departments.edit_assoc=Edit association -scimember.ui.departments.remove=Remove association -scimember.ui.department.add=Add member to department -scimember.ui.organizations.none=This member is not associated to any organization -scimember.ui.departments.none=This member is not associated to any department -scimember.ui.projects.none=This member is not associated to any project -scimember.ui.project.add=Add member to project -scimember.ui.project=Project -scimember.ui.project.role=Role -scimember.ui.project.status=Status -scimember.ui.project.edit=Edit -scimember.ui.project.remove=Remove -scimember.ui.project.edit_assoc=Edit association -scimember.ui.projects.remove=Remove association -scimember.ui.department.select_department=Department -scimember.ui.department.confirm_remove=Do you really want to remove this association? -scimember.ui.project.confirm_remove=Do you really want to remove this association? -scimember.ui.project.select_project=Project -scimember.ui.projects.edit_assoc=Edit association -sciorganization.ui.project.description=Description of project -sciorganization.ui.organization.department.add.no_suitable_language_variant=The selected item has no language variant for the language of the current item. Please add an suitable language variant to the item to add before adding it. -sciorganization.ui.department.organization.add.no_suitable_language_variant=The selected item has no language variant for the language of the current item. Please add an suitable language variant to the item to add before adding it. -sciorganization.ui.organization.department.add.already_added=The selected department has already been added to the current organization. -sciorganization.ui.organization.department.add.no_department_selected=No department selected. -sciorganization.ui.department.organization.add.no_organization_selected=No organization selected. -sciorganization.ui.department.select_project.no_project_selected=No project selected. -sciorganization.ui.department.select_project.no_suitable_language_variant=The select project is no available for the language of the current department item.. -sciorganization.ui.department.select_project.already_added=The selected project has already been added to the projects of the current department item. -sciorganization.ui.department.select_subdepartment.no_department_selected=No department selected. -sciorganization.ui.department.select_subdepartment.no_suitable_language_variant=The selected department to add as subdepartment is not available for the language of the current department. -sciorganization.ui.department.select_subdepartment.adding_to_itself=It is not possible to add a department to itself as a sub department. -sciorganization.ui.department.select_subdepartment.already_added=The selected department is already an sub department of the current department. -sciorganization.ui.department.select_superdepartment.no_department_selected=No department selected. -sciorganization.ui.department.select_superdepartment.no_suitable_language_variant=The department selected to set as super department is not available in the language of the current department. -sciorganization.ui.department.select_superdepartment.same_department=It is not possible to set the super department of a department to itself. -scimember.ui.department.select_department.no_department_selected=No department selected. -scimember.ui.department.select_department.no_suitable_language_variant=The department to add is not available for the language of the current member item. -scimember.ui.department.select_department.already_added=The current member is already a member of the selected department. -scimember.ui.organization.select_organization.no_orga_selected=No organization selected. -scimember.ui.organization.select_organization.no_suitable_language_variant=The selected organization is not available for the language of the current member item. -scimember.ui.organization.select_organization.already_added=The current member is already a member of the selected organization. -scimember.ui.project.select_project.no_project_selected=No project selected. -scimember.ui.project.select_project.no_suitable_language_variant=The selected project is not available for the language of the current member item. -scimember.ui.project.select_project.already_added=The current member is already a member of the selected project. -sciorganization.ui.organization.select_project.no_project_selected=No project selected. -sciorganization.ui.organization.select_project.no_suitable_language_variant=The selected project is not available for the language of the current organization item. -sciorganization.ui.organization.select_project.already_added=The selected project is already a project of the current organization. -sciorganization.ui.project.select_department.no_department_selected=No department selected. -sciorganization.ui.project.select_department.no_suitable_language_variant=The selected department is not available for the language of the current project item. -sciorganization.ui.project.select_department.already_added=The current project is already a project of the selected department. -sciorganization.ui.project.select_organization.no_organization_selected=No organization selected. -sciorganization.ui.project.select_organization.no_suitable_language_variant=The selected organization is not available for the language of the current project item. -sciorganization.ui.project.select_organization.already_added=The current project is already a project of the selected organization. -sciorganization.ui.project.select_subproject.no_project_selected=No project selected. -sciorganization.ui.project.select_subproject.no_suitable_language_variant=The selected sub project is not available for the language of the current project. -sciorganization.ui.project.select_subproject.same_project=A project can't be a sub project of itself. -sciorganization.ui.project.select_subproject.already_added=The selected project is already a sub project of the current project. -sciorganization.ui.project.select_superproject.no_project_selected=No project selected. -sciorganization.ui.project.select_superproject.no_suitable_language_variant=The selected super project is not available for the language of the current project item. -sciorganization.ui.project.select_superproject.same_project=A project can't be the super project of itself. -sciorganization.ui.selectDepartment.no_department_selected=No department selected. -sciorganization.ui.selectDepartment.no_suitable_language_variant=The selected department is not avaiable for the language of the current publication item. -sciorganization.ui.selectDepartment.already_added=The current publications has already been added to the list of publications of the selected department. -sciorganization.ui.selectOrganization.no_orga_selected=No organization selected. -sciorganization.ui.selectOrganization.no_suitable_language_variant=The selected organization is not avaiable for the language of the current publication item. -sciorganization.ui.selectOrganization.already_added=The current publication has already been added to the list of publications of the selected organization. -sciorganization.ui.selectProject.no_project_selected=No project selected. -sciorganization.ui.selectProject.no_suitable_language_variant=The selected project is not available for the language of the current publication item. -sciorganization.ui.selectProject.already_added=The current publications has already been added to the publication list of the selected project. -sciorganization.ui.selectPublication.no_publication_selected=No publication selected. -sciorganization.ui.selectPublication.no_suitable_language_variant=The selected publication is not available for the language of the current item. -sciorganization.ui.selectPublication.already_added=The selected publication has already been added to the publication list of the current item. diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties deleted file mode 100644 index 50bd4fdf6..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationResources_de.properties +++ /dev/null @@ -1,232 +0,0 @@ -sciorganization.ui.project.subprojects.none=Keine Unterprojekte gefunden -sciorganization.ui.project.subproject=Unterprojekt -sciorganization.ui.project.subproject.remove=Unterprojekt entfernen -sciorganization.ui.project.subproject.up=Hoch -sciorganization.ui.project.subproject.down=Runter -sciorganization.ui.project.subproject.confirm_remove=Wollen sie dieses Unterprojekt wirklich entfernen? -sciorganization.ui.project.select_subproject=Projekt zum Hinzuf\u00fcgen als Unterprojekt ausw\u00e4hlen -sciorganization.ui.member.edit_basic_properties=Basiseigenschaften bearbeiten -sciorganization.ui.member.associatedMember=Assoziertes Mitglied? -sciorganization.ui.member.formerMember=Ehemaliges Mitglied? -sciorganization.ui.project.edit_desc=Beschreibung bearbeiten -sciorganization.ui.project.upload_desc=Beschreibung hochladen -sciorganization.ui.project.desc=Projektbeschreibung -sciorganization.ui.project.funding=Finanzierung -sciorganization.ui.organization.add_department=Abteilung hinzuf\u00fcgen -sciorganization.ui.department.add_project=Projekt hinzuf\u00fcgen -sciorganization.ui.organization.add_project=Projekt hinzuf\u00fcgen -sciorganization.ui.department.edit_basic_properties=Basiseigenschaften bearbeiten -sciorganization.ui.department.basic_properties=Basiseigenschaften -sciorganization.ui.organization.edit_basic_sheet=Basiseigenschaften -sciorganization.ui.organization.basic_properties=Basiseigenschaften -sciorganization.ui.project.begin=Begin des Projektes -sciorganization.ui.project.end=Ende des Projektes -sciorganization.ui.project.shortdesc=Kurzbeschreibung -sciorganization.ui.project.edit_basic_sheet=Basiseigenschaften -sciorganization.ui.project.basic_properties=Basiseigenschaften -sciorganization.ui.department.add_subdepartment=Unterabteilung hinzuf\u00fcgen -sciorganization.ui.organization.departments.none=Keine Abteilungen gefunden -sciorganization.ui.organization.department=Abteilung -sciorganization.ui.organization.department.remove=Abteilung entfernen -sciorganization.ui.organization.department.up=Hoch -sciorganization.ui.organization.department.down=Runter -sciorganization.ui.organization.department.confirm_remove=Wollen sie diese Abteilung wirklich entfernen? -sciorganization.ui.department.projects.none=Keine Projekte gefunden -sciorganization.ui.department.project=Projekt -sciorganization.ui.department.project.remove=Projekt entfernen -sciorganization.ui.department.project.up=Hoch -sciorganization.ui.department.project.down=Runter -sciorganization.ui.department.project.confirm_remove=Wollen sie dieses Projekt wirklich entfernen? -sciorganization.ui.organization.select_department=Abteilung zum hinzuf\u00fcgen ausw\u00e4hlen -sciorganization.ui.organization.projects.none=Keine Projekte gefunden -sciorganization.ui.organization.project=Projekt -sciorganization.ui.organization.project.remove=Projekt entfernen -sciorganization.ui.organization.project.up=Hoch -sciorganization.ui.organization.project.down=Runter -sciorganization.ui.organization.project.confirm_remove=Wollen sie dieses Projekt wirklich entfernen? -sciorganization.ui.project.addSubProject=Unterprojekt hinzuf\u00fcgen -sciorganization.ui.department.select_project=Projekt zum hinzuf\u00fcgen ausw\u00e4hlen -sciorganization.ui.organization.select_project=Projekt zum hinzuf\u00fcgen ausw\u00e4hlen -sciorganization.ui.department.subdepartments.none=Keine Unterabteilungen gefunden -sciorganization.ui.department.subdepartment=Unterabteilung -sciorganization.ui.department.subdepartment.remove=Unterabteilung entfernen -sciorganization.ui.department.subdepartment.up=Hoch -sciorganization.ui.department.subdepartment.down=Runter -sciorganization.ui.department.subdepartment.confirm_remove=Wollen sie diese Unterabteilung wirklich entfernen -sciorganizations.ui.department.shortdescription=Kurzbeschreibung -sciorganizations.ui.organization.shortdescription=Kurzbeschreibung -sciorganization.ui.department.select_subdepartment=Unterabteilung zum hinzuf\u00fcgen ausw\u00e4hlen -sciorganization.ui.department.add_member=Mitglied hinzuf\u00fcgen -sciorganizations.ui.project.shortdesc=Kurzbeschreibung -sciorganization.ui.project.addDepartment=Beteiligte Abteilung hinzuf\u00fcgen -sciorganization.ui.project.addOrga=Beteiligte Organization hinzuf\u00fcgen -sciorganization.ui.project.departments.none=Keine beteiligen Abteilungen gefunden -sciorganization.ui.project.department=Beteiligte Abteilung -sciorganization.ui.project.department.remove=Beteiligte Abteilung entfernen -sciorganization.ui.project.department.up=Hoch -sciorganization.ui.project.department.down=Runter -sciorganization.ui.project.organization.confirm_remove=Wollen diese beteiligte Organization wirklich entfernen? -sciorganization.ui.project.select_organization=Organisation zum hinzuf\u00fcgen ausw\u00e4hlen -sciorganization.ui.project.organization.none=Keine beteiligten Organisationen gefunden -sciorganization.ui.project.organization=Beteiligte Organisation -sciorganization.ui.project.organization.remove=Beteiligte Organisation entfernen -sciorganization.ui.project.organization.up=Hoch -sciorganization.ui.project.organization.down=Runter -sciorganization.ui.project.select_department=Abteilung zum hinzuf\u00fcgen ausw\u00e4hlen -sciorganization.ui.project.superproject_none=Kein \u00fcbergeordnetes Projekt gefunden -sciorganization.ui.project.superproject=\u00dcbergeordnetes Projekt -sciorganization.ui.project.superproject.remove=\u00dcbergeordnetes Projekt entfernen -sciorganization.ui.project.superproject.confirm_remove=Wollen sie dieses \u00fcbergeordnete Projekt wirklich entfernen? -sciorganization.ui.department.select_superdepartment=\u00dcbergeordnete Abteilung -sciorganization.ui.project.setSuperProject=\u00dcbergeordnetes Projekt setzen -sciorganization.ui.project.description.upload=Projektbeschreibung hochladen -sciorganization.ui.project.description.upload.mimetype=Dateityp -sciorganization.ui.organization.edit_desc=Beschreibung bearbeiten -sciorganization.ui.organization.upload_desc=Beschreibung hochladen -sciorganization.ui.organization.desc=Beschreibung -sciorganization.ui.organization.description=Beschreibung -sciorganization.ui.organization.description.upload=Beschriebung hochladen -sciorganization.ui.organization.description.upload.mimetype=Dateityp -sciorganization.ui.project.select_superproject=\u00dcbergeordnetes Projekt ausw\u00e4hlen -sciorganization.ui.department.setSuperDepartment=\u00dcbergeordnete Abteilung setzen -sciorganization.ui.department.superdepartment_none=Keine \u00fcbergeordnete Abteilung gefunden -sciorganization.ui.department.superdepartment=\u00dcbergeordnete Abteilung -sciorganization.ui.department.superdepartment.remove=\u00dcbergeordnete Abteilung entfernen -sciorganization.ui.department.superdepartment.confirm_remove=Wollen sie die \u00fcbergeordnete Abteilung wirklich entfernen? -sciorganization.ui.department.setOrganization=Organization setzen -sciorganization.ui.department.select_organization=Organization ausw\u00e4hlen -sciorganization.ui.department.organization_none=Keine zugeordnete Organization gefunden -sciorganization.ui.department.organization=Organisation -sciorganization.ui.department.organization.remove=Zugeordnete Organisation entfernen -sciorganization.ui.department.organization.confirm_remove=Wollen sie zugeordnete Organisation wirklich entfernen? -sciorganization.ui.department.edit_desc=Beschreibung bearbeiten -sciorganization.ui.department.upload_desc=Beschreibung hochladen -sciorganization.ui.department.desc=Beschreibung -sciorganization.ui.department.description=Beschreibung -sciorganization.ui.department.description.upload=Beschreibung hochladen -sciorganization.ui.department.description.upload.mimetype=Dateityp -sciorganization.ui.orgnization.add_member=Mitglied hinzuf\u00fcgen -sciorganization.ui.member.yes=Ja -sciorganization.ui.member.no=Nein -sciorganization.ui.organization.contacts=Kontakte -sciorganization.ui.organization_members=Mitglieder der Organisation -sciorganization.ui.organization.departments=Abteilungen -sciorganization.ui.organization.projects=Projekte -sciorganization.ui.organizsation_description.title=Beschreibung -sciorganization.ui.organization.properties.title=Eigenschaften -sciorganization.ui.organization.description.title=Beschreibung -sciorganization.ui.department.properties.title=Eigenschaften -sciorganization.ui.department.contacts=Kontakte -sciorganization.ui.department.members=Mitglieder der Abteilung -sciorganization.ui.department.subdepartments=Unterabteilungen -sciorganization.ui.department.projects=Projekte der Abteilung -sciorganization.ui.department.description.title=Beschreibung -sciorganization.ui.project_properties.title=Eigenschaften -sciorganization.ui.project.edit_basic_properties=Basiseigenschaften bearbeiten -sciorganization.ui.project.contacts=Kontakte -sciorganization.ui.project.members=Mitglieder des Projektes -sciorganization.ui.project.subprojects=Unterprojekte -sciorganization.ui.project.organizations=Beteiligte Organisationen -sciorganization.ui.project.departments=Beteiligte Abteilungen -sciorganization.ui.project.publications=Publikationen des Projektes -sciorganization.ui.project_description.title=Beschreibung -sciorganization.ui.project.add_member\ =Mitglied hinzuf\u00fcgen -sciorganization.ui.project.subproject..confirm_remove=Sind sie sicher das sie dieses Unterprojekt entfernen wollen? -sciorganization.ui.project.superproject..confirm_remove=Wollen sie dieses \u00fcbergeordnete Projekt wirklich entfernen? -sciorganization.ui.project.add_member=Mitglied hinzuf\u00fcgen -sciorganization.ui.department.publications=Publikationen der Abteilung -sciorganizations.ui.department.title=Bezeichnung der Abteilung -sciorganizations.ui.organization.title=Name der Organisation -sciorganizations.ui.project.title=Name des Projektes -sciorganization.ui.project.funding_volume=Volumen der Finanzierung -scimember.ui.basic_properties=Basiseigenschaften -scimember.ui.organization=Organisation -scimember.ui.organization.role=Rolle -scimember.ui.organization.status=Status -scimember.ui.organization.edit=Bearbeiten -scimember.ui.organization.remove=Entfernen -scimember.ui.organizations.edit_assoc=Verkn\u00fcpfung bearbeiten -scimember.ui.organizations.remove=Verkn\u00fcpfung entfernen -scimember.ui.organization.add=Mitglied einer Organisation hinzuf\u00fcgen -scimember.ui.organization.select_organization=Organisation -scimember.ui.organization.confirm_remove=Wollen Sie diese Verkn\u00fcpfung wirklich entfernen? -scimember.ui.departments=Abteilungen -scimember.ui.projects=Projekte -scimember.ui.organizations=Organisationen -scimember.ui.department=Abteilung -scimember.ui.department.role=Rolle -scimember.ui.department.status=Status -scimember.ui.department.edit=Bearbeiten -scimember.ui.department.remove=Entfernen -scimember.ui.departments.edit_assoc=Verkn\u00fcpfung bearbeiten -scimember.ui.departments.remove=Verkn\u00fcpfung entfernen -scimember.ui.department.add=Mitglied einer Abteilung hinzuf\u00fcgen -scimember.ui.organizations.none=Dieses Mitglied ist keinen Organisationen zugeordnet -scimember.ui.departments.none=Dieses Mitglied ist keinen Abteilungen zugeordnet -scimember.ui.projects.none=Dieses Mitglied ist keinen Projekten zugeordnet -scimember.ui.project.add=Mitglied einem Projekt hinzuf\u00fcgen -scimember.ui.project=Projekt -scimember.ui.project.role=Rolle -scimember.ui.project.status=Status -scimember.ui.project.edit=Bearbeiten -scimember.ui.project.remove=Entfernen -scimember.ui.project.edit_assoc=Verkn\u00fcpfung bearbeiten -scimember.ui.projects.remove=Verkn\u00fcpfung entfernen -scimember.ui.department.select_department=Abteilung -scimember.ui.department.confirm_remove=Wollen Sie diese Verkn\u00fcpfung wirklich entfernen? -scimember.ui.project.confirm_remove=Wollen Sie diese Verkn\u00fcpfung wirklich entfernen? -scimember.ui.project.select_project=Projekt -scimember.ui.projects.edit_assoc=Verkn\u00fcpfung bearbeiten -sciorganization.ui.project.description=Projektbeschreibung -sciorganization.ui.organization.department.add.no_suitable_language_variant=Das ausgew\u00e4hlte ContentItem besitzt keine Sprachvariante f\u00fcr die Sprache dieses Items und kann daher nicht hinzugef\u00fcgt werden. -sciorganization.ui.department.organization.add.no_suitable_language_variant=Das ausgew\u00e4hlte ContentItem besitzt keine Sprachvariante f\u00fcr die Sprache dieses Items und kann daher nicht hinzugef\u00fcgt werden. -sciorganization.ui.organization.department.add.already_added=Die ausgew\u00e4hlte Abteilung wurde der aktuellen Organisation bereits hinzugef\u00fcgt. -sciorganization.ui.organization.department.add.no_department_selected=Keine Abteilung ausgew\u00e4hlt. -sciorganization.ui.department.organization.add.no_organization_selected=Keine Organisation ausgew\u00e4hlt. -sciorganization.ui.department.select_project.no_project_selected=Kein Project ausgew\u00e4hlt. -sciorganization.ui.department.select_project.no_suitable_language_variant=Das ausgew\u00e4hlte Projekt ist f\u00fcr die Sprache des aktuellen Abteilungs-Items nicht verf\u00fcgbar. -sciorganization.ui.department.select_project.already_added=Das ausgew\u00e4hlte Projekt wurde dem aktuellen Abteilungs-Item bereits hinzugef\u00fcgt. -sciorganization.ui.department.select_subdepartment.no_department_selected=Keine Abteilung ausgew\u00e4hlt. -sciorganization.ui.department.select_subdepartment.no_suitable_language_variant=Die zum hinzuf\u00fcgen als Unterabteilung ausw\u00e4hlte Abteilung ist f\u00fcr die Sprache der aktuellen Abteilung nicht verf\u00fcgbar. -sciorganization.ui.department.select_subdepartment.adding_to_itself=Eine Abteilung kann nicht sich selbst als Unterabteilung zugewiesen werden. -sciorganization.ui.department.select_subdepartment.already_added=Die ausgew\u00e4hlte Abteilung ist bereits eine Unterabteilung der aktuellen Abteilung. -sciorganization.ui.department.select_superdepartment.no_department_selected=Keine Abteilung ausgew\u00e4hlt. -sciorganization.ui.department.select_superdepartment.no_suitable_language_variant=Die als \u00fcbergeordnete Abteilung ausgew\u00e4hlte Abteilung ist nicht in der Sprache der aktuellen Abteilung verf\u00fcgbar. -sciorganization.ui.department.select_superdepartment.same_department=Eine Abteilung kann nicht ihre eigene \u00fcbergeordnete Abteilung sein. -scimember.ui.department.select_department.no_department_selected=Keine Abteilung ausgew\u00e4hlt. -scimember.ui.department.select_department.no_suitable_language_variant=Die ausgew\u00e4hlte Abteilung ist nicht f\u00fcr die Sprache des aktuellen Mitglieds-Items verf\u00fcgbar. -scimember.ui.department.select_department.already_added=Das aktuelle Mitglieder ist bereits ein Mitglied der ausgew\u00e4hlten Abteilung. -scimember.ui.organization.select_organization.no_orga_selected=Keine Organisation ausgew\u00e4hlt. -scimember.ui.organization.select_organization.no_suitable_language_variant=Die ausgew\u00e4hlte Organisation ist f\u00fcr die Sprache des aktuellen Mitglieds-Items nicht verf\u00fcgbar. -scimember.ui.organization.select_organization.already_added=Das aktuelle Mitglied ist bereits Mitglied der ausgew\u00e4hlten Organisation. -scimember.ui.project.select_project.no_project_selected=Kein Projekt ausgew\u00e4hlt. -scimember.ui.project.select_project.no_suitable_language_variant=Das ausgew\u00e4hlte Projekt ist f\u00fcr die Sprache des aktuellen Mitglieds-Items nicht verf\u00fcgbar. -scimember.ui.project.select_project.already_added=Das aktuelle Mitglied ist bereits ein Mitglied des ausgew\u00e4hlten Projektes. -sciorganization.ui.organization.select_project.no_project_selected=Kein Projekt ausgew\u00e4hlt. -sciorganization.ui.organization.select_project.no_suitable_language_variant=Das ausgew\u00e4hlte Projekt ist nicht f\u00fcr die Sprache des aktuellen Organisations-Items verf\u00fcgbar. -sciorganization.ui.organization.select_project.already_added=Das ausgew\u00e4hlte Projekt ist bereits ein Projekt der aktuellen Organisation. -sciorganization.ui.project.select_department.no_department_selected=Kein Projekt ausgew\u00e4hlt. -sciorganization.ui.project.select_department.no_suitable_language_variant=Die ausgew\u00e4hlte Abteilung ist nicht f\u00fcr die Sprache des aktuellen Projekt-Items verf\u00fcgbar. -sciorganization.ui.project.select_department.already_added=Das aktuelle Projekt ist bereits ein Projekt der ausgew\u00e4hlten Abteilung. -sciorganization.ui.project.select_organization.no_organization_selected=Keine Organisation ausgew\u00e4hlt. -sciorganization.ui.project.select_organization.no_suitable_language_variant=Die ausgew\u00e4hlte Organisation ist nicht f\u00fcr die Sprache des aktuellen Projekt-Items verf\u00fcgbar. -sciorganization.ui.project.select_organization.already_added=Das aktuelle Projekt is bereits ein Projekt der der ausgew\u00e4hlten Organisation. -sciorganization.ui.project.select_subproject.no_project_selected=Kein Projekt ausgew\u00e4hlt. -sciorganization.ui.project.select_subproject.no_suitable_language_variant=Das ausgew\u00e4hlte Unterprojekt ist nicht f\u00fcr die Sprache des aktuellen Projektes verf\u00fcgbar. -sciorganization.ui.project.select_subproject.same_project=Ein Projekt kann kein Unterprojekt von sich selbst sein. -sciorganization.ui.project.select_subproject.already_added=Das ausgew\u00e4hlte Projekt ist bereits ein Unterprojekt des aktuellen Projektes. -sciorganization.ui.project.select_superproject.no_project_selected=Kein Projekt ausgew\u00e4hlt. -sciorganization.ui.project.select_superproject.no_suitable_language_variant=Das ausgew\u00e4hlte Hauptprojekt ist nicht f\u00fcr die Sprache des aktuellen Projektes verf\u00fcgbar. -sciorganization.ui.project.select_superproject.same_project=Ein Projekt kann nicht sein eigenes Hauptprojekt sein. -sciorganization.ui.selectDepartment.no_department_selected=Keine Abteilung ausgew\u00e4hlt. -sciorganization.ui.selectDepartment.no_suitable_language_variant=Die ausgew\u00e4hlte Abteilung ist nicht f\u00fcr die Sprache des aktuellen Publikations-Items verf\u00fcgbar. -sciorganization.ui.selectDepartment.already_added=Die aktuelle Publikation wurde bereits der Publikationsliste der ausgew\u00e4hlten Abteilung hinzugef\u00fcgt. -sciorganization.ui.selectOrganization.no_orga_selected=Keine Organisation ausgew\u00e4hlt. -sciorganization.ui.selectOrganization.no_suitable_language_variant=Die ausgew\u00e4hlte Organisation ist nicht f\u00fcr die Sprache der aktuellen Publikation verf\u00fcgbar. -sciorganization.ui.selectOrganization.already_added=Die aktuelle Publikation wurde bereits der Liste der Publikationen der ausgew\u00e4hlten Organisation hinzugef\u00fcgt. -sciorganization.ui.selectProject.no_project_selected=Kein Projekt ausgew\u00e4hlt. -sciorganization.ui.selectProject.no_suitable_language_variant=Das ausgew\u00e4hlte Projekt ist nicht f\u00fcr die Sprache des aktuellen Publikations-Items verf\u00fcgbar. -sciorganization.ui.selectProject.already_added=Die aktuelle Publikation wurde bereits der Publikationsliste des ausgew\u00e4hlten Projektes hinzugef\u00fcgt. -sciorganization.ui.selectPublication.no_publication_selected=Keine Publikation ausgew\u00e4hlt. -sciorganization.ui.selectPublication.no_suitable_language_variant=Die ausgew\u00e4hlte Publikation ist nicht f\u00fcr die Sprache des aktuellen Items verf\u00fcgbar. -sciorganization.ui.selectPublication.already_added=Die ausgew\u00e4hlte Publikation ist bereits Teil der Publikationsliste des aktuellen Items. diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentAddForm.java deleted file mode 100644 index d0fa62f67..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentAddForm.java +++ /dev/null @@ -1,127 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.SciProjectDepartmentsCollection; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Form for adding a link between a {@link SciProject} and a - * {@link SciDepartment}. - * - * @author Jens Pelzetter - */ -public class SciProjectDepartmentAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget m_itemSearch; - private final String ITEM_SEARCH = "projectDepartment"; - - public SciProjectDepartmentAddForm(ItemSelectionModel itemModel) { - super("projectDepartmentAddForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_department"))); - m_itemSearch = new ItemSearchWidget( - ITEM_SEARCH, - ContentType.findByAssociatedObjectType( - SciDepartment.class.getName())); - add(m_itemSearch); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciProject project = (SciProject) getItemSelectionModel(). - getSelectedObject(state); - - if (!(this.getSaveCancelSection().getCancelButton(). - isSelected(state))) { - SciDepartment department = (SciDepartment) data.get(ITEM_SEARCH); - department = (SciDepartment) department.getContentBundle(). - getInstance(project.getLanguage()); - - project.addDepartment(department); - } - - init(fse); - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_department.no_department_selected")); - return; - } - - SciProject project = (SciProject) getItemSelectionModel(). - getSelectedObject(state); - SciDepartment department = (SciDepartment) data.get(ITEM_SEARCH); - if (!(department.getContentBundle().hasInstance(project.getLanguage()))) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_department.no_suitable_language_variant")); - return; - } - - department = (SciDepartment) department.getContentBundle().getInstance(project. - getLanguage()); - SciProjectDepartmentsCollection departments = project.getDepartments(); - departments.addFilter(String.format("id = %s", department.getID(). - toString())); - if (departments.size() > 0) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_department.already_added")); - } - - departments.close(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java deleted file mode 100644 index 9664fb0bd..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsStep.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * Step for adding and removing links between a {@link SciProject} and a - * {@link SciDepartment}. - * - * @author Jens Pelzetter - */ -public class SciProjectDepartmentsStep extends SimpleEditStep { - - private String PROJECT_ADD_DEPARTMENT_SHEET_NAME = "projectAddDepartment"; - - public SciProjectDepartmentsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciProjectDepartmentsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addDepartmentForm = - new SciProjectDepartmentAddForm(itemModel); - add(PROJECT_ADD_DEPARTMENT_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.addDepartment").localize(), - new WorkflowLockedComponentAccess(addDepartmentForm, itemModel), - addDepartmentForm.getSaveCancelSection().getCancelButton()); - - setDisplayComponent(new SciProjectDepartmentsTable(itemModel)); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsTable.java deleted file mode 100644 index 09ffe765e..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDepartmentsTable.java +++ /dev/null @@ -1,373 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.SciProjectDepartmentsCollection; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; -import org.apache.log4j.Logger; - -/** - * Table for showing the links between a {@link SciProject} and a - * {@link SciDepartment}. - * - * @author Jens Pelzetter - */ -public class SciProjectDepartmentsTable - extends Table - implements TableActionListener { - - private final static Logger s_log = Logger.getLogger( - SciProjectDepartmentsTable.class); - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private final String TABLE_COL_UP = "table_col_up"; - private final String TABLE_COL_DOWN = "table_col_down"; - private ItemSelectionModel m_itemModel; - - public SciProjectDepartmentsTable(ItemSelectionModel itemModel) { - super(); - m_itemModel = itemModel; - - setEmptyView( - new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.departments.none"))); - - TableColumnModel colModel = getColumnModel(); - colModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.department").localize(), - TABLE_COL_EDIT)); - colModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.department.remove").localize(), - TABLE_COL_DEL)); - colModel.add(new TableColumn( - 2, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.department.up").localize(), - TABLE_COL_UP)); - colModel.add(new TableColumn( - 3, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.department.down").localize(), - TABLE_COL_DOWN)); - - setModelBuilder( - new SciProjectDepartmentsTableModelBuilder(itemModel)); - colModel.get(0).setCellRenderer(new EditCellRenderer()); - colModel.get(1).setCellRenderer(new DeleteCellRenderer()); - colModel.get(2).setCellRenderer(new UpCellRenderer()); - colModel.get(3).setCellRenderer(new DownCellRenderer()); - - addTableActionListener(this); - } - - private class SciProjectDepartmentsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - public SciProjectDepartmentsTableModelBuilder( - ItemSelectionModel itemModel) { - m_itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - return new SciProjectDepartmentsTableModel(table, - state, - project); - - } - } - - private class SciProjectDepartmentsTableModel implements TableModel { - - private Table m_table; - private SciProjectDepartmentsCollection m_departments; - private SciDepartment m_department; - - public SciProjectDepartmentsTableModel(Table table, - PageState state, - SciProject project) { - m_table = table; - m_departments = project.getDepartments(); - } - - @Override - public int getColumnCount() { - return m_table.getColumnModel().size(); - } - - @Override - public boolean nextRow() { - boolean ret; - - if ((m_departments != null) && m_departments.next()) { - m_department = m_departments.getDepartment(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - @Override - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return m_department.getTitle(); - case 1: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.department.remove"). - localize(); - case 2: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.department.up"). - localize(); - case 3: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.department.down"). - localize(); - default: - return null; - } - } - - @Override - public Object getKeyAt(int columnIndex) { - return m_department.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess(state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - project); - if (canEdit) { - SciDepartment department; - try { - department = new SciDepartment((BigDecimal) key); - } catch (DataObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = - new Link(String.format("%s (%s)", - value.toString(), - department.getLanguage()), - resolver.generateItemURL(state, - department, - section, - department.getVersion())); - - return link; - } else { - SciDepartment department; - try { - department = new SciDepartment((BigDecimal) key); - } catch (DataObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - Label label = new Label(String.format("%s (%s)", - value.toString(), - department.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.DELETE_ITEM, - project); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "sciorganization.ui.project.organization." - + ".confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - private class UpCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - if (0 == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.department.up"). - localize()); - return link; - } - } - } - - private class DownCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - SciProjectDepartmentsCollection departments = - project.getDepartments(); - - if ((departments.size() - 1) == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.department.down"). - localize()); - return link; - } - } - } - - @Override - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - SciDepartment department = new SciDepartment( - new BigDecimal(event.getRowKey().toString())); - - SciProject project = - (SciProject) m_itemModel.getSelectedObject(state); - - SciProjectDepartmentsCollection departments = - project.getDepartments(); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { - project.removeDepartment(department); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) { - departments.swapWithPrevious(department); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) { - departments.swapWithNext(department); - } - } - - @Override - public void headSelected(TableActionEvent event) { - //Nothing to do. - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionEditForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionEditForm.java deleted file mode 100644 index c18271a9e..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionEditForm.java +++ /dev/null @@ -1,143 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.form.TextArea; -import com.arsdigita.bebop.form.TextField; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.bebop.parameters.StringInRangeValidationListener; -import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.CMSDHTMLEditor; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Form for editing the description of a {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectDescriptionEditForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - public SciProjectDescriptionEditForm(ItemSelectionModel itemModel) { - super("sciprojectEditDescForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.description"))); - ParameterModel descParam = new StringParameter( - SciProject.PROJECT_DESCRIPTION); - TextArea desc; - if (SciProject.getConfig().getProjectDescriptionDhtml()) { - desc = new CMSDHTMLEditor(descParam); - } else { - desc = new TextArea(descParam); - } - desc.setCols(75); - desc.setRows(25); - add(desc); - - if (!SciProject.getConfig().getProjectFundingHide()) { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.funding"))); - ParameterModel fundingParam = new StringParameter( - SciProject.FUNDING); - TextArea funding; - if (SciProject.getConfig().getProjectFundingDhtml()) { - funding = new CMSDHTMLEditor(fundingParam); - } else { - funding = new TextArea(fundingParam); - } - funding.setCols(75); - funding.setRows(8); - add(funding); - } - - if (!SciProject.getConfig().getProjectFundingVolumeHide()) { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.funding_volume"))); - ParameterModel fundingVolumeParam = new StringParameter(SciProject.FUNDING_VOLUME); - TextField fundingVolume = new TextField(fundingVolumeParam); - fundingVolume.addValidationListener(new StringInRangeValidationListener( - 0, 128)); - add(fundingVolume); - } - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - FormData data = fse.getFormData(); - SciProject project = (SciProject) getItemSelectionModel(). - getSelectedObject(state); - - data.put(SciProject.PROJECT_DESCRIPTION, - project.getProjectDescription()); - if (!SciProject.getConfig().getProjectFundingHide()) { - data.put(SciProject.FUNDING, project.getFunding()); - } - - if (!SciProject.getConfig().getProjectFundingVolumeHide()) { - data.put(SciProject.FUNDING_VOLUME, project.getFundingVolume()); - } - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - FormData data = fse.getFormData(); - SciProject project = (SciProject) getItemSelectionModel(). - getSelectedObject(state); - - if ((project != null) && getSaveCancelSection().getSaveButton(). - isSelected(state)) { - project.setProjectDescription((String) data.get( - SciProject.PROJECT_DESCRIPTION)); - if (!SciProject.getConfig().getProjectFundingHide()) { - project.setFunding((String) data.get( - SciProject.FUNDING)); - } - if (!SciProject.getConfig().getProjectFundingVolumeHide()) { - project.setFundingVolume((String) data.get( - SciProject.FUNDING_VOLUME)); - } - - project.save(); - - init(fse); - } - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionStep.java deleted file mode 100644 index 034dd8730..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionStep.java +++ /dev/null @@ -1,94 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; - -/** - * Step for editing the description of a {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectDescriptionStep extends SimpleEditStep { - - private String EDIT_PROJECT_DESC_SHEET_NAME = "editProjectDesc"; - private String UPLOAD_PROJECT_DESC_SHEET_NAME = "uploadProjectDesc"; - - public SciProjectDescriptionStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciProjectDescriptionStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm editDescForm = - new SciProjectDescriptionEditForm(itemModel); - add(EDIT_PROJECT_DESC_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.edit_desc").localize(), - new WorkflowLockedComponentAccess(editDescForm, itemModel), - editDescForm.getSaveCancelSection().getCancelButton()); - - SciProjectDescriptionUploadForm uploadDescForm = - new SciProjectDescriptionUploadForm( - itemModel); - add(UPLOAD_PROJECT_DESC_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.upload_desc").localize(), - new WorkflowLockedComponentAccess(uploadDescForm, itemModel), - uploadDescForm.getSaveCancelSection().getCancelButton()); - - setDisplayComponent( - getSciProjectEditDescSheet(itemModel)); - - } - - public static Component getSciProjectEditDescSheet( - ItemSelectionModel itemModel) { - DomainObjectPropertySheet sheet = new DomainObjectPropertySheet( - itemModel); - - sheet.add(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.desc"), - SciProject.PROJECT_DESCRIPTION); - if (!SciProject.getConfig().getProjectFundingHide()) { - sheet.add(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.funding"), - SciProject.FUNDING); - } - if (!SciProject.getConfig().getProjectFundingVolumeHide()) { - sheet.add(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.funding_volume"), - SciProject.FUNDING_VOLUME); - } - - return sheet; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionUploadForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionUploadForm.java deleted file mode 100644 index 90b146878..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectDescriptionUploadForm.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.globalization.GlobalizedMessage; - -/** - * Form for uploading the description of a {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectDescriptionUploadForm extends AbstractTextUploadForm { - - public SciProjectDescriptionUploadForm(ItemSelectionModel itemModel) { - super(itemModel); - } - - @Override - public GlobalizedMessage getLabelText() { - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.description.upload"); - } - - @Override - public GlobalizedMessage getMimeTypeLabel() { - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.description.upload.mimetype"); - } - - @Override - public void setText(ItemSelectionModel itemModel, - PageState state, - String text) { - SciProject project = (SciProject) itemModel.getSelectedObject(state); - project.setProjectDescription(text); - project.save(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberAddForm.java deleted file mode 100644 index f7ed216d8..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberAddForm.java +++ /dev/null @@ -1,51 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.contenttypes.GenericPerson; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciProject; - -/** - * Form for adding a link between a {@link SciProject} and a {@link SciMember}. - * - * @author Jens Pelzetter - */ -public class SciProjectMemberAddForm - extends GenericOrganizationalUnitPersonAddForm { - - public SciProjectMemberAddForm( - ItemSelectionModel itemModel, - GenericOrganizationalUnitPersonSelector personSelector) { - super(itemModel, personSelector); - } - - @Override - protected String getPersonType() { - return GenericPerson.class.getName(); - } - - @Override - protected String getRoleAttributeName() { - return "SciProjectRole"; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberStep.java deleted file mode 100644 index 01d029fc4..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberStep.java +++ /dev/null @@ -1,96 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.GenericPerson; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * Step for adding and removing member to and from a {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectMemberStep - extends SimpleEditStep - implements GenericOrganizationalUnitPersonSelector { - - private static final String ADD_MEMBER_SHEET_NAME = "addMember"; - private GenericPerson selectedPerson; - private String selectedPersonRole; - private String selectedPersonStatus; - - public SciProjectMemberStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciProjectMemberStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addMemberSheet = - new SciProjectMemberAddForm(itemModel, - this); - add(ADD_MEMBER_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.add_member").localize(), - new WorkflowLockedComponentAccess(addMemberSheet, itemModel), - addMemberSheet.getSaveCancelSection().getCancelButton()); - - SciProjectMemberTable memberTable = new SciProjectMemberTable( - itemModel, this); - setDisplayComponent(memberTable); - } - - public GenericPerson getSelectedPerson() { - return selectedPerson; - } - - public void setSelectedPerson(final GenericPerson selectedPerson) { - this.selectedPerson = selectedPerson; - } - - public String getSelectedPersonRole() { - return selectedPersonRole; - } - - public void setSelectedPersonRole(final String selectedPersonRole) { - this.selectedPersonRole = selectedPersonRole; - } - - public String getSelectedPersonStatus() { - return selectedPersonStatus; - } - - public void setSelectedPersonStatus(final String selectedPersonStatus) { - this.selectedPersonStatus = selectedPersonStatus; - } - - public void showEditComponent(PageState state) { - showComponent(state, ADD_MEMBER_SHEET_NAME); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberTable.java deleted file mode 100644 index f195ac1b4..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectMemberTable.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; - -/** - * - * @author Jens Pelzetter - */ -public class SciProjectMemberTable - extends GenericOrganizationalUnitPersonsTable { - - public SciProjectMemberTable(ItemSelectionModel itemModel, - GenericOrganizationalUnitPersonSelector personSelector) { - super(itemModel, personSelector); - } - - @Override - protected String getRoleAttributeName() { - return "SciProjectRole"; - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsAddForm.java deleted file mode 100644 index 4c580873c..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsAddForm.java +++ /dev/null @@ -1,122 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.SciProjectOrganizationsCollection; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Form for adding a link between a {@link SciProject} and a - * {@link SciOrganization}. - * - * @author Jens Pelzetter - */ -public class SciProjectOrganizationsAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget m_itemSearch; - private final String ITEM_SEARCH = "projectOrga"; - - public SciProjectOrganizationsAddForm(ItemSelectionModel itemModel) { - super("projectOrgaAddForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_organization"))); - m_itemSearch = new ItemSearchWidget( - ITEM_SEARCH, - ContentType.findByAssociatedObjectType( - SciOrganization.class.getName())); - add(m_itemSearch); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciProject project = (SciProject) getItemSelectionModel(). - getSelectedObject(state); - - if (!(this.getSaveCancelSection().getCancelButton(). - isSelected(state))) { - SciOrganization orga = (SciOrganization) data.get(ITEM_SEARCH); - orga = (SciOrganization) orga.getContentBundle().getInstance(project. - getLanguage()); - - project.addOrganization(orga); - } - - init(fse); - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_organization.no_organization_selected")); - return; - } - - SciProject project = (SciProject) getItemSelectionModel(). - getSelectedObject(state); - SciOrganization orga = (SciOrganization) data.get(ITEM_SEARCH); - if (!(orga.getContentBundle().hasInstance(project.getLanguage()))) { - data.addError(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_organization.no_suitable_language_variant")); - return; - } - - orga = (SciOrganization) orga.getContentBundle().getInstance(project.getLanguage()); - SciProjectOrganizationsCollection organizations = project.getOrganizations(); - organizations.addFilter(String.format("id = %s", orga.getID().toString())); - if (organizations.size() > 0) { - data.addError(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_organization.already_added")); - } - - organizations.close(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsStep.java deleted file mode 100644 index 1d5279984..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsStep.java +++ /dev/null @@ -1,61 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * Step for adding and removing links between a {@link SciProject} and - * {@link SciOrganization}s. - * - * @author Jens Pelzetter - */ -public class SciProjectOrganizationsStep extends SimpleEditStep { - - private String PROJECT_ADD_ORGA_SHEET_NAME = "projectAddOrga"; - - public SciProjectOrganizationsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciProjectOrganizationsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addOrgaForm = - new SciProjectOrganizationsAddForm(itemModel); - add(PROJECT_ADD_ORGA_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.addOrga").localize(), - new WorkflowLockedComponentAccess(addOrgaForm, itemModel), - addOrgaForm.getSaveCancelSection().getCancelButton()); - - setDisplayComponent( - new SciProjectOrganizationsTable(itemModel)); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsTable.java deleted file mode 100644 index 13bc310af..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectOrganizationsTable.java +++ /dev/null @@ -1,381 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import java.math.BigDecimal; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.SciProjectOrganizationsCollection; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import org.apache.log4j.Logger; - -/** - * Table for showing the links between a {@link SciProject} and - * {@link SciOrganization}s. - * - * @author Jens Pelzetter - */ -public class SciProjectOrganizationsTable - extends Table - implements TableActionListener { - - private static final Logger s_log = Logger.getLogger( - SciProjectOrganizationsTable.class); - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private final String TABLE_COL_UP = "table_col_up"; - private final String TABLE_COL_DOWN = "table_col_down"; - private ItemSelectionModel m_itemModel; - - public SciProjectOrganizationsTable(ItemSelectionModel itemModel) { - super(); - m_itemModel = itemModel; - - setEmptyView( - new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.organization.none"))); - TableColumnModel colModel = getColumnModel(); - colModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.organization").localize(), - TABLE_COL_EDIT)); - colModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.organization.remove").localize(), - TABLE_COL_DEL)); - colModel.add(new TableColumn( - 2, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.organization.up").localize(), - TABLE_COL_UP)); - colModel.add(new TableColumn( - 3, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.organization.down").localize(), - TABLE_COL_DOWN)); - - - setModelBuilder( - new SciProjectOrganizationsTableModelBuilder(itemModel)); - - colModel.get(0).setCellRenderer(new EditCellRenderer()); - colModel.get(1).setCellRenderer(new DeleteCellRenderer()); - colModel.get(2).setCellRenderer(new UpCellRenderer()); - colModel.get(3).setCellRenderer(new DownCellRenderer()); - - addTableActionListener(this); - } - - private class SciProjectOrganizationsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel m_itemModel; - - public SciProjectOrganizationsTableModelBuilder( - ItemSelectionModel itemModel) { - m_itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - return new SciProjectOrganizationsTableModel(table, - state, - project); - } - } - - private class SciProjectOrganizationsTableModel - implements TableModel { - - private Table m_table; - private SciProjectOrganizationsCollection m_organizations; - private SciOrganization m_organization; - - public SciProjectOrganizationsTableModel(Table table, - PageState state, - SciProject project) { - m_table = table; - m_organizations = project.getOrganizations(); - } - - @Override - public int getColumnCount() { - return m_table.getColumnModel().size(); - } - - @Override - public boolean nextRow() { - boolean ret; - - if ((m_organizations != null) && m_organizations.next()) { - m_organization = m_organizations.getOrganization(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - @Override - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return m_organization.getTitle(); - case 1: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.organization.remove"). - localize(); - case 2: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.organization.up"). - localize(); - case 3: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.organization.down"). - localize(); - default: - return null; - } - } - - @Override - public Object getKeyAt(int columnIndex) { - return m_organization.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.EDIT_ITEM, - project); - - if (canEdit) { - SciOrganization orga; - try { - orga = new SciOrganization((BigDecimal) key); - } catch (DataObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = - new Link(String.format("%s (%s)", - value.toString(), - orga.getLanguage()), - resolver.generateItemURL(state, - orga, - section, - orga.getVersion())); - return link; - - } else { - SciOrganization orga; - try { - orga = new SciOrganization((BigDecimal) key); - } catch (DataObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - Label label = new Label(String.format("%s (%s)", - value.toString(), - orga.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.DELETE_ITEM, - project); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "sciorganization.ui.project.organization." - + ".confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - private class UpCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - if (0 == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.organization.up"). - localize()); - return link; - } - } - } - - private class DownCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - SciProjectOrganizationsCollection orgas = - project.getOrganizations(); - - if ((orgas.size() - 1) == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.organization.down"). - localize()); - return link; - } - } - } - - @Override - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - SciOrganization orga = new SciOrganization( - new BigDecimal(event.getRowKey().toString())); - - SciProject project = - (SciProject) m_itemModel.getSelectedObject(state); - - SciProjectOrganizationsCollection subprojects = - project.getOrganizations(); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { - project.removeOrganization(orga); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) { - subprojects.swapWithPrevious(orga); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) { - subprojects.swapWithNext(orga); - } - } - - @Override - public void headSelected(TableActionEvent event) { - //Nothing to do. - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPanel.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPanel.java deleted file mode 100644 index 269ef5052..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPanel.java +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnitPersonCollection; -import com.arsdigita.cms.contenttypes.SciOrganizationConfig; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.SciProjectSubProjectsCollection; -import com.arsdigita.xml.Element; -import java.util.LinkedList; -import java.util.List; -import org.apache.log4j.Logger; - -/** - * - * @author Jens Pelzetter - */ -public class SciProjectPanel extends SciOrganizationBasePanel { - - private static final Logger s_log = Logger.getLogger(SciProjectPanel.class); - public static final String SHOW_DESCRIPTION = "description"; - public static final String SHOW_SUBPROJECTS = "subprojects"; - public static final String SHOW_SUBPROJECTS_ONGOING = "subprojectsOngoing"; - public static final String SHOW_SUBPROJECTS_FINISHED = "subprojectsFinished"; - private boolean displayDescription = true; - private boolean displaySubProjects = true; - private boolean displayPublications = true; - - @Override - protected String getDefaultShowParam() { - return SHOW_DESCRIPTION; - } - - @Override - protected Class getAllowedClass() { - return SciProject.class; - } - - public boolean isDisplayDescription() { - return displayDescription; - } - - public void setDisplayDescription(boolean displayDescription) { - this.displayDescription = displayDescription; - } - - public boolean isDisplaySubProjects() { - return displaySubProjects; - } - - public void setDisplaySubProjects(boolean displaySubProjects) { - this.displaySubProjects = displaySubProjects; - } - - protected boolean hasMembers(final SciProject project) { - return project.hasMembers(SciProject.getConfig(). - getOrganizationMembersMerge(), - SciProject.MemberStatus.ALL); - } - - protected boolean hasActiveMembers(final SciProject project) { - return project.hasMembers(SciProject.getConfig(). - getOrganizationMembersMerge(), - SciProject.MemberStatus.ACTIVE); - } - - protected boolean hasAssociatedMembers(final SciProject project) { - return project.hasMembers(SciProject.getConfig(). - getOrganizationMembersMerge(), - SciProject.MemberStatus.ASSOCIATED); - } - - protected boolean hasFormerMembers(final SciProject project) { - return project.hasMembers(SciProject.getConfig(). - getOrganizationMembersMerge(), - SciProject.MemberStatus.FORMER); - } - - protected boolean hasSubProjects(final SciProject project) { - return project.hasSubProjects(); - } - - protected void generateSubProjectsXML(final SciProject project, - final Element parent, - final PageState state, - final List filters) { - SciProjectSubProjectsCollection subProjects; - subProjects = project.getSubProjects(); - for (String filter : filters) { - subProjects.addFilter(filter); - } - subProjects.addOrder("begin desc, end desc"); - - long pageNumber = getPageNumber(state); - - Element subProjectsElem = parent.newChildElement("subProjects"); - - long pageCount = getPageCount(subProjects.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, subProjects.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - createPaginatorElement(parent, pageNumber, pageCount, begin, end, count, - subProjects.size()); - subProjects.setRange((int) begin + 1, (int) end + 1); - - - while (subProjects.next()) { - SciProject subProject; - subProject = subProjects.getSubProject(); - - generateProjectXML(subProject, subProjectsElem, state); - } - } - - protected void mergeMembers( - final SciProjectSubProjectsCollection subProjects, - final List members, - final boolean active, - final boolean associated, - final boolean former) { - while (subProjects.next()) { - SciProject subProject = subProjects.getSubProject(); - GenericOrganizationalUnitPersonCollection projectMembers; - projectMembers = subProject.getPersons(); - - while (projectMembers.next()) { - addMember(projectMembers, - members); - } - - SciProjectSubProjectsCollection subSubProjects; - subSubProjects = subProject.getSubProjects(); - if ((subSubProjects != null) && (subSubProjects.size() > 0)) { - mergeMembers(subProjects, members, active, associated, former); - } - } - } - - protected void generateMembersXML(final SciProject project, - final Element parent, - final PageState state, - final boolean active, - final boolean associated, - final boolean former) { - GenericOrganizationalUnitPersonCollection projectMembers; - projectMembers = project.getPersons(); - - List members; - members = new LinkedList(); - - while (projectMembers.next()) { - addMember(projectMembers, - members); - } - - if (SciProject.getConfig().getProjectMembersMerge()) { - - SciProjectSubProjectsCollection subProjects; - subProjects = project.getSubProjects(); - - mergeMembers(subProjects, members, active, associated, former); - } - - generateMembersListXML(members, parent, state); - } - - @Override - protected void generateAvailableDataXml(final GenericOrganizationalUnit orga, - final Element element, - final PageState state) { - - SciOrganizationConfig config = SciProject.getConfig(); - - SciProject project = (SciProject) orga; - - if ((project.getProjectDescription() != null) - && !project.getProjectDescription().isEmpty() - && displayDescription) { - element.newChildElement("description"); - } - if (project.hasContacts() - && isDisplayContacts()) { - element.newChildElement("contacts"); - } - if (hasSubProjects(project) - && displaySubProjects) { - element.newChildElement("subProjects"); - } - if (config.getProjectMembersAllInOne()) { - if (hasMembers(project) - && isDisplayMembers()) { - element.newChildElement("members"); - } - } else { - if (hasActiveMembers(project) - && isDisplayMembers()) { - element.newChildElement("activeMembers"); - } - if (hasAssociatedMembers(project) - && isDisplayMembers()) { - element.newChildElement("associatedMembers"); - } - if (hasFormerMembers(project) - && isDisplayMembers()) { - element.newChildElement("formerMembers"); - } - } - } - - @Override - protected void generateDataXml(final GenericOrganizationalUnit orga, - final Element element, - final PageState state) { - - String show = getShowParam(state); - - SciProject project = (SciProject) orga; - - if (SHOW_DESCRIPTION.equals(show)) { - Element description = element.newChildElement("description"); - description.setText(project.getProjectDescription()); - - Element funding = element.newChildElement("funding"); - funding.setText(project.getFunding()); - } else if (SHOW_CONTACTS.equals(show)) { - generateContactsXML(project, element, state); - } else if (SHOW_SUBPROJECTS.equals(show)) { - generateSubProjectsXML(project, element, state, - new LinkedList()); - } else if (SHOW_SUBPROJECTS_ONGOING.equals(show)) { - generateSubProjectsXML(project, element, state, - getFiltersForOngoingProjects()); - } else if (SHOW_SUBPROJECTS_FINISHED.equals(show)) { - generateSubProjectsXML(project, element, state, - getFiltersForFinishedProjects()); - } else if (SHOW_MEMBERS.equals(show)) { - generateMembersXML(project, element, state, true, true, true); - } - } - - /*@Override - public void generateXML(ContentItem item, - Element element, - PageState state) { - Element content = generateBaseXML(item, element, state); - - Element availableData = content.newChildElement("availableData"); - - SciProject project = (SciProject) item; - - generateAvailableDataXml(project, element, state); - - generateDataXml(project, element, state); - - }*/ -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java deleted file mode 100644 index 86c6f8426..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertiesStep.java +++ /dev/null @@ -1,191 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ContentTypeCollection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciOrganizationConfig; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.util.ContenttypesGlobalizationUtil; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicPageForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -import com.arsdigita.domain.DomainObject; -import com.arsdigita.toolbox.ui.DomainObjectPropertySheet; -import java.text.DateFormat; - -/** - * Step for editing the basic properties of a {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectPropertiesStep - extends GenericOrganizationalUnitPropertiesStep { - - public SciProjectPropertiesStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - super(itemModel, parent); - } - - public static Component getSciProjectPropertySheet( - ItemSelectionModel itemModel) { - DomainObjectPropertySheet sheet = (DomainObjectPropertySheet) GenericOrganizationalUnitPropertiesStep. - getGenericOrganizationalUnitPropertySheet( - itemModel); - - sheet.add(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.begin"), - SciProject.BEGIN, - new DomainObjectPropertySheet.AttributeFormatter() { - - public String format(DomainObject obj, - String attribute, - PageState state) { - SciProject project = (SciProject) obj; - if (project.getBegin() == null) { - return (String) ContenttypesGlobalizationUtil.globalize( - "cms.ui.unknown").localize(); - } else { - return DateFormat.getDateInstance(DateFormat.LONG).format( - project.getBegin()); - } - } - }); - sheet.add(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.end"), - SciProject.END, - new DomainObjectPropertySheet.AttributeFormatter() { - - public String format(DomainObject obj, - String attribute, - PageState state) { - SciProject project = (SciProject) obj; - if (project.getEnd() == null) { - return (String) ContenttypesGlobalizationUtil.globalize( - "cms.ui.unknown").localize(); - } else { - return DateFormat.getDateInstance(DateFormat.LONG).format( - project.getEnd()); - } - } - }); - sheet.add(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.shortdesc"), - SciProject.PROJECT_SHORT_DESCRIPTION); - - return sheet; - } - - @Override - protected void addBasicProperties(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - SimpleEditStep basicProperties = new SimpleEditStep(itemModel, - parent, - EDIT_SHEET_NAME); - - BasicPageForm editBasicSheet = - new SciProjectPropertyForm(itemModel, this); - - basicProperties.add(EDIT_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.edit_basic_sheet").localize(), - new WorkflowLockedComponentAccess(editBasicSheet, - itemModel), - editBasicSheet.getSaveCancelSection(). - getCancelButton()); - - basicProperties.setDisplayComponent( - getSciProjectPropertySheet(itemModel)); - - getSegmentedPanel().addSegment( - new Label((String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.edit_basic_properties"). - localize()), - basicProperties); - } - - @Override - protected void addSteps(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - SciOrganizationConfig config; - config = SciProject.getConfig(); - - if (!config.getProjectAddContactHide()) { - addStep(new GenericOrganizationalUnitContactPropertiesStep(itemModel, - parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.contacts")); - } - - /* if (!config.getProjectAddPersonHide()) { - addStep(new SciProjectMemberStep(itemModel, - parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.members")); - }*/ - - if (!config.getProjectSetSuperProjectHide()) { - addStep(new SciProjectSuperProjectStep(itemModel, - parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.superproject")); - } - - /* if (!config.getProjectAddSubProjectHide()) { - addStep(new SciProjectSubprojectsStep(itemModel, - parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.subprojects")); - }*/ - - if (!config.getProjectAddOrganizationHide()) { - addStep(new SciProjectOrganizationsStep(itemModel, parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.organizations")); - } - - /*if (!config.getProjectAddDepartmentHide()) { - addStep(new SciProjectDepartmentsStep(itemModel, parent), - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.departments")); - } - - ContentTypeCollection contentTypes = ContentType.getAllContentTypes(); - contentTypes.addFilter("associatedObjectType = :type").set( - "type", - "com.arsdigita.cms.contenttypes.Publication"); - if ((!config.getProjectMaterialsHide()) - && (contentTypes.size() > 0)) { - /* - * Must add this step manually since the basic class is not - * SimpleEditStep... - */ - /* getSegmentedPanel().addSegment(new Label(SciOrganizationGlobalizationUtil. - globalize("sciorganization.ui.project.publications")), - new SciProjectPublicationsStep( - itemModel, parent)); - }*/ - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java deleted file mode 100644 index 4778b93d3..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectPropertyForm.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.bebop.event.FormSubmissionListener; -import com.arsdigita.bebop.form.Date; -import com.arsdigita.bebop.form.TextArea; -import com.arsdigita.bebop.parameters.DateParameter; -import com.arsdigita.bebop.parameters.ParameterModel; -import com.arsdigita.bebop.parameters.StringInRangeValidationListener; -import com.arsdigita.bebop.parameters.StringParameter; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciProject; -import java.util.Calendar; -import java.util.GregorianCalendar; - -/** - * Form for editing the basic properties of a {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectPropertyForm - extends GenericOrganizationalUnitPropertyForm - implements FormProcessListener, - FormInitListener, - FormSubmissionListener { - - public static final String ID = "SciProjectEdit"; - - public SciProjectPropertyForm(ItemSelectionModel itemModel) { - this(itemModel, null); - } - - public SciProjectPropertyForm(ItemSelectionModel itemModel, - SciProjectPropertiesStep step) { - super(itemModel, step); - addSubmissionListener(this); - } - - @Override - protected void addWidgets() { - super.addWidgets(); - - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.begin"))); - ParameterModel beginParam = new DateParameter(SciProject.BEGIN); - Calendar today = new GregorianCalendar(); - Date begin = new Date(beginParam); - begin.setYearRange(1970, (today.get(Calendar.YEAR) + 2)); - add(begin); - - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.end"))); - ParameterModel endParam = new DateParameter(SciProject.END); - Date end = new Date(endParam); - end.setYearRange(1970, (today.get(Calendar.YEAR) + 8)); - add(end); - - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganizations.ui.project.shortdesc"))); - ParameterModel shortDescParam = new StringParameter( - SciProject.PROJECT_SHORT_DESCRIPTION); - TextArea shortDesc = new TextArea(shortDescParam); - shortDesc.addValidationListener(new StringInRangeValidationListener(0, 500)); - shortDesc.setCols(75); - shortDesc.setRows(5); - add(shortDesc); - - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - super.init(fse); - - FormData data = fse.getFormData(); - SciProject project = (SciProject) super.initBasicWidgets(fse); - - data.put(SciProject.BEGIN, project.getBegin()); - data.put(SciProject.END, project.getEnd()); - data.put(SciProject.PROJECT_SHORT_DESCRIPTION, - project.getProjectShortDescription()); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - super.process(fse); - - FormData data = fse.getFormData(); - SciProject project = (SciProject) super.processBasicWidgets(fse); - - if ((project != null) && getSaveCancelSection().getSaveButton(). - isSelected(fse.getPageState())) { - project.setBegin((java.util.Date) data.get( - SciProject.BEGIN)); - project.setEnd((java.util.Date) data.get( - SciProject.END)); - project.setProjectShortDescription((String) data.get( - SciProject.PROJECT_SHORT_DESCRIPTION)); - - project.save(); - - init(fse); - } - } - - @Override - public String getTitleLabel() { - return (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganizations.ui.project.title").localize(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubProjectsTable.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubProjectsTable.java deleted file mode 100644 index aa7ae11a1..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubProjectsTable.java +++ /dev/null @@ -1,379 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import java.math.BigDecimal; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.SciProjectSubProjectsCollection; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.domain.DataObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import org.apache.log4j.Logger; - -/** - * Table of showing the subprojects of a {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectSubProjectsTable - extends Table - implements TableActionListener { - - private static final Logger s_log = Logger.getLogger( - SciProjectSubProjectsTable.class); - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private final String TABLE_COL_UP = "table_col_up"; - private final String TABLE_COL_DOWN = "table_col_down"; - private ItemSelectionModel m_itemModel; - - public SciProjectSubProjectsTable(ItemSelectionModel itemModel) { - super(); - m_itemModel = itemModel; - - setEmptyView( - new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.subprojects.none"))); - - TableColumnModel colModel = getColumnModel(); - colModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.subproject").localize(), - TABLE_COL_EDIT)); - colModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.subproject.remove").localize(), - TABLE_COL_DEL)); - /*colModel.add(new TableColumn( - 2, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.subproject.up").localize(), - TABLE_COL_UP)); - colModel.add(new TableColumn( - 3, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.subproject.down").localize(), - TABLE_COL_DOWN));*/ - - setModelBuilder( - new SciProjectSubProjectsTableModelBuilder(itemModel)); - colModel.get(0).setCellRenderer(new EditCellRenderer()); - colModel.get(1).setCellRenderer(new DeleteCellRenderer()); - //colModel.get(2).setCellRenderer(new UpCellRenderer()); - //colModel.get(3).setCellRenderer(new DownCellRenderer()); - - addTableActionListener(this); - } - - private class SciProjectSubProjectsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel m_itemModel; - - public SciProjectSubProjectsTableModelBuilder( - ItemSelectionModel itemModel) { - m_itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - return new SciProjectSubProjectsTableModel(table, - state, - project); - } - } - - private class SciProjectSubProjectsTableModel - implements TableModel { - - private Table m_table; - private SciProjectSubProjectsCollection m_subprojects; - private SciProject m_subproject; - - public SciProjectSubProjectsTableModel(Table table, - PageState state, - SciProject project) { - m_table = table; - m_subprojects = project.getSubProjects(); - } - - @Override - public int getColumnCount() { - return m_table.getColumnModel().size(); - } - - @Override - public boolean nextRow() { - boolean ret; - - if ((m_subprojects != null) && m_subprojects.next()) { - m_subproject = m_subprojects.getSubProject(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - @Override - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return m_subproject.getTitle(); - case 1: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.subproject.remove"). - localize(); - case 2: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.subproject.up"). - localize(); - case 3: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.subproject.down"). - localize(); - default: - return null; - } - } - - @Override - public Object getKeyAt(int columnIndex) { - return m_subproject.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.EDIT_ITEM, - project); - - if (canEdit) { - SciProject subProject; - try { - subProject = new SciProject((BigDecimal) key); - } catch (DataObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = new Link(String.format("%s (%s)", - value.toString(), - subProject.getLanguage()), - resolver.generateItemURL(state, - subProject, - section, - subProject. - getVersion())); - - return link; - - } else { - SciProject subProject; - try { - subProject = new SciProject((BigDecimal) key); - } catch (DataObjectNotFoundException ex) { - s_log.warn(String.format("No object with key '%s' found.", - key), - ex); - return new Label(value.toString()); - } - - Label label = new Label(String.format("%s (%s)", - value.toString(), - subProject.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.DELETE_ITEM, - project); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "sciorganization.ui.project.subproject." - + ".confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - private class UpCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - if (0 == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.subproject.up"). - localize()); - return link; - } - } - } - - private class DownCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent( - Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - SciProjectSubProjectsCollection subProjects = - project.getSubProjects(); - - if ((subProjects.size() - 1) == row) { - Label label = new Label(""); - return label; - } else { - ControlLink link = new ControlLink( - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.subproject.down"). - localize()); - return link; - } - } - } - - @Override - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - SciProject subProject = new SciProject( - new BigDecimal(event.getRowKey().toString())); - - SciProject project = - (SciProject) m_itemModel.getSelectedObject(state); - - SciProjectSubProjectsCollection subprojects = - project.getSubProjects(); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { - project.removeSubProject(subProject); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_UP)) { - subprojects.swapWithPrevious(subProject); - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DOWN)) { - subprojects.swapWithNext(subProject); - } - } - - @Override - public void headSelected(TableActionEvent event) { - //Nothing to do. - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectAddForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectAddForm.java deleted file mode 100644 index eabf5e335..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectAddForm.java +++ /dev/null @@ -1,130 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.SciProjectSubProjectsCollection; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Form for adding a subproject to a {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectSubprojectAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget m_itemSearch; - private final String ITEM_SEARCH = "projects"; - - public SciProjectSubprojectAddForm(ItemSelectionModel itemModel) { - super("SubprojectAddForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label((String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_subproject").localize())); - m_itemSearch = new ItemSearchWidget( - ITEM_SEARCH, - ContentType.findByAssociatedObjectType( - SciProject.class.getName())); - add(m_itemSearch); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciProject project = (SciProject) getItemSelectionModel(). - getSelectedObject(state); - - if (!(this.getSaveCancelSection().getCancelButton(). - isSelected(state))) { - SciProject subProject = (SciProject) data.get(ITEM_SEARCH); - subProject = (SciProject) subProject.getContentBundle(). - getInstance(project.getLanguage()); - - project.addSubProject(subProject); - } - - init(fse); - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_subproject.no_project_selected")); - return; - } - - SciProject project = (SciProject) getItemSelectionModel(). - getSelectedObject(state); - SciProject subProject = (SciProject) data.get(ITEM_SEARCH); - if (!(subProject.getContentBundle().hasInstance(project.getLanguage()))) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_subproject.no_suitable_language_variant")); - return; - } - - subProject = (SciProject) subProject.getContentBundle().getInstance(project. - getLanguage()); - if (subProject.getID().equals(project.getID())) { - data.addError(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_subproject.same_project")); - return; - } - - SciProjectSubProjectsCollection subProjects = project.getSubProjects(); - subProjects.addFilter(String.format("id = %s", subProject.getID(). - toString())); - if(subProjects.size() > 0) { - data.addError(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_subproject.already_added")); - } - - subProjects.close(); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectsStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectsStep.java deleted file mode 100644 index f4fa3f78e..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSubprojectsStep.java +++ /dev/null @@ -1,64 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; -import org.apache.log4j.Logger; - -/** - * Step for adding and removing subprojects to and from a {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectSubprojectsStep extends SimpleEditStep { - - private final static Logger s_log = Logger.getLogger( - SciProjectSubprojectsStep.class); - private String ADD_CHILD_SHEET_NAME = "addChild"; - - public SciProjectSubprojectsStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciProjectSubprojectsStep( - ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addSubProjectSheet = - new SciProjectSubprojectAddForm(itemModel); - add(ADD_CHILD_SHEET_NAME, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.addSubProject").localize(), - new WorkflowLockedComponentAccess(addSubProjectSheet, itemModel), - addSubProjectSheet.getSaveCancelSection().getCancelButton()); - - SciProjectSubProjectsTable subProjectsTable = new SciProjectSubProjectsTable( - itemModel); - setDisplayComponent(subProjectsTable); - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSetForm.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSetForm.java deleted file mode 100644 index 68ade854c..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSetForm.java +++ /dev/null @@ -1,121 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * Form for setting the superior project of a {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectSuperProjectSetForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget m_itemSearch; - private final String ITEM_SEARCH = "superproject"; - - public SciProjectSuperProjectSetForm(ItemSelectionModel itemModel) { - super("SuperProjectSetForm", itemModel); - } - - @Override - protected void addWidgets() { - add(new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_superproject"))); - m_itemSearch = new ItemSearchWidget( - ITEM_SEARCH, - ContentType.findByAssociatedObjectType( - SciProject.class.getName())); - add(m_itemSearch); - } - - @Override - public void init(FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciProject project = (SciProject) getItemSelectionModel(). - getSelectedObject(state); - - if (this.getSaveCancelSection().getSaveButton(). - isSelected(state)) { - SciProject superProject = (SciProject) data.get(ITEM_SEARCH); - superProject = (SciProject) superProject.getContentBundle(). - getInstance(project.getLanguage()); - - project.setSuperProject(superProject); - } - - init(fse); - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_superproject.no_project_selected")); - return; - } - - SciProject project = (SciProject) getItemSelectionModel(). - getSelectedObject(state); - SciProject superProject = (SciProject) data.get(ITEM_SEARCH); - if (!(superProject.getContentBundle().hasInstance(project.getLanguage()))) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_superproject.no_suitable_language_variant")); - return; - } - - superProject = (SciProject) superProject.getContentBundle().getInstance(project. - getLanguage()); - if (superProject.getID().equals(project.getID())) { - data.addError( - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.select_superproject.same_project")); - return; - } - - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSheet.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSheet.java deleted file mode 100644 index abe16001b..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectSheet.java +++ /dev/null @@ -1,291 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.SecurityManager; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; - -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; -import org.apache.log4j.Logger; - -/** - * Sheet for showing the superior project of a {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectSuperProjectSheet - extends Table - implements TableActionListener { - - private static final Logger logger = Logger.getLogger( - SciProjectSuperProjectSheet.class); - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private ItemSelectionModel m_itemModel; - - public SciProjectSuperProjectSheet(ItemSelectionModel itemModel) { - super(); - m_itemModel = itemModel; - - setEmptyView( - new Label(SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.superproject_none"))); - - TableColumnModel colModel = getColumnModel(); - colModel.add(new TableColumn( - 0, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.superproject").localize(), - TABLE_COL_EDIT)); - colModel.add(new TableColumn( - 1, - SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.superproject.remove").localize(), - TABLE_COL_DEL)); - - setModelBuilder( - new SciProjectSuperProjectSheetModelBuilder(itemModel)); - colModel.get(0).setCellRenderer(new EditCellRenderer()); - colModel.get(1).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - } - - private class SciProjectSuperProjectSheetModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel m_itemModel; - - public SciProjectSuperProjectSheetModelBuilder( - ItemSelectionModel itemModel) { - m_itemModel = itemModel; - } - - @Override - public TableModel makeModel(Table table, PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - return new SciProjectSuperProjectSheetModel(table, - state, - project); - } - } - - private class SciProjectSuperProjectSheetModel - implements TableModel { - - private Table m_table; - private SciProject m_superProject; - private boolean m_done; - - public SciProjectSuperProjectSheetModel(Table table, - PageState state, - SciProject project) { - m_table = table; - m_superProject = project.getSuperProject(); - if (m_superProject == null) { - m_done = false; - } else { - m_done = true; - logger.debug(String.format("Super project to show: %s", - m_superProject.getTitle())); - } - - } - - public int getColumnCount() { - return m_table.getColumnModel().size(); - } - - public boolean nextRow() { - boolean ret; - - if (m_done) { - logger.debug("Returning true for nextRow()"); - ret = true; - m_done = false; - } else { - logger.debug("Returning false for nextRow()"); - ret = false; - } - - return ret; - } - - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - logger.debug("returning project title..."); - return m_superProject.getTitle(); - case 1: - return SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.superproject.remove"). - localize(); - default: - return null; - } - } - - public Object getKeyAt(int columnIndex) { - return m_superProject.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.EDIT_ITEM, - project); - - if (canEdit) { - SciProject subProject; - try { - subProject = new SciProject((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = new Link(String.format("%s (%s)", - value.toString(), - subProject.getLanguage()), - resolver.generateItemURL(state, - subProject, - section, - subProject. - getVersion())); - - return link; - } else { - SciProject subDepartment; - try { - subDepartment = new SciProject((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - Label label = new Label( - String.format("%s (%s)", - value.toString(), - subDepartment.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - @Override - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int col) { - SecurityManager securityManager = - Utilities.getSecurityManager(state); - SciProject project = (SciProject) m_itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - SecurityManager.DELETE_ITEM, - project); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationGlobalizationUtil. - globalize( - "sciorganization.ui.project.superproject." - + ".confirm_remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - @Override - public void cellSelected(TableActionEvent event) { - PageState state = event.getPageState(); - - /*SciProject superProject = new SciProject( - new BigDecimal(event.getRowKey().toString()));*/ - - SciProject project = (SciProject) m_itemModel.getSelectedObject(state); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (column.getHeaderKey().toString().equals(TABLE_COL_EDIT)) { - } else if (column.getHeaderKey().toString().equals(TABLE_COL_DEL)) { - project.setSuperProject(null); - } - - } - - @Override - public void headSelected(TableActionEvent event) { - //Nothing to do. - } -} diff --git a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectStep.java b/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectStep.java deleted file mode 100644 index cd01e4d5f..000000000 --- a/ccm-sci-types-organization/src/com/arsdigita/cms/contenttypes/ui/SciProjectSuperProjectStep.java +++ /dev/null @@ -1,62 +0,0 @@ -/* - * Copyright (c) 2010 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * Step for setting the superior project of a {@link SciProject}. - * - * @author Jens Pelzetter - */ -public class SciProjectSuperProjectStep extends SimpleEditStep { - - private String SET_SUPER_PROJECT_STEP = "setSuperProject"; - - public SciProjectSuperProjectStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciProjectSuperProjectStep(ItemSelectionModel itemModel, - AuthoringKitWizard parent, - String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm setSuperProjectForm = - new SciProjectSuperProjectSetForm(itemModel); - add(SET_SUPER_PROJECT_STEP, - (String) SciOrganizationGlobalizationUtil.globalize( - "sciorganization.ui.project.setSuperProject").localize(), - new WorkflowLockedComponentAccess(setSuperProjectForm, - itemModel), - setSuperProjectForm.getSaveCancelSection(). - getCancelButton()); - - SciProjectSuperProjectSheet superProjectSheet = - new SciProjectSuperProjectSheet(itemModel); - setDisplayComponent(superProjectSheet); - } -} diff --git a/ccm-sci-types-organization/src/empty.pdl.mf b/ccm-sci-types-organization/src/empty.pdl.mf deleted file mode 100644 index e69de29bb..000000000 diff --git a/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciDepartment.xsl b/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciDepartment.xsl deleted file mode 100644 index 9af8f5179..000000000 --- a/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciDepartment.xsl +++ /dev/null @@ -1,19 +0,0 @@ - -]> - - - - -

-
- - -

-
- -
\ No newline at end of file diff --git a/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl b/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl deleted file mode 100644 index 80359c344..000000000 --- a/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciMember.xsl +++ /dev/null @@ -1,20 +0,0 @@ - -]> - - - - -

-
- - -

-
- -
\ No newline at end of file diff --git a/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciOrganization.xsl b/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciOrganization.xsl deleted file mode 100644 index 93f7e0825..000000000 --- a/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciOrganization.xsl +++ /dev/null @@ -1,19 +0,0 @@ - -]> - - - - -

-
- - -

-
- -
\ No newline at end of file diff --git a/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciProject.xsl b/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciProject.xsl deleted file mode 100644 index 5dd9498a5..000000000 --- a/ccm-sci-types-organization/web/static/content-types/com/arsdigita/cms/contenttypes/SciProject.xsl +++ /dev/null @@ -1,19 +0,0 @@ - -]> - - - - -

-
- - -

-
- -
\ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/application.xml b/ccm-sci-types-organizationwithpublications/application.xml deleted file mode 100644 index 5b6a0be1f..000000000 --- a/ccm-sci-types-organizationwithpublications/application.xml +++ /dev/null @@ -1,27 +0,0 @@ - - - - - - - - - - - - - - - - - - - Extended versions of the types SciOrganization, SciDepartment and SciProject, - with an association to publications. - - \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/pdl/com/arsdigita/content-types/SciDepartmentWithPublications.pdl b/ccm-sci-types-organizationwithpublications/pdl/com/arsdigita/content-types/SciDepartmentWithPublications.pdl deleted file mode 100644 index d9b752ab6..000000000 --- a/ccm-sci-types-organizationwithpublications/pdl/com/arsdigita/content-types/SciDepartmentWithPublications.pdl +++ /dev/null @@ -1,50 +0,0 @@ -model com.arsdigita.cms.contenttypes; - -import com.arsdigita.kernel.ACSObject; -import com.arsdigita.cms.*; - -object type SciDepartmentWithPublications extends SciDepartment { - reference key ( ct_sciorga_departments_with_publications.department_id ); -} - -association { - SciDepartment[0..n] departments = join ct_publications.publication_id - to ct_department_publication_map.publication_id, - join ct_department_publication_map.department_id - to ct_sciorga_departments_with_publications.department_id; - - Publication[0..n] publications = join ct_sciorga_departments_with_publications.department_id - to ct_department_publication_map.department_id, - join ct_department_publication_map.publication_id - to ct_publications.publication_id; - - Integer[0..1] publicationOrder = ct_department_publication_map.publication_order INTEGER; -} - -query getIdsOfPublicationsOfSciDepartment { - BigDecimal publicationId; - String objectType; - - do { - select ct_department_publication_map.publication_id, acs_objects.object_type - from ct_department_publication_map join acs_objects on ct_department_publication_map.publication_id = acs_objects.object_id - where ct_department_publication_map.department_id = :department - } map { - publicationId = ct_department_publication_map.publication_id; - objectType = acs_objects.object_type; - } -} - -query getIdsOfWorkingPapersOfSciDepartment { - BigDecimal workingPaperId; - String objectType; - - do { - select ct_department_publication_map.publication_id, acs_objects.object_type - from ct_department_publication_map join acs_objects on ct_department_publication_map.publication_id = acs_objects.object_id - where ct_department_publication_map.department_id = :department and acs_objects.object_type = 'com.arsdigita.cms.contenttypes.WorkingPaper' - } map { - workingPaperId = ct_department_publication_map.publication_id; - objectType = acs_objects.object_type; - } -} \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/pdl/com/arsdigita/content-types/SciOrganizationWithPublications.pdl b/ccm-sci-types-organizationwithpublications/pdl/com/arsdigita/content-types/SciOrganizationWithPublications.pdl deleted file mode 100644 index 5d3642ab1..000000000 --- a/ccm-sci-types-organizationwithpublications/pdl/com/arsdigita/content-types/SciOrganizationWithPublications.pdl +++ /dev/null @@ -1,123 +0,0 @@ -model com.arsdigita.cms.contenttypes; - -import com.arsdigita.kernel.ACSObject; -import com.arsdigita.cms.*; - -object type SciOrganizationWithPublications extends SciOrganization { - reference key ( ct_sciorga_organizations_with_publications.organization_id ); -} - -association { - SciOrganization[0..n] organizations = join ct_publications.publication_id - to ct_organization_publication_map.publication_id, - join ct_organization_publication_map.organization_id - to ct_sciorga_organizations_with_publications.organization_id; - - Publication[0..n] publications = join ct_sciorga_organizations_with_publications.organization_id - to ct_organization_publication_map.organization_id, - join ct_organization_publication_map.publication_id - to ct_publications.publication_id; - - Integer[0..1] publicationOrder = ct_organization_publication_map.publication_order INTEGER; -} - -query getIdsOfPublicationsOfSciOrganization { - BigDecimal publicationId; - String objectType; - - do { - select ct_organization_publication_map.publication_id, acs_objects.object_type - from ct_organization_publication_map join acs_objects on ct_organization_publication_map.publication_id = acs_objects.object_id - where ct_organization_publication_map.organization_id = :organization - } map { - publicationId = ct_organization_publication_map.publication_id; - objectType = acs_objects.object_type; - } -} - -query getIdsOfWorkingPapersOfSciOrganization { - BigDecimal workingPaperId; - String objectType; - - do { - select ct_organization_publication_map.publication_id, acs_objects.object_type - from ct_organization_publication_map join acs_objects on ct_organization_publication_map.publication_id = acs_objects.object_id - where ct_organization_publication_map.organization_id = :organization and acs_objects.object_type = 'com.arsdigita.cms.contenttypes.WorkingPaper' - } map { - workingPaperId = ct_organization_publication_map.publication_id; - objectType = acs_objects.object_type; - } -} - -query getAllYearsOfPublication { - Integer yearOfPublication; - - do { - select distinct ct_publications.year - from ct_publications - } map { - yearOfPublication = ct_publications.year; - } -} - -query getAllYearsOfPublicationForAuthor { - Integer yearOfPublication; - - do { - select distinct ct_publications.year - from ct_publications join ct_publications_authorship on ct_publications.publication_id = ct_publications_authorship.publication_id - where person_id = :author - } map { - yearOfPublication = ct_publications.year; - } -} - -query getAllPublicationTypes { - - String objectType; - - do { - select distinct acs_objects.object_type - from ct_publications join acs_objects on ct_publications.publication_id = acs_objects.object_id - } map { - objectType = acs_objects.object_type; - } -} - -query getAllPublicationTypesForAuthor { - - String objectType; - - do { - select distinct acs_objects.object_type - from ct_publications join acs_objects on ct_publications.publication_id = acs_objects.object_id join ct_publications_authorship on ct_publications.publication_id = ct_publications_authorship.publication_id - where person_id = :author - } map { - objectType = acs_objects.object_type; - } - -} - -query getIdsOfPublicationsOfSciMember { - BigDecimal publicationId; - - do { - select ct_publications_authorship.publication_id - from ct_publications_authorship - where ct_publications_authorship.person_id = :author - } map { - publicationId = ct_publications_authorship.publication_id; - } -} - -query getIdsOfProjectsOfSciMember { - BigDecimal projectId; - - do { - select ct_sciorga_projects.project_id - from ct_sciorga_projects join cms_organizationalunits_person_map on ct_sciorga_projects.project_id = cms_organizationalunits_person_map.organizationalunit_id - where cms_organizationalunits_person_map.person_id = :member - } map { - projectId = ct_sciorga_projects.project_id; - } -} diff --git a/ccm-sci-types-organizationwithpublications/pdl/com/arsdigita/content-types/SciProjectWithPublications.pdl b/ccm-sci-types-organizationwithpublications/pdl/com/arsdigita/content-types/SciProjectWithPublications.pdl deleted file mode 100644 index 82fac65a6..000000000 --- a/ccm-sci-types-organizationwithpublications/pdl/com/arsdigita/content-types/SciProjectWithPublications.pdl +++ /dev/null @@ -1,50 +0,0 @@ -model com.arsdigita.cms.contenttypes; - -import com.arsdigita.kernel.ACSObject; -import com.arsdigita.cms.*; - -object type SciProjectWithPublications extends SciProject { - - reference key ( ct_sciorga_projects_with_publications.project_id ); -} - -association { - SciProject[0..n] projects = join ct_publications.publication_id - to ct_project_publication_map.publication_id, - join ct_project_publication_map.project_id - to ct_sciorga_projects_with_publications.project_id; - - Publication[0..n] publications = join ct_sciorga_projects_with_publications.project_id - to ct_project_publication_map.project_id, - join ct_project_publication_map.publication_id - to ct_publications.publication_id; - - Integer[0..1] publicationOrder = ct_project_publication_map.publication_order INTEGER; - -} - -query getIdsOfPublicationsOfSciProject { - BigDecimal publicationId; - - do { - select ct_project_publication_map.publication_id - from ct_project_publication_map - where ct_project_publication_map.project_id = :project - } map { - publicationId = ct_project_publication_map.publication_id; - } -} - -query getIdsOfWorkingPapersOfSciProject { - BigDecimal workingPaperId; - String objectType; - - do { - select ct_project_publication_map.publication_id, acs_objects.object_type - from ct_project_publication_map join acs_objects on ct_project_publication_map.publication_id = acs_objects.object_id - where ct_project_publication_map.project_id = :project and acs_objects.object_type = 'com.arsdigita.cms.contenttypes.WorkingPaper' - } map { - workingPaperId = ct_project_publication_map.publication_id; - objectType = acs_objects.object_type; - } -} \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/sql/ccm-sci-types-organizationwithpublications/postgres-create.sql b/ccm-sci-types-organizationwithpublications/sql/ccm-sci-types-organizationwithpublications/postgres-create.sql deleted file mode 100644 index 38716a0ca..000000000 --- a/ccm-sci-types-organizationwithpublications/sql/ccm-sci-types-organizationwithpublications/postgres-create.sql +++ /dev/null @@ -1,4 +0,0 @@ -begin; -\i ddl/postgres/create.sql -\i ddl/postgres/deferred.sql -end; \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.xml b/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.xml deleted file mode 100644 index 7de75ac0b..000000000 --- a/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.xml b/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.xml deleted file mode 100644 index 2b1ab7894..000000000 --- a/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.xml +++ /dev/null @@ -1,64 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProjectWithPublications.xml b/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProjectWithPublications.xml deleted file mode 100644 index 52927fd9f..000000000 --- a/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProjectWithPublications.xml +++ /dev/null @@ -1,65 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/scidepartment-with-publications-item.jsp b/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/scidepartment-with-publications-item.jsp deleted file mode 100644 index b8003537c..000000000 --- a/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/scidepartment-with-publications-item.jsp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - NavigationModel model = new CMSNavigationModel(); - - - - - - - ((com.arsdigita.navigation.ui.category.Path)categoryPath) - .setModel(model); - - - - ((com.arsdigita.navigation.ui.category.Menu)categoryMenu) - .setModel(model); - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciorganization-with-publications-item.jsp b/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciorganization-with-publications-item.jsp deleted file mode 100644 index daa940e9b..000000000 --- a/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciorganization-with-publications-item.jsp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - NavigationModel model = new CMSNavigationModel(); - - - - - - - ((com.arsdigita.navigation.ui.category.Path)categoryPath) - .setModel(model); - - - - ((com.arsdigita.navigation.ui.category.Menu)categoryMenu) - .setModel(model); - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciproject-with-publications-item.jsp b/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciproject-with-publications-item.jsp deleted file mode 100644 index a5f875fe1..000000000 --- a/ccm-sci-types-organizationwithpublications/src/WEB-INF/content-types/com/arsdigita/cms/contenttypes/sciproject-with-publications-item.jsp +++ /dev/null @@ -1,44 +0,0 @@ - - - - - - NavigationModel model = new CMSNavigationModel(); - - - - - - - ((com.arsdigita.navigation.ui.category.Path)categoryPath) - .setModel(model); - - - - ((com.arsdigita.navigation.ui.category.Menu)categoryMenu) - .setModel(model); - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.xml b/ccm-sci-types-organizationwithpublications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.xml deleted file mode 100644 index 35c899532..000000000 --- a/ccm-sci-types-organizationwithpublications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.xml b/ccm-sci-types-organizationwithpublications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.xml deleted file mode 100644 index 1bedd0dc2..000000000 --- a/ccm-sci-types-organizationwithpublications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.xml +++ /dev/null @@ -1,13 +0,0 @@ - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciProjectWithPublications.xml b/ccm-sci-types-organizationwithpublications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciProjectWithPublications.xml deleted file mode 100644 index 02c350a3d..000000000 --- a/ccm-sci-types-organizationwithpublications/src/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciProjectWithPublications.xml +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/src/ccm-sci-types-organizationwithpublications.config b/ccm-sci-types-organizationwithpublications/src/ccm-sci-types-organizationwithpublications.config deleted file mode 100644 index 2ba1da7f4..000000000 --- a/ccm-sci-types-organizationwithpublications/src/ccm-sci-types-organizationwithpublications.config +++ /dev/null @@ -1,5 +0,0 @@ - - - - \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/src/ccm-sci-types-organizationwithpublications.load b/ccm-sci-types-organizationwithpublications/src/ccm-sci-types-organizationwithpublications.load deleted file mode 100644 index 467655745..000000000 --- a/ccm-sci-types-organizationwithpublications/src/ccm-sci-types-organizationwithpublications.load +++ /dev/null @@ -1,27 +0,0 @@ - - -
-
-
-
-
-
-
- - - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ConvertRelatedPublicationLinks.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ConvertRelatedPublicationLinks.java deleted file mode 100644 index 92cfb665e..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ConvertRelatedPublicationLinks.java +++ /dev/null @@ -1,248 +0,0 @@ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.categorization.CategorizedCollection; -import com.arsdigita.categorization.Category; -import com.arsdigita.cms.ContentBundle; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.contentassets.RelatedLink; -import com.arsdigita.domain.DomainObject; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.Session; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.TransactionContext; -import java.math.BigDecimal; - -/** - * - * @author Jens Pelzetter - */ -public class ConvertRelatedPublicationLinks { - - public static void main(final String args[]) { - final com.arsdigita.runtime.Runtime runtime = - new com.arsdigita.runtime.Runtime(); - - runtime.startup(); - - final Session session = SessionManager.getSession(); - final TransactionContext tctx = session.getTransactionContext(); - - tctx.beginTxn(); - try { - DataCollection data = session.retrieve( - SciDepartment.BASE_DATA_OBJECT_TYPE); - data.addOrder("title"); - - - SciOrganizationWithPublications organization = null; - SciDepartmentWithPublications department; - while (data.next()) { - department = - (SciDepartmentWithPublications) DomainObjectFactory.newInstance( - data.getDataObject()); - - if (department.isDraftVersion()) { - System.out.printf("Found department '%s'\n", - department.getTitle()); - - DataCollection relatedLinks = RelatedLink.getRelatedLinks( - department, "SciDepartmentPublications"); - - System.out.printf( - "Found %d related links from department '%s' with link list name '%s':\n", - relatedLinks.size(), - department.getTitle(), - "SciDepartmentPublications"); - - int i = 0; - long num = relatedLinks.size(); - - while (relatedLinks.next()) { - RelatedLink relatedLink = - new RelatedLink(relatedLinks.getDataObject()); - - if (relatedLink == null) { - System.out.println( - "Failed to convert related link to domain object...\n"); - continue; - } - - ContentItem target = relatedLink.getTargetItem(); - Publication publication = (Publication) target; - System.out.printf( - "\tconverting related link to '%s' (%d of %d)\n", - publication.getTitle(), - i, - num); - - department.addPublication(publication); - - relatedLink.delete(); - - i++; - - organization = - (SciOrganizationWithPublications) department. - getOrganization().getDraftVersion(); - } - - } - } - - if (organization == null) { - data.rewind(); - while (data.next()) { - department = - (SciDepartmentWithPublications) DomainObjectFactory. - newInstance(data.getDataObject()); - - if (department.isDraftVersion()) { - if (department.getOrganization() != null) { - organization = - (SciOrganizationWithPublications) department. - getOrganization().getDraftVersion(); - } - } - } - } - - //Add publications without department to organization. - if (args.length > 0) { - System.out.println( - "Found arguments. Interpreting as categories."); - - for (int i = 0; i < args.length; i++) { - Category category = new Category(new BigDecimal(args[i])); - - if (category == null) { - throw new IllegalArgumentException(String.format( - "No category with id '%s'", args[i])); - } - - if (organization == null) { - throw new IllegalArgumentException("No organization."); - } - - System.out.printf( - "Adding all publications in category '%s' to publications of organization '%s'...\n", - category.getName(), - organization.getName()); - - CategorizedCollection objects = - category.getObjects( - ContentItem.BASE_DATA_OBJECT_TYPE); - - while (objects.next()) { - DomainObject obj = - DomainObjectFactory.newInstance(objects. - getDomainObject().getOID()); - if (obj instanceof ContentBundle) { - obj = ((ContentBundle) obj).getPrimaryInstance(); - } - - if (obj instanceof Publication) { - Publication publication = (Publication) obj; - publication = (Publication) publication. - getDraftVersion(); - - if ((publication.get("organizations") == null) - || ((DataCollection) publication.get( - "organizations")).size() == 0) { - System.out.printf( - "Publication '%s' has no associated organization. Adding...\n", - publication.getTitle()); - organization.addPublication(publication); - } else { - System.out.printf( - "Publication '%s' has already an associated organization. No action neccessary.\n", - publication.getTitle()); - } - - } else { - System.out.printf( - "Object is not a publication. Skiping.\n"); - continue; - } - - } - } - } - - DataCollection persons = session.retrieve( - GenericPerson.BASE_DATA_OBJECT_TYPE); - persons.addOrder("surname"); - persons.addOrder("givenname"); - - GenericPerson person; - while (persons.next()) { - person = - (GenericPerson) DomainObjectFactory.newInstance(persons. - getDataObject()); - - if (person.isDraftVersion()) { - System.out.printf("Found person '%s'\n", - person.getGivenName(), - person.getSurname()); - - DataCollection relatedLinks = RelatedLink.getRelatedLinks( - person, "MyPublications"); - - System.out.printf( - "Found %d related links from person '%s' '%s' with link list name '%s'\n", - relatedLinks.size(), - person.getGivenName(), - person.getSurname(), - "MyPublications"); - int i = 1; - while (relatedLinks.next()) { - RelatedLink relatedLink = - (RelatedLink) DomainObjectFactory. - newInstance(relatedLinks.getDataObject()); - - if (relatedLink == null) { - System.out.println( - "Failed to convert related link to domain object..."); - continue; - } - - ContentItem target = relatedLink.getTargetItem(); - if (target == null) { - System.out.println( - "\t Strange: Target item is null. But thats no problem, since we are only deleting this related link."); - - } else { - Publication publication = (Publication) target; - System.out.printf( - "\tDeleting obsolete related link to '%s' (%d of %d)\n", - publication.getTitle(), - i, - relatedLinks.size()); - } - relatedLink.delete(); - i++; - } - } - } - - System.out.println("Finished, no errors. Commiting transaction."); - tctx.commitTxn(); - System.out.println( - "Now republish all SciOrganization, SciDepartment, " - + "GenericPerson and Publication items, for example using " - + "BulkPublish from the london-util module, with the " - + "'-r' switch."); - } catch (Exception ex) { - System.err.println( - "Exeception ocurred during convert process. " - + "Transaction rolled back, all changes will be lost."); - ex.printStackTrace(System.err); - } finally { - if (tctx.inTxn()) { - tctx.abortTxn(); - } - } - - - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/PublicationSciDepartmentCollection.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/PublicationSciDepartmentCollection.java deleted file mode 100644 index 84e187587..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/PublicationSciDepartmentCollection.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.persistence.DataCollection; - -/** - * - * @author Jens Pelzetter - */ -public class PublicationSciDepartmentCollection extends DomainCollection { - - public PublicationSciDepartmentCollection( - final DataCollection dataCollection) { - super(dataCollection); - - addOrder("title"); - } - - public SciDepartmentWithPublications getDepartment() { - return (SciDepartmentWithPublications) DomainObjectFactory.newInstance(m_dataCollection. - getDataObject()); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/PublicationSciOrganizationCollection.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/PublicationSciOrganizationCollection.java deleted file mode 100644 index 6d25d9cbb..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/PublicationSciOrganizationCollection.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.persistence.DataCollection; - -/** - * - * @author Jens Pelzetter - */ -public class PublicationSciOrganizationCollection extends DomainCollection { - - public PublicationSciOrganizationCollection( - final DataCollection dataCollection) { - super(dataCollection); - - addOrder("title"); - } - - public SciOrganizationWithPublications getOrganization() { - return (SciOrganizationWithPublications) DomainObjectFactory.newInstance(m_dataCollection. - getDataObject()); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/PublicationSciProjectCollection.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/PublicationSciProjectCollection.java deleted file mode 100644 index ba69d14ca..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/PublicationSciProjectCollection.java +++ /dev/null @@ -1,43 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.persistence.DataCollection; - -/** - * - * @author Jens Pelzetter - */ -public class PublicationSciProjectCollection extends DomainCollection { - - public PublicationSciProjectCollection( - final DataCollection dataCollection) { - super(dataCollection); - - addOrder("title"); - } - - public SciProjectWithPublications getOrganization() { - return (SciProjectWithPublications) DomainObjectFactory.newInstance(m_dataCollection. - getDataObject()); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentPublicationsCollection.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentPublicationsCollection.java deleted file mode 100644 index 9eaeaae34..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentPublicationsCollection.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.persistence.DataCollection; - -/** - * - * @author Jens Pelzetter - */ -public class SciDepartmentPublicationsCollection extends DomainCollection { - - public SciDepartmentPublicationsCollection( - final DataCollection dataCollection) { - super(dataCollection); - } - - public Publication getPublication() { - return (Publication) DomainObjectFactory.newInstance(m_dataCollection. - getDataObject()); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.java deleted file mode 100644 index fbaadf1f2..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.java +++ /dev/null @@ -1,254 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.DataQuery; -import com.arsdigita.persistence.OID; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.util.Assert; -import java.math.BigDecimal; - -/** - * - * @author Jens Pelzetter - */ -public class SciDepartmentWithPublications extends SciDepartment { - - public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.contenttypes.SciDepartmentWithPublications"; - public static final String PUBLICATIONS = "publications"; - - public SciDepartmentWithPublications() { - this(BASE_DATA_OBJECT_TYPE); - } - - public SciDepartmentWithPublications(final BigDecimal id) { - this(new OID(BASE_DATA_OBJECT_TYPE, id)); - } - - public SciDepartmentWithPublications(final OID oid) { - super(oid); - } - - public SciDepartmentWithPublications(final DataObject dobj) { - super(dobj); - } - - public SciDepartmentWithPublications(final String type) { - super(type); - - } - - public boolean hasPublications(final boolean merge) { - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfPublicationsOfSciDepartment"); - query.setParameter("department", getID()); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery departmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - departmentsQuery.setParameter("department", getID()); - - if (departmentsQuery.size() > 0) { - BigDecimal departmentId; - boolean result = false; - while (departmentsQuery.next()) { - departmentId = (BigDecimal) departmentsQuery.get( - "subDepartmentId"); - result = hasPublications(departmentId, merge); - - if (result) { - break; - } - } - - departmentsQuery.close(); - return result; - } else { - departmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - private boolean hasPublications(final BigDecimal departmentId, - final boolean merge) { - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfPublicationsOfSciDepartment"); - query.setParameter("department", departmentId); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subDepartmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - subDepartmentsQuery.setParameter("department", departmentId); - - if (subDepartmentsQuery.size() > 0) { - BigDecimal subDepartmentId; - boolean result = false; - while (subDepartmentsQuery.next()) { - subDepartmentId = (BigDecimal) subDepartmentsQuery.get( - "subDepartmentId"); - result = hasPublications(subDepartmentId, merge); - - if (result) { - break; - } - } - - subDepartmentsQuery.close(); - return result; - } else { - subDepartmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - public boolean hasWorkingPapers(final boolean merge) { - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfWorkingPapersOfSciDepartment"); - query.setParameter("department", getID()); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery departmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - departmentsQuery.setParameter("department", getID()); - - if (departmentsQuery.size() > 0) { - BigDecimal departmentId; - boolean result = false; - while (departmentsQuery.next()) { - departmentId = (BigDecimal) departmentsQuery.get( - "subDepartmentId"); - result = hasWorkingPapers(departmentId, merge); - - if (result) { - break; - } - } - - departmentsQuery.close(); - return result; - } else { - departmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - private boolean hasWorkingPapers(final BigDecimal departmentId, - final boolean merge) { - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfWorkingPapersOfSciDepartment"); - query.setParameter("department", departmentId); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subDepartmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - subDepartmentsQuery.setParameter("department", departmentId); - - if (subDepartmentsQuery.size() > 0) { - BigDecimal subDepartmentId; - boolean result = false; - while (subDepartmentsQuery.next()) { - subDepartmentId = (BigDecimal) subDepartmentsQuery.get( - "subDepartmentId"); - result = hasPublications(subDepartmentId, merge); - - if (result) { - break; - } - } - - subDepartmentsQuery.close(); - return result; - } else { - subDepartmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - public SciDepartmentPublicationsCollection getPublications() { - return new SciDepartmentPublicationsCollection((DataCollection) get( - PUBLICATIONS)); - } - - public void addPublication(final Publication publication) { - Assert.exists(publication, Publication.class); - - DataObject link = add(PUBLICATIONS, publication); - link.set("publicationOrder", Integer.valueOf((int) getPublications(). - size())); - link.save(); - } - - public void removePublication(final Publication publication) { - Assert.exists(publication, Publication.class); - - remove(PUBLICATIONS, publication); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublicationsInitializer.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublicationsInitializer.java deleted file mode 100644 index 243958060..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublicationsInitializer.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.contenttypes.ui.PublicationSciDepartmentStep; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.globalization.GlobalizedMessage; -import com.arsdigita.runtime.DomainInitEvent; - -/** - * - * @author Jens Pelzetter - */ -public class SciDepartmentWithPublicationsInitializer - extends ContentTypeInitializer { - - public SciDepartmentWithPublicationsInitializer() { - super("empty.pdl.mf", - SciDepartmentWithPublications.BASE_DATA_OBJECT_TYPE); - } - - @Override - public void init(final DomainInitEvent event) { - super.init(event); - - ContentType departmentType = - ContentType.findByAssociatedObjectType(SciDepartment.class. - getName()); - if (!departmentType.isInternal()) { - departmentType.setMode("internal"); - } - - AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE, - PublicationSciDepartmentStep.class, - new GlobalizedMessage( - "sciorganizationpublication.ui.publication.departments.title", - "com.arsdigita.cms.contenttypes.ui.SciOrganizationWithPublicationsResources"), - new GlobalizedMessage( - "sciorganizationpublication.ui.publication.departments.description", - "com.arsdigita.cms.contenttypes.ui.SciOrganizationWithPublicationsResources"), - 1); - } - - @Override - public String[] getStylesheets() { - return new String[]{ - "/static/content-types/com/arsdigita/cms/contenttypes/SciDepartment.xsl"}; - } - - @Override - public String getTraversalXML() { - return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.xml"; - - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublicationsLoader.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublicationsLoader.java deleted file mode 100644 index aa7cd959d..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciDepartmentWithPublicationsLoader.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.lifecycle.LifecycleDefinition; -import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.ResourceParameter; -import com.arsdigita.workflow.simple.WorkflowTemplate; -import java.io.InputStream; - -/** - * - * @author Jens Pelzetter - */ -public class SciDepartmentWithPublicationsLoader extends AbstractContentTypeLoader { - - private ResourceParameter m_template; - private static final String[] TYPES = { - "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciDepartmentWithPublications.xml" - }; - - public SciDepartmentWithPublicationsLoader() { - super(); - - m_template = - new ResourceParameter( - "com.arsdigita.cms.contenttypes.SciDepartmentWithPublicationsTemplate", - Parameter.REQUIRED, - "/WEB-INF/content-types/com/arsdigita/" - + "cms/contenttypes/scidepartment-with-publications-item.jsp"); - - register(m_template); - } - - public String[] getTypes() { - return TYPES; - } - - @Override - protected void prepareSection(final ContentSection section, - final ContentType type, - final LifecycleDefinition lifecycle, - final WorkflowTemplate workflow) { - super.prepareSection(section, type, lifecycle, workflow); - - setDefaultTemplate("SciDepartmentWithPublications Item", - "scidepartment-with-publications-item", - (InputStream) get(m_template), - section, - type, - lifecycle, - workflow); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationPublicationsCollection.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationPublicationsCollection.java deleted file mode 100644 index 8a3fc5512..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationPublicationsCollection.java +++ /dev/null @@ -1,44 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.persistence.DataCollection; - -/** - * - * @author Jens Pelzetter - */ -public class SciOrganizationPublicationsCollection extends DomainCollection { - - public String ORDER = "departmentOrder"; - public String LINKORDER = "link.departmentOrder"; - - public SciOrganizationPublicationsCollection( - final DataCollection dataCollection) { - super(dataCollection); - } - - public Publication getPublication() { - return (Publication) DomainObjectFactory.newInstance(m_dataCollection. - getDataObject()); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.java deleted file mode 100644 index c739600c5..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.DataQuery; -import com.arsdigita.persistence.OID; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.util.Assert; -import java.math.BigDecimal; - -/** - * - * @author Jens Pelzetter - */ -public class SciOrganizationWithPublications extends SciOrganization { - - public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.contenttypes.SciOrganizationWithPublications"; - public static final String PUBLICATIONS = "publications"; - public static final String PUBLICATION_ORDER = "publicationOrder"; - private static final SciOrganizationWithPublicationsConfig config = - new SciOrganizationWithPublicationsConfig(); - - static { - config.load(); - } - - public SciOrganizationWithPublications() { - this(BASE_DATA_OBJECT_TYPE); - } - - public SciOrganizationWithPublications(final BigDecimal id) { - this(new OID(BASE_DATA_OBJECT_TYPE, id)); - } - - public SciOrganizationWithPublications(final OID oid) { - super(oid); - } - - public SciOrganizationWithPublications(final DataObject dobj) { - super(dobj); - } - - public SciOrganizationWithPublications(final String type) { - super(type); - } - - public static SciOrganizationWithPublicationsConfig getConfig() { - return config; - } - - public boolean hasPublications(final boolean merge) { - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfPublicationsOfSciOrganization"); - query.setParameter("organization", getID()); - if (getConfig().getOrganizationPublicationsSeparateWorkingPapers()) { - query.addFilter( - "objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery departmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfDepartmentsOfSciOrganization"); - departmentsQuery.setParameter("organization", getID()); - - if (departmentsQuery.size() > 0) { - BigDecimal departmentId; - boolean result = false; - while (departmentsQuery.next()) { - departmentId = (BigDecimal) departmentsQuery.get( - "departmentId"); - result = hasPublications(departmentId, merge); - - if (result) { - break; - } - } - - departmentsQuery.close(); - return result; - } else { - departmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - private boolean hasPublications(final BigDecimal departmentId, - final boolean merge) { - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfPublicationsOfSciDepartment"); - query.setParameter("department", departmentId); - if (getConfig().getOrganizationPublicationsSeparateWorkingPapers()) { - query.addFilter( - "objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } - - System.out.printf("Proceedings department id %s\n ", departmentId.toString()); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subDepartmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - subDepartmentsQuery.setParameter("department", departmentId); - - if (subDepartmentsQuery.size() > 0) { - BigDecimal subDepartmentId; - boolean result = false; - while (subDepartmentsQuery.next()) { - subDepartmentId = (BigDecimal) subDepartmentsQuery.get( - "subDepartmentId"); - System.out.printf("Proceesing sub department %s...\n", subDepartmentId.toString()); - result = hasPublications(subDepartmentId, merge); - - if (result) { - break; - } - } - - subDepartmentsQuery.close(); - return result; - } else { - subDepartmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - public boolean hasWorkingPapers(final boolean merge) { - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfWorkingPapersOfSciOrganization"); - query.setParameter("organization", getID()); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - - DataQuery departmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfDepartmentsOfSciOrganization"); - departmentsQuery.setParameter("organization", - getID()); - - if (departmentsQuery.size() > 0) { - BigDecimal departmentId; - boolean result = false; - while (departmentsQuery.next()) { - departmentId = (BigDecimal) departmentsQuery.get( - "departmentId"); - result = hasWorkingPapers(departmentId, merge); - - if (result) { - break; - } - } - - departmentsQuery.close(); - return result; - } else { - departmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - private boolean hasWorkingPapers(final BigDecimal departmentId, - final boolean merge) { - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfWorkingPapersOfSciOrganization"); - query.setParameter("organization", departmentId); - if (getConfig().getOrganizationPublicationsSeparateWorkingPapers()) { - query.addFilter( - "objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subDepartmentsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubDepartmentsOfSciDepartment"); - subDepartmentsQuery.setParameter("department", departmentId); - - if (subDepartmentsQuery.size() > 0) { - BigDecimal subDepartmentId; - boolean result = false; - while (subDepartmentsQuery.next()) { - subDepartmentId = (BigDecimal) subDepartmentsQuery.get( - "subDepartmentId"); - result = hasPublications(subDepartmentId, merge); - - if (result) { - break; - } - } - - subDepartmentsQuery.close(); - return result; - } else { - subDepartmentsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - public SciOrganizationPublicationsCollection getPublications() { - return new SciOrganizationPublicationsCollection((DataCollection) get( - PUBLICATIONS)); - } - - public void addPublication(final Publication publication) { - Assert.exists(publication, Publication.class); - - DataObject link = add(PUBLICATIONS, publication); - link.set(PUBLICATION_ORDER, Integer.valueOf( - (int) getPublications().size())); - link.save(); - } - - public void removePublication(final Publication publication) { - Assert.exists(publication, Publication.class); - - remove(PUBLICATIONS, publication); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsConfig.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsConfig.java deleted file mode 100644 index f9697ba61..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsConfig.java +++ /dev/null @@ -1,67 +0,0 @@ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.util.parameter.BooleanParameter; -import com.arsdigita.util.parameter.Parameter; - -/** - * - * @author Jens Pelzetter - */ -public class SciOrganizationWithPublicationsConfig extends SciOrganizationConfig { - - private final Parameter m_organizationPublicationsMerge; - private final Parameter m_organizationPublicationsSeparateWorkingPapers; - private final Parameter m_departmentPublicationsSeparateWorkingPapers; - private final Parameter m_projectPublicationsSeparateWorkingPapers; - - public SciOrganizationWithPublicationsConfig() { - super(); - - m_organizationPublicationsMerge = - new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.publications_merge", - Parameter.REQUIRED, - Boolean.TRUE); - register(m_organizationPublicationsMerge); - - m_organizationPublicationsSeparateWorkingPapers = - new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization..organization.workingpapers_separate", - Parameter.REQUIRED, - Boolean.TRUE); - register(m_organizationPublicationsSeparateWorkingPapers); - - m_departmentPublicationsSeparateWorkingPapers = - new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.department.workingpapers_separate", - Parameter.REQUIRED, - Boolean.TRUE); - register(m_departmentPublicationsSeparateWorkingPapers); - - m_projectPublicationsSeparateWorkingPapers = - new BooleanParameter( - "com.arsdigita.cms.contenttypes.sciorganization.project.workingpapers_separate", - Parameter.REQUIRED, - Boolean.FALSE); - register(m_projectPublicationsSeparateWorkingPapers); - - loadInfo(); - } - - public final boolean getOrganizationPublicationsMerge() { - return (Boolean) get(m_organizationPublicationsMerge); - } - - public final boolean getOrganizationPublicationsSeparateWorkingPapers() { - return (Boolean) get(m_organizationPublicationsSeparateWorkingPapers); - } - - public final boolean getDepartmentPublicationsSeparateWorkingPapers() { - return (Boolean) get(m_departmentPublicationsSeparateWorkingPapers); - } - - public final boolean getProjectPublicationsSeparateWorkingPapers() { - return (Boolean) get(m_projectPublicationsSeparateWorkingPapers); - } - -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsConfig_parameter.properties b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsConfig_parameter.properties deleted file mode 100644 index 48a0c0353..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsConfig_parameter.properties +++ /dev/null @@ -1,20 +0,0 @@ -com.arsdigita.cms.contenttypes.sciorganization.publications_merge.title = Merge publications -com.arsdigita.cms.contenttypes.sciorganization.publications_merge.purpose = Merge publications from sub organizations into one list. -com.arsdigita.cms.contenttypes.sciorganization.publications_merge.example = true -com.arsdigita.cms.contenttypes.sciorganization.publications_merge.format = [boolean] - -com.arsdigita.cms.contenttypes.sciorganization.organization.workingpapers_separate.title = Separate working papers of SciOrganization -com.arsdigita.cms.contenttypes.sciorganization.organization.workingpapers_separate.purpose = Show a separate panel for the working papers on SciOrganizationWithPublicationsPanel -com.arsdigita.cms.contenttypes.sciorganization.organization.workingpapers_separate.example = true -com.arsdigita.cms.contenttypes.sciorganization.organization.workingpapers_separate.format [boolean] - -com.arsdigita.cms.contenttypes.scidepartment.department.workingpapers_separate.title = Separate working papers of SciDepartment -com.arsdigita.cms.contenttypes.scidepartment.department.workingpapers_separate.purpose = Show a separate panel for the working papers on SciDepartmentWithPublicationsPanel -com.arsdigita.cms.contenttypes.scidepartment.department.workingpapers_separate.example = true -com.arsdigita.cms.contenttypes.scidepartment.department.workingpapers_separate.format [boolean] - -com.arsdigita.cms.contenttypes.sciproject.project.workingpapers_separate.title = Separate working papers of SciProject -com.arsdigita.cms.contenttypes.sciproject.project.workingpapers_separate.purpose = Show a separate panel for the working papers on SciProjectWithPublicationsPanel -com.arsdigita.cms.contenttypes.sciproject.project.workingpapers_separate.example = false -com.arsdigita.cms.contenttypes.sciproject.project.workingpapers_separate.format [boolean] - diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsInitializer.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsInitializer.java deleted file mode 100644 index c9da03a86..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsInitializer.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.contenttypes.ui.PublicationSciOrganizationStep; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.globalization.GlobalizedMessage; -import com.arsdigita.runtime.DomainInitEvent; - -/** - * - * @author Jens Pelzetter - */ -public class SciOrganizationWithPublicationsInitializer - extends ContentTypeInitializer { - - public SciOrganizationWithPublicationsInitializer() { - super("ccm-sci-types-organizationwithpublications.pdl.mf", - SciOrganizationWithPublications.BASE_DATA_OBJECT_TYPE); - } - - @Override - public void init(final DomainInitEvent event) { - super.init(event); - - ContentType orgaType = - ContentType.findByAssociatedObjectType(SciOrganization.class. - getName()); - if (!orgaType.isInternal()) { - orgaType.setMode("internal"); - } - System.out.println("Set mode to interal"); - - AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE, - PublicationSciOrganizationStep.class, - new GlobalizedMessage( - "sciorganizationpublication.ui.publication.organization.title", - "com.arsdigita.cms.contenttypes.ui.SciOrganizationWithPublicationsResources"), - new GlobalizedMessage( - "sciorganizationpublication.ui.publication.organization.description", - "com.arsdigita.cms.contenttypes.ui.SciOrganizationWithPublicationsResources"), - 1); - } - - @Override - public String[] getStylesheets() { - return new String[]{ - "/static/content-types/com/arsdigita/cms/contenttypes/SciOrganization.xsl"}; - } - - @Override - public String getTraversalXML() { - return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciOrganizationWithPublications.xml"; - - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsLoader.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsLoader.java deleted file mode 100644 index 39b12e111..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciOrganizationWithPublicationsLoader.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.lifecycle.LifecycleDefinition; -import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.ResourceParameter; -import com.arsdigita.workflow.simple.WorkflowTemplate; -import java.io.InputStream; - -/** - * - * @author Jens Pelzetter - */ -public class SciOrganizationWithPublicationsLoader extends AbstractContentTypeLoader { - - private ResourceParameter m_template; - - public SciOrganizationWithPublicationsLoader() { - super(); - - m_template = new ResourceParameter( - "com.arsdigita.cms.contenttypes.SciOrganizationWithPublicationsTemplate", - Parameter.REQUIRED, - "/WEB-INF/content-types/com/arsdigita/" - + "cms/contenttypes/sciorganization-with-publications-item.jsp"); - - register(m_template); - } - private static final String[] TYPES = { - "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/" - + "SciOrganizationWithPublications.xml" - }; - - @Override - public String[] getTypes() { - return TYPES; - } - - @Override - protected void prepareSection(final ContentSection section, - final ContentType type, - final LifecycleDefinition lifecycle, - final WorkflowTemplate workflow) { - super.prepareSection(section, type, lifecycle, workflow); - - setDefaultTemplate("SciOrganizationWithPublications Item", - "sciorganization-with-publications-item", - (InputStream) get(m_template), - section, - type, - lifecycle, - workflow); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectPublicationsCollection.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectPublicationsCollection.java deleted file mode 100644 index fbb592469..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectPublicationsCollection.java +++ /dev/null @@ -1,40 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.domain.DomainObjectFactory; -import com.arsdigita.persistence.DataCollection; - -/** - * - * @author Jens Pelzetter - */ -public class SciProjectPublicationsCollection extends DomainCollection { - - public SciProjectPublicationsCollection(final DataCollection dataCollection) { - super(dataCollection); - } - - public Publication getPublication() { - return (Publication) DomainObjectFactory.newInstance(m_dataCollection. - getDataObject()); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublications.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublications.java deleted file mode 100644 index bfb1e3fc0..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublications.java +++ /dev/null @@ -1,253 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; -import com.arsdigita.persistence.DataQuery; -import com.arsdigita.persistence.OID; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.util.Assert; -import java.math.BigDecimal; - -/** - * - * @author Jens Pelzetter - */ -public class SciProjectWithPublications extends SciProject { - - public static final String BASE_DATA_OBJECT_TYPE = - "com.arsdigita.cms.contenttypes.SciProjectWithPublications"; - public static final String PUBLICATIONS = "publications"; - - public SciProjectWithPublications() { - this(BASE_DATA_OBJECT_TYPE); - } - - public SciProjectWithPublications(final BigDecimal id) { - this(new OID(BASE_DATA_OBJECT_TYPE, id)); - } - - public SciProjectWithPublications(final OID oid) { - super(oid); - } - - public SciProjectWithPublications(final DataObject dobj) { - super(dobj); - } - - public SciProjectWithPublications(final String type) { - super(type); - } - - public boolean hasPublications(final boolean merge) { - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfPublicationsOfSciProject"); - query.setParameter("project", getID()); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subProjectsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubProjectsOfSciProject"); - subProjectsQuery.setParameter("project", getID()); - - if (subProjectsQuery.size() > 0) { - BigDecimal subProjectId; - boolean result = false; - while (subProjectsQuery.next()) { - subProjectId = (BigDecimal) subProjectsQuery.get( - "projectId"); - result = hasPublications(subProjectId, merge); - - if (result) { - break; - } - } - - subProjectsQuery.close(); - return result; - } else { - subProjectsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - private boolean hasPublications(final BigDecimal projectId, - final boolean merge) { - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfPublicationsOfSciProject"); - query.setParameter("project", projectId); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subProjectsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubProjectsOfSciProject"); - subProjectsQuery.setParameter("project", projectId); - - if (subProjectsQuery.size() > 0) { - BigDecimal subProjectId; - boolean result = false; - while (subProjectsQuery.next()) { - subProjectId = (BigDecimal) subProjectsQuery.get( - "projectId"); - result = hasPublications(subProjectId, merge); - - if (result) { - break; - } - } - - subProjectsQuery.close(); - return result; - } else { - subProjectsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - public boolean hasWorkingPapers(final boolean merge) { - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfWorkingPapersOfSciProject"); - query.setParameter("project", getID()); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subProjectsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubProjectsOfSciProject"); - subProjectsQuery.setParameter("project", getID()); - - if (subProjectsQuery.size() > 0) { - BigDecimal subProjectId; - boolean result = false; - while (subProjectsQuery.next()) { - subProjectId = (BigDecimal) subProjectsQuery.get( - "projectId"); - result = hasPublications(subProjectId, merge); - - if (result) { - break; - } - } - - subProjectsQuery.close(); - return result; - } else { - subProjectsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - private boolean hasWorkingPapers(final BigDecimal projectId, - final boolean merge) { - DataQuery query = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfWorkingPapersOfSciProject"); - query.setParameter("projectId", projectId); - - if (query.size() > 0) { - query.close(); - return true; - } else { - if (merge) { - query.close(); - DataQuery subProjectsQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfSubProjectsOfSciProject"); - subProjectsQuery.setParameter("project", projectId); - - if (subProjectsQuery.size() > 0) { - BigDecimal subProjectId; - boolean result = false; - while (subProjectsQuery.next()) { - subProjectId = (BigDecimal) subProjectsQuery.get( - "projectId"); - result = hasPublications(subProjectId, merge); - - if (result) { - break; - } - } - - subProjectsQuery.close(); - return result; - } else { - subProjectsQuery.close(); - return false; - } - } else { - query.close(); - return false; - } - } - } - - public SciProjectPublicationsCollection getPublications() { - return new SciProjectPublicationsCollection((DataCollection) get( - PUBLICATIONS)); - } - - public void addPublication(final Publication publication) { - Assert.exists(publication, Publication.class); - - DataObject link = add(PUBLICATIONS, publication); - link.set("publicationOrder", Integer.valueOf((int) getPublications(). - size())); - link.save(); - } - - public void removePublication(final Publication publication) { - Assert.exists(publication, Publication.class); - - remove(PUBLICATIONS, publication); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublicationsInitializer.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublicationsInitializer.java deleted file mode 100644 index edd8a5081..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublicationsInitializer.java +++ /dev/null @@ -1,73 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.contenttypes.ui.PublicationSciProjectStep; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.globalization.GlobalizedMessage; -import com.arsdigita.runtime.DomainInitEvent; - -/** - * - * @author Jens Pelzetter - */ -public class SciProjectWithPublicationsInitializer - extends ContentTypeInitializer { - - public SciProjectWithPublicationsInitializer() { - super("empty.pdl.mf", - SciProjectWithPublications.BASE_DATA_OBJECT_TYPE); - } - - @Override - public void init(final DomainInitEvent event) { - super.init(event); - - ContentType projectType = - ContentType.findByAssociatedObjectType(SciProject.class. - getName()); - if (!projectType.isInternal()) { - projectType.setMode("internal"); - } - - AuthoringKitWizard.registerAssetStep(Publication.BASE_DATA_OBJECT_TYPE, - PublicationSciProjectStep.class, - new GlobalizedMessage( - "sciorganizationpublication.ui.publication.projects.title", - "com.arsdigita.cms.contenttypes.ui.SciOrganizationWithPublicationsResources"), - new GlobalizedMessage( - "sciorganizationpublication.ui.publication.projects.description", - "com.arsdigita.cms.contenttypes.ui.SciOrganizationWithPublicationsResources"), - 1); - } - - @Override - public String[] getStylesheets() { - return new String[]{ - "/static/content-types/com/arsdigita/cms/contenttypes/SciProject.xsl"}; - } - - @Override - public String getTraversalXML() { - return "/WEB-INF/traversal-adapters/com/arsdigita/cms/contenttypes/SciProjectWithPublications.xml"; - - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublicationsLoader.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublicationsLoader.java deleted file mode 100644 index 406d4bf6e..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciProjectWithPublicationsLoader.java +++ /dev/null @@ -1,74 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.lifecycle.LifecycleDefinition; -import com.arsdigita.util.parameter.Parameter; -import com.arsdigita.util.parameter.ResourceParameter; -import com.arsdigita.workflow.simple.WorkflowTemplate; -import java.io.InputStream; - -/** - * - * @author Jens Pelzetter - */ -public class SciProjectWithPublicationsLoader extends AbstractContentTypeLoader { - - private ResourceParameter m_template; - private static final String[] TYPES = { - "/WEB-INF/content-types/com/arsdigita/cms/contenttypes/SciProjectWithPublications.xml" - }; - - public SciProjectWithPublicationsLoader() { - super(); - - m_template = - new ResourceParameter( - "com.arsdigita.cms.contenttypes.SciProjectWithPublicationsTemplate", - Parameter.REQUIRED, - "/WEB-INF/content-types/com/arsdigita/" - + "cms/contenttypes/sciproject-with-publications-item.jsp"); - - register(m_template); - } - - @Override - public String[] getTypes() { - return TYPES; - } - - @Override - protected void prepareSection(final ContentSection section, - final ContentType type, - final LifecycleDefinition lifecycle, - final WorkflowTemplate workflow) { - super.prepareSection(section, type, lifecycle, workflow); - - setDefaultTemplate("SciProjectWithPublications Item", - "sciproject-with-publications-item", - (InputStream) get(m_template), - section, - type, - lifecycle, - workflow); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationAuthorComparator.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationAuthorComparator.java deleted file mode 100644 index de1d562a8..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationAuthorComparator.java +++ /dev/null @@ -1,58 +0,0 @@ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.persistence.DataQuery; -import com.arsdigita.persistence.SessionManager; -import java.math.BigDecimal; -import java.util.Comparator; -import org.apache.log4j.Logger; - -/** - * - * @author Jens Pelzetter - */ -public class SciPublicationAuthorComparator implements Comparator { - - private Logger logger = Logger.getLogger( - SciPublicationAuthorComparator.class); - - public int compare(Publication publication1, Publication publication2) { - if ((publication1.getAuthors() == null) - || publication1.getAuthors().size() == 0) { - logger.debug("publication1 has no authors, returning -1"); - return -1; - } else if ((publication2.getAuthors() == null) - || publication2.getAuthors().size() == 0) { - logger.debug("publication2 has no authors, returning "); - return 1; - } else { - logger.debug("Both publication have authors, comparing authors..."); - int ret = 0; - - AuthorshipCollection authors1 = publication1.getAuthors(); - AuthorshipCollection authors2 = publication2.getAuthors(); - - while ((ret == 0) && authors1.next() && authors2.next()) { - GenericPerson author1 = authors1.getAuthor(); - GenericPerson author2 = authors2.getAuthor(); - logger.debug(String.format( - "Comparing surnames: author1.surname = '%s'; author2.surname = '%s'", - author1.getSurname(), - author2.getSurname())); - ret = author1.getSurname().compareTo(author2.getSurname()); - - if (ret == 0) { - logger.debug(String.format( - "Surnames are identical, comparing given names:" - + "author1.givenName = '%s'; author2.givenName = '%s'", - author1.getGivenName(), - author2.getGivenName())); - ret = author1.getGivenName().compareTo( - author2.getGivenName()); - } - logger.debug(String.format("ret = %d", ret)); - } - - return ret; - } - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationTitleComparator.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationTitleComparator.java deleted file mode 100644 index 1c61571c5..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationTitleComparator.java +++ /dev/null @@ -1,43 +0,0 @@ -package com.arsdigita.cms.contenttypes; - -import java.util.Comparator; - -/** - * - * @author Jens Pelzetter - */ -public class SciPublicationTitleComparator implements Comparator { - - public int compare(Publication publication1, Publication publication2) { - String title1; - String title2; - if (publication1.getTitle().startsWith("\"")) { - title1 = publication1.getTitle().substring(1, - publication1.getTitle(). - length() - 1); - } else if (publication1.getTitle().startsWith("'")) { - title1 = publication1.getTitle().substring(1, - publication1.getTitle(). - length() - 1); - } else { - title1 = publication1.getTitle(); - } - - if (publication2.getTitle().startsWith("\"")) { - title2 = publication2.getTitle().substring(2, - publication2.getTitle(). - length() - 1); - } else if (publication2.getTitle().startsWith("'")) { - title2 = publication2.getTitle().substring(2, - publication2.getTitle(). - length() - 1); - } else { - title2 = publication2.getTitle(); - } - - - - return title1.compareToIgnoreCase(title2); - //return publication1.getTitle().compareTo(publication2.getTitle()); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationYearAscComparator.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationYearAscComparator.java deleted file mode 100644 index 89d844079..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationYearAscComparator.java +++ /dev/null @@ -1,30 +0,0 @@ -package com.arsdigita.cms.contenttypes; - -import java.util.Comparator; - -/** - * - * @author Jens Pelzetter - */ -public class SciPublicationYearAscComparator implements Comparator { - - public int compare(Publication publication1, Publication publication2) { - if (publication1.getYearOfPublication() == null) { - return -1; - } else if (publication2.getYearOfPublication() == null) { - return 1; - } else { - int ret = publication1.getYearOfPublication().compareTo(publication2. - getYearOfPublication()); - - if (ret == 0) { - SciPublicationTitleComparator titleComparator = - new SciPublicationTitleComparator(); - ret = titleComparator.compare(publication1, publication2); - } - - return ret; - } - - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationYearDescComparator.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationYearDescComparator.java deleted file mode 100644 index 5ee87a4a5..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/SciPublicationYearDescComparator.java +++ /dev/null @@ -1,28 +0,0 @@ -package com.arsdigita.cms.contenttypes; - -import java.util.Comparator; - -/** - * - * @author Jens Pelzetter - */ -public class SciPublicationYearDescComparator implements Comparator { - - public int compare(Publication publication1, Publication publication2) { - if (publication1.getYearOfPublication() == null) { - return 1; - } else if (publication2.getYearOfPublication() == null) { - return -1; - } else { - int ret = publication2.getYearOfPublication().compareTo(publication1. - getYearOfPublication()); - if (ret == 0) { - SciPublicationTitleComparator titleComparator = new SciPublicationTitleComparator(); - ret = titleComparator.compare(publication1, publication2); - } - - return ret; - } - - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ZeSLanguageVersionFix.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ZeSLanguageVersionFix.java deleted file mode 100644 index 02ce16048..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ZeSLanguageVersionFix.java +++ /dev/null @@ -1,511 +0,0 @@ -package com.arsdigita.cms.contenttypes; - -import com.arsdigita.cms.ContentBundle; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.ContentPage; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ContentSectionCollection; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ContentTypeLifecycleDefinition; -import com.arsdigita.cms.ContentTypeWorkflowTemplate; -import com.arsdigita.cms.Folder; -import com.arsdigita.cms.lifecycle.LifecycleDefinition; -import com.arsdigita.persistence.Session; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.TransactionContext; -import com.arsdigita.workflow.simple.Workflow; -import com.arsdigita.workflow.simple.WorkflowTemplate; -import java.util.Date; - -/** - * - * @author Jens Pelzetter - */ -public class ZeSLanguageVersionFix { - - public static void main(final String[] args) { - - final com.arsdigita.runtime.Runtime runtime = - new com.arsdigita.runtime.Runtime(); - runtime.startup(); - - final Session session = SessionManager.getSession(); - final TransactionContext tctx = session.getTransactionContext(); - - tctx.beginTxn(); - try { - System.out.println("Starting to fix associations..."); - - ContentSectionCollection contentSections = ContentSection. - getAllSections(); - ContentSection sectionContent = null; - ContentSection sectionResearch = null; - while (contentSections.next()) { - ContentSection section = contentSections.getContentSection(); - if ("content".equals(section.getName())) { - sectionContent = section; - } else if ("research".equals(section.getName())) { - sectionResearch = section; - } - } - - fixZeS(session, sectionContent, sectionResearch); - fixTheorieUndVerfassung(session, sectionContent, sectionResearch); - fixInstitutionenUndGeschichte(session, - sectionContent, - sectionResearch); - fixWirtschaftswissenschaftliche(session, - sectionContent, - sectionResearch); - fixGesundheit(session, sectionContent, sectionResearch); - fixGesundheitArbeitsbereich1(session, - sectionContent, - sectionResearch); - fixGesundheitArbeitsbereich2(session, - sectionContent, - sectionResearch); - fixGesundheitArbeitsbereich3(session, - sectionContent, - sectionResearch); - fixGesundheitArbeitsbereich4(session, - sectionContent, - sectionResearch); - fixGeschlechterpolitik(session, sectionContent, sectionResearch); - - fixFileStorageItems(session, sectionContent, sectionResearch); - - System.out.println("Finished, commiting transaction..."); - tctx.commitTxn(); - } catch (Exception ex) { - System.err.println( - "Exeception ocurred during convert process. " - + "Transaction rolled back, all changes will be lost."); - ex.printStackTrace(System.err); - } finally { - if (tctx.inTxn()) { - tctx.abortTxn(); - } - } - } - - public static void fixZeS(final Session session, - final ContentSection sectionContent, - final ContentSection sectionResearch) { - System.out.println( - "First, the publications of the english variant of the ZeS..."); - Folder folder = sectionContent.getRootFolder(); - folder = (Folder) folder.getItem("das-zentrum", true); - ContentItem item = folder.getItem("zes", false); - - SciOrganizationWithPublications zesDe; - SciOrganizationWithPublications zesEn; - if (item instanceof ContentBundle) { - zesDe = - (SciOrganizationWithPublications) ((ContentBundle) item). - getPrimaryInstance(); - } else { - zesDe = (SciOrganizationWithPublications) ((ContentPage) item). - getContentBundle().getPrimaryInstance(); - } - zesEn = (SciOrganizationWithPublications) zesDe.getContentBundle(). - getInstance("en"); - - System.out.printf("Got the ZeS: %s (%s)\n", zesDe.getName(), zesDe. - getLanguage()); - - SciOrganizationPublicationsCollection publicationsZeSde = zesDe. - getPublications(); - SciOrganizationPublicationsCollection publicationsZeSen = zesEn. - getPublications(); - - Publication publicationDe; - Publication publicationEn; - - //Delete all publication links from the english variant to german variants of publications - System.out.println( - "Deleting all assciations of the english ZeS item with german variants of publication items..."); - int i = 1; - long size = publicationsZeSen.size(); - while (publicationsZeSen.next()) { - publicationEn = publicationsZeSen.getPublication(); - System.out.printf("\tProcessing item %d of %d ('%s')...\n", - i, - size, - publicationEn.getName()); - if (!("de").equals(publicationEn.getLanguage())) { - zesEn.removePublication(publicationEn); - LifecycleDefinition lifecycleDef = - ContentTypeLifecycleDefinition. - getLifecycleDefinition( - publicationEn.getContentSection(), - publicationEn.getContentType()); - - System.out.println("\t\t\tPublishing new item..."); - publicationEn.publish(lifecycleDef, new Date()); - i++; - } - } - - publicationEn = null; - - publicationsZeSen = zesEn.getPublications(); - - i = 1; - size = publicationsZeSde.size(); - System.out.println( - "Processing publications and linking them to the english variant of the ZeS item..."); - while (publicationsZeSde.next()) { - publicationDe = publicationsZeSde.getPublication(); - publicationEn = (Publication) publicationDe.getContentBundle(). - getInstance("en"); - System.out.printf("\tProceesing item %d of %d ('%s')...", - i, - size, - publicationDe.getName()); - - System.out.println( - "\tCreating english versions of the publication items of associated with the ZeS item (if necessary)..."); - if (publicationEn == null) { - System.out.println( - "\t\tNo english version found, creating one..."); - publicationEn = - (Publication) createEnglishVersion(publicationDe, - sectionResearch); - } else { - System.out.println( - "\t\tEnglish version exists, no action necessary here."); - } - - System.out.println( - "\tChecking if english variant of the publication item is already associated with the english version of the ZeS item. "); - publicationsZeSen.addFilter(String.format("id = %s", publicationEn. - getID())); - if (publicationsZeSen.isEmpty()) { - System.out.println( - "\t\tAdding english version of publication item to english version of the ZeS item..."); - zesEn.addPublication(publicationEn); - LifecycleDefinition lifecycleDef = - ContentTypeLifecycleDefinition. - getLifecycleDefinition( - publicationEn.getContentSection(), - publicationEn.getContentType()); - System.out.println("\t\t\t(Re)publishing publication item..."); - if (publicationEn.isPublished()) { - publicationEn.republish(); - } else { - publicationEn.publish(lifecycleDef, new Date()); - } - } else { - System.out.println( - "\t\tAlready associated, no actions necessary."); - } - publicationsZeSen.reset(); - i++; - } - - System.out.println("\t\t\t(Re)publishing the english ZeS item..."); - if (zesEn.isPublished()) { - zesEn.republish(); - } else { - LifecycleDefinition lifcycleDef = - ContentTypeLifecycleDefinition. - getLifecycleDefinition(zesEn.getContentSection(), - zesEn.getContentType()); - zesEn.publish(lifcycleDef, new Date()); - } - } - - public static void fixTheorieUndVerfassung(final Session session, - final ContentSection sectionContent, - final ContentSection researchContent) { - Folder folder; - ContentItem item; - - System.out.println( - "Abteilung Theorie und Verfassung des Wohlfahrtsstaates..."); - folder = sectionContent.getRootFolder(); - folder = (Folder) folder.getItem("theorie-und-verfassung", true); - item = folder.getItem("theorie-und-verfassung-des-wohlfahrtsstaates", - false); - - final SciDepartmentWithPublications theorieDe; - if (item instanceof ContentBundle) { - theorieDe = - (SciDepartmentWithPublications) ((ContentBundle) item). - getPrimaryInstance(); - } else { - theorieDe = - (SciDepartmentWithPublications) ((ContentPage) item). - getContentBundle().getPrimaryInstance(); - } - - System.out.printf("Got '%s' (%s)\n", theorieDe.getName(), theorieDe. - getLanguage()); - } - - public static void fixInstitutionenUndGeschichte(final Session session, - final ContentSection sectionContent, - final ContentSection sectionResearch) { - Folder folder; - ContentItem item; - - System.out.println( - "Abteilung Institutionen und Geschichte des Wohlfahrtsstaates..."); - folder = sectionContent.getRootFolder(); - folder = (Folder) folder.getItem("institutionen-und-geschichte", - true); - item = folder.getItem( - "institutionen-und-geschichte-des-wohlfahrtsstaates", false); - - final SciDepartmentWithPublications institutionenDe; - if (item instanceof ContentBundle) { - institutionenDe = - (SciDepartmentWithPublications) ((ContentBundle) item). - getPrimaryInstance(); - } else { - institutionenDe = - (SciDepartmentWithPublications) ((ContentPage) item). - getContentBundle().getPrimaryInstance(); - } - - System.out.printf("Got '%s' (%s)\n", - institutionenDe.getName(), - institutionenDe.getLanguage()); - } - - public static void fixWirtschaftswissenschaftliche(final Session session, - final ContentSection sectionContent, - final ContentSection sectionResearch) { - Folder folder; - ContentItem item; - - System.out.println( - "Abteilung Wirtschaftswissenschaftliche Abteilung..."); - folder = sectionContent.getRootFolder(); - folder = (Folder) folder.getItem( - "wirtschaftswissenschaftliche-abteilung", - true); - item = - folder.getItem("wirtschaftswissenschaftliche-abteilung", false); - final SciDepartmentWithPublications wirtschaftDe; - if (item instanceof ContentBundle) { - wirtschaftDe = - (SciDepartmentWithPublications) ((ContentBundle) item). - getPrimaryInstance(); - } else { - wirtschaftDe = - (SciDepartmentWithPublications) ((ContentPage) item). - getContentBundle().getPrimaryInstance(); - } - - System.out.printf("Got '%s' (%s)\n", wirtschaftDe.getName(), - wirtschaftDe.getLanguage()); - } - - public static void fixGesundheit(final Session session, - final ContentSection sectionContent, - final ContentSection sectionResearch) { - Folder folder; - ContentItem item; - - System.out.println("Abteilung Gesundheit..."); - folder = sectionContent.getRootFolder(); - folder = (Folder) folder.getItem( - "gesundheit", - true); - item = - folder.getItem( - "gesundheitsoekonomie-gesundheitspolitik-und-versorgungsforschung", - false); - final SciDepartmentWithPublications gesundheitDe; - if (item instanceof ContentBundle) { - gesundheitDe = - (SciDepartmentWithPublications) ((ContentBundle) item). - getPrimaryInstance(); - } else { - gesundheitDe = - (SciDepartmentWithPublications) ((ContentPage) item). - getContentBundle().getPrimaryInstance(); - } - - System.out.printf("Got '%s' (%s)\n", gesundheitDe.getName(), - gesundheitDe.getLanguage()); - } - - public static void fixGesundheitArbeitsbereich1(final Session session, - final ContentSection sectionContent, - final ContentSection sectionResearch) { - Folder folder; - ContentItem item; - - System.out.println("Gesundheit/Arbeitsbereich 1..."); - folder = sectionContent.getRootFolder(); - folder = (Folder) folder.getItem( - "gesundheit", - true); - item = - folder.getItem("arbeitsbereich-1", false); - final SciDepartmentWithPublications arbeitsbereich1De; - if (item instanceof ContentBundle) { - arbeitsbereich1De = - (SciDepartmentWithPublications) ((ContentBundle) item). - getPrimaryInstance(); - } else { - arbeitsbereich1De = - (SciDepartmentWithPublications) ((ContentPage) item). - getContentBundle().getPrimaryInstance(); - } - - System.out.printf("Got '%s' (%s)\n", arbeitsbereich1De.getName(), - arbeitsbereich1De.getLanguage()); - } - - public static void fixGesundheitArbeitsbereich2(final Session session, - final ContentSection sectionContent, - final ContentSection sectionResearch) { - Folder folder; - ContentItem item; - - System.out.println("Arbeitsbereich 2..."); - folder = sectionContent.getRootFolder(); - folder = (Folder) folder.getItem( - "gesundheit", - true); - item = - folder.getItem("arbeitsbereich-2", false); - final SciDepartmentWithPublications arbeitsbereich2De; - if (item instanceof ContentBundle) { - arbeitsbereich2De = - (SciDepartmentWithPublications) ((ContentBundle) item). - getPrimaryInstance(); - } else { - arbeitsbereich2De = - (SciDepartmentWithPublications) ((ContentPage) item). - getContentBundle().getPrimaryInstance(); - } - - System.out.printf("Got '%s' (%s)\n", - arbeitsbereich2De.getName(), - arbeitsbereich2De.getLanguage()); - - } - - public static void fixGesundheitArbeitsbereich3(final Session session, - final ContentSection sectionContent, - final ContentSection sectionResearch) { - Folder folder; - ContentItem item; - - System.out.println("Arbeitsbereich 3..."); - folder = sectionContent.getRootFolder(); - folder = (Folder) folder.getItem( - "gesundheit", - true); - item = - folder.getItem("arbeitsbereich-3", false); - final SciDepartmentWithPublications arbeitsbereich3De; - if (item instanceof ContentBundle) { - arbeitsbereich3De = - (SciDepartmentWithPublications) ((ContentBundle) item). - getPrimaryInstance(); - } else { - arbeitsbereich3De = - (SciDepartmentWithPublications) ((ContentPage) item). - getContentBundle().getPrimaryInstance(); - } - - System.out.printf("Got '%s' (%s)\n", - arbeitsbereich3De.getName(), - arbeitsbereich3De.getLanguage()); - } - - public static void fixGesundheitArbeitsbereich4(final Session session, - final ContentSection sectionContent, - final ContentSection sectionResearch) { - Folder folder; - ContentItem item; - - System.out.println("Arbeitsbereich 4..."); - folder = sectionContent.getRootFolder(); - folder = (Folder) folder.getItem( - "gesundheit", - true); - item = - folder.getItem("arbeitsbereich-4", false); - final SciDepartmentWithPublications arbeitsbereich4De; - if (item instanceof ContentBundle) { - arbeitsbereich4De = - (SciDepartmentWithPublications) ((ContentBundle) item). - getPrimaryInstance(); - } else { - arbeitsbereich4De = - (SciDepartmentWithPublications) ((ContentPage) item). - getContentBundle().getPrimaryInstance(); - } - - System.out.printf("Got '%s' (%s)\n", - arbeitsbereich4De.getName(), - arbeitsbereich4De.getLanguage()); - } - - public static void fixGeschlechterpolitik(final Session session, - final ContentSection sectionContent, - final ContentSection sectionResearch) { - Folder folder; - ContentItem item; - - System.out.println("Abteilung Geschlechterpolitik..."); - folder = sectionContent.getRootFolder(); - folder = (Folder) folder.getItem("geschlechterpolitik", - true); - item = - folder.getItem("geschlechterpolitik-im-wohlfahrtsstaat", false); - final SciDepartmentWithPublications geschlechterDe; - if (item instanceof ContentBundle) { - geschlechterDe = - (SciDepartmentWithPublications) ((ContentBundle) item). - getPrimaryInstance(); - } else { - geschlechterDe = - (SciDepartmentWithPublications) ((ContentPage) item). - getContentBundle().getPrimaryInstance(); - } - - System.out.printf("Got '%s' (%s)\n", - geschlechterDe.getName(), - geschlechterDe.getLanguage()); - } - - public static void fixFileStorageItems(final Session session, - final ContentSection sectionContent, - final ContentSection sectionResearch) { - Folder folder; - ContentItem item; - - System.out.println("FileStorageItems for WorkingPapers..."); - } - - public static ContentPage createEnglishVersion(final ContentPage item, - final ContentSection section) { - ContentPage itemPrimary; - ContentPage itemEn; - - itemPrimary = (Publication) item.getContentBundle(). - getPrimaryInstance(); - - itemEn = (Publication) itemPrimary.copy("en"); - itemEn.setLanguage("en"); - itemEn.setName(item.getContentBundle().getName()); - - ContentType type = item.getContentType();; - WorkflowTemplate template = ContentTypeWorkflowTemplate. - getWorkflowTemplate(section, type); - if (template != null) { - Workflow workflow = template.instantiateNewWorkflow(); - workflow.setObjectID(itemEn.getID()); - workflow.save(); - } - - return itemEn; - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciDepartmentAddForm.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciDepartmentAddForm.java deleted file mode 100644 index 429970882..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciDepartmentAddForm.java +++ /dev/null @@ -1,133 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.PublicationSciDepartmentCollection; -import com.arsdigita.cms.contenttypes.SciDepartmentPublicationsCollection; -import com.arsdigita.cms.contenttypes.SciDepartmentWithPublications; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; - -/** - * - * @author Jens Pelzetter - */ -public class PublicationSciDepartmentAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget itemSearch; - private final String ITEM_SEARCH = "departments"; - - public PublicationSciDepartmentAddForm(ItemSelectionModel itemModel) { - super("PublicationSciDepartmentAddForm", itemModel); - } - - @Override - public void addWidgets() { - add(new Label((String) SciOrganizationWithPublicationsGlobalizationUtil. - globalize("sciorganization.ui.selectDepartment").localize())); - itemSearch = new ItemSearchWidget(ITEM_SEARCH, - ContentType.findByAssociatedObjectType(SciDepartmentWithPublications.class. - getName())); - add(itemSearch); - } - - @Override - public void init(final FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(final FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - - Publication publication = (Publication) getItemSelectionModel(). - getSelectedObject(state); - - if (this.getSaveCancelSection().getSaveButton().isSelected(state)) { - SciDepartmentWithPublications department = - (SciDepartmentWithPublications) data. - get(ITEM_SEARCH); - department = (SciDepartmentWithPublications) department. - getContentBundle().getInstance(publication.getLanguage()); - DataObject link = publication.add("departments", department); - link.set("publicationOrder", Integer.valueOf((int) department. - getPublications().size())); - - link.save(); - } - - init(fse); - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganization.ui.selectDepartment.no_department_selected")); - return; - } - - Publication publication = (Publication) getItemSelectionModel(). - getSelectedObject(state); - SciDepartmentWithPublications department = - (SciDepartmentWithPublications) data.get( - ITEM_SEARCH); - if (!(department.getContentBundle().hasInstance(publication.getLanguage()))) { - data.addError( - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganization.ui.selectDepartment.no_suitable_language_variant")); - return; - } - - department = (SciDepartmentWithPublications) department.getContentBundle().getInstance(publication.getLanguage()); - PublicationSciDepartmentCollection departments = new PublicationSciDepartmentCollection((DataCollection) publication. - get("departments")); - departments.addFilter(String.format("id = %s", department.getID().toString())); - if (departments.size() > 0) { - data.addError( - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganization.ui.selectDepartment.already_added")); - } - - departments.close(); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciDepartmentStep.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciDepartmentStep.java deleted file mode 100644 index 01bf10f0b..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciDepartmentStep.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * - * @author Jens Pelzetter - */ -public class PublicationSciDepartmentStep extends SimpleEditStep { - - private String ADD_ORGANIZATION_SHEET_NAME = "addSciDepartment"; - - public PublicationSciDepartmentStep(final ItemSelectionModel itemModel, - final AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public PublicationSciDepartmentStep(final ItemSelectionModel itemModel, - final AuthoringKitWizard parent, - final String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addDepartmentSheet = - new PublicationSciDepartmentAddForm(itemModel); - add(ADD_ORGANIZATION_SHEET_NAME, - (String) SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.addDepartment").localize(), - new WorkflowLockedComponentAccess(addDepartmentSheet, itemModel), - addDepartmentSheet.getSaveCancelSection().getCancelButton()); - - PublicationSciDepartmentTable departmentTable = - new PublicationSciDepartmentTable( - itemModel); - setDisplayComponent(departmentTable); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciDepartmentTable.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciDepartmentTable.java deleted file mode 100644 index 890b2516c..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciDepartmentTable.java +++ /dev/null @@ -1,278 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.PublicationSciDepartmentCollection; -import com.arsdigita.cms.contenttypes.SciDepartmentWithPublications; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.util.Assert; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; - -/** - * - * @author Jens Pelzetter - */ -public class PublicationSciDepartmentTable - extends Table - implements TableActionListener { - - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private ItemSelectionModel itemModel; - - public PublicationSciDepartmentTable(final ItemSelectionModel itemModel) { - super(); - this.itemModel = itemModel; - - setEmptyView(new Label(SciOrganizationWithPublicationsGlobalizationUtil. - globalize("sciorganizationpublication.ui.departments.none"))); - - TableColumnModel columnModel = getColumnModel(); - columnModel.add(new TableColumn( - 0, - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.department").localize(), - TABLE_COL_EDIT)); - columnModel.add(new TableColumn( - 1, - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.department.remove"). - localize(), TABLE_COL_DEL)); - - setModelBuilder(new PublicationSciDepartmentTableModelBuilder( - itemModel)); - - columnModel.get(0).setCellRenderer(new EditCellRenderer()); - columnModel.get(1).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - } - - private class PublicationSciDepartmentTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel itemModel; - - public PublicationSciDepartmentTableModelBuilder( - final ItemSelectionModel itemModel) { - this.itemModel = itemModel; - } - - public TableModel makeModel(final Table table, final PageState state) { - table.getRowSelectionModel().clearSelection(state); - Publication publication = (Publication) itemModel.getSelectedObject( - state); - return new PublicationSciDepartmentTableModel(table, - state, - publication); - } - } - - private class PublicationSciDepartmentTableModel implements TableModel { - - private Table table; - private PublicationSciDepartmentCollection departments; - private SciDepartmentWithPublications department; - - public PublicationSciDepartmentTableModel(final Table table, - final PageState state, - final Publication publication) { - this.table = table; - - departments = - new PublicationSciDepartmentCollection((DataCollection) publication. - get("departments")); - } - - public int getColumnCount() { - return table.getColumnModel().size(); - } - - public boolean nextRow() { - boolean ret; - - if ((departments != null) && departments.next()) { - department = departments.getDepartment(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return department.getTitle(); - case 1: - return SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganizationpublication.ui.department.remove"). - localize(); - default: - return null; - } - } - - public Object getKeyAt(int columnIndex) { - return department.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(final Table table, - final PageState state, - final Object value, - final boolean isSelected, - final Object key, - final int row, - final int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - Publication publication = (Publication) itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - publication); - - if (canEdit) { - SciDepartmentWithPublications department; - try { - department = - new SciDepartmentWithPublications((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = - new Link(String.format("%s (%s)", - value.toString(), - department.getLanguage()), - resolver.generateItemURL(state, - department, - section, - department.getVersion())); - return link; - } else { - SciDepartmentWithPublications department; - try { - department = - new SciDepartmentWithPublications((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - Label label = new Label(String.format("%s (%s)", - value.toString(), - department.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(final Table table, - final PageState state, - final Object value, - final boolean isSelected, - final Object key, - final int row, - final int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - Publication publication = (Publication) itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - com.arsdigita.cms.SecurityManager.DELETE_ITEM, - publication); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganizationpublication.ui.department.confirm.remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - public void cellSelected(final TableActionEvent event) { - PageState state = event.getPageState(); - - SciDepartmentWithPublications department = - new SciDepartmentWithPublications( - new BigDecimal(event.getRowKey().toString())); - - Publication publication = (Publication) itemModel.getSelectedObject( - state); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (TABLE_COL_EDIT.equals(column.getHeaderKey().toString())) { - //Nothing to do - } else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) { - Assert.exists(department, SciDepartmentWithPublications.class); - - publication.remove("departments", department); - } - } - - public void headSelected(final TableActionEvent event) { - //Nothing to do - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciOrganizationAddForm.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciOrganizationAddForm.java deleted file mode 100644 index 8332009b8..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciOrganizationAddForm.java +++ /dev/null @@ -1,134 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.PublicationSciOrganizationCollection; -import com.arsdigita.cms.contenttypes.SciOrganizationWithPublications; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; - -/** - * - * @author Jens Pelzetter - */ -public class PublicationSciOrganizationAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget itemSearch; - private final String ITEM_SEARCH = "organizations"; - - public PublicationSciOrganizationAddForm(final ItemSelectionModel itemModel) { - super("PublicationSciOrganizationAddForm", itemModel); - } - - @Override - public void addWidgets() { - add(new Label((String) SciOrganizationWithPublicationsGlobalizationUtil. - globalize("sciorganization.ui.selectOrganization").localize())); - itemSearch = new ItemSearchWidget(ITEM_SEARCH, - ContentType.findByAssociatedObjectType(SciOrganizationWithPublications.class. - getName())); - add(itemSearch); - } - - @Override - public void init(final FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(final FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - - Publication publication = (Publication) getItemSelectionModel(). - getSelectedObject(state); - - if (this.getSaveCancelSection().getSaveButton().isSelected(state)) { - SciOrganizationWithPublications organization = - (SciOrganizationWithPublications) data. - get(ITEM_SEARCH); - organization = (SciOrganizationWithPublications) organization. - getContentBundle().getInstance(publication.getLanguage()); - DataObject link = publication.add("organizations", organization); - link.set("publicationOrder", Integer.valueOf((int) organization. - getPublications().size())); - link.save(); - } - - init(fse); - } - - @Override - public void validate(final FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError(SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganization.ui.selectOrganization.no_orga_selected")); - return; - } - - Publication publication = (Publication) getItemSelectionModel(). - getSelectedObject(state); - SciOrganizationWithPublications organization = - (SciOrganizationWithPublications) data. - get(ITEM_SEARCH); - if (!(organization.getContentBundle().hasInstance(publication. - getLanguage()))) { - data.addError( - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganization.ui.selectOrganization.no_suitable_language_variant")); - return; - } - - organization = (SciOrganizationWithPublications) organization. - getContentBundle().getInstance(publication.getLanguage()); - PublicationSciOrganizationCollection organizations = - new PublicationSciOrganizationCollection((DataCollection) publication. - get("organizations")); - organizations.addFilter(String.format("id = %s", organization.getID().toString())); - if (organizations.size() > 0 ) { - data.addError( - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganization.ui.selectOrganization.already_added")); - } - - organizations.close(); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciOrganizationStep.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciOrganizationStep.java deleted file mode 100644 index 7f356072b..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciOrganizationStep.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * - * @author Jens Pelzetter - */ -public class PublicationSciOrganizationStep extends SimpleEditStep { - - private String ADD_ORGANIZATION_SHEET_NAME = "addSciOrganization"; - - public PublicationSciOrganizationStep(final ItemSelectionModel itemModel, - final AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public PublicationSciOrganizationStep(final ItemSelectionModel itemModel, - final AuthoringKitWizard parent, - final String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addOrganizationSheet = - new PublicationSciOrganizationAddForm(itemModel); - add(ADD_ORGANIZATION_SHEET_NAME, - (String) SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.addOrganization").localize(), - new WorkflowLockedComponentAccess(addOrganizationSheet, itemModel), - addOrganizationSheet.getSaveCancelSection().getCancelButton()); - - PublicationSciOrganizationTable organizationTable = - new PublicationSciOrganizationTable( - itemModel); - setDisplayComponent(organizationTable); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciOrganizationTable.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciOrganizationTable.java deleted file mode 100644 index 1a7123425..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciOrganizationTable.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.PublicationSciOrganizationCollection; -import com.arsdigita.cms.contenttypes.SciOrganizationWithPublications; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.util.Assert; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; - -/** - * - * @author Jens Pelzetter - */ -public class PublicationSciOrganizationTable - extends Table - implements TableActionListener { - - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private ItemSelectionModel itemModel; - - public PublicationSciOrganizationTable(final ItemSelectionModel itemModel) { - super(); - this.itemModel = itemModel; - - setEmptyView(new Label(SciOrganizationWithPublicationsGlobalizationUtil. - globalize("sciorganizationpublication.ui.organizations.none"))); - - TableColumnModel columnModel = getColumnModel(); - columnModel.add(new TableColumn( - 0, - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.organization").localize(), - TABLE_COL_EDIT)); - columnModel.add(new TableColumn( - 1, - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.organization.remove"). - localize(), TABLE_COL_DEL)); - - setModelBuilder(new PublicationSciOrganizationTableModelBuilder( - itemModel)); - - columnModel.get(0).setCellRenderer(new EditCellRenderer()); - columnModel.get(1).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - } - - private class PublicationSciOrganizationTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel itemModel; - - public PublicationSciOrganizationTableModelBuilder( - final ItemSelectionModel itemModel) { - this.itemModel = itemModel; - } - - public TableModel makeModel(final Table table, final PageState state) { - table.getRowSelectionModel().clearSelection(state); - Publication publication = (Publication) itemModel.getSelectedObject( - state); - return new PublicationSciOrganizationTableModel(table, - state, - publication); - } - } - - private class PublicationSciOrganizationTableModel implements TableModel { - - private Table table; - private PublicationSciOrganizationCollection organizations; - private SciOrganizationWithPublications organization; - - public PublicationSciOrganizationTableModel(final Table table, - final PageState state, - final Publication publication) { - - this.table = table; - - organizations = - new PublicationSciOrganizationCollection((DataCollection) publication. - get("organizations")); - } - - public int getColumnCount() { - return table.getColumnModel().size(); - } - - public boolean nextRow() { - boolean ret; - - if ((organizations != null) && organizations.next()) { - organization = organizations.getOrganization(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return organization.getTitle(); - case 1: - return SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganizationpublication.ui.organization.remove"). - localize(); - default: - return null; - } - } - - public Object getKeyAt(int columnIndex) { - return organization.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(final Table table, - final PageState state, - final Object value, - final boolean isSelected, - final Object key, - final int row, - final int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - Publication publication = (Publication) itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - publication); - - if (canEdit) { - SciOrganizationWithPublications organization; - try { - organization = - new SciOrganizationWithPublications((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = - new Link(String.format("%s (%s)", - value.toString(), - organization.getLanguage()), - resolver.generateItemURL(state, - organization, - section, - organization.getVersion())); - return link; - } else { - SciOrganizationWithPublications organization; - try { - organization = - new SciOrganizationWithPublications((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - Label label = new Label( - String.format("%s (%s)", - value.toString(), - organization.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(final Table table, - final PageState state, - final Object value, - final boolean isSelected, - final Object key, - final int row, - final int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - Publication publication = (Publication) itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - com.arsdigita.cms.SecurityManager.DELETE_ITEM, - publication); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganizationpublication.ui.organization.confirm.remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - public void cellSelected(final TableActionEvent event) { - PageState state = event.getPageState(); - - SciOrganizationWithPublications organization = - new SciOrganizationWithPublications( - new BigDecimal(event.getRowKey().toString())); - - Publication publication = (Publication) itemModel.getSelectedObject( - state); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (TABLE_COL_EDIT.equals(column.getHeaderKey().toString())) { - //Nothing to do - } else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) { - Assert.exists(organization, SciOrganizationWithPublications.class); - - publication.remove("organizations", organization); - } - } - - public void headSelected(final TableActionEvent event) { - //Nothing to do - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciProjectAddForm.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciProjectAddForm.java deleted file mode 100644 index 27397cf59..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciProjectAddForm.java +++ /dev/null @@ -1,131 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.PublicationSciProjectCollection; -import com.arsdigita.cms.contenttypes.SciProjectWithPublications; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataObject; - -/** - * - * @author Jens Pelzetter - */ -public class PublicationSciProjectAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget itemSearch; - private final String ITEM_SEARCH = "projects"; - - public PublicationSciProjectAddForm(final ItemSelectionModel itemModel) { - super("PublicationSciProjectAddForm", itemModel); - } - - @Override - public void addWidgets() { - add(new Label((String) SciOrganizationWithPublicationsGlobalizationUtil. - globalize("sciorganization.ui.selectProject").localize())); - itemSearch = new ItemSearchWidget(ITEM_SEARCH, - ContentType.findByAssociatedObjectType(SciProjectWithPublications.class. - getName())); - add(itemSearch); - } - - @Override - public void init(final FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(final FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - - Publication publication = (Publication) getItemSelectionModel(). - getSelectedObject(state); - - if (this.getSaveCancelSection().getSaveButton().isSelected(state)) { - SciProjectWithPublications project = - (SciProjectWithPublications) data.get( - ITEM_SEARCH); - project = (SciProjectWithPublications) project.getContentBundle(). - getInstance(publication.getLanguage()); - DataObject link = publication.add("projects", project); - link.set("publicationOrder", Integer.valueOf((int) project. - getPublications().size())); - link.save(); - } - - init(fse); - } - - @Override - public void validate(FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError(SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganization.ui.selectProject.no_project_selected")); - return; - } - - Publication publication = (Publication) getItemSelectionModel(). - getSelectedObject(state); - SciProjectWithPublications project = - (SciProjectWithPublications) data.get( - ITEM_SEARCH); - if (!(project.getContentBundle().hasInstance(publication.getLanguage()))) { - data.addError(SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganization.ui.selectProject.no_suitable_language_variant")); - return; - } - - project = (SciProjectWithPublications) project.getContentBundle().getInstance(publication.getLanguage()); - PublicationSciProjectCollection projects = new PublicationSciProjectCollection((DataCollection) publication. - get("projects")); - projects.addFilter(String.format("id = %s", project.getID().toString())); - if (projects.size() > 0) { - data.addError(SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganization.ui.selectProject.already_added")); - } - - projects.close(); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciProjectStep.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciProjectStep.java deleted file mode 100644 index cf32dda77..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciProjectStep.java +++ /dev/null @@ -1,60 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * - * @author Jens Pelzetter - */ -public class PublicationSciProjectStep extends SimpleEditStep { - - private String ADD_ORGANIZATION_SHEET_NAME = "addSciProject"; - - public PublicationSciProjectStep(final ItemSelectionModel itemModel, - final AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public PublicationSciProjectStep(final ItemSelectionModel itemModel, - final AuthoringKitWizard parent, - final String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addProjectSheet = - new PublicationSciProjectAddForm(itemModel); - add(ADD_ORGANIZATION_SHEET_NAME, - (String) SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.addOrganization").localize(), - new WorkflowLockedComponentAccess(addProjectSheet, itemModel), - addProjectSheet.getSaveCancelSection().getCancelButton()); - - PublicationSciProjectTable projectTable = - new PublicationSciProjectTable( - itemModel); - setDisplayComponent(projectTable); - } - -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciProjectTable.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciProjectTable.java deleted file mode 100644 index f6a85d9f8..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/PublicationSciProjectTable.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.PublicationSciProjectCollection; -import com.arsdigita.cms.contenttypes.SciProjectWithPublications; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.util.Assert; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; - -/** - * - * @author Jens Pelzetter - */ -public class PublicationSciProjectTable - extends Table - implements TableActionListener { - - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private ItemSelectionModel itemModel; - - public PublicationSciProjectTable(final ItemSelectionModel itemModel) { - super(); - this.itemModel = itemModel; - - setEmptyView(new Label(SciOrganizationWithPublicationsGlobalizationUtil. - globalize("sciorganizationpublication.ui.projects.none"))); - - TableColumnModel columnModel = getColumnModel(); - columnModel.add(new TableColumn( - 0, - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.projects").localize(), - TABLE_COL_EDIT)); - columnModel.add(new TableColumn( - 1, - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.projects.remove"). - localize(), TABLE_COL_DEL)); - - setModelBuilder(new PublicationSciProjectTableModelBuilder( - itemModel)); - - columnModel.get(0).setCellRenderer(new EditCellRenderer()); - columnModel.get(1).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - } - - private class PublicationSciProjectTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel itemModel; - - public PublicationSciProjectTableModelBuilder( - final ItemSelectionModel itemModel) { - this.itemModel = itemModel; - } - - public TableModel makeModel(final Table table, final PageState state) { - table.getRowSelectionModel().clearSelection(state); - Publication publication = (Publication) itemModel.getSelectedObject( - state); - return new PublicationSciProjectTableModel(table, - state, - publication); - } - } - - private class PublicationSciProjectTableModel implements TableModel { - - private Table table; - private PublicationSciProjectCollection projects; - private SciProjectWithPublications project; - - public PublicationSciProjectTableModel(final Table table, - final PageState state, - final Publication publication) { - - this.table = table; - - projects = - new PublicationSciProjectCollection((DataCollection) publication.get( - "projects")); - } - - public int getColumnCount() { - return table.getColumnModel().size(); - } - - public boolean nextRow() { - boolean ret; - - if ((projects != null) && projects.next()) { - project = projects.getOrganization(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return project.getTitle(); - case 1: - return SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganizationpublication.ui.project.remove"). - localize(); - default: - return null; - } - } - - public Object getKeyAt(int columnIndex) { - return project.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(final Table table, - final PageState state, - final Object value, - final boolean isSelected, - final Object key, - final int row, - final int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - Publication publication = (Publication) itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - publication); - - if (canEdit) { - SciProjectWithPublications project; - try { - project = - new SciProjectWithPublications((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = - new Link(String.format("%s (%s)", - value.toString(), - project.getLanguage()), - resolver.generateItemURL(state, - project, - section, - project.getVersion())); - return link; - } else { - SciProjectWithPublications project; - try { - project = - new SciProjectWithPublications((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - Label label = new Label(String.format("%s (%s)", - value.toString(), - project.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(final Table table, - final PageState state, - final Object value, - final boolean isSelected, - final Object key, - final int row, - final int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - Publication publication = (Publication) itemModel.getSelectedObject( - state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - com.arsdigita.cms.SecurityManager.DELETE_ITEM, - publication); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganizationpublication.ui.project.confirm.remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - public void cellSelected(final TableActionEvent event) { - PageState state = event.getPageState(); - - SciProjectWithPublications project = new SciProjectWithPublications( - new BigDecimal(event.getRowKey().toString())); - - Publication publication = (Publication) itemModel.getSelectedObject( - state); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (TABLE_COL_EDIT.equals(column.getHeaderKey().toString())) { - //Nothing to do - } else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) { - Assert.exists(project, SciProjectWithPublications.class); - - publication.remove("projects", project); - } - } - - public void headSelected(final TableActionEvent event) { - //Nothing to do - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsAddForm.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsAddForm.java deleted file mode 100644 index b669e25fe..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsAddForm.java +++ /dev/null @@ -1,126 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.SciDepartmentPublicationsCollection; -import com.arsdigita.cms.contenttypes.SciDepartmentWithPublications; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * - * @author Jens Pelzetter - */ -public class SciDepartmentPublicationsAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget itemSearch; - private final String ITEM_SEARCH = "publications"; - - public SciDepartmentPublicationsAddForm(final ItemSelectionModel itemModel) { - super("SciDepartmentPublicationsAddForm", itemModel); - } - - @Override - public void addWidgets() { - add(new Label((String) SciOrganizationWithPublicationsGlobalizationUtil. - globalize("sciorganization.ui.selectPublication").localize())); - itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. - findByAssociatedObjectType(Publication.class.getName())); - add(itemSearch); - } - - @Override - public void init(final FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(final FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciDepartmentWithPublications department = - (SciDepartmentWithPublications) getItemSelectionModel(). - getSelectedObject(state); - - if (this.getSaveCancelSection().getSaveButton().isSelected(state)) { - Publication publication = (Publication) data.get(ITEM_SEARCH); - publication = (Publication) publication.getContentBundle(). - getInstance(department.getLanguage()); - - department.addPublication(publication); - } - - init(fse); - } - - @Override - public void validate(final FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganization.ui.selectPublication.no_publication_selected")); - return; - } - - SciDepartmentWithPublications department = - (SciDepartmentWithPublications) getItemSelectionModel(). - getSelectedObject(state); - Publication publication = (Publication) data.get(ITEM_SEARCH); - if (!(publication.getContentBundle().hasInstance( - department.getLanguage()))) { - data.addError( - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganization.ui.selectPublication.no_suitable_language_variant")); - return; - } - - publication = (Publication) publication.getContentBundle().getInstance( - department.getLanguage()); - SciDepartmentPublicationsCollection publications = department. - getPublications(); - publications.addFilter(String.format("id = %s", publication.getID(). - toString())); - if (publications.size() > 0) { - data.addError(SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganization.ui.selectPublication.already_added")); - } - - publications.close(); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsStep.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsStep.java deleted file mode 100644 index e1d5c19f8..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsStep.java +++ /dev/null @@ -1,59 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * - * @author Jens Pelzetter - */ -public class SciDepartmentPublicationsStep extends SimpleEditStep { - - private String ADD_PUBLICATION_SHEET_NAME = "addPublication"; - - public SciDepartmentPublicationsStep(final ItemSelectionModel itemModel, - final AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciDepartmentPublicationsStep(final ItemSelectionModel itemModel, - final AuthoringKitWizard parent, - final String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addPublicationSheet = - new SciDepartmentPublicationsAddForm(itemModel); - add(ADD_PUBLICATION_SHEET_NAME, - (String) SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganization.ui.addPublication").localize(), - new WorkflowLockedComponentAccess(addPublicationSheet, itemModel), - addPublicationSheet.getSaveCancelSection().getCancelButton()); - - SciDepartmentPublicationsTable publicationTable = - new SciDepartmentPublicationsTable( - itemModel); - setDisplayComponent(publicationTable); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsTable.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsTable.java deleted file mode 100644 index e1174db8b..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentPublicationsTable.java +++ /dev/null @@ -1,281 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.SciDepartmentPublicationsCollection; -import com.arsdigita.cms.contenttypes.SciDepartmentWithPublications; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; - -/** - * - * @author Jens Pelzetter - */ -public class SciDepartmentPublicationsTable - extends Table - implements TableActionListener { - - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private ItemSelectionModel itemModel; - - public SciDepartmentPublicationsTable(final ItemSelectionModel itemModel) { - super(); - this.itemModel = itemModel; - - setEmptyView(new Label(SciOrganizationWithPublicationsGlobalizationUtil. - globalize("sciorganizationpublication.ui.publications.none"))); - - TableColumnModel columnModel = getColumnModel(); - columnModel.add(new TableColumn( - 0, - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.publication").localize(), - TABLE_COL_EDIT)); - columnModel.add(new TableColumn( - 1, - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.publication.remove"). - localize(), TABLE_COL_DEL)); - - setModelBuilder( - new SciDepartmentPublicationsTableModelBuilder(itemModel)); - - columnModel.get(0).setCellRenderer(new EditCellRenderer()); - columnModel.get(1).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - } - - private class SciDepartmentPublicationsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel itemModel; - - public SciDepartmentPublicationsTableModelBuilder( - final ItemSelectionModel itemModel) { - this.itemModel = itemModel; - } - - public TableModel makeModel(final Table table, - final PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciDepartmentWithPublications department = - (SciDepartmentWithPublications) itemModel. - getSelectedObject(state); - - return new SciDepartmentPublicationsTableModel(table, - state, - department); - } - } - - private class SciDepartmentPublicationsTableModel - implements TableModel { - - private Table table; - private SciDepartmentPublicationsCollection publications; - private Publication publication; - - public SciDepartmentPublicationsTableModel( - final Table table, - final PageState state, - final SciDepartmentWithPublications department) { - this.table = table; - publications = department.getPublications(); - } - - public int getColumnCount() { - return table.getColumnModel().size(); - } - - public boolean nextRow() { - boolean ret; - - if ((publications != null) && publications.next()) { - publication = publications.getPublication(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return publication.getTitle(); - case 1: - return SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganizationpublication.ui.publiction.remove"). - localize(); - default: - return null; - } - } - - public Object getKeyAt(int columnIndex) { - return publication.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(final Table table, - final PageState state, - final Object value, - final boolean isSelected, - final Object key, - final int row, - final int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - - SciDepartmentWithPublications department = - (SciDepartmentWithPublications) itemModel. - getSelectedObject(state); - - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - department); - - if (canEdit) { - Publication publication; - try { - publication = new Publication((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = new Link(String.format("%s (%s)", - value.toString(), - publication.getLanguage()), - resolver.generateItemURL(state, - publication, - section, - publication. - getVersion())); - - return link; - } else { - Publication publication; - try { - publication = new Publication((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - Label label = - new Label(String.format("%s (%s)", - value.toString(), - publication.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - SciDepartmentWithPublications organization = - (SciDepartmentWithPublications) itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - com.arsdigita.cms.SecurityManager.DELETE_ITEM, - organization); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganizationpublication.ui.publication.confirm.remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - public void cellSelected(final TableActionEvent event) { - PageState state = event.getPageState(); - - Publication publication = - new Publication(new BigDecimal(event.getRowKey().toString())); - - SciDepartmentWithPublications department = - (SciDepartmentWithPublications) itemModel. - getSelectedObject(state); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (TABLE_COL_EDIT.equals(column.getHeaderKey().toString())) { - //Nothing to do here - } else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) { - department.removePublication(publication); - } - } - - public void headSelected(final TableActionEvent event) { - //Nothing to do her - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentWithPublicationsPanel.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentWithPublicationsPanel.java deleted file mode 100644 index 1ab7268df..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciDepartmentWithPublicationsPanel.java +++ /dev/null @@ -1,411 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciDepartmentPublicationsCollection; -import com.arsdigita.cms.contenttypes.SciDepartmentSubDepartmentsCollection; -import com.arsdigita.cms.contenttypes.SciDepartmentWithPublications; -import com.arsdigita.cms.contenttypes.SciOrganizationWithPublications; -import com.arsdigita.cms.contenttypes.SciOrganizationWithPublicationsConfig; -import com.arsdigita.cms.contenttypes.SciPublicationTitleComparator; -import com.arsdigita.cms.contenttypes.SciPublicationYearAscComparator; -import com.arsdigita.cms.contenttypes.SciPublicationYearDescComparator; -import com.arsdigita.cms.contenttypes.ui.panels.Filter; -import com.arsdigita.cms.contenttypes.ui.panels.SelectFilter; -import com.arsdigita.cms.contenttypes.ui.panels.SortField; -import com.arsdigita.cms.contenttypes.ui.panels.TextFilter; -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.persistence.DataQuery; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.xml.Element; -import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.servlet.http.HttpServletRequest; -import org.apache.log4j.Logger; - -/** - * - * @author Jens Pelzetter - */ -public class SciDepartmentWithPublicationsPanel extends SciDepartmentPanel { - - private static final Logger logger = - Logger.getLogger( - SciDepartmentWithPublicationsPanel.class); - public static final String SHOW_PUBLICATIONS = "publications"; - public static final String SHOW_WORKING_PAPERS = "workingPapers"; - private static final String SORT = "sort"; - private static final String TITLE = "title"; - private static final String AUTHORS = "authors"; - private static final String YEAR_OF_PUBLICATION = "yearOfPublication"; - private static final String YEAR_ASC = "yearAsc"; - private static final String YEAR_DESC = "yearDesc"; - private String show; - private boolean displayPublications = true; - private boolean displayWorkingPapers = true; - private final Map filters = - new LinkedHashMap(); - private final Map> sortFields = - new LinkedHashMap>(); - private String sortByKey; - - public SciDepartmentWithPublicationsPanel() { - filters.put(TITLE, new TextFilter(TITLE, TITLE)); - filters.put(AUTHORS, new TextFilter(AUTHORS, "authors.surname")); - SelectFilter yearFilter = new SelectFilter(YEAR_OF_PUBLICATION, - YEAR_OF_PUBLICATION, - true, - true, - true, - true); - DataQuery query = SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getAllYearsOfPublication"); - yearFilter.setDataQuery(query, "yearOfPublication"); - filters.put(YEAR_OF_PUBLICATION, yearFilter); - - sortFields.put(YEAR_DESC, - new SortField(YEAR_DESC, - new SciPublicationYearDescComparator())); - sortFields.put(TITLE, - new SortField(TITLE, - new SciPublicationTitleComparator())); - sortFields.put(YEAR_ASC, - new SortField(YEAR_ASC, - new SciPublicationYearAscComparator())); - - /*sortFields.put(AUTHORS, - new SortField(AUTHORS, - new SciPublicationAuthorComparator()));*/ - } - - @Override - public Class getAllowedClass() { - return SciDepartmentWithPublications.class; - } - - @Override - protected String getPanelName() { - return SciDepartment.class.getSimpleName(); - } - - public boolean isDisplayPublications() { - return displayPublications; - } - - public void setDisplayPublications(final boolean displayPublications) { - this.displayPublications = displayPublications; - } - - public boolean isDisplayWorkingPapers() { - return displayWorkingPapers; - } - - public void setDisplayWorkingPapers(final boolean displayWorkingPapers) { - this.displayWorkingPapers = displayWorkingPapers; - } - - @Override - protected void generateAvailableDataXml(final GenericOrganizationalUnit orga, - final Element element, - final PageState state) { - SciDepartment department = (SciDepartment) orga; - - super.generateAvailableDataXml(department, element, state); - - SciOrganizationWithPublicationsConfig config = - SciOrganizationWithPublications. - getConfig(); - - SciDepartmentWithPublications dep = - (SciDepartmentWithPublications) department; - - if ((dep.hasPublications( - config.getOrganizationPublicationsMerge())) - && displayPublications) { - element.newChildElement("publications"); - } - if ((dep.hasWorkingPapers(config.getOrganizationPublicationsMerge()) - && displayWorkingPapers - && config.getDepartmentPublicationsSeparateWorkingPapers())) { - element.newChildElement("workingPapers"); - } - } - - protected void mergePublications( - final SciDepartmentSubDepartmentsCollection subDepartments, - final List publications, - final boolean workingPapersOnly, - final PageState state) { - while (subDepartments.next()) { - SciDepartment dep; - SciDepartmentWithPublications department; - SciDepartmentPublicationsCollection departmentPublications; - - dep = subDepartments.getSubDepartment(); - if (!(dep instanceof SciDepartmentWithPublications)) { - continue; - } - department = (SciDepartmentWithPublications) dep; - departmentPublications = department.getPublications(); - applyFilters(departmentPublications, state.getRequest()); - if (workingPapersOnly) { - departmentPublications.addFilter( - "objectType = 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } else if (SciOrganizationWithPublications.getConfig(). - getDepartmentPublicationsSeparateWorkingPapers()) { - departmentPublications.addFilter( - "objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } - - if (publications instanceof ArrayList) { - ((ArrayList) publications).ensureCapacity( - publications.size() - + (int) departmentPublications.size()); - } - - Publication publication; - while (departmentPublications.next()) { - publication = departmentPublications.getPublication(); - publications.add(publication); - } - - SciDepartmentSubDepartmentsCollection subSubDepartments = dep. - getSubDepartments(); - - if ((subSubDepartments != null) && subSubDepartments.size() > 0) { - mergePublications(subDepartments, - publications, - workingPapersOnly, - state); - } - } - } - - protected void generateFiltersXml( - final List publications, - final Element element) { - final Element filterElement = element.newChildElement("filters"); - - for (Map.Entry filterEntry : filters.entrySet()) { - filterEntry.getValue().generateXml(filterElement); - } - } - - protected void generateSortFieldsXml(final Element element) { - final Element sortFieldsElement = element.newChildElement("sortFields"); - sortFieldsElement.addAttribute("sortBy", sortByKey); - for (Map.Entry> sortField : - sortFields.entrySet()) { - sortField.getValue().generateXml(sortFieldsElement); - } - } - - protected void applySortFields( - final List publications, - final HttpServletRequest request) { - sortByKey = request.getParameter("sort"); - if (!sortFields.containsKey(sortByKey)) { - sortByKey = new ArrayList(sortFields.keySet()).get(0); - } - - if (sortFields.containsKey(sortByKey)) { - Comparator comparator = sortFields.get(sortByKey). - getComparator(); - Collections.sort(publications, comparator); - } else { - Collections.sort(publications, new SciPublicationTitleComparator()); - } - } - - protected void applyFilters( - final DomainCollection publications, - final HttpServletRequest request) { - //Get parameters from HTTP request - for (Map.Entry filterEntry : filters.entrySet()) { - String value = request.getParameter( - filterEntry.getValue().getLabel()); - - if ((value != null) && !(value.trim().isEmpty())) { - filterEntry.getValue().setValue(value); - } - } - - //Apply filters to DomainCollection - final StringBuilder filterBuilder = new StringBuilder(); - for (Map.Entry filterEntry : filters.entrySet()) { - if ((filterEntry.getValue().getFilter() == null) - || (filterEntry.getValue().getFilter().isEmpty())) { - continue; - } - - if (filterBuilder.length() > 0) { - filterBuilder.append(" AND "); - } - filterBuilder.append(filterEntry.getValue().getFilter()); - logger.debug(String.format("filters: %s", filterBuilder)); - if (filterBuilder.length() > 0) { - publications.addFilter(filterBuilder.toString()); - } - } - } - - protected void generatePublicationsXml(final SciDepartment department, - final Element parent, - final PageState state, - final boolean workingPapersOnly) { - final SciDepartmentWithPublications dep = - (SciDepartmentWithPublications) department; - - Element controls = parent.newChildElement("filterControls"); - controls.addAttribute("customName", "sciDepartmentPublications"); - controls.addAttribute("show", show); - - if (SciOrganizationWithPublications.getConfig(). - getOrganizationPublicationsMerge()) { - List publications; - SciDepartmentPublicationsCollection departmentPublications; - departmentPublications = dep.getPublications(); - applyFilters(departmentPublications, state.getRequest()); - if (workingPapersOnly) { - departmentPublications.addFilter( - "objectType = 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } else if (SciOrganizationWithPublications.getConfig(). - getDepartmentPublicationsSeparateWorkingPapers()) { - departmentPublications.addFilter( - "objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } - publications = - new ArrayList((int) departmentPublications.size()); - - Publication publication; - while (departmentPublications.next()) { - publication = departmentPublications.getPublication(); - publications.add(publication); - } - - mergePublications(department.getSubDepartments(), - publications, - workingPapersOnly, - state); - - Set publicationsSet; - List publicationsWithoutDoubles; - publicationsSet = new HashSet(publications); - publicationsWithoutDoubles = new LinkedList( - publicationsSet); - - applySortFields(publicationsWithoutDoubles, state.getRequest()); - - //Collections.sort(publicationsWithoutDoubles, - // new SciPublicationTitleComparator()); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(publicationsWithoutDoubles.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, publicationsWithoutDoubles. - size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - generateFiltersXml(publicationsWithoutDoubles, controls); - generateSortFieldsXml(controls); - createPaginatorElement(parent, pageNumber, pageCount, begin, end, - count, publicationsWithoutDoubles.size()); - List publicationsToShow = publicationsWithoutDoubles. - subList((int) begin, (int) end); - - for (Publication pub : publicationsToShow) { - PublicationXmlHelper xmlHelper = new PublicationXmlHelper(parent, - pub); - xmlHelper.generateXml(); - } - } else { - SciDepartmentPublicationsCollection departmentPublications; - departmentPublications = dep.getPublications(); - applyFilters(departmentPublications, state.getRequest()); - - List publications = new LinkedList(); - if (workingPapersOnly) { - departmentPublications.addFilter( - "objectType = 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } else if (SciOrganizationWithPublications.getConfig(). - getDepartmentPublicationsSeparateWorkingPapers()) { - departmentPublications.addFilter( - "objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } - - while (departmentPublications.next()) { - publications.add(departmentPublications.getPublication()); - } - - applySortFields(publications, state.getRequest()); - - //Collections.sort(publications, new SciPublicationTitleComparator()); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(publications.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, publications.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - generateFiltersXml(publications, controls); - generateSortFieldsXml(controls); - createPaginatorElement(parent, pageNumber, pageCount, begin, end, - count, publications.size()); - List publicationsToShow = publications.subList( - (int) begin, (int) end); - - for (Publication publication : publicationsToShow) { - PublicationXmlHelper xmlHelper = - new PublicationXmlHelper(parent, - publication); - xmlHelper.generateXml(); - } - } - } - - @Override - public void generateDataXml(final GenericOrganizationalUnit orga, - final Element element, - final PageState state) { - show = getShowParam(state); - - if (SHOW_PUBLICATIONS.equals(show)) { - generatePublicationsXml((SciDepartment) orga, element, state, false); - } else if (SHOW_WORKING_PAPERS.equals(show)) { - generatePublicationsXml((SciDepartment) orga, element, state, true); - } else { - super.generateDataXml(orga, element, state); - } - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciMemberDemoPanel.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciMemberDemoPanel.java deleted file mode 100644 index bec7137d0..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciMemberDemoPanel.java +++ /dev/null @@ -1,270 +0,0 @@ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.xml.Element; -import com.arsdigita.cms.contenttypes.SciMember; -import com.arsdigita.persistence.DataCollection; -import com.arsdigita.persistence.DataQuery; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.persistence.Session; -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.ui.panels.Filter; -import com.arsdigita.cms.contenttypes.ui.panels.TextFilter; -import com.arsdigita.cms.contenttypes.ui.panels.SelectFilter; -import com.arsdigita.cms.contenttypes.ui.panels.CollectionSortField; -import java.util.ArrayList; -import java.util.Map; -import java.util.LinkedHashMap; -import javax.servlet.http.HttpServletRequest; -import org.apache.log4j.Logger; - -/** - * - * @author Jens Pelzetter - */ -public class SciMemberDemoPanel extends CompoundContentItemPanel { - - private static final Logger logger = Logger.getLogger( - SciMemberDemoPanel.class); - private static final String SHOW_PUBLICATIONS = "publications"; - private static final String SHOW_PROJECTS = "projects"; - private static final String TITLE = "title"; - private static final String AUTHORS = "authors"; - private static final String YEAR_OF_PUBLICATION = "yearOfPublication"; - private static final String YEAR_ASC = "yearAsc"; - private static final String YEAR_DESC = "yearDesc"; - private static final String TYPE = "type"; - private String show; - private final Map filters = - new LinkedHashMap(); - private final Map sortFields = - new LinkedHashMap(); - private String sortByKey; - - public SciMemberDemoPanel() { - filters.put(TITLE, new TextFilter(TITLE, TITLE)); - filters.put(AUTHORS, new TextFilter(AUTHORS, "authors.surname")); - SelectFilter yearFilter = new SelectFilter(YEAR_OF_PUBLICATION, - YEAR_OF_PUBLICATION, - true, - true, - true, - true); - filters.put(YEAR_OF_PUBLICATION, yearFilter); - SelectFilter typeFilter = new SelectFilter(TYPE, - "objectType", - false, - true, - true, - false); - filters.put(TYPE, typeFilter); - sortFields.put(TITLE, - new CollectionSortField(TITLE, "title")); - sortFields.put(YEAR_ASC, - new CollectionSortField(YEAR_ASC, "year asc")); - sortFields.put(YEAR_DESC, - new CollectionSortField(YEAR_DESC, "year desc")); - } - - @Override - protected String getDefaultShowParam() { - return "publications"; - } - - @Override - protected Class getAllowedClass() { - return SciMember.class; - } - - protected void generatePublicationsXml(final SciMember member, - final Element parent, - final PageState state) { - - Element controls = parent.newChildElement("filterControls"); - controls.addAttribute("customName", "sciOrganizationPublications"); - controls.addAttribute("show", show); - - DataQuery yearQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getAllYearsOfPublicationForAuthor"); - yearQuery.setParameter("author", member.getID()); - ((SelectFilter) filters.get(YEAR_OF_PUBLICATION)).setDataQuery(yearQuery, - "yearOfPublication"); - DataQuery typeQuery = - SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getAllPublicationTypesForAuthor"); - typeQuery.setParameter("author", member.getID()); - ((SelectFilter) filters.get(TYPE)).setDataQuery(typeQuery, "objectType"); - - DataCollection publicationsData = (DataCollection) member.get( - "publication"); - DomainCollection publications = new DomainCollection(publicationsData); -// publications.addOrder("yearOfPublication desc"); - - applyPublicationsFilter(publications, state.getRequest()); - applyPublicationSortFields(publications, state.getRequest()); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(publications.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, publications.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - generatePublicationFiltersXml(controls); - generatePublicationSortFieldsXml(controls); - createPaginatorElement(parent, pageNumber, pageCount, begin, end, count, - publications.size()); - System.out.printf("\n\n\npublications.size = %d\n", publications.size()); - if ((publications.size() <= 1) || publications.isEmpty()) { - return; - } - - if (publications.size() == 1) { - publications.setRange((int) begin, (int) end); - } else { - publications.setRange((int) begin + 1, (int) end); - } - - while (publications.next()) { - /*Publication publication = (Publication) DomainObjectFactory. - newInstance(publications.getDomainObject().getOID());*/ - PublicationXmlHelper xmlHelper = - new PublicationXmlHelper(parent, - (Publication) publications. - getDomainObject()); - xmlHelper.generateXml(); - } - } - - protected void generateProjectsXml(final SciMember member, - final Element parent, - final PageState state) { - /*DataCollection projectsData = (DataCollection) member.get("project"); - DomainCollection projects = new DomainCollection(projectsData); - projects.addOrder("title"); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(projects.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, projects.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - createPaginatorElement(parent, pageNumber, pageCount, begin, end, count, - projects.size());*/ - } - - protected void generatePublicationFiltersXml(final Element element) { - final Element filterElement = element.newChildElement("filters"); - - for (Map.Entry filterEntry : filters.entrySet()) { - filterEntry.getValue().generateXml(filterElement); - } - } - - protected void generatePublicationSortFieldsXml(final Element element) { - final Element sortFieldsElement = element.newChildElement("sortFields"); - sortFieldsElement.addAttribute("sortBy", sortByKey); - for (Map.Entry sortField : sortFields. - entrySet()) { - sortField.getValue().generateXml(sortFieldsElement); - } - } - - protected void applyPublicationsFilter(final DomainCollection publications, - final HttpServletRequest request) { - for (Map.Entry filterEntry : filters.entrySet()) { - String value = request.getParameter( - filterEntry.getValue().getLabel()); - - if ((value != null) && !(value.trim().isEmpty())) { - filterEntry.getValue().setValue(value); - } - } - - final StringBuilder filterBuilder = new StringBuilder(); - for (Map.Entry filterEntry : filters.entrySet()) { - if ((filterEntry.getValue().getFilter() == null) - || (filterEntry.getValue().getFilter().isEmpty())) { - continue; - } - - if (filterBuilder.length() > 0) { - filterBuilder.append(" AND "); - } - filterBuilder.append(filterEntry.getValue().getFilter()); - logger.debug(String.format("filters: %s", filterBuilder)); - if (filterBuilder.length() > 0) { - publications.addFilter(filterBuilder.toString()); - } - } - } - - protected void applyPublicationSortFields( - final DomainCollection publications, - final HttpServletRequest request) { - sortByKey = request.getParameter("sort"); - if (!sortFields.containsKey(sortByKey)) { - sortByKey = new ArrayList(sortFields.keySet()).get(0); - } - - publications.addOrder(sortFields.get(sortByKey).getField()); - } - - protected void generateAvailableDataXml(final SciMember member, - final Element element, - final PageState state) { - Session session = SessionManager.getSession(); - DataQuery hasPublicationsQuery = - session.retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfPublicationsOfSciMember"); - hasPublicationsQuery.setParameter("author", member.getID().toString()); - - if (hasPublicationsQuery.size() > 0) { - element.newChildElement("publications"); - } - hasPublicationsQuery.close(); - - DataQuery hasProjectsQuery = session.retrieveQuery( - "com.arsdigita.cms.contenttypes.getIdsOfProjectsOfSciMember"); - hasProjectsQuery.setParameter("member", member.getID().toString()); - - if (hasProjectsQuery.size() > 0) { - element.newChildElement("projects"); - } - hasProjectsQuery.close(); - - } - - public void generateDataXml(final SciMember member, - final Element element, - final PageState state) { - show = getShowParam(state); - - if (SHOW_PUBLICATIONS.equals(show)) { - generatePublicationsXml(member, element, state); - } else if (SHOW_PROJECTS.equals(show)) { - generateProjectsXml(member, element, state); - } - - } - - @Override - public void generateXML(final ContentItem item, - final Element element, - final PageState state) { - Element content = generateBaseXML(item, element, state); - - SciMember member = (SciMember) item; - Element availableData = content.newChildElement("availableData"); - - if (!(isShowOnlyDefault())) { - generateAvailableDataXml(member, availableData, state); - } - - generateDataXml(member, content, state); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPublicationsAddForm.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPublicationsAddForm.java deleted file mode 100644 index 8d50e8642..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPublicationsAddForm.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.SciOrganizationPublicationsCollection; -import com.arsdigita.cms.contenttypes.SciOrganizationWithPublications; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * - * @author Jens Pelzetter - */ -public class SciOrganizationPublicationsAddForm - extends BasicItemForm - implements FormProcessListener, - FormInitListener { - - private ItemSearchWidget itemSearch; - private final String ITEM_SEARCH = "publications"; - - public SciOrganizationPublicationsAddForm(final ItemSelectionModel itemModel) { - super("SciOrganizationPublicationsAddForm", itemModel); - } - - @Override - public void addWidgets() { - add(new Label((String) SciOrganizationWithPublicationsGlobalizationUtil. - globalize("sciorganization.ui.selectPublication").localize())); - itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. - findByAssociatedObjectType(Publication.class.getName())); - add(itemSearch); - } - - @Override - public void init(final FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(final FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciOrganizationWithPublications organization = - (SciOrganizationWithPublications) getItemSelectionModel(). - getSelectedObject(state); - - if (this.getSaveCancelSection().getSaveButton().isSelected(state)) { - Publication publication = (Publication) data.get(ITEM_SEARCH); - publication = (Publication) publication.getContentBundle(). - getInstance(organization.getLanguage()); - organization.addPublication(publication); - } - - init(fse); - } - - @Override - public void validate(final FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganization.ui.selectPublication.no_publication_selected")); - return; - } - - SciOrganizationWithPublications organization = - (SciOrganizationWithPublications) getItemSelectionModel(). - getSelectedObject(state); - Publication publication = (Publication) data.get(ITEM_SEARCH); - if (!(publication.getContentBundle().hasInstance( - organization.getLanguage()))) { - data.addError( - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganization.ui.selectPublication.no_suitable_language_variant")); - return; - } - - publication = (Publication) publication.getContentBundle().getInstance( - organization.getLanguage()); - SciOrganizationPublicationsCollection publications = organization. - getPublications(); - publications.addFilter(String.format("id = %s", publication.getID(). - toString())); - if (publications.size() > 0) { - data.addError(SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganization.ui.selectPublication.already_added")); - } - - publications.close(); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPublicationsStep.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPublicationsStep.java deleted file mode 100644 index c55c11340..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPublicationsStep.java +++ /dev/null @@ -1,58 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * - * @author Jens Pelzetter - */ -public class SciOrganizationPublicationsStep extends SimpleEditStep { - - private String ADD_PUBLICATION_SHEET_NAME = "addPublication"; - - public SciOrganizationPublicationsStep(final ItemSelectionModel itemModel, - final AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciOrganizationPublicationsStep(final ItemSelectionModel itemModel, - final AuthoringKitWizard parent, - final String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addPublicationSheet = new SciOrganizationPublicationsAddForm(itemModel); - add(ADD_PUBLICATION_SHEET_NAME, - (String) SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.addPublication").localize(), - new WorkflowLockedComponentAccess(addPublicationSheet, itemModel), - addPublicationSheet.getSaveCancelSection().getCancelButton()); - - SciOrganizationPublicationsTable publicationTable = new SciOrganizationPublicationsTable(itemModel); - setDisplayComponent(publicationTable); - - } - -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPublicationsTable.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPublicationsTable.java deleted file mode 100644 index d18ab28ba..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationPublicationsTable.java +++ /dev/null @@ -1,279 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.SciOrganizationPublicationsCollection; -import com.arsdigita.cms.contenttypes.SciOrganizationWithPublications; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; - -/** - * - * @author Jens Pelzetter - */ -public class SciOrganizationPublicationsTable - extends Table - implements TableActionListener { - - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private ItemSelectionModel itemModel; - - public SciOrganizationPublicationsTable(final ItemSelectionModel itemModel) { - super(); - this.itemModel = itemModel; - - setEmptyView(new Label(SciOrganizationWithPublicationsGlobalizationUtil. - globalize("sciorganizationpublication.ui.publications.none"))); - - TableColumnModel columnModel = getColumnModel(); - columnModel.add(new TableColumn( - 0, - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.publication").localize(), - TABLE_COL_EDIT)); - columnModel.add(new TableColumn( - 1, - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.publication.remove"). - localize(), TABLE_COL_DEL)); - - setModelBuilder(new SciOrganizationPublicationsTableModelBuilder( - itemModel)); - - columnModel.get(0).setCellRenderer(new EditCellRenderer()); - columnModel.get(1).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - } - - private class SciOrganizationPublicationsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel itemModel; - - public SciOrganizationPublicationsTableModelBuilder( - final ItemSelectionModel itemModel) { - this.itemModel = itemModel; - } - - public TableModel makeModel(final Table table, final PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciOrganizationWithPublications organization = - (SciOrganizationWithPublications) itemModel. - getSelectedObject(state); - - return new SciOrganizationPublicationsTableModel(table, - state, - organization); - } - } - - private class SciOrganizationPublicationsTableModel implements TableModel { - - private Table table; - private SciOrganizationPublicationsCollection publications; - private Publication publication; - - public SciOrganizationPublicationsTableModel( - final Table table, - final PageState state, - final SciOrganizationWithPublications organization) { - this.table = table; - publications = organization.getPublications(); - } - - public int getColumnCount() { - return table.getColumnModel().size(); - } - - public boolean nextRow() { - boolean ret; - - if ((publications != null) && publications.next()) { - publication = publications.getPublication(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - public Object getElementAt(final int columnIndex) { - switch (columnIndex) { - case 0: - return publication.getTitle(); - case 1: - return SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganizationpublication.ui.publiction.remove"). - localize(); - default: - return null; - } - } - - public Object getKeyAt(final int columnIndex) { - return publication.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(final Table table, - final PageState state, - final Object value, - final boolean isSelected, - final Object key, - final int row, - final int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - SciOrganizationWithPublications organization = - (SciOrganizationWithPublications) itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - organization); - - if (canEdit) { - Publication publication; - try { - publication = new Publication((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = new Link(String.format("%s (%s)", - value.toString(), - publication.getLanguage()), - resolver.generateItemURL(state, - publication, - section, - publication. - getVersion())); - - return link; - } else { - Publication publication; - try { - publication = new Publication((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - Label label = - new Label(String.format("%s (%s)", - value.toString(), - publication.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - SciOrganizationWithPublications organization = - (SciOrganizationWithPublications) itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - com.arsdigita.cms.SecurityManager.DELETE_ITEM, - organization); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganizationpublication.ui.publication.confirm.remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - @Override - public void cellSelected(final TableActionEvent event) { - PageState state = event.getPageState(); - - Publication publication = - new Publication(new BigDecimal(event.getRowKey().toString())); - - SciOrganizationWithPublications organization = - (SciOrganizationWithPublications) itemModel. - getSelectedObject(state); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (TABLE_COL_EDIT.equals(column.getHeaderKey().toString())) { - //Nothing to do here - } else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) { - organization.removePublication(publication); - } - } - - @Override - public void headSelected(final TableActionEvent event) { - //Nothing to do. - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsGlobalizationUtil.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsGlobalizationUtil.java deleted file mode 100644 index 7894140f1..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsGlobalizationUtil.java +++ /dev/null @@ -1,41 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.contentassets.ui.*; -import com.arsdigita.globalization.GlobalizedMessage; - -/** - * - * @author Jens Pelzetter - */ -public class SciOrganizationWithPublicationsGlobalizationUtil { - - public static final String BUNDLE_NAME = - "com.arsdigita.cms.contenttypes.ui.SciOrganizationWithPublicationsResources"; - - public static GlobalizedMessage globalize(String key) { - return new GlobalizedMessage(key, BUNDLE_NAME); - } - - public static GlobalizedMessage globalize(String key, Object[] args) { - return new GlobalizedMessage(key, BUNDLE_NAME, args); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsPanel.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsPanel.java deleted file mode 100644 index d12918f87..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsPanel.java +++ /dev/null @@ -1,446 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.SciDepartment; -import com.arsdigita.cms.contenttypes.SciDepartmentPublicationsCollection; -import com.arsdigita.cms.contenttypes.SciDepartmentSubDepartmentsCollection; -import com.arsdigita.cms.contenttypes.SciDepartmentWithPublications; -import com.arsdigita.cms.contenttypes.SciOrganization; -import com.arsdigita.cms.contenttypes.SciOrganizationDepartmentsCollection; -import com.arsdigita.cms.contenttypes.SciOrganizationPublicationsCollection; -import com.arsdigita.cms.contenttypes.SciOrganizationWithPublications; -import com.arsdigita.cms.contenttypes.SciOrganizationWithPublicationsConfig; -import com.arsdigita.cms.contenttypes.SciPublicationTitleComparator; -import com.arsdigita.cms.contenttypes.SciPublicationYearAscComparator; -import com.arsdigita.cms.contenttypes.SciPublicationYearDescComparator; -import com.arsdigita.cms.contenttypes.ui.panels.Filter; -import com.arsdigita.cms.contenttypes.ui.panels.SelectFilter; -import com.arsdigita.cms.contenttypes.ui.panels.SortField; -import com.arsdigita.cms.contenttypes.ui.panels.TextFilter; -import com.arsdigita.domain.DomainCollection; -import com.arsdigita.persistence.DataQuery; -import com.arsdigita.persistence.SessionManager; -import com.arsdigita.xml.Element; -import java.util.ArrayList; -import java.util.Collection; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedHashMap; -import java.util.LinkedList; -import java.util.List; -import java.util.Map; -import java.util.Set; -import javax.servlet.http.HttpServletRequest; -import org.apache.log4j.Logger; - -/** - * - * @author Jens Pelzetter - */ -public class SciOrganizationWithPublicationsPanel extends SciOrganizationPanel { - - private static final Logger logger = - Logger.getLogger( - SciOrganizationWithPublicationsPanel.class); - public static final String SHOW_PUBLICATIONS = "publications"; - public static final String SHOW_WORKING_PAPERS = "workingPapers"; - private static final String SORT = "sort"; - private static final String TITLE = "title"; - private static final String AUTHORS = "authors"; - private static final String YEAR_OF_PUBLICATION = "yearOfPublication"; - private static final String YEAR_ASC = "yearAsc"; - private static final String YEAR_DESC = "yearDesc"; - private String show; - private boolean displayPublications = true; - private boolean displayWorkingPapers = true; - private final Map filters = - new LinkedHashMap(); - private final Map> sortFields = - new LinkedHashMap>(); - private String sortByKey; - - public SciOrganizationWithPublicationsPanel() { - filters.put(TITLE, new TextFilter(TITLE, TITLE)); - filters.put(AUTHORS, new TextFilter(AUTHORS, "authors.surname")); - SelectFilter yearFilter = new SelectFilter(YEAR_OF_PUBLICATION, - YEAR_OF_PUBLICATION, - true, - true, - true, - true); - DataQuery query = SessionManager.getSession().retrieveQuery( - "com.arsdigita.cms.contenttypes.getAllYearsOfPublication"); - yearFilter.setDataQuery(query, "yearOfPublication"); - filters.put(YEAR_OF_PUBLICATION, yearFilter); - sortFields.put(TITLE, - new SortField(TITLE, - new SciPublicationTitleComparator())); - sortFields.put(YEAR_ASC, - new SortField(YEAR_ASC, - new SciPublicationYearAscComparator())); - sortFields.put(YEAR_DESC, - new SortField(YEAR_DESC, - new SciPublicationYearDescComparator())); - /*sortFields.put(AUTHORS, - new SortField(AUTHORS, - new SciPublicationAuthorComparator()));*/ - } - - @Override - protected Class getAllowedClass() { - return SciOrganizationWithPublications.class; - } - - @Override - protected String getPanelName() { - return SciOrganization.class.getSimpleName(); - } - - public boolean isDisplayPublications() { - return displayPublications; - } - - public void setDisplayPublications(final boolean displayPublications) { - this.displayPublications = displayPublications; - } - - public boolean isDisplayWorkingPapers() { - return displayWorkingPapers; - } - - public void setDisplayWorkingPapers(final boolean displayWorkingPapers) { - this.displayWorkingPapers = displayWorkingPapers; - } - - @Override - protected void generateAvailableDataXml( - final GenericOrganizationalUnit organization, - final Element element, - final PageState state) { - super.generateAvailableDataXml(organization, element, state); - - SciOrganizationWithPublicationsConfig config; - config = SciOrganizationWithPublications.getConfig(); - - SciOrganizationWithPublications orga = - (SciOrganizationWithPublications) organization; - - long start = System.currentTimeMillis(); - if ((orga.hasPublications(config.getOrganizationPublicationsMerge())) - && displayPublications) { - element.newChildElement("publications"); - } - if ((orga.hasWorkingPapers(config.getOrganizationPublicationsMerge())) - && displayWorkingPapers - && config.getOrganizationPublicationsSeparateWorkingPapers()) { - element.newChildElement("workingPapers"); - } - - System.out.printf( - "\n\nNeeded %d ms to determine if organization has publications\n\n", - System.currentTimeMillis() - start); - } - - protected void mergePublications( - final SciOrganizationDepartmentsCollection departments, - final Collection publications, - final boolean workingPapersOnly, - final PageState state) { - while (departments.next()) { - SciDepartment dep; - SciDepartmentWithPublications department; - SciDepartmentPublicationsCollection departmentPublications; - - dep = departments.getDepartment(); - if (!(dep instanceof SciDepartmentWithPublications)) { - continue; - } - department = (SciDepartmentWithPublications) dep; - departmentPublications = department.getPublications(); - applyPublicationFilters(departmentPublications, state.getRequest()); - if (workingPapersOnly) { - departmentPublications.addFilter( - "objectType = 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } else if (SciOrganizationWithPublications.getConfig(). - getOrganizationPublicationsSeparateWorkingPapers()) { - departmentPublications.addFilter( - "objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } - - if (publications instanceof ArrayList) { - ((ArrayList) publications).ensureCapacity( - publications.size() - + (int) departmentPublications.size()); - } - - Publication publication; - while (departmentPublications.next()) { - publication = departmentPublications.getPublication(); - publications.add(publication); - } - - SciDepartmentSubDepartmentsCollection subDepartments; - subDepartments = dep.getSubDepartments(); - - if ((subDepartments != null) && subDepartments.size() > 0) { - mergePublications(departments, - publications, - workingPapersOnly, - state); - } - } - } - - protected void generatePublicationFiltersXml( - final List publications, - final Element element) { - final Element filterElement = element.newChildElement("filters"); - - for (Map.Entry filterEntry : filters.entrySet()) { - filterEntry.getValue().generateXml(filterElement); - } - } - - protected void generatePublicationSortFieldsXml(final Element element) { - final Element sortFieldsElement = element.newChildElement("sortFields"); - sortFieldsElement.addAttribute("sortBy", sortByKey); - for (Map.Entry> sortField : - sortFields.entrySet()) { - sortField.getValue().generateXml(sortFieldsElement); - } - } - - protected void applyPublicationSortFields( - final List publications, - final HttpServletRequest request) { - sortByKey = request.getParameter("sort"); - if (!sortFields.containsKey(sortByKey)) { - sortByKey = new ArrayList(sortFields.keySet()).get(0); - } - - if (sortFields.containsKey(sortByKey)) { - Collections.sort(publications, sortFields.get(sortByKey). - getComparator()); - } else { - Collections.sort(publications, new SciPublicationTitleComparator()); - } - } - - protected void applyPublicationFilters( - final DomainCollection publications, - final HttpServletRequest request) { - //Get parameters from HTTP request - for (Map.Entry filterEntry : filters.entrySet()) { - String value = request.getParameter( - filterEntry.getValue().getLabel()); - - if ((value != null) && !(value.trim().isEmpty())) { - filterEntry.getValue().setValue(value); - } - } - - //Apply filters to DomainCollection - final StringBuilder filterBuilder = new StringBuilder(); - for (Map.Entry filterEntry : filters.entrySet()) { - if ((filterEntry.getValue().getFilter() == null) - || (filterEntry.getValue().getFilter().isEmpty())) { - continue; - } - - if (filterBuilder.length() > 0) { - filterBuilder.append(" AND "); - } - filterBuilder.append(filterEntry.getValue().getFilter()); - logger.debug(String.format("filters: %s", filterBuilder)); - if (filterBuilder.length() > 0) { - publications.addFilter(filterBuilder.toString()); - } - } - } - - protected void generatePublicationsXml(final SciOrganization organization, - final Element parent, - final PageState state, - final boolean workingPapersOnly) { - final SciOrganizationWithPublications orga = - (SciOrganizationWithPublications) organization; - - Element controls = parent.newChildElement("filterControls"); - controls.addAttribute("customName", "sciOrganizationPublications"); - controls.addAttribute("show", show); - - if (SciOrganizationWithPublications.getConfig(). - getOrganizationPublicationsMerge()) { - long start = System.currentTimeMillis(); - List publications; - SciOrganizationPublicationsCollection orgaPublications; - orgaPublications = orga.getPublications(); - applyPublicationFilters(orgaPublications, state.getRequest()); - if (workingPapersOnly) { - orgaPublications.addFilter( - "objectType = 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } else if (SciOrganizationWithPublications.getConfig(). - getOrganizationPublicationsSeparateWorkingPapers()) { - orgaPublications.addFilter( - "objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } - publications = new ArrayList((int) orgaPublications. - size()); - - Publication publication; - while (orgaPublications.next()) { - publication = orgaPublications.getPublication(); - publications.add(publication); - } - - System.out.printf("Got publications of organization in %d ms\n", - System.currentTimeMillis() - start); - - SciOrganizationDepartmentsCollection departments = organization. - getDepartments(); - long mergeStart = System.currentTimeMillis(); - mergePublications(departments, - publications, - workingPapersOnly, - state); - System.err.printf("Merged publications in %d ms\n", System. - currentTimeMillis() - mergeStart); - - long sortStart = System.currentTimeMillis(); - Set publicationsSet; - List publicationsWithoutDoubles; - publicationsSet = new HashSet(publications); - publicationsWithoutDoubles = new LinkedList( - publicationsSet); - - - applyPublicationSortFields(publicationsWithoutDoubles, state. - getRequest()); - - //Collections.sort(publicationsWithoutDoubles, - // new SciPublicationTitleComparator()); - System.out.printf("Sorted publications in %d ms\n", System. - currentTimeMillis() - sortStart); - - long paginatorStart = System.currentTimeMillis(); - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(publicationsWithoutDoubles.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, - publicationsWithoutDoubles.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - generatePublicationFiltersXml(publicationsWithoutDoubles, controls); - generatePublicationSortFieldsXml(controls); - createPaginatorElement(parent, pageNumber, pageCount, begin, end, - count, publicationsWithoutDoubles.size()); - System.out.printf("Created paginator in %d ms", System. - currentTimeMillis() - paginatorStart); - List publicationsToShow = publicationsWithoutDoubles. - subList((int) begin, (int) end); - - System.out.printf( - "\n\nCreated list of publications to show in %d ms.\n\n", - System.currentTimeMillis() - start); - - start = System.currentTimeMillis(); - - for (Publication pub : publicationsToShow) { - PublicationXmlHelper xmlHelper = - new PublicationXmlHelper(parent, - pub); - xmlHelper.generateXml(); - } - - System.out.printf("\n\nGenerated publications XML in %d ms\n\n", - System.currentTimeMillis() - start); - } else { - SciOrganizationPublicationsCollection orgaPublications; - orgaPublications = orga.getPublications(); - applyPublicationFilters(orgaPublications, state.getRequest()); - if (workingPapersOnly) { - orgaPublications.addFilter( - "objectType = 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } else if (SciOrganizationWithPublications.getConfig(). - getOrganizationPublicationsSeparateWorkingPapers()) { - orgaPublications.addFilter( - "objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } - - List publications = new LinkedList(); - - while (orgaPublications.next()) { - publications.add(orgaPublications.getPublication()); - } - - applyPublicationSortFields(publications, state.getRequest()); - - //Collections.sort(publications, new SciPublicationTitleComparator()); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(publications.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, publications.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - generatePublicationFiltersXml(publications, controls); - generatePublicationSortFieldsXml(controls); - createPaginatorElement(parent, pageNumber, pageCount, begin, end, - count, publications.size()); - List publicationsToShow = publications.subList( - (int) begin, (int) end); - - for (Publication publication : publicationsToShow) { - PublicationXmlHelper xmlHelper = - new PublicationXmlHelper(parent, - publication); - xmlHelper.generateXml(); - } - } - } - - @Override - protected void generateDataXml(final GenericOrganizationalUnit organization, - final Element element, - final PageState state) { - show = getShowParam(state); - - if (SHOW_PUBLICATIONS.equals(show)) { - generatePublicationsXml((SciOrganization) organization, - element, - state, - false); - } else if (SHOW_WORKING_PAPERS.equals(show)) { - generatePublicationsXml((SciOrganization) organization, - element, - state, - true); - } else { - super.generateDataXml(organization, element, state); - } - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsResources.properties b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsResources.properties deleted file mode 100644 index 4ec4dd842..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsResources.properties +++ /dev/null @@ -1,35 +0,0 @@ - -sciorganizationpublication.ui.publicationsOfOrganization=Publications of the organization -sciorganizationpublication.ui.publicationsOfDepartment=Publications of the department -sciorganizationpublication.ui.publicationsOfProject=Publications of the project -sciorganizationpublication.ui.organizationsOfPublication=Organizations -sciorganizationpublication.ui.organization=Organization -sciorganizationpublication.ui.organization.remove=Remove orgnization -sciorganizationpublication.ui.addOrganization=Add organization -sciorganizationpublication.ui.publication=Publication -sciorganizationpublication.ui.publication.remove=Remove publication -sciorganizationpublication.ui.addPublication=Add publication -sciorganizationpublication.ui.publications.none=No publications found -sciorganizationpublication.ui.organization.publications.title=Publications -sciorganizationpublication.ui.organization.publications.description=Publications -sciorganizationpublication.ui.department.publications.title=Publications -sciorganizationpublication.ui.department.publications.description=Publications -sciorganizationpublication.ui.project.publications.title=Publications -sciorganizationpublication.ui.project.publications.description=Publications -sciorganizationpublication.ui.publication.projects.title=Lists of publications (Projects) -sciorganizationpublication.ui.publication.projects.description=Lists of publications (Projects) -sciorganizationpublication.ui.publication.organization.title=Lists of publications (Organizations) -sciorganizationpublication.ui.publication.organization.description=Lists of publications (Organizations) -sciorganizationpublication.ui.publication.departments.title=Lists of publications (Departments) -sciorganizationpublication.ui.publication.departments.description=Lists of publications (Departments) -sciorganization.ui.selectPublication=Select publication -sciorganizationpublication.ui.publiction.remove=Remove publication -sciorganizationpublication.ui.organizations.none=This publication is not part of any publication list of a organization -sciorganization.ui.selectOrganization=Select organization -sciorganization.ui.addPublication=Add publication -sciorganizationpublication.ui.departments.none=This publication is not part of any publication list of a department -sciorganizationpublication.ui.addDepartment=Add publication to publication list of a department -sciorganization.ui.selectDepartment=Select department -sciorganizationpublication.ui.projects.none=This publication is not part of any publication list of a project -sciorganizationpublication.ui.project.addPublication=Add publication to publication list of a project -sciorganization.ui.selectProject=Select project diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsResources_de.properties b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsResources_de.properties deleted file mode 100644 index 3b047dff7..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciOrganizationWithPublicationsResources_de.properties +++ /dev/null @@ -1,35 +0,0 @@ - -sciorganizationpublication.ui.publicationsOfOrganization=Publikationen der Organisation -sciorganizationpublication.ui.publicationsOfDepartment=Publikationen der Abteilung -sciorganizationpublication.ui.publicationsOfProject=Publikationen des Projektes -sciorganizationpublication.ui.organizationsOfPublication=Beteiligte Organizationen -sciorganizationpublication.ui.organization=Organisation -sciorganizationpublication.ui.organization.remove=Organisation entfernen -sciorganizationpublication.ui.addOrganization=Organisation hinzuf\u00fcgen -sciorganizationpublication.ui.publication=Publikation -sciorganizationpublication.ui.publication.remove=Publikation entfernen -sciorganizationpublication.ui.addPublication=Publikation hinzuf\u00fcgen -sciorganizationpublication.ui.publications.none=Keine Publikationen gefunden -sciorganizationpublication.ui.organization.publications.title=Publikationen -sciorganizationpublication.ui.organization.publications.description=Publikationen -sciorganizationpublication.ui.department.publications.title=Publikationen -sciorganizationpublication.ui.department.publications.description=Publikationen -sciorganizationpublication.ui.project.publications.title=Publikationen -sciorganizationpublication.ui.project.publications.description=Publikationen -sciorganizationpublication.ui.publication.projects.title=Publikationslisten (Projekte) -sciorganizationpublication.ui.publication.projects.description=Publikationslisten (Projekte) -sciorganizationpublication.ui.publication.organization.title=Publikationslisten (Organisationen) -sciorganizationpublication.ui.publication.organization.description=Publikationslisten (Organisationen) -sciorganizationpublication.ui.publication.departments.title=Publikationslisten (Abteilungen) -sciorganizationpublication.ui.publication.departments.description=Publikationslisten (Abteilungen) -sciorganization.ui.selectPublication=Publikation w\u00e4hlen -sciorganizationpublication.ui.publiction.remove=Publikation entfernen -sciorganizationpublication.ui.organizations.none=Diese Publikation ist nicht Teil einer Publikationsliste einer Organisation -sciorganization.ui.selectOrganization=Organisation w\u00e4hlen -sciorganization.ui.addPublication=Publikation hinzuf\u00fcgen -sciorganizationpublication.ui.departments.none=Diese Publikation ist nicht Teil einer Publikationsliste einer Abteilung -sciorganizationpublication.ui.addDepartment=Publikation der Publikationsliste einer Abteilung hinzuf\u00fcgen -sciorganization.ui.selectDepartment=Abteilung w\u00e4hlen -sciorganizationpublication.ui.projects.none=Diese Publikation ist nicht Teil einer Publikationsliste eines Projektes -sciorganizationpublication.ui.project.addPublication=Publikation der Publikationsliste eines Projektes hinzuf\u00fcgen -sciorganization.ui.selectProject=Projekt w\u00e4hlen diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsAddForm.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsAddForm.java deleted file mode 100644 index ee51c5bd9..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsAddForm.java +++ /dev/null @@ -1,125 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.FormData; -import com.arsdigita.bebop.FormProcessException; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.event.FormInitListener; -import com.arsdigita.bebop.event.FormProcessListener; -import com.arsdigita.bebop.event.FormSectionEvent; -import com.arsdigita.cms.ContentType; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.SciProjectPublicationsCollection; -import com.arsdigita.cms.contenttypes.SciProjectWithPublications; -import com.arsdigita.cms.ui.ItemSearchWidget; -import com.arsdigita.cms.ui.authoring.BasicItemForm; - -/** - * - * @author Jens Pelzetter - */ -public class SciProjectPublicationsAddForm - extends BasicItemForm - implements FormInitListener, - FormProcessListener { - - private ItemSearchWidget itemSearch; - private final String ITEM_SEARCH = "publications"; - - public SciProjectPublicationsAddForm(final ItemSelectionModel itemModel) { - super("SciProjectPublicationsAddForm", itemModel); - } - - @Override - public void addWidgets() { - add(new Label((String) SciOrganizationWithPublicationsGlobalizationUtil. - globalize("sciorganization.ui.selectPublication").localize())); - itemSearch = new ItemSearchWidget(ITEM_SEARCH, ContentType. - findByAssociatedObjectType(Publication.class.getName())); - add(itemSearch); - } - - @Override - public void init(final FormSectionEvent fse) throws FormProcessException { - PageState state = fse.getPageState(); - - setVisible(state, true); - } - - @Override - public void process(final FormSectionEvent fse) throws FormProcessException { - FormData data = fse.getFormData(); - PageState state = fse.getPageState(); - SciProjectWithPublications project = - (SciProjectWithPublications) getItemSelectionModel(). - getSelectedObject(state); - - if (this.getSaveCancelSection().getSaveButton().isSelected(state)) { - Publication publication = (Publication) data.get(ITEM_SEARCH); - publication = (Publication) publication.getContentBundle(). - getInstance(project.getLanguage()); - project.addPublication(publication); - } - - init(fse); - } - - @Override - public void validate(final FormSectionEvent fse) throws FormProcessException { - final PageState state = fse.getPageState(); - final FormData data = fse.getFormData(); - - if (data.get(ITEM_SEARCH) == null) { - data.addError( - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciproject.ui.selectPublication.no_publication_selected")); - return; - } - - SciProjectWithPublications project = - (SciProjectWithPublications) getItemSelectionModel(). - getSelectedObject(state); - Publication publication = (Publication) data.get(ITEM_SEARCH); - if (!(publication.getContentBundle().hasInstance( - project.getLanguage()))) { - data.addError( - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciproject.ui.selectPublication.no_suitable_language_variant")); - return; - } - - publication = (Publication) publication.getContentBundle().getInstance( - project.getLanguage()); - SciProjectPublicationsCollection publications = - project.getPublications(); - publications.addFilter(String.format("id = %s", publication.getID(). - toString())); - if (publications.size() > 0) { - data.addError(SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciproject.ui.selectPublication.already_added")); - } - - publications.close(); - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsStep.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsStep.java deleted file mode 100644 index 21214bf98..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsStep.java +++ /dev/null @@ -1,57 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.ui.authoring.AuthoringKitWizard; -import com.arsdigita.cms.ui.authoring.BasicItemForm; -import com.arsdigita.cms.ui.authoring.SimpleEditStep; -import com.arsdigita.cms.ui.workflow.WorkflowLockedComponentAccess; - -/** - * - * @author Jens Pelzetter - */ -public class SciProjectPublicationsStep extends SimpleEditStep { - - private String ADD_PUBLICATION_SHEET_NAME = "addPublication"; - - public SciProjectPublicationsStep(final ItemSelectionModel itemModel, - final AuthoringKitWizard parent) { - this(itemModel, parent, null); - } - - public SciProjectPublicationsStep(final ItemSelectionModel itemModel, - final AuthoringKitWizard parent, - final String prefix) { - super(itemModel, parent, prefix); - - BasicItemForm addPublicationSheet = new SciProjectPublicationsAddForm(itemModel); - add(ADD_PUBLICATION_SHEET_NAME, - (String) SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.project.addPublication").localize(), - new WorkflowLockedComponentAccess(addPublicationSheet, itemModel), - addPublicationSheet.getSaveCancelSection().getCancelButton()); - - SciProjectPublicationsTable publicationTable = new SciProjectPublicationsTable(itemModel); - setDisplayComponent(publicationTable); - - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsTable.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsTable.java deleted file mode 100644 index 1da215821..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectPublicationsTable.java +++ /dev/null @@ -1,276 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.Component; -import com.arsdigita.bebop.ControlLink; -import com.arsdigita.bebop.Label; -import com.arsdigita.bebop.Link; -import com.arsdigita.bebop.PageState; -import com.arsdigita.bebop.Table; -import com.arsdigita.bebop.event.TableActionEvent; -import com.arsdigita.bebop.event.TableActionListener; -import com.arsdigita.bebop.table.TableCellRenderer; -import com.arsdigita.bebop.table.TableColumn; -import com.arsdigita.bebop.table.TableColumnModel; -import com.arsdigita.bebop.table.TableModel; -import com.arsdigita.bebop.table.TableModelBuilder; -import com.arsdigita.cms.CMS; -import com.arsdigita.cms.ContentSection; -import com.arsdigita.cms.ItemSelectionModel; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.SciProjectPublicationsCollection; -import com.arsdigita.cms.contenttypes.SciProjectWithPublications; -import com.arsdigita.cms.dispatcher.ItemResolver; -import com.arsdigita.cms.dispatcher.Utilities; -import com.arsdigita.dispatcher.ObjectNotFoundException; -import com.arsdigita.util.LockableImpl; -import java.math.BigDecimal; - -/** - * - * @author Jens Pelzetter - */ -public class SciProjectPublicationsTable - extends Table - implements TableActionListener { - - private final String TABLE_COL_EDIT = "table_col_edit"; - private final String TABLE_COL_DEL = "table_col_del"; - private ItemSelectionModel itemModel; - - public SciProjectPublicationsTable(final ItemSelectionModel itemModel) { - super(); - this.itemModel = itemModel; - - setEmptyView(new Label(SciOrganizationWithPublicationsGlobalizationUtil. - globalize("sciorganizationpublication.ui.publications.none"))); - - TableColumnModel columnModel = getColumnModel(); - columnModel.add(new TableColumn( - 0, - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.publication").localize(), - TABLE_COL_EDIT)); - columnModel.add(new TableColumn( - 1, - SciOrganizationWithPublicationsGlobalizationUtil.globalize( - "sciorganizationpublication.ui.publication.remove"). - localize(), TABLE_COL_DEL)); - - setModelBuilder(new SciProjectPublicationsTableModelBuilder( - itemModel)); - - columnModel.get(0).setCellRenderer(new EditCellRenderer()); - columnModel.get(1).setCellRenderer(new DeleteCellRenderer()); - - addTableActionListener(this); - } - - private class SciProjectPublicationsTableModelBuilder - extends LockableImpl - implements TableModelBuilder { - - private ItemSelectionModel itemModel; - - public SciProjectPublicationsTableModelBuilder( - final ItemSelectionModel itemModel) { - this.itemModel = itemModel; - } - - public TableModel makeModel(final Table table, final PageState state) { - table.getRowSelectionModel().clearSelection(state); - SciProjectWithPublications project = - (SciProjectWithPublications) itemModel. - getSelectedObject(state); - - return new SciProjectPublicationsTableModel(table, - state, - project); - } - } - - private class SciProjectPublicationsTableModel implements TableModel { - - private Table table; - private SciProjectPublicationsCollection publications; - private Publication publication; - - public SciProjectPublicationsTableModel( - final Table table, - final PageState state, - final SciProjectWithPublications project) { - this.table = table; - publications = project.getPublications(); - } - - public int getColumnCount() { - return table.getColumnModel().size(); - } - - public boolean nextRow() { - boolean ret; - - if ((publications != null) && publications.next()) { - publication = publications.getPublication(); - ret = true; - } else { - ret = false; - } - - return ret; - } - - public Object getElementAt(int columnIndex) { - switch (columnIndex) { - case 0: - return publication.getTitle(); - case 1: - return SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganizationpublication.ui.publiction.remove"). - localize(); - default: - return null; - } - } - - public Object getKeyAt(int columnIndex) { - return publication.getID(); - } - } - - private class EditCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(final Table table, - final PageState state, - final Object value, - final boolean isSelected, - final Object key, - final int row, - final int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - SciProjectWithPublications project = - (SciProjectWithPublications) itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - com.arsdigita.cms.SecurityManager.EDIT_ITEM, - project); - - if (canEdit) { - Publication publication; - try { - publication = new Publication((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - - ContentSection section = CMS.getContext().getContentSection(); - ItemResolver resolver = section.getItemResolver(); - Link link = new Link(String.format("%s (%s)", - value.toString(), - publication.getLanguage()), - resolver.generateItemURL(state, - publication, - section, - publication. - getVersion())); - - return link; - } else { - Publication publication; - try { - publication = new Publication((BigDecimal) key); - } catch (ObjectNotFoundException ex) { - return new Label(value.toString()); - } - Label label = - new Label(String.format("%s (%s)", - value.toString(), - publication.getLanguage())); - return label; - } - } - } - - private class DeleteCellRenderer - extends LockableImpl - implements TableCellRenderer { - - public Component getComponent(Table table, - PageState state, - Object value, - boolean isSelected, - Object key, - int row, - int column) { - com.arsdigita.cms.SecurityManager securityManager = Utilities. - getSecurityManager(state); - SciProjectWithPublications project = - (SciProjectWithPublications) itemModel. - getSelectedObject(state); - - boolean canEdit = securityManager.canAccess( - state.getRequest(), - com.arsdigita.cms.SecurityManager.DELETE_ITEM, - project); - - if (canEdit) { - ControlLink link = new ControlLink(value.toString()); - link.setConfirmation((String) SciOrganizationWithPublicationsGlobalizationUtil. - globalize( - "sciorganizationpublication.ui.publication.confirm.remove"). - localize()); - return link; - } else { - Label label = new Label(value.toString()); - return label; - } - } - } - - public void cellSelected(final TableActionEvent event) { - PageState state = event.getPageState(); - - Publication publication = - new Publication(new BigDecimal(event.getRowKey().toString())); - - SciProjectWithPublications project = - (SciProjectWithPublications) itemModel. - getSelectedObject(state); - - TableColumn column = getColumnModel().get(event.getColumn().intValue()); - - if (TABLE_COL_EDIT.equals(column.getHeaderKey().toString())) { - //Nothing to do here - } else if (TABLE_COL_DEL.equals(column.getHeaderKey().toString())) { - project.removePublication(publication); - } - } - - public void headSelected(final TableActionEvent event) { - //Nothing to do. - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectWithPublicationsPanel.java b/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectWithPublicationsPanel.java deleted file mode 100644 index 3c4583ffe..000000000 --- a/ccm-sci-types-organizationwithpublications/src/com/arsdigita/cms/contenttypes/ui/SciProjectWithPublicationsPanel.java +++ /dev/null @@ -1,264 +0,0 @@ -/* - * Copyright (c) 2011 Jens Pelzetter, - * for the Center of Social Politics of the University of Bremen - * - * This library is free software; you can redistribute it and/or - * modify it under the terms of the GNU Lesser General Public License - * as published by the Free Software Foundation; either version 2.1 of - * the License, or (at your option) any later version. - * - * This library is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - * Lesser General Public License for more details. - * - * You should have received a copy of the GNU Lesser General Public - * License along with this library; if not, write to the Free Software - * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - * - */ -package com.arsdigita.cms.contenttypes.ui; - -import com.arsdigita.bebop.PageState; -import com.arsdigita.cms.ContentItem; -import com.arsdigita.cms.contenttypes.GenericOrganizationalUnit; -import com.arsdigita.cms.contenttypes.Publication; -import com.arsdigita.cms.contenttypes.SciOrganizationWithPublications; -import com.arsdigita.cms.contenttypes.SciOrganizationWithPublicationsConfig; -import com.arsdigita.cms.contenttypes.SciProject; -import com.arsdigita.cms.contenttypes.SciProjectPublicationsCollection; -import com.arsdigita.cms.contenttypes.SciProjectSubProjectsCollection; -import com.arsdigita.cms.contenttypes.SciProjectWithPublications; -import com.arsdigita.cms.contenttypes.SciPublicationTitleComparator; -import com.arsdigita.xml.Element; -import java.util.ArrayList; -import java.util.Collections; -import java.util.HashSet; -import java.util.LinkedList; -import java.util.List; -import java.util.Set; - -/** - * - * @author Jens Pelzetter - */ -public class SciProjectWithPublicationsPanel extends SciProjectPanel { - - public static final String SHOW_PUBLICATIONS = "publications"; - public static final String SHOW_WORKING_PAPERS = "workingPapers"; - private boolean displayPublications = true; - private boolean displayWorkingPapers = true; - - public SciProjectWithPublicationsPanel() { - } - - @Override - public Class getAllowedClass() { - return SciProjectWithPublications.class; - } - - @Override - protected String getPanelName() { - return SciProject.class.getSimpleName(); - } - - public boolean isDisplayPublications() { - return displayPublications; - } - - public void setDisplayPublications(final boolean displayPublications) { - this.displayPublications = displayPublications; - } - - public boolean isDisplayWorkingPapers() { - return displayWorkingPapers; - } - - public void setDisplayWorkingPapers(final boolean displayWorkingPapers) { - this.displayWorkingPapers = displayWorkingPapers; - } - - @Override - public void generateAvailableDataXml(final GenericOrganizationalUnit orga, - final Element element, - final PageState state) { - SciProject project = (SciProject) orga; - - super.generateAvailableDataXml(project, element, state); - - SciOrganizationWithPublicationsConfig config = - SciOrganizationWithPublications. - getConfig(); - - SciProjectWithPublications proj = - (SciProjectWithPublications) project; - - if ((proj.hasPublications(config.getOrganizationPublicationsMerge())) - && displayPublications) { - element.newChildElement("publications"); - } - if ((proj.hasWorkingPapers(config.getOrganizationPublicationsMerge())) - && displayWorkingPapers - && config.getProjectPublicationsSeparateWorkingPapers()) { - element.newChildElement("workingPapers"); - } - } - - protected void mergePublications( - final SciProjectSubProjectsCollection subProjects, - final List publications, - final boolean workingPapersOnly) { - while (subProjects.next()) { - SciProject proj; - SciProjectWithPublications project; - SciProjectPublicationsCollection projectPublications; - - proj = subProjects.getSubProject(); - project = (SciProjectWithPublications) proj; - projectPublications = project.getPublications(); - if (workingPapersOnly) { - projectPublications.addFilter( - "objectType = 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } else if (SciOrganizationWithPublications.getConfig(). - getProjectPublicationsSeparateWorkingPapers()) { - projectPublications.addFilter( - "objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } - - if (publications instanceof ArrayList) { - ((ArrayList) publications).ensureCapacity( - publications.size() + (int) projectPublications.size()); - } - - Publication publication; - while (projectPublications.next()) { - publication = projectPublications.getPublication(); - publications.add(publication); - } - - SciProjectSubProjectsCollection subSubProjects = - proj.getSubProjects(); - - if ((subSubProjects != null) && subSubProjects.size() > 0) { - mergePublications(subSubProjects, publications, - workingPapersOnly); - } - } - } - - protected void generatePublicationsXml(final SciProject project, - final Element parent, - final PageState state, - final boolean workingPapersOnly) { - final SciProjectWithPublications proj = - (SciProjectWithPublications) project; - - if (SciOrganizationWithPublications.getConfig(). - getOrganizationPublicationsMerge()) { - List publications; - SciProjectPublicationsCollection projectPublications = proj. - getPublications(); - if (workingPapersOnly) { - projectPublications.addFilter( - "objectType = 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } else if (SciOrganizationWithPublications.getConfig(). - getProjectPublicationsSeparateWorkingPapers()) { - projectPublications.addFilter( - "objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } - - publications = - new ArrayList((int) projectPublications.size()); - - Publication publication; - while (projectPublications.next()) { - publication = projectPublications.getPublication(); - publications.add(publication); - } - - mergePublications(project.getSubProjects(), - publications, - workingPapersOnly); - - Set publicationsSet; - List publicationsWithoutDoubles; - publicationsSet = new HashSet(publications); - publicationsWithoutDoubles = new LinkedList( - publicationsSet); - Collections.sort(publicationsWithoutDoubles, - new SciPublicationTitleComparator()); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(publicationsWithoutDoubles.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, publicationsWithoutDoubles. - size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - createPaginatorElement(parent, pageNumber, pageCount, begin, end, - count, publicationsWithoutDoubles.size()); - List publicationsToShow = publicationsWithoutDoubles. - subList((int) begin, (int) end); - - for (Publication pub : publicationsToShow) { - PublicationXmlHelper xmlHelper = new PublicationXmlHelper(parent, - pub); - xmlHelper.generateXml(); - } - } else { - SciProjectPublicationsCollection projectPublications = proj. - getPublications(); - if (workingPapersOnly) { - projectPublications.addFilter( - "objectType = 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } else if (SciOrganizationWithPublications.getConfig(). - getProjectPublicationsSeparateWorkingPapers()) { - projectPublications.addFilter( - "objectType != 'com.arsdigita.cms.contenttypes.WorkingPaper'"); - } - - List publications = new LinkedList(); - - while (projectPublications.next()) { - publications.add(projectPublications.getPublication()); - } - - Collections.sort(publications, new SciPublicationTitleComparator()); - - long pageNumber = getPageNumber(state); - long pageCount = getPageCount(publications.size()); - long begin = getPaginatorBegin(pageNumber); - long count = getPaginatorCount(begin, publications.size()); - long end = getPaginatorEnd(begin, count); - pageNumber = normalizePageNumber(pageCount, pageNumber); - - createPaginatorElement(parent, pageNumber, pageCount, begin, end, - count, publications.size()); - List publicationsToShow = publications.subList( - (int) begin, (int) end); - - for (Publication publication : publicationsToShow) { - PublicationXmlHelper xmlHelper = - new PublicationXmlHelper(parent, - publication); - xmlHelper.generateXml(); - } - } - } - - @Override - public void generateDataXml(final GenericOrganizationalUnit orga, - final Element element, - final PageState state) { - String show = getShowParam(state); - - if (SHOW_PUBLICATIONS.equals(show)) { - generatePublicationsXml((SciProject) orga, element, state, false); - } else if (SHOW_WORKING_PAPERS.equals(show)) { - generatePublicationsXml((SciProject) orga, element, state, true); - } else { - super.generateDataXml(orga, element, state); - } - } -} diff --git a/ccm-sci-types-organizationwithpublications/src/empty.pdl.mf b/ccm-sci-types-organizationwithpublications/src/empty.pdl.mf deleted file mode 100644 index e69de29bb..000000000