diff --git a/Kieker.WebGUI/lib/spring-2.5.6.LICENSE b/Kieker.WebGUI/lib/spring-2.5.6.LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f49a4e16e68b128803cc2dcea614603632b04eac --- /dev/null +++ b/Kieker.WebGUI/lib/spring-2.5.6.LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/Kieker.WebGUI/lib/spring-context-3.1.2.RELEASE.LICENSE b/Kieker.WebGUI/lib/spring-context-3.1.2.RELEASE.LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..f49a4e16e68b128803cc2dcea614603632b04eac --- /dev/null +++ b/Kieker.WebGUI/lib/spring-context-3.1.2.RELEASE.LICENSE @@ -0,0 +1,201 @@ + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. \ No newline at end of file diff --git a/Kieker.WebGUI/nb-configuration.xml b/Kieker.WebGUI/nb-configuration.xml index 3e1840f86953bff823f259b37d36e350fda36ce7..1d0c993533666497fbca9a8c4395aac4fceab81c 100644 --- a/Kieker.WebGUI/nb-configuration.xml +++ b/Kieker.WebGUI/nb-configuration.xml @@ -19,4 +19,10 @@ Any value defined here will override the pom.xml file value but is only applicab <netbeans.compile.on.save>all</netbeans.compile.on.save> <org-netbeans-modules-projectapi.jsf_2e_language>Facelets</org-netbeans-modules-projectapi.jsf_2e_language> </properties> + <spring-data xmlns="http://www.netbeans.org/ns/spring-data/1"> + <config-files> + <config-file>src/main/webapp/WEB-INF/spring-config.xml</config-file> + </config-files> + <config-file-groups/> + </spring-data> </project-shared-configuration> diff --git a/Kieker.WebGUI/pom.xml b/Kieker.WebGUI/pom.xml index 431fe151bbfcff2ba6ec16dab21f2e5e4d56a359..6dc757d5c429d8072942142a28e797a92a90d402 100644 --- a/Kieker.WebGUI/pom.xml +++ b/Kieker.WebGUI/pom.xml @@ -27,7 +27,7 @@ <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> <kieker.jar>kieker-1.6_emf.jar</kieker.jar> </properties> - + <repositories> <repository> <id>prime-repo</id> @@ -35,9 +35,24 @@ <url>http://repository.primefaces.org</url> <layout>default</layout> </repository> + <repository> + <id>springsource-repo</id> + <name>SpringSource Repository</name> + <url>http://repo.springsource.org/release</url> + </repository> </repositories> - <dependencies> + <dependencies> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring-context</artifactId> + <version>3.1.2.RELEASE</version> + </dependency> + <dependency> + <groupId>org.springframework</groupId> + <artifactId>spring</artifactId> + <version>2.5.6</version> + </dependency> <dependency> <groupId>commons-logging</groupId> <artifactId>commons-logging</artifactId> @@ -266,7 +281,7 @@ <version>1.6-SNAPSHOT</version> <scope>system</scope> <systemPath>${project.basedir}/lib/${kieker.jar}</systemPath> - </dependency> + </dependency> <dependency> <groupId>commons-io</groupId> <artifactId>commons-io</artifactId> @@ -373,7 +388,7 @@ <configuration> <tasks> <copy file="${project.basedir}/lib/${kieker.jar}" - todir="${project.build.directory}/Kieker.WebGUI-${project.version}/WEB-INF/lib"/> + todir="${project.build.directory}/Kieker.WebGUI-${project.version}/WEB-INF/lib" /> </tasks> </configuration> </execution> diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/GlobalPropertiesBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/GlobalPropertiesBean.java index 69d6897ea82e83374325c970e71df6e14e66a2fd..def85fb2b9abb58be6d89563568f35c6156f9454 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/GlobalPropertiesBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/GlobalPropertiesBean.java @@ -16,49 +16,30 @@ package kieker.webgui.beans.application; -import java.io.IOException; import java.io.Serializable; -import java.util.Properties; import java.util.ResourceBundle; import javax.faces.application.FacesMessage; import javax.faces.application.FacesMessage.Severity; -import javax.faces.bean.ApplicationScoped; -import javax.faces.bean.ManagedBean; import javax.faces.context.FacesContext; -import kieker.common.logging.Log; -import kieker.common.logging.LogFactory; +import org.springframework.beans.factory.annotation.Autowired; /** - * The class {@link GlobalPropertiesBean} is an application-scoped JSF bean, containing properties, constants and partially localized texts for the application. It - * reads them from properties files and ressource bundles, making sure that those constants can be modified without a necessary recompiling of the whole - * application.<br> + * The class {@link GlobalPropertiesBean} is a singleton scoped Spring bean, containing properties, constants and partially localized texts for the application. Some + * of the properties are injected via Spring, others are loaded directly from the resource bundle. This makes sure that those constants can be modified without a + * necessary recompiling of the whole application.<br> * It implements the {@link Serializable} interface to make sure that some session scoped beans can use this class.<br> - * It is application-scoped as only one instance of this class is necessary. + * It is singleton scoped as the properties are the same for every user and as only one instance of this class is necessary. * * @author Nils Christian Ehmke */ -@ManagedBean -@ApplicationScoped public final class GlobalPropertiesBean implements Serializable { private static final long serialVersionUID = 4253541090603377504L; - private static final Log LOG = LogFactory.getLog(GlobalPropertiesBean.class); - - private static final String PROPERTIES_FILE_GLOBAL = "global.properties"; private static final String RESOURCE_BUNDLE_NAME = "lang.Common"; - private static final String PROPERTY_FACES_CONTEXT_THEME_KEY = "kieker.webgui.config.lookAndFeel.facesContextKey"; - private static final String PROPERTY_THEME_COOKIE_NAME = "kieker.webgui.config.lookAndFeel.cookieName"; - private static final String PROPERTY_DEFAULT_THEME = "kieker.webgui.config.lookAndFeel.defaultTheme"; - private static final String PROPERTY_PROJECT_OVERVIEW_PAGE = "kieker.webgui.page.projectOverview"; - private static final String PROPERTY_ANALYSIS_EDITOR_GRID_SIZE_COOKIE_NAME = "kieker.webgui.config.analysisEditor.gridSize.cookieName"; - private static final String PROPERTY_ANALYSIS_EDITOR_GRID_COLOR_COOKIE_NAME = "kieker.webgui.config.analysisEditor.gridColor.cookieName"; - private static final String PROPERTY_ANALYSIS_EDITOR_DEFAULT_GRID_SIZE = "kieker.webgui.config.analysisEditor.defaultGridSize"; - private static final String PROPERTY_ANALYSIS_EDITOR_DEFAULT_GRID_COLOR = "kieker.webgui.config.analysisEditor.defaultGridColor"; - private static final String PROPERTY_MSG_PROJECT_LOADING_EXCEPTION = "msgProjectLoadingException"; private static final String PROPERTY_MSG_PROJECT_SAVED = "msgProjectSaved"; private static final String PROPERTY_MSG_PLUGIN_CREATION_EXCEPTION = "msgPluginCreationException"; @@ -71,39 +52,57 @@ public final class GlobalPropertiesBean implements Serializable { private static final String PROPERTY_MSG_LIBRARY_EXISTING_EXCEPTION = "msgLibraryExistingException"; private static final String PROPERTY_MSG_LIBRARY_UPLOADING_EXCEPTION = "msgLibraryUploadingException"; - private final Properties globalProperties = new Properties(); + @Autowired + private String themeCookieName; + @Autowired + private String projectOverviewPage; + @Autowired + private String facesContextThemeKey; + @Autowired + private String defaultTheme; + @Autowired + private String analysisEditorGridSizeCookieName; + @Autowired + private String analysisEditorGridColorCookieName; + @Autowired + private String analysisEditorDefaultGridSize; + @Autowired + private String analysisEditorDefaultGridColor; /** - * Default constructor. <b>Do not use this constructor. This bean is JSF managed.</b> + * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> */ public GlobalPropertiesBean() { - try { - // Try to load the properties from the properties file(s) - this.globalProperties.load(Thread.currentThread().getContextClassLoader().getResourceAsStream(GlobalPropertiesBean.PROPERTIES_FILE_GLOBAL)); - } catch (final IOException ex) { - // If this exception occurs there isn't much we can do. This means the resource isn't available. We can't shutdown the whole application, so instead we - // log the error. - GlobalPropertiesBean.LOG.error("An error occured during the initialization of the properties.", ex); - } + // No code necessary } /** - * This method delivers the default theme stored in the properties file. + * Setter for the property {@link GlobalPropertiesBean#projectOverviewPage}. <b>Do not use this method. This property is Spring managed.</b> * - * @return The value of the property. + * @param projectOverviewPage + * The new value for the property. */ - public String getDefaultTheme() { - return this.globalProperties.getProperty(GlobalPropertiesBean.PROPERTY_DEFAULT_THEME); + public void setProjectOverviewPage(final String projectOverviewPage) { + this.projectOverviewPage = projectOverviewPage; } /** - * This method delivers the name of the theme cookie stored in the properties file. This cookie name should only be used to (re)store the current user's look and - * feel. + * This method delivers the redirecting-link to the project overview page. * * @return The value of the property. */ - public String getThemeCookieName() { - return this.globalProperties.getProperty(GlobalPropertiesBean.PROPERTY_THEME_COOKIE_NAME); + public String getProjectOverviewPage() { + return this.projectOverviewPage; + } + + /** + * Setter for the property {@link GlobalPropertiesBean#facesContextThemeKey}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param facesContextThemeKey + * The new value for the property. + */ + public void setFacesContextThemeKey(final String facesContextThemeKey) { + this.facesContextThemeKey = facesContextThemeKey; } /** @@ -112,16 +111,36 @@ public final class GlobalPropertiesBean implements Serializable { * @return The value of the property. */ public String getFacesContextThemeKey() { - return this.globalProperties.getProperty(GlobalPropertiesBean.PROPERTY_FACES_CONTEXT_THEME_KEY); + return this.facesContextThemeKey; } /** - * This method delivers the redirecting-link to the project overview page. + * Setter for the property {@link GlobalPropertiesBean#defaultTheme}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param defaultTheme + * The new value for the property. + */ + public void setDefaultTheme(final String defaultTheme) { + this.defaultTheme = defaultTheme; + } + + /** + * This method delivers the default theme stored in the properties file. * * @return The value of the property. */ - public String getProjectOverviewPage() { - return this.globalProperties.getProperty(GlobalPropertiesBean.PROPERTY_PROJECT_OVERVIEW_PAGE); + public String getDefaultTheme() { + return this.defaultTheme; + } + + /** + * Setter for the property {@link GlobalPropertiesBean#analysisEditorGridSizeCookieName}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param projectOverviewPage + * The new value for the property. + */ + public void setAnalysisEditorGridSizeCookieName(final String analysisEditorGridSizeCookieName) { + this.analysisEditorGridSizeCookieName = analysisEditorGridSizeCookieName; } /** @@ -130,7 +149,17 @@ public final class GlobalPropertiesBean implements Serializable { * @return The value of the property. */ public String getAnalysisEditorGridSizeCookieName() { - return this.globalProperties.getProperty(GlobalPropertiesBean.PROPERTY_ANALYSIS_EDITOR_GRID_SIZE_COOKIE_NAME); + return this.analysisEditorGridSizeCookieName; + } + + /** + * Setter for the property {@link GlobalPropertiesBean#analysisEditorGridColorCookieName}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param analysisEditorGridColorCookieName + * The new value for the property. + */ + public void setAnalysisEditorGridColorCookieName(final String analysisEditorGridColorCookieName) { + this.analysisEditorGridColorCookieName = analysisEditorGridColorCookieName; } /** @@ -139,7 +168,17 @@ public final class GlobalPropertiesBean implements Serializable { * @return The value of the property. */ public String getAnalysisEditorGridColorCookieName() { - return this.globalProperties.getProperty(GlobalPropertiesBean.PROPERTY_ANALYSIS_EDITOR_GRID_COLOR_COOKIE_NAME); + return this.analysisEditorGridColorCookieName; + } + + /** + * Setter for the property {@link GlobalPropertiesBean#analysisEditorDefaultGridSize}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param analysisEditorDefaultGridSize + * The new value for the property. + */ + public void setAnalysisEditorDefaultGridSize(final String analysisEditorDefaultGridSize) { + this.analysisEditorDefaultGridSize = analysisEditorDefaultGridSize; } /** @@ -148,7 +187,17 @@ public final class GlobalPropertiesBean implements Serializable { * @return The value of the property. */ public String getAnalysisEditorDefaultGridSize() { - return this.globalProperties.getProperty(GlobalPropertiesBean.PROPERTY_ANALYSIS_EDITOR_DEFAULT_GRID_SIZE); + return this.analysisEditorDefaultGridSize; + } + + /** + * Setter for the property {@link GlobalPropertiesBean#analysisEditorDefaultGridColor}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param analysisEditorDefaultGridColor + * The new value for the property. + */ + public void setAnalysisEditorDefaultGridColor(final String analysisEditorDefaultGridColor) { + this.analysisEditorDefaultGridColor = analysisEditorDefaultGridColor; } /** @@ -157,7 +206,27 @@ public final class GlobalPropertiesBean implements Serializable { * @return The value of the property. */ public String getAnalysisEditorDefaultGridColor() { - return this.globalProperties.getProperty(GlobalPropertiesBean.PROPERTY_ANALYSIS_EDITOR_DEFAULT_GRID_COLOR); + return this.analysisEditorDefaultGridColor; + } + + /** + * Setter for the property {@link GlobalPropertiesBean#themeCookieName}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param themeCookieName + * The new value for the property. + */ + public void setThemeCookieName(final String themeCookieName) { + this.themeCookieName = themeCookieName; + } + + /** + * This method delivers the name of the theme cookie stored in the properties file. This cookie name should only be used to (re)store the current user's look and + * feel. + * + * @return The value of the property. + */ + public String getThemeCookieName() { + return this.themeCookieName; } /** diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java index 233d1cf27b9d34c8cf5fc0b1e44f41b19a2912cc..65ce5bdc23b639390cda2cfb0cda269508d4d1dc 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java @@ -22,10 +22,9 @@ import java.util.Collections; import java.util.Date; import java.util.List; -import javax.annotation.PostConstruct; import javax.faces.application.FacesMessage; -import javax.faces.bean.ApplicationScoped; -import javax.faces.bean.ManagedBean; + +import org.springframework.beans.factory.annotation.Autowired; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.common.logging.Log; @@ -38,38 +37,45 @@ import kieker.webgui.common.exception.ProjectLoadException; import kieker.webgui.common.exception.ProjectNotExistingException; /** - * The {@link ProjectsBean} is a JSF managed bean to manage a list with all application wide available projects. It provides methods to receive this list as well as - * methods to add, create, rename, open and copy projects. Furthermore the state of existing projects (like the timestamp or the state of the analysis) can be - * received via this bean. In order to realize a good abstraction, this bean should be used for any access to the projects. The necessary synchronization is achieved - * in the {@link ProjectManagerFacade}.<br> - * As this bean contains the whole list of the available projects, it is application scoped. There is no reason for multiple instances of this class. + * The {@link ProjectsBean} is a Spring managed bean to manage a list with all application wide available projects. It provides methods to receive this list as well + * as methods to add, create, rename, open and copy projects. Furthermore the state of existing projects (like the timestamp or the state of the analysis) can be + * received via this bean. In order to realize a good abstraction, this bean should be used for most accesses to the projects. The necessary synchronization is + * achieved in the {@link IProjectManagerFacade}.<br> + * As this bean contains the whole list of the available projects, it is session scoped. There is no reason for multiple instances of this class. * * @author Nils Christian Ehmke */ -@ManagedBean -@ApplicationScoped public final class ProjectsBean { private static final Log LOG = LogFactory.getLog(ProjectsBean.class); - private static final String DEFAULT_TIMESTAMP = "N/A"; private static final String DEFAULT_ANALYSIS_STATE = ""; private final List<String> projects = Collections.synchronizedList(new ArrayList<String>()); - private final IProjectManagerFacade projectManagerFacade = ProjectManagerFacade.getInstance(); + @Autowired + private IProjectManagerFacade projectManagerFacade; /** - * Default constructor. <b>Do not use this constructor. This bean is JSF managed.</b> + * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> */ public ProjectsBean() { // No code necessary } /** - * This method does some initialization work after construction. <b>Do not call this method. The method is managed by the class loader.</b> + * The Setter for the property {@link ProjectsBean#projectManagerFacade}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param projectManagerFacade + * The new value for the property. + */ + public void setProjectManagerFacade(final IProjectManagerFacade projectManagerFacade) { + this.projectManagerFacade = projectManagerFacade; + } + + /** + * This method does some initialization work after construction. <b>Do not call this method. The method is Spring managed.</b> */ - @PostConstruct protected void initialize() { // Load a list with all available projects on the FS this.projects.addAll(this.projectManagerFacade.listAllProjects()); @@ -86,7 +92,7 @@ public final class ProjectsBean { * @param project * The name for the new project which should be added to the application. */ - public void addProject(final String project) { + public void addProject(final String project, final CurrentProjectOverviewBean currentProjectOverviewBean) { try { // Try and use the FS-Manager to create the project atomically. this.projectManagerFacade.addProject(project); @@ -95,7 +101,7 @@ public final class ProjectsBean { // Inform the user GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, "Project created."); // Update the list of the "calling" bean - CurrentProjectOverviewBean.getCurrentInstance().updateLists(); + currentProjectOverviewBean.updateLists(); } catch (final IOException ex) { ProjectsBean.LOG.error("An error occured while creating the project.", ex); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, "An error occured while creating the project."); @@ -117,7 +123,7 @@ public final class ProjectsBean { * @param destinationProject * The name of the new (copied) project. */ - public void copyProject(final String sourceProject, final String destinationProject) { + public void copyProject(final String sourceProject, final String destinationProject, final CurrentProjectOverviewBean currentProjectOverviewBean) { try { // Try and use the FS-Manager to copy the project atomically. this.projectManagerFacade.copyProject(sourceProject, destinationProject); @@ -126,7 +132,7 @@ public final class ProjectsBean { // Inform the user GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, "Project created."); // Update the list of the "calling" bean - CurrentProjectOverviewBean.getCurrentInstance().updateLists(); + currentProjectOverviewBean.updateLists(); } catch (final IOException ex) { ProjectsBean.LOG.error("An error occured while creating the project.", ex); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_ERROR, "An error occured while creating the project."); @@ -188,7 +194,7 @@ public final class ProjectsBean { * This method delivers all available projects as a list of string. The list itself is just a copy and can be modified as will. Keep in mind that this means also * that every call to this method will create a new copy. * - * @return All currently available projects as a copied and modificable list. + * @return All currently available projects as a copied and modifiable list. */ public List<String> getProjects() { synchronized (this.projects) { diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ThemeSwitcherBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ThemeSwitcherBean.java index e88427d59da032062d08127445cb0461d09e5aa8..f260734306d6d933025be3056ad789134e075d0e 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ThemeSwitcherBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ThemeSwitcherBean.java @@ -18,30 +18,20 @@ package kieker.webgui.beans.application; import java.util.Collections; import java.util.Map; -import java.util.TreeMap; - -import javax.annotation.PostConstruct; -import javax.faces.bean.ApplicationScoped; -import javax.faces.bean.ManagedBean; /** * The {@link ThemeSwitcherBean} is responsible for holding a list with all application wide available themes (look and feels). As this is a static list, it is not - * possible to import new themes during the runtime.<br> - * This class is an application scoped JSF managed bean, as the list with the available themes is a static list. + * possible to import new themes during the runtime. The initialization is done in the Spring configuration file.<br> + * This class is a singleton scoped Spring managed bean, as the list with the available themes is a static list. * * @author Nils Christian Ehmke */ -@ManagedBean -@ApplicationScoped public final class ThemeSwitcherBean { - /** - * A map containing all available themes. - */ - private final Map<String, String> themes = new TreeMap<String, String>(); // NOPMD (No concurrent access) + private Map<String, String> themes; /** - * Default constructor. <b>Do not use this constructor. This bean is JSF managed.</b> + * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> */ public ThemeSwitcherBean() { // No code necessary @@ -57,41 +47,11 @@ public final class ThemeSwitcherBean { } /** - * This method does some initialization work after construction. <b>Do not call this method. The method is managed by the class loader.</b> If one wants to add - * new themes to the program, this is the right place. + * The setter for the property {@link ThemeSwitcherBean#themes}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param themes */ - @PostConstruct - protected void initialize() { - this.themes.put("Aristo", "aristo"); - this.themes.put("Black-Tie", "black-tie"); - this.themes.put("Blitzer", "blitzer"); - this.themes.put("Bluesky", "bluesky"); - this.themes.put("Casablanca", "casablanca"); - this.themes.put("Cupertino", "cupertino"); - this.themes.put("Dark-Hive", "dark-hive"); - this.themes.put("Dot-Luv", "dot-luv"); - this.themes.put("Eggplant", "eggplant"); - this.themes.put("Excite-Bike", "excite-bike"); - this.themes.put("Flick", "flick"); - this.themes.put("Glass-X", "glass-x"); - this.themes.put("Hot-Sneaks", "hot-sneaks"); - this.themes.put("Humanity", "humanity"); - this.themes.put("Le-Frog", "le-frog"); - this.themes.put("Midnight", "midnight"); - this.themes.put("Mint-Choc", "mint-choc"); - this.themes.put("Overcast", "overcast"); - this.themes.put("Pepper-Grinder", "pepper-grinder"); - this.themes.put("Redmond", "redmond"); - this.themes.put("Rocket", "rocket"); - this.themes.put("Sam", "sam"); - this.themes.put("Smoothness", "smoothness"); - this.themes.put("South-Street", "south-street"); - this.themes.put("Start", "start"); - this.themes.put("Sunny", "sunny"); - this.themes.put("Swanky-Purse", "swanky-purse"); - this.themes.put("Trontastic", "trontastic"); - this.themes.put("UI-Darkness", "ui-darkness"); - this.themes.put("UI-Lightness", "ui-lightness"); - this.themes.put("Vader", "vader"); + public void setThemes(final Map<String, String> themes) { + this.themes = themes; } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/package-info.java index e4a3bf0b2aee7add2bf0bcc0199757232711cc14..07aa9a7350f75b910d9801c5a9173dba62aef592 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/package-info.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/package-info.java @@ -15,8 +15,9 @@ ***************************************************************************/ /** - * This package contains JSF managed beans with application scope. + * This package contains Spring managed beans with application (singleton) scope. * * @author Nils Christian Ehmke */ package kieker.webgui.beans.application; + diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/StringBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/StringBean.java index bc613022f5d27b17c22fc77996867b79024d2494..caabc4aeb126b04ef40a67065377dd2fa4fa6662 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/StringBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/StringBean.java @@ -16,9 +16,6 @@ package kieker.webgui.beans.request; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.RequestScoped; - /** * This simple bean can be used to store a string during a request. Furthermore it provides some simple methods to handle strings within the application where a bean * is necessary. <br> @@ -26,14 +23,12 @@ import javax.faces.bean.RequestScoped; * * @author Nils Christian Ehmke */ -@ManagedBean -@RequestScoped public final class StringBean { private String string; /** - * Creates a new instance of this bean and initializes it with an empty string. <b>Do not use this constructor. This bean is JSF managed.</b> + * Creates a new instance of this bean and initializes it with an empty string. <b>Do not use this constructor. This bean is Spring managed.</b> */ public StringBean() { this.string = ""; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/package-info.java index d9be0755858caac71ad4af1ec4e541c0358d7604..26cfe25c23162f1f1618067bf0951a560de31731 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/package-info.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/package-info.java @@ -15,8 +15,9 @@ ***************************************************************************/ /** - * This package contains JSF managed beans with request scope. + * This package contains Spring managed beans with request scope. * * @author Nils Christian Ehmke */ package kieker.webgui.beans.request; + diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentConfigurationBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentConfigurationBean.java index f2c849497c35136ae34fa2aa8d0a2ebca649d954..979096471017794b18fad2eb825797410f0a90d1 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentConfigurationBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/CurrentConfigurationBean.java @@ -19,36 +19,33 @@ package kieker.webgui.beans.session; import java.io.Serializable; import java.util.Map; -import javax.annotation.PostConstruct; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ManagedProperty; -import javax.faces.bean.SessionScoped; import javax.faces.context.FacesContext; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; +import org.springframework.beans.factory.annotation.Autowired; + import kieker.webgui.beans.application.GlobalPropertiesBean; /** - * The class {@link CurrentConfigurationBean} is a session-scoped JSF bean, containing the properties and configurations of the current (session) user.<br> - * It is session-scoped as only one instance per user is necessary. This means also that is has to implement the {@link Serializable} interface. + * The class {@link CurrentConfigurationBean} is a session scoped Spring bean, containing the properties and configurations of the current (session) user.<br> + * It is session scoped as only one instance per user is necessary. This means also that is has to implement the {@link Serializable} interface. * * @author Nils Christian Ehmke */ -@ManagedBean -@SessionScoped public final class CurrentConfigurationBean implements Serializable { private static final long serialVersionUID = 4226402116177851270L; + private String lookAndFeel; private String gridColor; private int gridSize; - @ManagedProperty(value = "#{globalPropertiesBean}") + @Autowired private GlobalPropertiesBean globalPropertiesBean; /** - * Default constructor. <b>Do not use this constructor. This bean is JSF managed.</b> + * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> */ public CurrentConfigurationBean() { // No code necessary @@ -56,27 +53,15 @@ public final class CurrentConfigurationBean implements Serializable { /** * This method initializes the bean. In fact it loads the default values before trying to load the values of the user from their cookies. <b>Do not call this - * method. The method is managed by the class loader.</b> + * method. The method is Spring managed.</b> */ - @PostConstruct protected void initialize() { this.loadDefaultValues(); this.loadValuesFromCookies(); } /** - * The getter for the property {@link CurrentConfigurationBean#globalPropertiesBean}. - * - * @return The current value for the property. - */ - public GlobalPropertiesBean getGlobalPropertiesBean() { - synchronized (this) { - return this.globalPropertiesBean; - } - } - - /** - * The setter for the property {@link CurrentConfigurationBean#globalPropertiesBean}. + * The setter for the property {@link CurrentConfigurationBean#globalPropertiesBean}. <b>Do not use this method. This property is Spring managed.</b> * * @param globalPropertiesBean * The new value for the property. diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java index b242dd68d94af7f790708d751829a1d4830f3519..a1710512b783692b51bb40c194719b7c5d2161cb 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java @@ -18,9 +18,7 @@ package kieker.webgui.beans.session; import java.io.Serializable; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ManagedProperty; -import javax.faces.bean.SessionScoped; +import org.springframework.beans.factory.annotation.Autowired; import kieker.webgui.beans.application.GlobalPropertiesBean; @@ -31,15 +29,13 @@ import kieker.webgui.beans.application.GlobalPropertiesBean; * * @author Nils Christian Ehmke */ -@ManagedBean -@SessionScoped public final class UserBean implements Serializable { private static final long serialVersionUID = 6422563876003638348L; private String userName; private String password; - @ManagedProperty(value = "#{globalPropertiesBean}") + @Autowired private GlobalPropertiesBean globalPropertiesBean; /** diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java index 948bdda9d1d145bf11550221806b8bd415fa4bda..cc31c01537bc20f72aac5b3dbe30b73096df8dc7 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java @@ -26,12 +26,11 @@ import java.util.Collections; import java.util.List; import javax.faces.application.FacesMessage; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ManagedProperty; -import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; import javax.faces.event.ValueChangeEvent; +import org.springframework.beans.factory.annotation.Autowired; + import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; import kieker.analysis.model.analysisMetaModel.MIDependency; import kieker.analysis.model.analysisMetaModel.MIDisplay; @@ -57,7 +56,6 @@ import kieker.webgui.beans.application.ProjectsBean; import kieker.webgui.beans.session.CurrentConfigurationBean; import kieker.webgui.common.ClassAndMethodContainer; import kieker.webgui.common.IProjectManagerFacade; -import kieker.webgui.common.ProjectManagerFacade; import kieker.webgui.common.exception.LibraryAlreadyExistingException; import kieker.webgui.common.exception.LibraryLoadException; import kieker.webgui.common.exception.NewerProjectException; @@ -83,8 +81,6 @@ import org.eclipse.emf.ecore.EObject; * * @author Nils Christian Ehmke */ -@ManagedBean -@ViewScoped public final class CurrentAnalysisEditorBean { /** * This field contains the log-object for the whole class, which will be used to log all important errors and exceptions which occur. @@ -138,18 +134,19 @@ public final class CurrentAnalysisEditorBean { * This field contains the currently selected component (this can either be a plugin ({@link MIPlugin}) or a repository ({@link MIRepository})). */ private EObject selectedComponent; - private final IProjectManagerFacade projectManagerFacade = ProjectManagerFacade.getInstance(); + @Autowired + private IProjectManagerFacade projectManagerFacade; - @ManagedProperty(value = "#{projectsBean}") + @Autowired private ProjectsBean projectsBean; - @ManagedProperty(value = "#{currentAnalysisEditorGraphBean}") + @Autowired private CurrentAnalysisEditorGraphBean currentAnalysisEditorGraphBean; - @ManagedProperty(value = "#{currentConfigurationBean}") + @Autowired private CurrentConfigurationBean currentConfigurationBean; - @ManagedProperty(value = "#{globalPropertiesBean}") + @Autowired private GlobalPropertiesBean globalPropertiesBean; /** @@ -159,6 +156,10 @@ public final class CurrentAnalysisEditorBean { // No code necessary } + public void setProjectManagerFacade(final IProjectManagerFacade projectManagerFacade) { + this.projectManagerFacade = projectManagerFacade; + } + /** * Getter for the attribute {@link CurrentAnalysisEditorBean#currentAnalysisEditorGraphBean}. * @@ -1180,15 +1181,6 @@ public final class CurrentAnalysisEditorBean { } } - /** - * The getter for the property {@link CurrentAnalysisEditorBean#globalPropertiesBean}. - * - * @return The current value of the property. - */ - public GlobalPropertiesBean getGlobalPropertiesBean() { - return this.globalPropertiesBean; - } - /** * The setter for the property {@link CurrentAnalysisEditorBean#globalPropertiesBean}. * diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorGraphBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorGraphBean.java index 9907337d720044c8390b75d4ca9922073bc3b99f..68b0e974c822768a080f14048db5d84a4b8f9b56 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorGraphBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorGraphBean.java @@ -18,8 +18,6 @@ package kieker.webgui.beans.view; import java.util.Map; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; import kieker.analysis.model.analysisMetaModel.MIFilter; @@ -47,8 +45,6 @@ import org.eclipse.emf.ecore.EObject; * * @author Nils Christian Ehmke */ -@ManagedBean -@ViewScoped public final class CurrentAnalysisEditorGraphBean { /** * This is the log for errors, exceptions etc. diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitBean.java index 6711a6b3fbf8fc4ca20da9f0e2b5d229391c9451..2f0912281c892a6731b3c2bb529df6a9cff2c4dd 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitBean.java @@ -19,11 +19,10 @@ package kieker.webgui.beans.view; import java.io.IOException; import javax.faces.application.FacesMessage; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ManagedProperty; -import javax.faces.bean.ViewScoped; import javax.faces.context.FacesContext; +import org.springframework.beans.factory.annotation.Autowired; + import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.MIView; import kieker.common.logging.Log; @@ -32,7 +31,6 @@ import kieker.webgui.beans.application.GlobalPropertiesBean; import kieker.webgui.beans.application.ProjectsBean; import kieker.webgui.common.ClassAndMethodContainer; import kieker.webgui.common.IProjectManagerFacade; -import kieker.webgui.common.ProjectManagerFacade; import kieker.webgui.common.exception.DisplayNotFoundException; import kieker.webgui.common.exception.ProjectNotExistingException; @@ -44,19 +42,17 @@ import kieker.webgui.common.exception.ProjectNotExistingException; * * @author Nils Christian Ehmke */ -@ManagedBean -@ViewScoped public final class CurrentCockpitBean { private static final Log LOG = LogFactory.getLog(CurrentCockpitBean.class); - - private final IProjectManagerFacade projectManagerFacade = ProjectManagerFacade.getInstance(); + @Autowired + private IProjectManagerFacade projectManagerFacade; private String projectName; private MIProject project; private MIView activeView; private ClassAndMethodContainer classAndMethodContainer; - @ManagedProperty(value = "#{projectsBean}") + @Autowired private ProjectsBean projectsBean; /** @@ -77,6 +73,10 @@ public final class CurrentCockpitBean { } } + public void setProjectManagerFacade(final IProjectManagerFacade projectManagerFacade) { + this.projectManagerFacade = projectManagerFacade; + } + /** * The getter for the {@link #projectsBean}-property. * diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java index 10028d2804638e708fe0b1df8b80942fdf442eef..e80462aac87c5db604c14de7dd95f8d34a22e87c 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java @@ -25,14 +25,13 @@ import java.util.UUID; import javax.faces.application.Application; import javax.faces.application.FacesMessage; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ManagedProperty; -import javax.faces.bean.ViewScoped; import javax.faces.component.UIComponent; import javax.faces.component.UIInput; import javax.faces.component.html.HtmlOutputText; import javax.faces.context.FacesContext; +import org.springframework.beans.factory.annotation.Autowired; + import kieker.analysis.display.annotation.Display; import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; import kieker.analysis.model.analysisMetaModel.MIDisplay; @@ -47,7 +46,6 @@ import kieker.webgui.beans.application.GlobalPropertiesBean; import kieker.webgui.beans.application.ProjectsBean; import kieker.webgui.common.ClassAndMethodContainer; import kieker.webgui.common.IProjectManagerFacade; -import kieker.webgui.common.ProjectManagerFacade; import kieker.webgui.common.exception.NewerProjectException; import kieker.webgui.common.exception.ProjectLoadException; import kieker.webgui.common.exception.ProjectNotExistingException; @@ -68,15 +66,14 @@ import org.primefaces.model.DefaultDashboardModel; * * @author Nils Christian Ehmke */ -@ManagedBean -@ViewScoped public final class CurrentCockpitEditorBean { private static final int NUMBER_COLUMNS = 2; private static final Log LOG = LogFactory.getLog(CurrentCockpitEditorBean.class); private final MIAnalysisMetaModelFactory factory = new MAnalysisMetaModelFactory(); - private final IProjectManagerFacade projectManagerFacade = ProjectManagerFacade.getInstance(); + @Autowired + private IProjectManagerFacade projectManagerFacade; private ClassAndMethodContainer classAndMethodContainer; private long timeStamp; @@ -87,10 +84,10 @@ public final class CurrentCockpitEditorBean { private Dashboard dashboard; private DashboardModel dashboardModel; - @ManagedProperty(value = "#{projectsBean}") + @Autowired private ProjectsBean projectsBean; - @ManagedProperty(value = "#{globalPropertiesBean}") + @Autowired private GlobalPropertiesBean globalPropertiesBean; /** @@ -100,6 +97,10 @@ public final class CurrentCockpitEditorBean { this.createDashboard(); } + public void setProjectManagerFacade(final IProjectManagerFacade projectManagerFacade) { + this.projectManagerFacade = projectManagerFacade; + } + private void createDashboard() { final FacesContext fc = FacesContext.getCurrentInstance(); final Application application = fc.getApplication(); diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentControllerBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentControllerBean.java index ce755eb5c66c48807fa7f6c9b061aa7c011e5cce..7bfc06eead3725b48352356101e3797b3dd5624e 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentControllerBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentControllerBean.java @@ -25,16 +25,13 @@ import java.util.Collection; import java.util.Date; import java.util.List; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ManagedProperty; -import javax.faces.bean.ViewScoped; +import org.springframework.beans.factory.annotation.Autowired; import kieker.analysis.AnalysisController; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; import kieker.webgui.beans.application.ProjectsBean; import kieker.webgui.common.IProjectManagerFacade; -import kieker.webgui.common.ProjectManagerFacade; import kieker.webgui.common.exception.AnalysisInitializationException; import kieker.webgui.common.exception.AnalysisStateException; import kieker.webgui.common.exception.ProjectNotExistingException; @@ -46,17 +43,16 @@ import kieker.webgui.common.exception.ProjectNotExistingException; * * @author Nils Christian Ehmke */ -@ManagedBean -@ViewScoped public final class CurrentControllerBean { private static final Log LOG = LogFactory.getLog(CurrentControllerBean.class); - private final IProjectManagerFacade projectManagerFacade = ProjectManagerFacade.getInstance(); + @Autowired + private IProjectManagerFacade projectManagerFacade; private final List<String> logEntries = new ArrayList<String>(); private String projectName; - @ManagedProperty(value = "#{projectsBean}") + @Autowired private ProjectsBean projectsBean; /** @@ -75,6 +71,10 @@ public final class CurrentControllerBean { return this.projectsBean; } + public void setProjectManagerFacade(final IProjectManagerFacade projectManagerFacade) { + this.projectManagerFacade = projectManagerFacade; + } + /** * The setter for the {@link #projectsBean}-property. * diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentProjectOverviewBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentProjectOverviewBean.java index 80451190765f82744385e7575a9d35151a0093b3..49fa28e93e0e48859192ccfd19b865387eecebcb 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentProjectOverviewBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentProjectOverviewBean.java @@ -19,27 +19,22 @@ package kieker.webgui.beans.view; import java.util.ArrayList; import java.util.List; -import javax.annotation.PostConstruct; -import javax.el.ELResolver; -import javax.faces.bean.ManagedBean; -import javax.faces.bean.ViewScoped; -import javax.faces.context.FacesContext; +import org.springframework.beans.factory.annotation.Autowired; import kieker.webgui.beans.application.ProjectsBean; import org.primefaces.event.SelectEvent; /** - * /** * The {@link CurrentProjectOverviewBean} contains the necessary data behind an instance of the project overview.<br> * The class is a JSF managed bean with view scope. * * @author Nils Christian Ehmke */ -@ManagedBean -@ViewScoped public final class CurrentProjectOverviewBean { + @Autowired + private ProjectsBean projectsBean; /** * This list contains all available projects by name. */ @@ -85,10 +80,13 @@ public final class CurrentProjectOverviewBean { this.setProjectName((String) event.getObject()); } + public void setProjectsBean(final ProjectsBean projectsBean) { + this.projectsBean = projectsBean; + } + /** * This method should only be called automatically by the JVM to update the projects list. */ - @PostConstruct protected void initialialize() { this.updateLists(); } @@ -97,25 +95,7 @@ public final class CurrentProjectOverviewBean { * Updates the list containing the available projects name. */ public void updateLists() { - // TODO This part should be replaced by a ManagedProperty annotation - final ELResolver el = FacesContext.getCurrentInstance().getApplication().getELResolver(); - final ProjectsBean bean = (ProjectsBean) el.getValue(FacesContext.getCurrentInstance().getELContext(), null, "projectsBean"); - - this.projects = bean.getProjects(); - } - - /** - * This method delivers the current instance of this bean, using the current faces context and the necessary el resolver. - * - * @return The current instance of {@link CurrentProjectOverviewBean}. - */ - public static CurrentProjectOverviewBean getCurrentInstance() { - // Get both the context and the resolver - final FacesContext facesContext = FacesContext.getCurrentInstance(); - final ELResolver el = facesContext.getApplication().getELResolver(); - - // Get the current bean instance by name - return (CurrentProjectOverviewBean) el.getValue(facesContext.getELContext(), null, "currentProjectOverviewBean"); + this.projects = this.projectsBean.getProjects(); } /** diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/ViewScope.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/ViewScope.java new file mode 100644 index 0000000000000000000000000000000000000000..0fd597f124c55c6ff9ca8aebe367fa43e7a99091 --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/ViewScope.java @@ -0,0 +1,61 @@ +/*************************************************************************** + * Copyright 2012 Kieker Project (http://kieker-monitoring.net) + * + * Licensed under the Apache License, Version 2.0 (the "License"); + * you may not use this file except in compliance with the License. + * You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software + * distributed under the License is distributed on an "AS IS" BASIS, + * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + * See the License for the specific language governing permissions and + * limitations under the License. + ***************************************************************************/ + +package kieker.webgui.common.util; + +import java.util.Map; + +import javax.faces.context.FacesContext; + +import org.springframework.beans.factory.ObjectFactory; +import org.springframework.beans.factory.config.Scope; + +public class ViewScope implements Scope { + + @Override + public Object get(final String name, final ObjectFactory objectFactory) { + final Map<String, Object> viewMap = FacesContext.getCurrentInstance().getViewRoot().getViewMap(); + + if (viewMap.containsKey(name)) { + return viewMap.get(name); + } else { + final Object object = objectFactory.getObject(); + viewMap.put(name, object); + + return object; + } + } + + @Override + public Object remove(final String name) { + return FacesContext.getCurrentInstance().getViewRoot().getViewMap().remove(name); + } + + @Override + public String getConversationId() { + return null; + } + + @Override + public void registerDestructionCallback(final String name, final Runnable callback) { + // Not supported + } + + @Override + public Object resolveContextualObject(final String key) { + return null; + } +} diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/faces-config.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/faces-config.xml index 1dd24bc6c8fbd0e9dddb0713f43f9357eb14dcf5..04f30384b318f46077d11c6a0791fb0fa423db77 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/faces-config.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/faces-config.xml @@ -6,16 +6,24 @@ xsi:schemaLocation="http://java.sun.com/xml/ns/javaee http://java.sun.com/xml/ns/javaee/web-facesconfig_2_1.xsd"> <application> + <!-- Declare the available languages (English and German). The correct language will be determined automatically using the user's browser settings. --> <locale-config> <default-locale>en</default-locale> <supported-locale>de</supported-locale> - </locale-config> + </locale-config> + + <!-- This part is necessary to delegate the work to resolve variables to the Spring framework. --> + <variable-resolver> + org.springframework.web.jsf.DelegatingVariableResolver + </variable-resolver> </application> + <!-- The following part contains the navigation cases to move from one page to another. --> <navigation-rule> <navigation-case> <from-outcome>projectOverview</from-outcome> <to-view-id>/ProjectOverviewPage.xhtml</to-view-id> + <redirect>true</redirect> </navigation-case> </navigation-rule> diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/pretty-config.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/pretty-config.xml index ed35f3fee6424e347c165542926b7829c198a15d..81ed73da8d70baa5b4ad4949a96079dd16f6a894 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/pretty-config.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/pretty-config.xml @@ -2,6 +2,7 @@ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://ocpsoft.com/prettyfaces/3.3.2 http://ocpsoft.com/xml/ns/prettyfaces/ocpsoft-pretty-faces-3.3.2.xsd"> + <!-- The following mappings make sure that we have more "pretty" looking urls. --> <url-mapping id="home"> <pattern value="/" /> <view-id value="/faces/ProjectOverviewPage.xhtml" /> diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/shiro.ini b/Kieker.WebGUI/src/main/webapp/WEB-INF/shiro.ini deleted file mode 100644 index d9c8f02590031a966eee2bc82f43d1af14a27188..0000000000000000000000000000000000000000 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/shiro.ini +++ /dev/null @@ -1,17 +0,0 @@ -# ======================= -# Shiro INI configuration -# ======================= - -[main] - -authc.loginUrl = /Kieker.WebGUI/login - -securityManager.rememberMeManager.cookie.name = KiekerWebGuiLoginCookie -securityManager.rememberMeManager.cookie.maxAge = 10000 - -[users] -Nils = kieker - -[roles] - -[urls] diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-config.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-config.xml new file mode 100644 index 0000000000000000000000000000000000000000..302d8ffd258c0a27762287b6841a28bab6098a37 --- /dev/null +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-config.xml @@ -0,0 +1,117 @@ +<beans xmlns="http://www.springframework.org/schema/beans" + xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:aop="http://www.springframework.org/schema/aop" + xmlns:context="http://www.springframework.org/schema/context" + xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd + http://www.springframework.org/schema/aop http://www.springframework.org/schema/aop/spring-aop-2.5.xsd + http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-2.5.xsd"> + + <!-- As there is no view scope available in Spring, we have to use a custom defined scope for this purpose. --> + <bean class="org.springframework.beans.factory.config.CustomScopeConfigurer"> + <property name="scopes"> + <map> + <entry key="view"> + <bean class="kieker.webgui.common.util.ViewScope"/> + </entry> + </map> + </property> + </bean> + + <!-- This is for the properties-files. --> + <bean id="globalPropertPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> + <property name="locations"> + <list> + <value>classpath:global.properties</value> + </list> + </property> + </bean> + + <!-- The singleton scoped beans. --> + <bean id="projectManagerFacade" class="kieker.webgui.common.ProjectManagerFacade"/> + <bean id="projectsBean" class="kieker.webgui.beans.application.ProjectsBean" init-method="initialize"> + <property name="projectManagerFacade" ref="projectManagerFacade" /> + </bean> + <bean id="globalPropertiesBean" class="kieker.webgui.beans.application.GlobalPropertiesBean"> + <property name="themeCookieName" value="${kieker.webgui.config.lookAndFeel.cookieName}"/> + <property name="projectOverviewPage" value="${kieker.webgui.page.projectOverview}"/> + <property name="facesContextThemeKey" value="${kieker.webgui.config.lookAndFeel.facesContextKey}"/> + <property name="defaultTheme" value="${kieker.webgui.config.lookAndFeel.defaultTheme}"/> + <property name="analysisEditorGridSizeCookieName" value="${kieker.webgui.config.analysisEditor.gridSize.cookieName}"/> + <property name="analysisEditorGridColorCookieName" value="${kieker.webgui.config.analysisEditor.gridColor.cookieName}"/> + <property name="analysisEditorDefaultGridSize" value="${kieker.webgui.config.analysisEditor.defaultGridSize}"/> + <property name="analysisEditorDefaultGridColor" value="${kieker.webgui.config.analysisEditor.defaultGridColor}"/> + </bean> + <bean id="themeSwitcherBean" class="kieker.webgui.beans.application.ThemeSwitcherBean"> + <!-- This is the map containing the available themes (look and feels). If one wants to add more themes, this is the correct place to do so. --> + <property name="themes"> + <map> + <entry key="Aristo" value="aristo"/> + <entry key="Black-Tie" value="black-tie"/> + <entry key="Blitzer" value="blitzer"/> + <entry key="Bluesky" value="bluesky"/> + <entry key="Casablanca" value="casablanca"/> + <entry key="Cupertino" value="cupertino"/> + <entry key="Dark-Hive" value="dark-hive"/> + <entry key="Dot-Luv" value="dot-luv"/> + <entry key="Eggplant" value="eggplant"/> + <entry key="Excite-Bike" value="excite-bike"/> + <entry key="Flick" value="flick"/> + <entry key="Glass-X" value="glass-x"/> + <entry key="Hot-Sneaks" value="hot-sneaks"/> + <entry key="Humanity" value="humanity"/> + <entry key="Le-Frog" value="le-frog"/> + <entry key="Midnight" value="midnight"/> + <entry key="Mint-Choc" value="mint-choc"/> + <entry key="Overcast" value="overcast"/> + <entry key="Pepper-Grinder" value="pepper-grinder"/> + <entry key="Redmond" value="redmond"/> + <entry key="Rocket" value="rocket"/> + <entry key="Smoothness" value="smoothness"/> + <entry key="South-Street" value="south-street"/> + <entry key="Start" value="start"/> + <entry key="Sunny" value="sunny"/> + <entry key="Swanky-Purse" value="swanky-purse"/> + <entry key="Trontastic" value="trontastic"/> + <entry key="UI-Darkness" value="ui-darkness"/> + <entry key="UI-Lightness" value="ui-lightness"/> + <entry key="Vader" value="vader"/> + </map> + </property> + </bean> + + <!-- The session scoped beans. --> + <bean id="currentConfigurationBean" class="kieker.webgui.beans.session.CurrentConfigurationBean" scope="session" init-method="initialize"> + <property name="globalPropertiesBean" ref="globalPropertiesBean"/> + </bean> + <bean id="userBean" class="kieker.webgui.beans.session.UserBean" scope="session"> + <property name="globalPropertiesBean" ref="globalPropertiesBean"/> + </bean> + + <!-- The view scoped beans. --> + <bean id="currentAnalysisEditorBean" class="kieker.webgui.beans.view.CurrentAnalysisEditorBean" scope="view"> + <property name="globalPropertiesBean" ref="globalPropertiesBean"/> + <property name="projectManagerFacade" ref="projectManagerFacade" /> + <property name="projectsBean" ref="projectsBean" /> + <property name="currentAnalysisEditorGraphBean" ref="currentAnalysisEditorGraphBean" /> + <property name="currentConfigurationBean" ref="currentConfigurationBean" /> + </bean> + <bean id="currentAnalysisEditorGraphBean" class="kieker.webgui.beans.view.CurrentAnalysisEditorGraphBean" scope="view"/> + <bean id="currentCockpitBean" class="kieker.webgui.beans.view.CurrentCockpitBean" scope="view"> + <property name="projectsBean" ref="projectsBean"/> + <property name="projectManagerFacade" ref="projectManagerFacade" /> + </bean> + <bean id="currentCockpitEditorBean" class="kieker.webgui.beans.view.CurrentCockpitEditorBean" scope="view"> + <property name="globalPropertiesBean" ref="globalPropertiesBean"/> + <property name="projectManagerFacade" ref="projectManagerFacade" /> + <property name="projectsBean" ref="projectsBean"/> + </bean> + <bean id="currentControllerBean" class="kieker.webgui.beans.view.CurrentControllerBean" scope="view"> + <property name="projectsBean" ref="projectsBean"/> + <property name="projectManagerFacade" ref="projectManagerFacade" /> + </bean> + <bean id="currentProjectOverviewBean" class="kieker.webgui.beans.view.CurrentProjectOverviewBean" scope="view" init-method="initialialize"> + <property name="projectsBean" ref="projectsBean"/> + </bean> + + <!-- The request scoped beans. --> + <bean id="stringBean" class="kieker.webgui.beans.request.StringBean" scope="request"/> +</beans> \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml index 8e6a4a3dca3c88461ce9201ee98604247c3a8966..a1cf9fe49bc6a317d54ea643ce47f914e22a6501 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml @@ -16,7 +16,7 @@ <param-value>Development</param-value> </context-param> - <!-- This parameter makes sure that the theme chooser will work. --> + <!-- This parameter makes sure that the primefaces theme chooser will work. --> <context-param> <param-name>primefaces.THEME</param-name> <param-value>#{currentConfigurationBean.lookAndFeel}</param-value> @@ -37,6 +37,7 @@ <url-pattern>/*</url-pattern> </filter-mapping> + <!-- The following servlet and mapping make sure that the JSF pages will be interpreted correctly. --> <servlet> <servlet-name>Faces Servlet</servlet-name> <servlet-class>javax.faces.webapp.FacesServlet</servlet-class> @@ -77,25 +78,6 @@ <dispatcher>ERROR</dispatcher> </filter-mapping> - <!-- The following is necessary for Apache Shiro. --> - <listener> - <listener-class>org.apache.shiro.web.env.EnvironmentLoaderListener</listener-class> - </listener> - - <filter> - <filter-name>ShiroFilter</filter-name> - <filter-class>org.apache.shiro.web.servlet.ShiroFilter</filter-class> - </filter> - - <filter-mapping> - <filter-name>ShiroFilter</filter-name> - <url-pattern>/*</url-pattern> - <dispatcher>REQUEST</dispatcher> - <dispatcher>FORWARD</dispatcher> - <dispatcher>INCLUDE</dispatcher> - <dispatcher>ERROR</dispatcher> - </filter-mapping> - <!-- This listener will be used by the webgui itself to initialize the environment. --> <listener> <listener-class>kieker.webgui.common.EnvironmentLoaderListener</listener-class> @@ -106,4 +88,19 @@ <param-name>com.sun.faces.expressionFactory</param-name> <param-value>com.sun.el.ExpressionFactoryImpl</param-value> </context-param> + + <!-- The following part is necessary for Spring. --> + <context-param> + <param-name>contextConfigLocation</param-name> + <param-value>/WEB-INF/spring-config.xml</param-value> + </context-param> + + <listener> + <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> + </listener> + + <listener> + <listener-class>org.springframework.web.context.request.RequestContextListener</listener-class> + </listener> + </web-app> diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/ProjectOverviewPageDialogs.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/ProjectOverviewPageDialogs.xhtml index f9f0b4aa0fbf6db85b74a9ea1232660b572a039c..374fbde018e6b55419162d5b00e291b12481c091 100644 --- a/Kieker.WebGUI/src/main/webapp/dialogs/ProjectOverviewPageDialogs.xhtml +++ b/Kieker.WebGUI/src/main/webapp/dialogs/ProjectOverviewPageDialogs.xhtml @@ -18,7 +18,7 @@ <hr/> <div style="text-align: right"> - <p:commandButton value="#{localizedMessages.ok}" action="#{projectsBean.addProject(stringBean.string)}" update=":projectsListForm :messages" oncomplete="newProjectDialog.hide()" /> + <p:commandButton value="#{localizedMessages.ok}" action="#{projectsBean.addProject(stringBean.string, currentProjectOverviewBean)}" update=":projectsListForm :messages" oncomplete="newProjectDialog.hide()" /> <p:spacer width="10px" height="10" /> <p:commandButton value="#{localizedMessages.cancel}" onclick="newProjectDialog.hide()" /> </div> @@ -73,7 +73,7 @@ <hr/> <div style="text-align: right"> - <p:commandButton value="#{localizedMessages.ok}" action="#{projectsBean.copyProject(currentProjectOverviewBean.projectName, stringBean.string)}" update=":projectsListForm :messages" oncomplete="copyProjectDialog.hide()" /> + <p:commandButton value="#{localizedMessages.ok}" action="#{projectsBean.copyProject(currentProjectOverviewBean.projectName, stringBean.string, currentProjectOverviewBean)}" update=":projectsListForm :messages" oncomplete="copyProjectDialog.hide()" /> <p:spacer width="10px" height="10" /> <p:commandButton value="#{localizedMessages.cancel}" onclick="copyProjectDialog.hide()" /> </div> diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/SettingsDialog.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/SettingsDialog.xhtml index f13fd987afa8effa744f66a9c35f0be9cec52175..a0776c0c62be2100c6d59312bd46875464a3b0dc 100644 --- a/Kieker.WebGUI/src/main/webapp/dialogs/SettingsDialog.xhtml +++ b/Kieker.WebGUI/src/main/webapp/dialogs/SettingsDialog.xhtml @@ -46,7 +46,7 @@ </p:tabView> <hr/> <div style="text-align: right"> - <p:commandButton value="#{localizedMessages.ok}" oncomplete="settingsDlg.hide();"/> + <p:commandButton value="#{localizedMessages.ok}" oncomplete="settingsDlg.hide()"/> </div> </h:form> </p:dialog>