From 252ee27b49b892e43c93793f786964fa7b0b45a8 Mon Sep 17 00:00:00 2001 From: Nils Christian Ehmke <nie@informatik.uni-kiel.de> Date: Mon, 29 Oct 2012 10:57:29 +0100 Subject: [PATCH] Revert "Refactoring" This reverts commit 8fd2a615b840a8c269b882a4db29771196f6b22b. --- Kieker.WebGUI/bin/Kieker.WebGUI.bat | 2 +- Kieker.WebGUI/bin/Kieker.WebGUI.sh | 2 +- .../Bookstore-Example/Bookstore-Example.kax | 2 +- Kieker.WebGUI/pom.xml | 3 +- .../application/GlobalPropertiesBean.java | 47 +-- .../beans/application/ProjectsBean.java | 67 ++-- .../beans/application/ThemeSwitcherBean.java | 7 +- .../beans/application/package-info.java | 2 +- .../beans/request/NewUserBean.java | 9 +- .../beans/request/StringBean.java | 7 +- .../beans/request/package-info.java | 2 +- .../beans/session/UserBean.java | 48 +-- .../beans/session/package-info.java | 2 +- .../beans/view/CurrentAnalysisEditorBean.java | 94 +++-- .../view/CurrentAnalysisEditorGraphBean.java | 7 +- .../beans/view/CurrentCockpitBean.java | 50 ++- .../beans/view/CurrentCockpitEditorBean.java | 38 +- .../beans/view/CurrentControllerBean.java | 59 +-- .../view/CurrentProjectOverviewBean.java | 31 +- .../beans/view/CurrentUserManagementBean.java | 60 ++- .../beans/view/package-info.java | 2 +- .../business/converter/package-info.java | 7 - .../kieker/webgui/business/package-info.java | 7 - .../kieker/webgui/common/IProjectManager.java | 348 ++++++++++++++++++ .../IUserManager.java} | 22 +- .../main/java/kieker/webgui/common/Role.java | 40 ++ .../main/java/kieker/webgui/common/User.java | 46 +++ .../converter/RoleStringConverter.java | 4 +- .../converter}/package-info.java | 5 +- .../ApplicationInitializationException.java | 55 --- .../common/exception/DataAccessException.java | 54 --- .../impl/ProjectManagerImpl.java} | 156 ++++---- .../impl/UserManagerImpl.java} | 140 +++---- .../impl/package-info.java | 5 +- .../impl => common}/util/ACManager.java | 15 +- .../impl => common}/util/Analysis.java | 2 +- .../util/FSManager.java} | 132 +++---- .../impl => common}/util/PluginFinder.java | 7 +- .../webgui/common/{ => util}/ViewScope.java | 2 +- .../webgui/common/util/package-info.java | 23 ++ .../java/kieker/webgui/domain/Project.java | 48 --- .../main/java/kieker/webgui/domain/User.java | 133 ------- .../webgui/persistence/IProjectDAO.java | 101 ----- .../kieker/webgui/persistence/IUserDAO.java | 55 --- .../webgui/persistence/impl/package-info.java | 22 -- .../webgui/persistence/package-info.java | 22 -- .../webgui/service/IProjectService.java | 124 ------- .../webgui/service/impl/UserServiceImpl.java | 97 ----- .../service/impl/util/package-info.java | 7 - .../kieker/webgui/service/package-info.java | 22 -- .../src/main/resources/global.properties | 9 - .../lang/AccessDeniedPage_de.properties | 4 +- .../lang/AnalysisEditorPage_de.properties | 4 +- .../lang/CockpitEditorPage_de.properties | 4 +- .../resources/lang/CockpitPage_de.properties | 2 +- .../main/resources/lang/Common_de.properties | 15 +- .../main/resources/lang/Common_en.properties | 3 +- .../lang/ControllerPage_de.properties | 12 +- .../resources/lang/LoginPage_de.properties | 4 +- .../lang/ProjectOverviewPage_de.properties | 6 +- .../lang/UserManagementPage_de.properties | 6 +- .../src/main/webapp/WEB-INF/faces-config.xml | 6 +- .../src/main/webapp/WEB-INF/pretty-config.xml | 19 +- .../webapp/WEB-INF/spring-bean-config.xml | 89 +++-- .../webapp/WEB-INF/spring-common-config.xml | 15 +- .../webapp/WEB-INF/spring-database-config.xml | 11 +- .../webapp/WEB-INF/spring-security-config.xml | 21 +- .../webapp/WEB-INF/spring-security-taglib.xml | 5 +- Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml | 8 +- .../src/main/webapp/css/AccessDeniedPage.css | 5 - .../main/webapp/css/AnalysisEditorPage.css | 5 - .../src/main/webapp/css/CockpitEditorPage.css | 5 - .../src/main/webapp/css/CockpitPage.css | 5 - Kieker.WebGUI/src/main/webapp/css/Common.css | 5 - .../src/main/webapp/css/ControllerPage.css | 7 +- .../src/main/webapp/css/DefaultTemplate.css | 4 +- .../src/main/webapp/css/FlowEditor.css | 5 - Kieker.WebGUI/src/main/webapp/css/Icons.css | 5 - .../src/main/webapp/css/LoginPage.css | 5 - .../main/webapp/css/ProjectOverviewPage.css | 5 - .../src/main/webapp/css/UserManagement.css | 5 +- .../src/main/webapp/dialogs/AboutDialog.xhtml | 5 +- .../dialogs/AnalysisEditorPageDialogs.xhtml | 4 - .../dialogs/CockpitEditorPageDialogs.xhtml | 19 +- .../dialogs/ProjectOverviewPageDialogs.xhtml | 22 +- .../main/webapp/dialogs/SettingsDialog.xhtml | 6 - .../dialogs/UserManagementDialogs.xhtml | 3 - .../main/webapp/templates/PagesTemplate.xhtml | 2 +- 88 files changed, 1060 insertions(+), 1547 deletions(-) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/application/GlobalPropertiesBean.java (92%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/application/ProjectsBean.java (85%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/application/ThemeSwitcherBean.java (91%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/application/package-info.java (94%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/request/NewUserBean.java (92%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/request/StringBean.java (93%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/request/package-info.java (95%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/session/UserBean.java (89%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/session/package-info.java (95%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/view/CurrentAnalysisEditorBean.java (94%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/view/CurrentAnalysisEditorGraphBean.java (99%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/view/CurrentCockpitBean.java (84%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/view/CurrentCockpitEditorBean.java (95%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/view/CurrentControllerBean.java (84%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/view/CurrentProjectOverviewBean.java (81%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/view/CurrentUserManagementBean.java (70%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => }/beans/view/package-info.java (95%) delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/business/converter/package-info.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/business/package-info.java create mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/common/IProjectManager.java rename Kieker.WebGUI/src/main/java/kieker/webgui/{service/IUserService.java => common/IUserManager.java} (61%) create mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/common/Role.java create mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/common/User.java rename Kieker.WebGUI/src/main/java/kieker/webgui/{business => common}/converter/RoleStringConverter.java (94%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{domain => common/converter}/package-info.java (89%) delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/common/exception/ApplicationInitializationException.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/common/exception/DataAccessException.java rename Kieker.WebGUI/src/main/java/kieker/webgui/{service/impl/ProjectServiceImpl.java => common/impl/ProjectManagerImpl.java} (67%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{persistence/impl/DerbyUserDAO.java => common/impl/UserManagerImpl.java} (50%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{service => common}/impl/package-info.java (89%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{service/impl => common}/util/ACManager.java (96%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{service/impl => common}/util/Analysis.java (99%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{persistence/impl/FSProjectDAOImpl.java => common/util/FSManager.java} (84%) rename Kieker.WebGUI/src/main/java/kieker/webgui/{service/impl => common}/util/PluginFinder.java (96%) rename Kieker.WebGUI/src/main/java/kieker/webgui/common/{ => util}/ViewScope.java (98%) create mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/common/util/package-info.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/domain/Project.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/domain/User.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IProjectDAO.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IUserDAO.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/package-info.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/persistence/package-info.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/service/IProjectService.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/UserServiceImpl.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/package-info.java delete mode 100644 Kieker.WebGUI/src/main/java/kieker/webgui/service/package-info.java diff --git a/Kieker.WebGUI/bin/Kieker.WebGUI.bat b/Kieker.WebGUI/bin/Kieker.WebGUI.bat index de50cb99..43f71488 100644 --- a/Kieker.WebGUI/bin/Kieker.WebGUI.bat +++ b/Kieker.WebGUI/bin/Kieker.WebGUI.bat @@ -1,6 +1,6 @@ @echo off REM @author Nils Christian Ehmke -java -XX:PermSize=256M -XX:MaxPermSize=512M -Xms128M -Xmx256M -jar ..\lib\jetty-runner-*.jar --path /Kieker.WebGUI ..\target\Kieker.WebGUI-*.war +java -jar ..\lib\jetty-runner-*.jar --path /Kieker.WebGUI ..\target\Kieker.WebGUI-*.war @echo on \ No newline at end of file diff --git a/Kieker.WebGUI/bin/Kieker.WebGUI.sh b/Kieker.WebGUI/bin/Kieker.WebGUI.sh index df1ff528..82a5cab6 100644 --- a/Kieker.WebGUI/bin/Kieker.WebGUI.sh +++ b/Kieker.WebGUI/bin/Kieker.WebGUI.sh @@ -2,4 +2,4 @@ # @author Nils Christian Ehmke -java -XX:PermSize=256M -XX:MaxPermSize=512M -Xms128M -Xmx256M -jar ../lib/jetty-runner-*.jar --path /Kieker.WebGUI ../target/Kieker.WebGUI-*.war \ No newline at end of file +java -jar ../lib/jetty-runner-*.jar --path /Kieker.WebGUI ../target/Kieker.WebGUI-*.war \ No newline at end of file diff --git a/Kieker.WebGUI/bin/data/Bookstore-Example/Bookstore-Example.kax b/Kieker.WebGUI/bin/data/Bookstore-Example/Bookstore-Example.kax index c5d6fd62..719668e2 100644 --- a/Kieker.WebGUI/bin/data/Bookstore-Example/Bookstore-Example.kax +++ b/Kieker.WebGUI/bin/data/Bookstore-Example/Bookstore-Example.kax @@ -1,5 +1,5 @@ <?xml version="1.0" encoding="UTF-8"?> -<Project xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="platform:/resource/Kieker/model/AnalysisMetaModel.ecore" name="Bookstore-Example"> +<Project xmi:version="2.0" xmlns:xmi="http://www.omg.org/XMI" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns="platform:/resource/Kieker/model/AnalysisMetaModel.ecore"> <plugins xsi:type="Reader" name="FSReader" classname="kieker.analysis.plugin.reader.filesystem.FSReader"> <properties name="inputDirs" value="data/Bookstore-Example/testdata"/> <properties name="ignoreUnknownRecordTypes" value="false"/> diff --git a/Kieker.WebGUI/pom.xml b/Kieker.WebGUI/pom.xml index f959b1f2..b7ad5ff9 100644 --- a/Kieker.WebGUI/pom.xml +++ b/Kieker.WebGUI/pom.xml @@ -22,7 +22,6 @@ </developer> </developers> - <properties> <endorsed.dir>${project.build.directory}/endorsed</endorsed.dir> <project.build.sourceEncoding>UTF-8</project.build.sourceEncoding> @@ -410,7 +409,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/business/beans/application/GlobalPropertiesBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/GlobalPropertiesBean.java similarity index 92% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/application/GlobalPropertiesBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/GlobalPropertiesBean.java index 06494bb4..d93a1bdc 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/application/GlobalPropertiesBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/GlobalPropertiesBean.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.application; +package kieker.webgui.beans.application; import java.io.Serializable; import java.util.ResourceBundle; @@ -23,9 +23,6 @@ import javax.faces.application.FacesMessage; import javax.faces.application.FacesMessage.Severity; import javax.faces.context.FacesContext; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - /** * 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 @@ -35,8 +32,6 @@ import org.springframework.stereotype.Component; * * @author Nils Christian Ehmke */ -@Component -@Scope("singleton") public final class GlobalPropertiesBean implements Serializable { private static final long serialVersionUID = 4253541090603377504L; @@ -63,8 +58,6 @@ public final class GlobalPropertiesBean implements Serializable { private String analysisEditorGridColorCookieName; private String analysisEditorDefaultGridSize; private String analysisEditorDefaultGridColor; - private String version; - private String kiekerUrl; /** * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> @@ -92,44 +85,6 @@ public final class GlobalPropertiesBean implements Serializable { return this.projectOverviewPage; } - /** - * Getter for the property {@link GlobalPropertiesBean#version}. - * - * @return The current value of the property. - */ - public String getVersion() { - return this.version; - } - - /** - * Setter for the property {@link GlobalPropertiesBean#version}. - * - * @param version - * The new value of the property. - */ - public void setVersion(final String version) { - this.version = version; - } - - /** - * Getter for the property {@link GlobalPropertiesBean#kiekerUrl}. - * - * @return The current value of the property. - */ - public String getKiekerUrl() { - return this.kiekerUrl; - } - - /** - * Setter for the property {@link GlobalPropertiesBean#kiekerUrl}. - * - * @param kiekerUrl - * The new value of the property. - */ - public void setKiekerUrl(final String kiekerUrl) { - this.kiekerUrl = kiekerUrl; - } - /** * Setter for the property {@link GlobalPropertiesBean#facesContextThemeKey}. <b>Do not use this method. This property is Spring managed.</b> * diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/application/ProjectsBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java similarity index 85% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/application/ProjectsBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java index d09ecb32..f28ed670 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/application/ProjectsBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ProjectsBean.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.application; +package kieker.webgui.beans.application; import java.io.IOException; import java.util.ArrayList; @@ -24,22 +24,14 @@ import java.util.List; import javax.faces.application.FacesMessage; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Lazy; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - -import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; -import kieker.webgui.business.beans.view.CurrentProjectOverviewBean; +import kieker.webgui.beans.view.CurrentProjectOverviewBean; +import kieker.webgui.common.IProjectManager; import kieker.webgui.common.exception.ProjectAlreadyExistingException; import kieker.webgui.common.exception.ProjectLoadException; import kieker.webgui.common.exception.ProjectNotExistingException; -import kieker.webgui.domain.Project; -import kieker.webgui.service.IProjectService; /** * 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 @@ -50,10 +42,7 @@ import kieker.webgui.service.IProjectService; * * @author Nils Christian Ehmke */ -@Component -@Scope("singleton") -@Lazy -public final class ProjectsBean implements InitializingBean { +public final class ProjectsBean { private static final Log LOG = LogFactory.getLog(ProjectsBean.class); private static final String DEFAULT_TIMESTAMP = "N/A"; @@ -61,8 +50,7 @@ public final class ProjectsBean implements InitializingBean { private final List<String> projects = Collections.synchronizedList(new ArrayList<String>()); - @Autowired - private IProjectService projectService; + private IProjectManager projectManagerFacade; /** * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> @@ -71,6 +59,24 @@ public final class ProjectsBean implements InitializingBean { // No code necessary } + /** + * 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 IProjectManager projectManagerFacade) { + this.projectManagerFacade = projectManagerFacade; + } + + /** + * This method does some initialization work after construction. <b>Do not call this method. The method is Spring managed.</b> + */ + protected void initialize() { + // Load a list with all available projects on the FS + this.projects.addAll(this.projectManagerFacade.listAllProjects()); + } + /** * This method adds a new project with the given name to the application if this is possible. In either case (this means if the project has been created, if the * project could not be created for any reason) the user will be informed via the growl component. In other words: A message will be delivered within the current @@ -86,10 +92,8 @@ public final class ProjectsBean implements InitializingBean { */ public void addProject(final String project, final CurrentProjectOverviewBean currentProjectOverviewBean) { try { - final Project emptyProject = new Project(MIAnalysisMetaModelFactory.eINSTANCE.createProject()); - emptyProject.getMiproject().setName(project); // Try and use the FS-Manager to create the project atomically. - this.projectService.addProject(emptyProject); + this.projectManagerFacade.addProject(project); // If there were no exception, everything went well. We can add the project to our list. this.projects.add(project); // Inform the user @@ -122,7 +126,7 @@ public final class ProjectsBean implements InitializingBean { 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.projectService.copyProject(sourceProject, destinationProject); + this.projectManagerFacade.copyProject(sourceProject, destinationProject); // If there were no exception, everything went well. We can add the project to our list. this.projects.add(destinationProject); // Inform the user @@ -154,7 +158,7 @@ public final class ProjectsBean implements InitializingBean { */ public MIProject openProject(final String project) throws ProjectLoadException { try { - return this.projectService.openProject(project).getMiproject(); + return this.projectManagerFacade.openProject(project); } catch (final IOException ex) { ProjectsBean.LOG.error("An error occured while loading the project.", ex); throw new ProjectLoadException("An error occured while loading the project.", ex); @@ -175,17 +179,13 @@ public final class ProjectsBean implements InitializingBean { public String getCurrTimeStamp(final String project) { try { // Get the current time stamp of the project - final long timeStamp = this.projectService.getCurrTimestamp(project); + final long timeStamp = this.projectManagerFacade.getCurrTimeStamp(project); // Convert the stamp into a human readable string. return new Date(timeStamp).toString(); } catch (final ProjectNotExistingException ex) { ProjectsBean.LOG.info("A project with the given name does not exist.", ex); // We can assume that something went wrong return ProjectsBean.DEFAULT_TIMESTAMP; - } catch (final IOException ex) { - ProjectsBean.LOG.info("An IO Exception occured.", ex); - // We can assume that something went wrong - return ProjectsBean.DEFAULT_TIMESTAMP; } } @@ -211,21 +211,10 @@ public final class ProjectsBean implements InitializingBean { */ public String getAnalysisControllerState(final String project) { try { - return this.projectService.getCurrentState(project).toString(); + return this.projectManagerFacade.getCurrentState(project).toString(); } catch (final ProjectNotExistingException ex) { ProjectsBean.LOG.info("A project with the given name does not exist.", ex); return ProjectsBean.DEFAULT_ANALYSIS_STATE; } } - - /* - * (non-Javadoc) - * - * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() - */ - @Override - public void afterPropertiesSet() throws Exception { - // Load a list with all available projects on the FS - this.projects.addAll(this.projectService.listAllProjects()); - } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/application/ThemeSwitcherBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ThemeSwitcherBean.java similarity index 91% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/application/ThemeSwitcherBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ThemeSwitcherBean.java index cfbc8ebc..91bb4b37 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/application/ThemeSwitcherBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/ThemeSwitcherBean.java @@ -14,14 +14,11 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.application; +package kieker.webgui.beans.application; import java.util.Collections; import java.util.Map; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - /** * 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. The initialization is done in the Spring configuration file.<br> @@ -29,8 +26,6 @@ import org.springframework.stereotype.Component; * * @author Nils Christian Ehmke */ -@Component -@Scope("singleton") public final class ThemeSwitcherBean { private Map<String, String> themes; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/application/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/package-info.java similarity index 94% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/application/package-info.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/package-info.java index 527f6e06..07aa9a73 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/application/package-info.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/application/package-info.java @@ -19,5 +19,5 @@ * * @author Nils Christian Ehmke */ -package kieker.webgui.business.beans.application; +package kieker.webgui.beans.application; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/request/NewUserBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/NewUserBean.java similarity index 92% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/request/NewUserBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/NewUserBean.java index f3742d6e..23c42a30 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/request/NewUserBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/NewUserBean.java @@ -14,15 +14,12 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.request; +package kieker.webgui.beans.request; import java.util.ArrayList; import java.util.List; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - -import kieker.webgui.domain.User.Role; +import kieker.webgui.common.Role; /** * This simple bean is request scoped and can be used to store the necessary data for a new user during a request. It is not to be used to deliver a list of users @@ -30,8 +27,6 @@ import kieker.webgui.domain.User.Role; * * @author Nils Christian Ehmke */ -@Component -@Scope("request") public class NewUserBean { private List<Role> roles; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/request/StringBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/StringBean.java similarity index 93% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/request/StringBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/StringBean.java index cdbbf929..caabc4ae 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/request/StringBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/StringBean.java @@ -14,10 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.request; - -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; +package kieker.webgui.beans.request; /** * 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 @@ -26,8 +23,6 @@ import org.springframework.stereotype.Component; * * @author Nils Christian Ehmke */ -@Component -@Scope("request") public final class StringBean { private String string; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/request/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/package-info.java similarity index 95% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/request/package-info.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/package-info.java index 04b12db2..26cfe25c 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/request/package-info.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/request/package-info.java @@ -19,5 +19,5 @@ * * @author Nils Christian Ehmke */ -package kieker.webgui.business.beans.request; +package kieker.webgui.beans.request; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/session/UserBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java similarity index 89% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/session/UserBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java index e92c7403..a9a6025d 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/session/UserBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/UserBean.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.session; +package kieker.webgui.beans.session; import java.io.Serializable; import java.util.Map; @@ -23,14 +23,10 @@ import javax.faces.context.FacesContext; import javax.servlet.http.Cookie; import javax.servlet.http.HttpServletResponse; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; import org.springframework.security.core.context.SecurityContextHolder; import org.springframework.security.core.userdetails.UserDetails; -import org.springframework.stereotype.Component; -import kieker.webgui.business.beans.application.GlobalPropertiesBean; +import kieker.webgui.beans.application.GlobalPropertiesBean; /** * This bean contains information about the user of this session (like the properties and configurations). This class is a Spring managed bean with session scope. @@ -38,9 +34,7 @@ import kieker.webgui.business.beans.application.GlobalPropertiesBean; * * @author Nils Christian Ehmke */ -@Component -@Scope("session") -public final class UserBean implements Serializable, InitializingBean { +public final class UserBean implements Serializable { private static final long serialVersionUID = 6422563876003638348L; @@ -48,7 +42,9 @@ public final class UserBean implements Serializable, InitializingBean { private String gridColor; private int gridSize; - @Autowired + /** + * This property is injected by Spring. + */ private GlobalPropertiesBean globalPropertiesBean; /** @@ -58,6 +54,15 @@ public final class UserBean implements Serializable, InitializingBean { // No code necessary } + /** + * 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 Spring managed.</b> + */ + protected void initialize() { + this.loadDefaultValues(); + this.loadValuesFromCookies(); + } + /** * Returns the name of the user of the current session. If something goes wrong during the search, it returns a human readable 'N/A'. * @@ -80,6 +85,18 @@ public final class UserBean implements Serializable, InitializingBean { return username; } + /** + * The setter for the property {@link UserBean#globalPropertiesBean}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param globalPropertiesBean + * The new value for the property. + */ + public void setGlobalPropertiesBean(final GlobalPropertiesBean globalPropertiesBean) { + synchronized (this) { + this.globalPropertiesBean = globalPropertiesBean; + } + } + /** * The getter for the property {@link UserBean#lookAndFeel}. * @@ -210,15 +227,4 @@ public final class UserBean implements Serializable, InitializingBean { final HttpServletResponse response = (HttpServletResponse) FacesContext.getCurrentInstance().getExternalContext().getResponse(); response.addCookie(cookie); } - - /* - * (non-Javadoc) - * - * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() - */ - @Override - public void afterPropertiesSet() throws Exception { - this.loadDefaultValues(); - this.loadValuesFromCookies(); - } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/session/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/package-info.java similarity index 95% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/session/package-info.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/package-info.java index 3afe701f..ecc09dce 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/session/package-info.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/session/package-info.java @@ -19,5 +19,5 @@ * * @author Nils Christian Ehmke */ -package kieker.webgui.business.beans.session; +package kieker.webgui.beans.session; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentAnalysisEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java similarity index 94% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentAnalysisEditorBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java index 3d72c24f..4462c676 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentAnalysisEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorBean.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.view; +package kieker.webgui.beans.view; import java.io.IOException; import java.lang.annotation.Annotation; @@ -29,10 +29,6 @@ import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; import javax.faces.event.ValueChangeEvent; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; import kieker.analysis.model.analysisMetaModel.MIDependency; import kieker.analysis.model.analysisMetaModel.MIDisplay; @@ -53,17 +49,16 @@ import kieker.analysis.plugin.reader.AbstractReaderPlugin; import kieker.analysis.repository.AbstractRepository; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; -import kieker.webgui.business.beans.application.GlobalPropertiesBean; -import kieker.webgui.business.beans.application.ProjectsBean; -import kieker.webgui.business.beans.session.UserBean; +import kieker.webgui.beans.application.GlobalPropertiesBean; +import kieker.webgui.beans.application.ProjectsBean; +import kieker.webgui.beans.session.UserBean; import kieker.webgui.common.ClassAndMethodContainer; +import kieker.webgui.common.IProjectManager; import kieker.webgui.common.exception.LibraryAlreadyExistingException; import kieker.webgui.common.exception.LibraryLoadException; import kieker.webgui.common.exception.NewerProjectException; import kieker.webgui.common.exception.ProjectLoadException; import kieker.webgui.common.exception.ProjectNotExistingException; -import kieker.webgui.domain.Project; -import kieker.webgui.service.IProjectService; import org.primefaces.context.RequestContext; import org.primefaces.event.FileUploadEvent; @@ -84,8 +79,6 @@ import org.eclipse.emf.ecore.EObject; * * @author Nils Christian Ehmke */ -@Component -@Scope("view") 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. @@ -139,15 +132,10 @@ 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; - @Autowired - private IProjectService projectService; - @Autowired + private IProjectManager projectManagerFacade; private ProjectsBean projectsBean; - @Autowired private CurrentAnalysisEditorGraphBean currentAnalysisEditorGraphBean; - @Autowired private UserBean userBean; - @Autowired private GlobalPropertiesBean globalPropertiesBean; /** @@ -157,6 +145,54 @@ public final class CurrentAnalysisEditorBean { // No code necessary } + /** + * Setter for the attribute {@link CurrentAnalysisEditorBean#projectManagerFacade}. + * + * @param projectManagerFacade + * The new value of the attribute. + */ + public void setProjectManagerFacade(final IProjectManager projectManagerFacade) { + this.projectManagerFacade = projectManagerFacade; + } + + /** + * Getter for the attribute {@link CurrentAnalysisEditorBean#currentAnalysisEditorGraphBean}. + * + * @return Delivers the value of the attribute. + */ + public CurrentAnalysisEditorGraphBean getCurrentAnalysisEditorGraphBean() { + return this.currentAnalysisEditorGraphBean; + } + + /** + * Setter for the attribute {@link CurrentAnalysisEditorBean#currentAnalysisEditorGraphBean}. + * + * @param currentAnalysisEditorGraphBean + * The new value of the attribute. + */ + public void setCurrentAnalysisEditorGraphBean(final CurrentAnalysisEditorGraphBean currentAnalysisEditorGraphBean) { + this.currentAnalysisEditorGraphBean = currentAnalysisEditorGraphBean; + } + + /** + * Getter for the attribute {@link CurrentAnalysisEditorBean#projectsBean}. + * + * @return Delivers the value of the attribute. + */ + public ProjectsBean getProjectsBean() { + return this.projectsBean; + } + + /** + * Setter for the attribute {@link CurrentAnalysisEditorBean#projectsBean}. + * + * @param projectsBean + * The new value of the attribute. + */ + public void setProjectsBean(final ProjectsBean projectsBean) { + this.projectsBean = projectsBean; + } + /** * This method delivers the project stored in this bean. * @@ -262,8 +298,8 @@ public final class CurrentAnalysisEditorBean { */ private void addContentsToToolPalette(final MIDependency dependency) throws LibraryLoadException { this.addContentsToToolPalette( - this.projectService.getAllPluginsWithinLib(dependency, new Project(this.project), this.classLoader, this.classAndMethodContainer), - this.projectService.getAllRepositoriesWithinLib(dependency, new Project(this.project), this.classLoader, this.classAndMethodContainer)); + this.projectManagerFacade.getAllPluginsWithinLib(dependency, this.projectName, this.classLoader, this.classAndMethodContainer), + this.projectManagerFacade.getAllRepositoriesWithinLib(dependency, this.projectName, this.classLoader, this.classAndMethodContainer)); } /** @@ -274,8 +310,8 @@ public final class CurrentAnalysisEditorBean { */ private void addKiekerContentsToToolPalette() throws LibraryLoadException { this.addContentsToToolPalette( - this.projectService.getAllPluginsWithinKiekerLib(this.classLoader, this.classAndMethodContainer), - this.projectService.getAllRepositoriesWithinKiekerLib(this.classLoader, this.classAndMethodContainer)); + this.projectManagerFacade.getAllPluginsWithinKiekerLib(this.classLoader, this.classAndMethodContainer), + this.projectManagerFacade.getAllRepositoriesWithinKiekerLib(this.classLoader, this.classAndMethodContainer)); } /** @@ -333,7 +369,7 @@ public final class CurrentAnalysisEditorBean { private void initializeModelLibraries() throws ProjectLoadException { synchronized (this) { try { - final List<String> libs = this.projectService.listAllLibraries(new Project(this.project)); + final List<String> libs = this.projectManagerFacade.listAllLibraries(this.projectName); // Add them, but remove all existing dependencies so far to avoid double entries. This also makes sure that the model - after it has been opened - // points // just to valid dependencies (and to all of them). @@ -359,7 +395,7 @@ public final class CurrentAnalysisEditorBean { private void reloadClassLoader() throws ProjectLoadException { synchronized (this) { try { - this.classLoader = this.projectService.getClassLoader(new Project(this.project)); // NOPMD (ClassLoader) + this.classLoader = this.projectManagerFacade.getClassLoader(this.projectName); // NOPMD (ClassLoader) } catch (final NullPointerException ex) { throw new ProjectLoadException("Invalid class loader.", ex); } catch (final IOException ex) { @@ -633,7 +669,7 @@ public final class CurrentAnalysisEditorBean { // Use the file system manager to upload the new file final MIDependency lib; synchronized (this) { - this.projectService.uploadLibrary(file, new Project(this.project)); + this.projectManagerFacade.uploadLibrary(file, this.projectName); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, this.globalPropertiesBean.getMsgLibraryUploaded()); // As it seem to have worked, we can add the library to our model. lib = this.factory.createDependency(); @@ -673,7 +709,7 @@ public final class CurrentAnalysisEditorBean { public List<String> getLibraries() { synchronized (this) { try { - final List<String> result = this.projectService.listAllLibraries(new Project(this.project)); + final List<String> result = this.projectManagerFacade.listAllLibraries(this.projectName); result.add(0, "Kieker"); return result; @@ -724,11 +760,7 @@ public final class CurrentAnalysisEditorBean { public void saveProject(final boolean overwriteNewerProject) { synchronized (this) { try { - if (overwriteNewerProject) { - this.projectService.editProject(new Project(this.project)); - } else { - this.projectService.editProject(new Project(this.project), this.timeStamp); - } + this.projectManagerFacade.saveProject(this.projectName, this.project, this.timeStamp, overwriteNewerProject); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, this.globalPropertiesBean.getMsgProjectSaved()); // Update the time stamp! this.resetTimeStamp(); diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentAnalysisEditorGraphBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorGraphBean.java similarity index 99% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentAnalysisEditorGraphBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorGraphBean.java index d601b31a..ca3f6c43 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentAnalysisEditorGraphBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentAnalysisEditorGraphBean.java @@ -14,15 +14,12 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.view; +package kieker.webgui.beans.view; import java.util.Map; import javax.faces.context.FacesContext; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.model.analysisMetaModel.MIFilter; import kieker.analysis.model.analysisMetaModel.MIInputPort; import kieker.analysis.model.analysisMetaModel.MIOutputPort; @@ -48,8 +45,6 @@ import org.eclipse.emf.ecore.EObject; * * @author Nils Christian Ehmke */ -@Component -@Scope("view") public final class CurrentAnalysisEditorGraphBean { /** * This is the log for errors, exceptions etc. diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentCockpitBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitBean.java similarity index 84% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentCockpitBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitBean.java index 89829074..529e1d84 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentCockpitBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitBean.java @@ -14,28 +14,23 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.view; +package kieker.webgui.beans.view; import java.io.IOException; import javax.faces.application.FacesMessage; import javax.faces.context.FacesContext; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.model.analysisMetaModel.MIView; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; -import kieker.webgui.business.beans.application.GlobalPropertiesBean; -import kieker.webgui.business.beans.application.ProjectsBean; +import kieker.webgui.beans.application.GlobalPropertiesBean; +import kieker.webgui.beans.application.ProjectsBean; import kieker.webgui.common.ClassAndMethodContainer; +import kieker.webgui.common.IProjectManager; import kieker.webgui.common.exception.DisplayNotFoundException; import kieker.webgui.common.exception.ProjectNotExistingException; -import kieker.webgui.domain.Project; -import kieker.webgui.service.IProjectService; /** * The {@link CurrentCockpitBean} contains the necessary data behind an instance of the cockpit. It provides methods to read the state of the currently selected @@ -45,18 +40,14 @@ import kieker.webgui.service.IProjectService; * * @author Nils Christian Ehmke */ -@Component -@Scope("view") public final class CurrentCockpitBean { private static final Log LOG = LogFactory.getLog(CurrentCockpitBean.class); - @Autowired - private IProjectService projectService; + private IProjectManager projectManagerFacade; private String projectName; private MIProject project; private MIView activeView; private ClassAndMethodContainer classAndMethodContainer; - @Autowired private ProjectsBean projectsBean; /** @@ -77,6 +68,33 @@ public final class CurrentCockpitBean { } } + public void setProjectManagerFacade(final IProjectManager projectManagerFacade) { + this.projectManagerFacade = projectManagerFacade; + } + + /** + * The getter for the {@link #projectsBean}-property. + * + * @return {@link #projectsBean} + */ + public ProjectsBean getProjectsBean() { + synchronized (this) { + return this.projectsBean; + } + } + + /** + * The setter for the {@link #projectsBean}-property. + * + * @param projectsBean + * The new value for {@link #projectsBean}. + */ + public void setProjectsBean(final ProjectsBean projectsBean) { + synchronized (this) { + this.projectsBean = projectsBean; + } + } + /** * This method sets the project stored within this bean. * @@ -104,7 +122,7 @@ public final class CurrentCockpitBean { this.project = this.projectsBean.openProject(this.projectName); if (this.project != null) { - final ClassLoader classLoader = this.projectService.getClassLoader(new Project(this.project)); // NOPMD (ClassLoader) + final ClassLoader classLoader = this.projectManagerFacade.getClassLoader(this.projectName); // NOPMD (ClassLoader) this.classAndMethodContainer = new ClassAndMethodContainer(classLoader); } } @@ -145,7 +163,7 @@ public final class CurrentCockpitBean { synchronized (this) { if ((this.activeView != null) && (this.projectName != null)) { try { - final Object displayObj = this.projectService.getDisplay(this.projectName, this.activeView.getName(), displayName); + final Object displayObj = this.projectManagerFacade.getDisplay(this.projectName, this.activeView.getName(), displayName); final String result = (String) ClassAndMethodContainer.invokeMethod(this.classAndMethodContainer.getPlainTextgetTextMethod(), displayObj, "Error"); return result; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentCockpitEditorBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java similarity index 95% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentCockpitEditorBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java index 1eb383b7..68fc91eb 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentCockpitEditorBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentCockpitEditorBean.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.view; +package kieker.webgui.beans.view; import java.io.IOException; import java.lang.annotation.Annotation; @@ -30,10 +30,6 @@ import javax.faces.component.UIInput; import javax.faces.component.html.HtmlOutputText; import javax.faces.context.FacesContext; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.display.annotation.Display; import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; import kieker.analysis.model.analysisMetaModel.MIDisplay; @@ -44,14 +40,13 @@ import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory; import kieker.analysis.plugin.AbstractPlugin; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; -import kieker.webgui.business.beans.application.GlobalPropertiesBean; -import kieker.webgui.business.beans.application.ProjectsBean; +import kieker.webgui.beans.application.GlobalPropertiesBean; +import kieker.webgui.beans.application.ProjectsBean; import kieker.webgui.common.ClassAndMethodContainer; +import kieker.webgui.common.IProjectManager; import kieker.webgui.common.exception.NewerProjectException; import kieker.webgui.common.exception.ProjectLoadException; import kieker.webgui.common.exception.ProjectNotExistingException; -import kieker.webgui.domain.Project; -import kieker.webgui.service.IProjectService; import org.primefaces.component.dashboard.Dashboard; import org.primefaces.component.panel.Panel; @@ -69,16 +64,13 @@ import org.primefaces.model.DefaultDashboardModel; * * @author Nils Christian Ehmke */ -@Component -@Scope("view") 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(); - @Autowired - private IProjectService projectService; + private IProjectManager projectManagerFacade; private ClassAndMethodContainer classAndMethodContainer; private long timeStamp; @@ -89,9 +81,7 @@ public final class CurrentCockpitEditorBean { private Dashboard dashboard; private DashboardModel dashboardModel; - @Autowired private ProjectsBean projectsBean; - @Autowired private GlobalPropertiesBean globalPropertiesBean; /** @@ -101,6 +91,16 @@ public final class CurrentCockpitEditorBean { this.createDashboard(); } + /** + * Setter for the property {@link CurrentCockpitEditorBean#projectManagerFacade}. + * + * @param projectManagerFacade + * The new value of the property. + */ + public void setProjectManagerFacade(final IProjectManager projectManagerFacade) { + this.projectManagerFacade = projectManagerFacade; + } + private void createDashboard() { final FacesContext fc = FacesContext.getCurrentInstance(); final Application application = fc.getApplication(); @@ -227,7 +227,7 @@ public final class CurrentCockpitEditorBean { private void reloadClassLoader() throws ProjectLoadException { synchronized (this) { try { - this.classLoader = this.projectService.getClassLoader(new Project(this.project)); // NOPMD (ClassLoader) + this.classLoader = this.projectManagerFacade.getClassLoader(this.projectName); // NOPMD (ClassLoader) } catch (final NullPointerException ex) { throw new ProjectLoadException("Invalid class loader.", ex); } catch (final IOException ex) { @@ -314,11 +314,7 @@ public final class CurrentCockpitEditorBean { public void saveProject(final boolean overwriteNewerProject) { synchronized (this) { try { - if (overwriteNewerProject) { - this.projectService.editProject(new Project(this.project)); - } else { - this.projectService.editProject(new Project(this.project), this.timeStamp); - } + this.projectManagerFacade.saveProject(this.projectName, this.project, this.timeStamp, overwriteNewerProject); GlobalPropertiesBean.showMessage(FacesMessage.SEVERITY_INFO, this.globalPropertiesBean.getMsgProjectSaved()); // Update the time stamp! this.resetTimeStamp(); diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentControllerBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentControllerBean.java similarity index 84% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentControllerBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentControllerBean.java index d4d093ac..5c62d286 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentControllerBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentControllerBean.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.view; +package kieker.webgui.beans.view; import java.io.IOException; import java.io.PrintWriter; @@ -25,18 +25,14 @@ import java.util.Collection; import java.util.Date; import java.util.List; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.AnalysisController; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; -import kieker.webgui.business.beans.application.ProjectsBean; +import kieker.webgui.beans.application.ProjectsBean; +import kieker.webgui.common.IProjectManager; import kieker.webgui.common.exception.AnalysisInitializationException; import kieker.webgui.common.exception.AnalysisStateException; import kieker.webgui.common.exception.ProjectNotExistingException; -import kieker.webgui.service.IProjectService; /** * /** @@ -45,17 +41,13 @@ import kieker.webgui.service.IProjectService; * * @author Nils Christian Ehmke */ -@Component -@Scope("view") public final class CurrentControllerBean { private static final Log LOG = LogFactory.getLog(CurrentControllerBean.class); - @Autowired - private IProjectService projectService; + private IProjectManager projectManagerFacade; private final List<String> logEntries = new ArrayList<String>(); private String projectName; - @Autowired private ProjectsBean projectsBean; /** @@ -65,6 +57,29 @@ public final class CurrentControllerBean { // No code necessary } + /** + * The getter for the {@link #projectsBean}-property. + * + * @return {@link #projectsBean} + */ + public ProjectsBean getProjectsBean() { + return this.projectsBean; + } + + public void setProjectManagerFacade(final IProjectManager projectManagerFacade) { + this.projectManagerFacade = projectManagerFacade; + } + + /** + * The setter for the {@link #projectsBean}-property. + * + * @param projectsBean + * The new value for {@link #projectsBean}. + */ + public void setProjectsBean(final ProjectsBean projectsBean) { + this.projectsBean = projectsBean; + } + /** * This method sets the project stored within this bean and returns the new page for the navigation. * @@ -96,7 +111,7 @@ public final class CurrentControllerBean { synchronized (this) { this.addLogEntry("Starting Analysis for project '" + this.projectName + "'"); try { - this.projectService.startAnalysis(this.projectName); + this.projectManagerFacade.startAnalysis(this.projectName); } catch (final AnalysisStateException ex) { CurrentControllerBean.LOG.info("The analysis has already been started.", ex); this.addLogEntry(ex); @@ -114,7 +129,7 @@ public final class CurrentControllerBean { try { this.addLogEntry("Stopping Analysis for project '" + this.projectName + "'"); synchronized (this) { - this.projectService.stopAnalysis(this.projectName); + this.projectManagerFacade.stopAnalysis(this.projectName); } } catch (final AnalysisStateException ex) { CurrentControllerBean.LOG.info("The analysis has not been started yet.", ex); @@ -132,7 +147,7 @@ public final class CurrentControllerBean { synchronized (this) { this.addLogEntry("Instantiating Analysis for project '" + this.projectName + "'"); try { - this.projectService.initializeAnalysis(this.projectName, this.projectService.getClassLoader(this.projectName)); // NOPMD (ClassLoader) + this.projectManagerFacade.initializeAnalysis(this.projectName, this.projectManagerFacade.getClassLoader(this.projectName)); // NOPMD (ClassLoader) } catch (final AnalysisStateException ex) { CurrentControllerBean.LOG.error("The analysis has already been instantiated.", ex); this.addLogEntry(ex); @@ -156,7 +171,7 @@ public final class CurrentControllerBean { synchronized (this) { this.addLogEntry("Cleaning Analysis for project '" + this.projectName + "'"); try { - this.projectService.cleanAnalysis(this.projectName); + this.projectManagerFacade.cleanAnalysis(this.projectName); } catch (final ProjectNotExistingException ex) { CurrentControllerBean.LOG.info("The project does not exist.", ex); this.addLogEntry(ex); @@ -175,7 +190,7 @@ public final class CurrentControllerBean { public boolean isAnalysisRunning() { synchronized (this) { try { - return this.projectService.getCurrentState(this.projectName) == AnalysisController.STATE.RUNNING; + return this.projectManagerFacade.getCurrentState(this.projectName) == AnalysisController.STATE.RUNNING; } catch (final ProjectNotExistingException ex) { CurrentControllerBean.LOG.info("The project does not exist.", ex); return false; @@ -195,7 +210,7 @@ public final class CurrentControllerBean { public boolean isAnalysisReady() { synchronized (this) { try { - return this.projectService.getCurrentState(this.projectName) == AnalysisController.STATE.READY; + return this.projectManagerFacade.getCurrentState(this.projectName) == AnalysisController.STATE.READY; } catch (final ProjectNotExistingException ex) { CurrentControllerBean.LOG.info("The project does not exist.", ex); return false; @@ -215,7 +230,7 @@ public final class CurrentControllerBean { public boolean isAnalysisNotAvailable() { synchronized (this) { try { - return this.projectService.getCurrentState(this.projectName) == null; + return this.projectManagerFacade.getCurrentState(this.projectName) == null; } catch (final ProjectNotExistingException ex) { CurrentControllerBean.LOG.info("The project does not exist.", ex); return true; @@ -235,7 +250,7 @@ public final class CurrentControllerBean { public boolean isAnalysisTerminated() { synchronized (this) { try { - return this.projectService.getCurrentState(this.projectName) == AnalysisController.STATE.TERMINATED; + return this.projectManagerFacade.getCurrentState(this.projectName) == AnalysisController.STATE.TERMINATED; } catch (final ProjectNotExistingException ex) { CurrentControllerBean.LOG.info("The project does not exist.", ex); return false; @@ -255,7 +270,7 @@ public final class CurrentControllerBean { public boolean isAnalysisFailed() { synchronized (this) { try { - return this.projectService.getCurrentState(this.projectName) == AnalysisController.STATE.FAILED; + return this.projectManagerFacade.getCurrentState(this.projectName) == AnalysisController.STATE.FAILED; } catch (final ProjectNotExistingException ex) { CurrentControllerBean.LOG.info("The project does not exist.", ex); return false; @@ -274,7 +289,7 @@ public final class CurrentControllerBean { */ public Object[] getAnalysisLog() { try { - return this.projectService.getLogEntries(this.projectName); + return this.projectManagerFacade.getLogEntries(this.projectName); } catch (final AnalysisStateException ex) { // Ignore return new Object[0]; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentProjectOverviewBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentProjectOverviewBean.java similarity index 81% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentProjectOverviewBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentProjectOverviewBean.java index 4fdb984c..6ccfb249 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentProjectOverviewBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentProjectOverviewBean.java @@ -14,17 +14,12 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.view; +package kieker.webgui.beans.view; import java.util.ArrayList; import java.util.List; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - -import kieker.webgui.business.beans.application.ProjectsBean; +import kieker.webgui.beans.application.ProjectsBean; import org.primefaces.event.SelectEvent; @@ -34,11 +29,8 @@ import org.primefaces.event.SelectEvent; * * @author Nils Christian Ehmke */ -@Component -@Scope("view") -public final class CurrentProjectOverviewBean implements InitializingBean { +public final class CurrentProjectOverviewBean { - @Autowired private ProjectsBean projectsBean; /** * This list contains all available projects by name. @@ -95,6 +87,13 @@ public final class CurrentProjectOverviewBean implements InitializingBean { this.projectsBean = projectsBean; } + /** + * This method should only be called automatically by Spring to update the projects list. + */ + protected void initialialize() { + this.updateLists(); + } + /** * Updates the list containing the available projects name. */ @@ -111,14 +110,4 @@ public final class CurrentProjectOverviewBean implements InitializingBean { return this.projects; } - /* - * (non-Javadoc) - * - * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() - */ - @Override - public void afterPropertiesSet() throws Exception { - this.updateLists(); - } - } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentUserManagementBean.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentUserManagementBean.java similarity index 70% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentUserManagementBean.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentUserManagementBean.java index 3325d127..f044ba0a 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/CurrentUserManagementBean.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/CurrentUserManagementBean.java @@ -14,30 +14,21 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.beans.view; +package kieker.webgui.beans.view; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - -import kieker.webgui.domain.User; -import kieker.webgui.domain.User.Role; -import kieker.webgui.service.IUserService; +import kieker.webgui.common.IUserManager; +import kieker.webgui.common.Role; +import kieker.webgui.common.User; /** * @author Nils Christian Ehmke */ -@Component -@Scope("view") -public final class CurrentUserManagementBean implements InitializingBean { +public final class CurrentUserManagementBean { - @Autowired - private IUserService userService; + private IUserManager userManagerFacade; /** * This list contains all available users. */ @@ -50,6 +41,16 @@ public final class CurrentUserManagementBean implements InitializingBean { // No code necessary } + /** + * Setter for the property {@link CurrentUserManagementBean#userManagerFacade}. + * + * @param userManagerFacade + * The new value for the property. + */ + public void setUserManagerFacade(final IUserManager userManagerFacade) { + this.userManagerFacade = userManagerFacade; + } + /** * This method adds the given user to the database and informs about success via the growl component. * @@ -61,9 +62,9 @@ public final class CurrentUserManagementBean implements InitializingBean { * The roles of the new user. */ public void addUser(final String username, final String password, final List<Role> roles) { - this.userService.addUser(new User(username, password, roles, true)); + this.userManagerFacade.addUser(username, password, roles); // TODO Check that the op was successful before adding the user to our list - this.users.add(new User(username, "", roles, true)); + this.users.add(new User(username, roles, true)); } /** @@ -72,8 +73,8 @@ public final class CurrentUserManagementBean implements InitializingBean { * @param username * The name of the user. */ - public void deleteUser(final User user) { - this.userService.deleteUser(user); + public void removeUser(final String username) { + this.userManagerFacade.removeUser(username); } /** @@ -87,14 +88,21 @@ public final class CurrentUserManagementBean implements InitializingBean { * The (new) roles of the user. */ public void editUser(final String username, final String password, final Role... roles) { - this.userService.editUserWithPassword(new User(username, password, Arrays.asList(roles), true)); + this.userManagerFacade.editUser(username, password, roles); + } + + /** + * This method initializes the bean. <b>Do not call this method manually. It will only be accessed by Spring.</b> + */ + protected void initialialize() { + this.updateList(); } /** * Updates the list containing the available users. */ public void updateList() { - this.users = this.userService.getUsers(); + this.users = this.userManagerFacade.getUsers(); } /** @@ -105,14 +113,4 @@ public final class CurrentUserManagementBean implements InitializingBean { public List<User> getUsers() { return this.users; } - - /* - * (non-Javadoc) - * - * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() - */ - @Override - public void afterPropertiesSet() throws Exception { - this.updateList(); - } } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/package-info.java similarity index 95% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/package-info.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/package-info.java index 4ad020a3..1294ccfa 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/beans/view/package-info.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/beans/view/package-info.java @@ -19,5 +19,5 @@ * * @author Nils Christian Ehmke */ -package kieker.webgui.business.beans.view; +package kieker.webgui.beans.view; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/converter/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/business/converter/package-info.java deleted file mode 100644 index 77315859..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/converter/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * - */ -/** - * @author Nils Christian Ehmke - */ -package kieker.webgui.business.converter; \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/business/package-info.java deleted file mode 100644 index 6958f39b..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * - */ -/** - * @author Nils Christian Ehmke - */ -package kieker.webgui.business; \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/IProjectManager.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/IProjectManager.java new file mode 100644 index 00000000..d7e68c11 --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/IProjectManager.java @@ -0,0 +1,348 @@ +/*************************************************************************** + * 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; + +import java.io.IOException; +import java.util.Collection; +import java.util.List; + +import kieker.analysis.AnalysisController.STATE; +import kieker.analysis.model.analysisMetaModel.MIDependency; +import kieker.analysis.model.analysisMetaModel.MIProject; +import kieker.analysis.plugin.AbstractPlugin; +import kieker.analysis.repository.AbstractRepository; +import kieker.webgui.common.exception.AnalysisInitializationException; +import kieker.webgui.common.exception.AnalysisStateException; +import kieker.webgui.common.exception.DisplayNotFoundException; +import kieker.webgui.common.exception.LibraryAlreadyExistingException; +import kieker.webgui.common.exception.LibraryLoadException; +import kieker.webgui.common.exception.NewerProjectException; +import kieker.webgui.common.exception.ProjectAlreadyExistingException; +import kieker.webgui.common.exception.ProjectNotExistingException; + +import org.primefaces.model.UploadedFile; + +/** + * This is the interface for a component which is responsible for managing all projects. This means that this interface can be used to create, copy, delete projects + * as well as to start and stop the corresponding analyses and similar things. The facade should abstract from details like the (memory) locations and from + * synchronization. Latter should be guaranteed by the facade, which means that multiple requests for the same project do not go wrong. + * + * @author Nils Christian Ehmke + */ +public interface IProjectManager { + + /** + * This method adds a new project to the application. It creates an empty, but nevertheless valid kax-file to the file system. If the method fails due to an + * {@link IOException}, it will make sure that the project-directories will be removed as if the method would never have been called. + * + * @param projectName + * The name of the new project. + * @throws ProjectAlreadyExistingException + * If a project with the same name exists already. + * @throws IOException + * If something went wrong during the creation of the project. + */ + public void addProject(final String projectName) throws ProjectAlreadyExistingException, IOException; + + /** + * This method makes a copy of a project and saves it under another name. If the method fails due to an {@link IOException}, it will make sure that the + * project-directories of the destination-project will be removed as if the method would never have been called. + * + * @param originalProjectName + * The name of the source project. + * @param newProjectName + * The name of the target project. + * @throws ProjectNotExistingException + * If a project with the given (source) name doesn't exist. + * @throws ProjectAlreadyExistingException + * If a project with the same (target) name exists already. + * @throws IOException + * If something went wrong during the creation of the target-project or during the loading of the source-project. + */ + public void copyProject(final String originalProjectName, final String newProjectName) throws ProjectNotExistingException, ProjectAlreadyExistingException, + IOException; + + /** + * This method loads the kax-file for the given project name and delivers an initializes instance of {@link MIProject}. + * + * @param projectName + * The name of the project to be loaded. + * @return The model instance as defined by the corresponding kax-file. + * @throws ProjectNotExistingException + * If a project with the given (source) name doesn't exist. + * @throws IOException + * If something went wrong during the opening of the project. + */ + public MIProject openProject(final String projectName) throws ProjectNotExistingException, IOException; + + /** + * This method loads the kax-file for the given project name and delivers an initializes instance of {@link MIProject} - but instead of using the "normal" class + * loader, it uses the methods and classes stored in the given instance of {@link ClassAndMethodContainer}. This means that this method <b>does</b> return an + * instance of {@link MIProject}, but the one defined in the container. This is also the reason why this method has to return an {@link Object}-instance. + * + * @param projectName + * The name of the project to be loaded. + * @param classAndMethodContainer + * The container, which will be used to load the project instance. + * @return The model instance as defined by the corresponding kax-file. + * @throws ProjectNotExistingException + * If a project with the given (source) name doesn't exist. + * @throws IOException + * If something went wrong during the opening of the project. This can also mean that the given {@link ClassAndMethodContainer} is somehow invalid. + */ + public Object openProject(final String projectName, final ClassAndMethodContainer classAndMethodContainer) throws ProjectNotExistingException, IOException; + + /** + * This method tries to save the given model instance for the given project. The given time stamp will be compared (if the corresponding flag says so) with the + * current time stamp of the project. If the project on the file system has been modified in the meantime, a {@link NewerProjectException} will be thrown. If + * something goes wrong during the storage, it is <b>not</b> guaranteed that the resulting file will be valid. + * + * @param projectName + * The name of the project which has to be saved. + * @param project + * The model instance to be stored in the corresponding kax-file. + * @param timeStamp + * The time stamp which has to be compared with the "real" time stamp of the project. + * @param overwriteNewerProject + * Determines whether a newer project file will be overwritten without further warning or not- + * @throws ProjectNotExistingException + * If a project with the given name does not exist. + * @throws IOException + * If something went wrong during the storage of the model instance. + * @throws NewerProjectException + * If the project on the file system is newer and the overwriteNewerProject-flag has not been set. + */ + public void saveProject(final String projectName, final MIProject project, final long timeStamp, final boolean overwriteNewerProject) throws + ProjectNotExistingException, IOException, NewerProjectException; + + /** + * Delivers the current time stamp of the given project. + * + * @param projectName + * The name of the project whose time stamp will be delivered. + * @return The current time stamp. + * @throws ProjectNotExistingException + * If a project with the given name does not exist. + */ + public long getCurrTimeStamp(final String projectName) throws ProjectNotExistingException; + + /** + * This method tries to upload a dependency to the given project. + * + * @param file + * The file to be uploaded to the project. + * @param projectName + * The name of the project. + * @throws ProjectNotExistingException + * If a project with the given name does not exist. + * @throws IOException + * If something went wrong during the uploading. + * @throws LibraryAlreadyExistingException + * If a library with the same name exists already. + */ + public void uploadLibrary(final UploadedFile file, final String projectName) throws ProjectNotExistingException, IOException, LibraryAlreadyExistingException; + + /** + * This method delivers a class loader containing the currently available libraries of the given project. + * + * @param projectName + * The name of the project. + * @return A class loader for the given project. + * @throws ProjectNotExistingException + * If a project with the given name does not exist. + * @throws IOException + * If something went wrong during the initialization of the class loader. + */ + public ClassLoader getClassLoader(final String projectName) throws ProjectNotExistingException, IOException; + + /** + * This method lists all available libraries of the given project. + * + * @param projectName + * The name of the project whose libraries have to be delivered. + * @return A list containing all available library-names of the project. + * @throws ProjectNotExistingException + * If a project with the given name does not exist. + */ + public List<String> listAllLibraries(final String projectName) throws ProjectNotExistingException; + + /** + * This method delivers the available classes from the type {@link AbstractRepository} within the given dependency for the given project, using the given + * parameters. + * + * @param lib + * The library to be searched. + * @param project + * The project for the given library. + * @param classLoader + * The class loader to be used. + * @param classAndMethodContainer + * The container with classes and methods to be used. + * @return A list with all repository-classes. + * @throws LibraryLoadException + * If something went wrong during the loading of the library. + */ + public List<Class<AbstractRepository>> getAllRepositoriesWithinLib(final MIDependency lib, final String project, final ClassLoader classLoader, + final ClassAndMethodContainer classAndMethodContainer) throws LibraryLoadException; + + /** + * This method delivers the available classes from the type {@link AbstractPlugin} within the given dependency for the given project, using the given + * parameters. + * + * @param lib + * The library to be searched. + * @param project + * The project for the given library. + * @param classLoader + * The class loader to be used. + * @param classAndMethodContainer + * The container with classes and methods to be used. + * @return A list with all plugin-classes. + * @throws LibraryLoadException + * If something went wrong during the loading of the library. + */ + public List<Class<AbstractPlugin>> getAllPluginsWithinLib(final MIDependency lib, final String project, final ClassLoader classLoader, + final ClassAndMethodContainer classAndMethodContainer) throws LibraryLoadException; + + /** + * This method delivers the available classes from the type {@link AbstractRepository} within the kieker dependency using the given parameters. + * + * @param classLoader + * The class loader to be used. + * @param classAndMethodContainer + * The container with classes and methods to be used. + * @return A list with all repository-classes. + * @throws LibraryLoadException + * If something went wrong during the loading of the library. + */ + public List<Class<AbstractRepository>> getAllRepositoriesWithinKiekerLib(final ClassLoader classLoader, + final ClassAndMethodContainer classAndMethodContainer) throws LibraryLoadException; + + /** + * This method delivers the available classes from the type {@link AbstractPlugin} within the kieker dependency using the given parameters. + * + * @param classLoader + * The class loader to be used. + * @param classAndMethodContainer + * The container with classes and methods to be used. + * @return A list with all plugin-classes. + * @throws LibraryLoadException + * If something went wrong during the loading of the library. + */ + public List<Class<AbstractPlugin>> getAllPluginsWithinKiekerLib(final ClassLoader classLoader, final ClassAndMethodContainer classAndMethodContainer) throws + LibraryLoadException; + + /** + * This method lists all available projects on the file system. + * + * @return A list containing all available project names. + */ + public Collection<String> listAllProjects(); + + /** + * This method initializes the analysis of the given project. + * + * @param projectName + * The name of the project whose analysis should be initialized. + * @param classLoader + * The class loader to be used during the loading. + * @throws ProjectNotExistingException + * If a project with the given name does not exist. + * @throws AnalysisStateException + * If the analysis of the given project is in the wrong state to be initialized. This means that it has not been cleaned yet. + * @throws AnalysisInitializationException + * If an error occurred during the initialization of the analysis. + */ + public void initializeAnalysis(final String projectName, final ClassLoader classLoader) throws ProjectNotExistingException, AnalysisStateException, + AnalysisInitializationException; + + /** + * This method cleans the analysis of the given project. + * + * @param projectName + * The name of the project whose analysis should be cleaned. + * @throws ProjectNotExistingException + * If a project with the given name does not exist. + * @throws AnalysisStateException + * If the analysis of the given project is in the wrong state to be cleaned. This means that it has not been terminated yet. + */ + public void cleanAnalysis(final String projectName) throws ProjectNotExistingException, AnalysisStateException; + + /** + * This method starts the analysis of the given project. + * + * @param projectName + * The name of the project whose analysis should be started. + * @throws ProjectNotExistingException + * If a project with the given name does not exist. + * @throws AnalysisStateException + * If the analysis of the given project is in the wrong state to be started. This means that it has not been initialized yet. + */ + public void startAnalysis(final String projectName) throws ProjectNotExistingException, AnalysisStateException; + + /** + * This method stops the analysis of the given project. + * + * @param projectName + * The name of the project whose analysis should be stopped. + * @throws ProjectNotExistingException + * If a project with the given name does not exist. + * @throws AnalysisStateException + * If the analysis of the given project is in the wrong state to be stopped. This means that it has not been started yet or is no longer running. + */ + public void stopAnalysis(final String projectName) throws ProjectNotExistingException, AnalysisStateException; + + /** + * This method delivers the display object of the (currently running) analysis for the given project and the given parameters. Technically it is an instance of + * {@code AbstractDisplay}, but in fact the project specific class loader has been used. + * + * @param projectName + * The name of the project. + * @param viewName + * The name of the view. + * @param displayName + * The name of the display. + * @return A display object for the given parameters. + * @throws ProjectNotExistingException + * If a project with the given name does not exist. + * @throws DisplayNotFoundException + * If a view or a display within the given view does not exist. + */ + public Object getDisplay(final String projectName, final String viewName, final String displayName) throws ProjectNotExistingException, DisplayNotFoundException; + + /** + * This method delivers the current state of the given project. + * + * @param projectName + * The name of the project whose state have to be returned. + * @return The state of the given project, if available. {@code null} otherwise. + * @throws ProjectNotExistingException + * If a project with the given name does not exist. + */ + public STATE getCurrentState(final String projectName) throws ProjectNotExistingException; + + /** + * This method delivers the available log entries of the analysis controller of the given project. + * + * @param projectName + * The name of the project. + * @return An array containing the entries of the log. + * @throws AnalysisStateException + * If the analysis is in an invalid state to deliver the entries. + */ + public Object[] getLogEntries(final String projectName) throws AnalysisStateException; +} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/IUserService.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/IUserManager.java similarity index 61% rename from Kieker.WebGUI/src/main/java/kieker/webgui/service/IUserService.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/common/IUserManager.java index 96ecdb6d..c8266c2b 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/IUserService.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/IUserManager.java @@ -14,34 +14,22 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.service; +package kieker.webgui.common; import java.util.List; import org.springframework.security.access.prepost.PreAuthorize; -import kieker.webgui.common.exception.DataAccessException; -import kieker.webgui.domain.User; - -/** - * This is the interface for the user service, responsible for managing the available users within the system. This interface will only be accessible by - * administrators. - * - * @author Nils Christian Ehmke - */ -public interface IUserService { - - @PreAuthorize("hasRole('ROLE_ADMIN')") - public void addUser(final User user); +public interface IUserManager { @PreAuthorize("hasRole('ROLE_ADMIN')") - public void editUserWithoutPassword(final User user) throws DataAccessException; + public void addUser(final String username, final String password, final List<Role> roles); @PreAuthorize("hasRole('ROLE_ADMIN')") - public void editUserWithPassword(final User user) throws DataAccessException; + public void removeUser(final String username); @PreAuthorize("hasRole('ROLE_ADMIN')") - public void deleteUser(final User user); + public void editUser(final String username, final String password, final Role... roles); @PreAuthorize("hasRole('ROLE_ADMIN')") public List<User> getUsers(); diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/Role.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/Role.java new file mode 100644 index 00000000..8819d3cb --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/Role.java @@ -0,0 +1,40 @@ +/*************************************************************************** + * 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; + +public enum Role { + + ROLE_USER(1), ROLE_ADMIN(2); + + private int id; + + private Role(final int id) { + this.id = id; + } + + public int getID() { + return this.id; + } + + public static Role fromID(final int id) { + if (id == 2) { + return Role.ROLE_ADMIN; + } else { + return Role.ROLE_USER; + } + } +} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/User.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/User.java new file mode 100644 index 00000000..784eaf26 --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/User.java @@ -0,0 +1,46 @@ +/*************************************************************************** + * 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; + +import java.util.List; + +public class User { + + private final String name; + private final List<Role> roles; + private final boolean enabled; + + public User(final String name, final List<Role> roles, final boolean enabled) { + this.name = name; + this.roles = roles; + this.enabled = enabled; + } + + public String getName() { + return this.name; + } + + public List<Role> getRoles() { + return this.roles; + } + + public boolean isEnabled() { + return enabled; + } + + +} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/business/converter/RoleStringConverter.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/converter/RoleStringConverter.java similarity index 94% rename from Kieker.WebGUI/src/main/java/kieker/webgui/business/converter/RoleStringConverter.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/common/converter/RoleStringConverter.java index 2af8d493..2ddb4906 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/business/converter/RoleStringConverter.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/converter/RoleStringConverter.java @@ -14,14 +14,14 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.business.converter; +package kieker.webgui.common.converter; import javax.faces.component.UIComponent; import javax.faces.context.FacesContext; import javax.faces.convert.Converter; import javax.faces.convert.FacesConverter; -import kieker.webgui.domain.User.Role; +import kieker.webgui.common.Role; @FacesConverter("roleStringConverter") public class RoleStringConverter implements Converter { diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/converter/package-info.java similarity index 89% rename from Kieker.WebGUI/src/main/java/kieker/webgui/domain/package-info.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/common/converter/package-info.java index d9d9d837..7d66d449 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/package-info.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/converter/package-info.java @@ -15,8 +15,7 @@ ***************************************************************************/ /** - * This package contains the domain objects for the application. - * * @author Nils Christian Ehmke + * */ -package kieker.webgui.domain; \ No newline at end of file +package kieker.webgui.common.converter; \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/exception/ApplicationInitializationException.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/exception/ApplicationInitializationException.java deleted file mode 100644 index 68dcb579..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/common/exception/ApplicationInitializationException.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * 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.exception; - -/** - * - * @author Nils Christian Ehmke - */ -public final class ApplicationInitializationException extends AbstractKiekerWebGUIException { - - private static final long serialVersionUID = 1L; - - /** - * Creates a new instance of this class. - */ - public ApplicationInitializationException() { - super(); - } - - /** - * Creates a new instance of this class using the given parameters. - * - * @param msg - * The message used for the exception. - */ - public ApplicationInitializationException(final String msg) { - super(msg); - } - - /** - * Creates a new instance of this class using the given parameters. - * - * @param msg - * The message used for the exception. - * @param cause - * The cause for the exception. - */ - public ApplicationInitializationException(final String msg, final Throwable cause) { - super(msg, cause); - } -} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/exception/DataAccessException.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/exception/DataAccessException.java deleted file mode 100644 index df28b2e7..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/common/exception/DataAccessException.java +++ /dev/null @@ -1,54 +0,0 @@ -/*************************************************************************** - * 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.exception; - -public class DataAccessException extends AbstractKiekerWebGUIException { - - /** - * The UID. - */ - private static final long serialVersionUID = 1L; - - /** - * Creates a new instance of this class. - */ - public DataAccessException() { - super(); - } - - /** - * Creates a new instance of this class using the given parameters. - * - * @param msg - * The message used for the exception. - */ - public DataAccessException(final String msg) { - super(msg); - } - - /** - * Creates a new instance of this class using the given parameters. - * - * @param msg - * The message used for the exception. - * @param cause - * The cause for the exception. - */ - public DataAccessException(final String msg, final Throwable cause) { - super(msg, cause); - } -} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/ProjectServiceImpl.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/impl/ProjectManagerImpl.java similarity index 67% rename from Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/ProjectServiceImpl.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/common/impl/ProjectManagerImpl.java index 267db268..497457ca 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/ProjectServiceImpl.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/impl/ProjectManagerImpl.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.service.impl; +package kieker.webgui.common.impl; import java.io.IOException; import java.net.MalformedURLException; @@ -22,18 +22,13 @@ import java.util.Collection; import java.util.List; import java.util.concurrent.ConcurrentHashMap; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.stereotype.Service; - import kieker.analysis.AnalysisController.STATE; -import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; import kieker.analysis.model.analysisMetaModel.MIDependency; import kieker.analysis.model.analysisMetaModel.MIProject; import kieker.analysis.plugin.AbstractPlugin; import kieker.analysis.repository.AbstractRepository; import kieker.webgui.common.ClassAndMethodContainer; +import kieker.webgui.common.IProjectManager; import kieker.webgui.common.exception.AnalysisInitializationException; import kieker.webgui.common.exception.AnalysisStateException; import kieker.webgui.common.exception.DisplayNotFoundException; @@ -42,40 +37,65 @@ import kieker.webgui.common.exception.LibraryLoadException; import kieker.webgui.common.exception.NewerProjectException; import kieker.webgui.common.exception.ProjectAlreadyExistingException; import kieker.webgui.common.exception.ProjectNotExistingException; -import kieker.webgui.domain.Project; -import kieker.webgui.persistence.IProjectDAO; -import kieker.webgui.service.IProjectService; -import kieker.webgui.service.impl.util.ACManager; -import kieker.webgui.service.impl.util.PluginFinder; +import kieker.webgui.common.util.ACManager; +import kieker.webgui.common.util.FSManager; +import kieker.webgui.common.util.PluginFinder; import org.primefaces.model.UploadedFile; -@Service -@Scope("singleton") -public class ProjectServiceImpl implements IProjectService { +/** + * This is an implemented facade for the project management. For technical reasons it is a singleton class. + * + * @author Nils Christian Ehmke + */ +public final class ProjectManagerImpl implements IProjectManager { private final ConcurrentHashMap<String, Object> fileSystemLocks = new ConcurrentHashMap<String, Object>(); private final ConcurrentHashMap<String, Object> analysesLocks = new ConcurrentHashMap<String, Object>(); - @Autowired private ACManager acManager; - @Autowired + private FSManager fsManager; private PluginFinder pluginFinder; - @Autowired - private IProjectDAO projectDAO; /** * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> */ - public ProjectServiceImpl() { + public ProjectManagerImpl() { // No code necessary. } + /** + * The setter for the property {@link ProjectManagerImpl#acManager}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param acManager + */ + public void setAcManager(final ACManager acManager) { + this.acManager = acManager; + } + + /** + * The setter for the property {@link ProjectManagerImpl#fsManager}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param fsManager + */ + public void setFsManager(final FSManager fsManager) { + this.fsManager = fsManager; + } + + /** + * The setter for the property {@link ProjectManagerImpl#pluginFinder}. <b>Do not use this method. This property is Spring managed.</b> + * + * @param pluginFinder + */ + public void setPluginFinder(final PluginFinder pluginFinder) { + this.pluginFinder = pluginFinder; + } + @Override - public void addProject(final Project project) throws ProjectAlreadyExistingException, IOException { - final Object projectLock = this.getLock(project.getMiproject().getName(), this.fileSystemLocks); + public void addProject(final String projectName) throws ProjectAlreadyExistingException, IOException { + final Object projectLock = this.getLock(projectName, this.fileSystemLocks); synchronized (projectLock) { - this.projectDAO.addProject(project); + this.fsManager.addProject(projectName); } } @@ -101,17 +121,17 @@ public class ProjectServiceImpl implements IProjectService { synchronized (lockFst) { synchronized (lockSnd) { - this.projectDAO.copyProject(originalProjectName, newProjectName); + this.fsManager.copyProject(originalProjectName, newProjectName); } } } @Override - public Project openProject(final String projectName) throws ProjectNotExistingException, IOException { + public MIProject openProject(final String projectName) throws ProjectNotExistingException, IOException { final Object projectLock = this.getLock(projectName, this.fileSystemLocks); synchronized (projectLock) { - return this.projectDAO.openProject(projectName); + return this.fsManager.openProject(projectName); } } @@ -120,52 +140,55 @@ public class ProjectServiceImpl implements IProjectService { final Object projectLock = this.getLock(projectName, this.fileSystemLocks); synchronized (projectLock) { - return this.projectDAO.openProject(projectName, classAndMethodContainer); + return this.fsManager.openProject(projectName, classAndMethodContainer); } } @Override - public long getCurrTimestamp(final String projectName) throws ProjectNotExistingException, IOException { + public void saveProject(final String projectName, final MIProject project, final long timeStamp, final boolean overwriteNewerProject) throws + ProjectNotExistingException, IOException, NewerProjectException { final Object projectLock = this.getLock(projectName, this.fileSystemLocks); synchronized (projectLock) { - return this.projectDAO.getCurrTimestamp(projectName); + this.fsManager.saveProject(projectName, project, timeStamp, overwriteNewerProject); } } @Override - public void uploadLibrary(final UploadedFile file, final Project project) throws ProjectNotExistingException, IOException, LibraryAlreadyExistingException { - final Object projectLock = this.getLock(project.getMiproject().getName(), this.fileSystemLocks); + public long getCurrTimeStamp(final String projectName) throws ProjectNotExistingException { + final Object projectLock = this.getLock(projectName, this.fileSystemLocks); synchronized (projectLock) { - this.projectDAO.uploadLibrary(file, project); + return this.fsManager.getCurrTimeStamp(projectName); } } @Override - public ClassLoader getClassLoader(final Project project) throws ProjectNotExistingException, IOException { - final Object projectLock = this.getLock(project.getMiproject().getName(), this.fileSystemLocks); + public void uploadLibrary(final UploadedFile file, final String projectName) throws ProjectNotExistingException, IOException, LibraryAlreadyExistingException { + final Object projectLock = this.getLock(projectName, this.fileSystemLocks); synchronized (projectLock) { - return this.projectDAO.getClassLoader(project); // NOPMD (ClassLoader) + this.fsManager.uploadLibrary(file, projectName); } } @Override - public ClassLoader getClassLoader(final String projectName) throws IOException, ProjectNotExistingException { - final MIProject project = MIAnalysisMetaModelFactory.eINSTANCE.createProject(); - project.setName(projectName); - return this.getClassLoader(new Project(project)); + public ClassLoader getClassLoader(final String projectName) throws ProjectNotExistingException, IOException { + final Object projectLock = this.getLock(projectName, this.fileSystemLocks); + + synchronized (projectLock) { + return this.fsManager.getClassLoader(projectName); // NOPMD (ClassLoader) + } } @Override - public List<Class<AbstractRepository>> getAllRepositoriesWithinLib(final MIDependency lib, final Project project, final ClassLoader classLoader, + public List<Class<AbstractRepository>> getAllRepositoriesWithinLib(final MIDependency lib, final String projectName, final ClassLoader classLoader, final ClassAndMethodContainer classAndMethodContainer) throws LibraryLoadException { - final Object projectLock = this.getLock(project.getMiproject().getName(), this.fileSystemLocks); + final Object projectLock = this.getLock(projectName, this.fileSystemLocks); synchronized (projectLock) { try { - return this.pluginFinder.getAllRepositoriesWithinJar(this.projectDAO.getURL(lib, project), classLoader, classAndMethodContainer); + return this.pluginFinder.getAllRepositoriesWithinJar(this.fsManager.getURL(lib, projectName), classLoader, classAndMethodContainer); } catch (final MalformedURLException ex) { throw new LibraryLoadException("An error occured while loading the library.", ex); } @@ -173,13 +196,13 @@ public class ProjectServiceImpl implements IProjectService { } @Override - public List<Class<AbstractPlugin>> getAllPluginsWithinLib(final MIDependency lib, final Project project, final ClassLoader classLoader, + public List<Class<AbstractPlugin>> getAllPluginsWithinLib(final MIDependency lib, final String projectName, final ClassLoader classLoader, final ClassAndMethodContainer classAndMethodContainer) throws LibraryLoadException { - final Object projectLock = this.getLock(project.getMiproject().getName(), this.fileSystemLocks); + final Object projectLock = this.getLock(projectName, this.fileSystemLocks); synchronized (projectLock) { try { - return this.pluginFinder.getAllPluginsWithinJar(this.projectDAO.getURL(lib, project), classLoader, classAndMethodContainer); + return this.pluginFinder.getAllPluginsWithinJar(this.fsManager.getURL(lib, projectName), classLoader, classAndMethodContainer); } catch (final MalformedURLException ex) { throw new LibraryLoadException("An error occured while loading the library.", ex); } @@ -190,7 +213,7 @@ public class ProjectServiceImpl implements IProjectService { public List<Class<AbstractRepository>> getAllRepositoriesWithinKiekerLib(final ClassLoader classLoader, final ClassAndMethodContainer classAndMethodContainer) throws LibraryLoadException { try { - return this.pluginFinder.getAllRepositoriesWithinJar(this.projectDAO.getKiekerURL(), classLoader, classAndMethodContainer); + return this.pluginFinder.getAllRepositoriesWithinJar(this.fsManager.getKiekerURL(), classLoader, classAndMethodContainer); } catch (final NullPointerException ex) { throw new LibraryLoadException("An error occured while loading the library.", ex); @@ -201,7 +224,7 @@ public class ProjectServiceImpl implements IProjectService { public List<Class<AbstractPlugin>> getAllPluginsWithinKiekerLib(final ClassLoader classLoader, final ClassAndMethodContainer classAndMethodContainer) throws LibraryLoadException { try { - return this.pluginFinder.getAllPluginsWithinJar(this.projectDAO.getKiekerURL(), classLoader, classAndMethodContainer); + return this.pluginFinder.getAllPluginsWithinJar(this.fsManager.getKiekerURL(), classLoader, classAndMethodContainer); } catch (final NullPointerException ex) { throw new LibraryLoadException("An error occured while loading the library.", ex); @@ -209,17 +232,17 @@ public class ProjectServiceImpl implements IProjectService { } @Override - public List<String> listAllLibraries(final Project project) throws ProjectNotExistingException { - final Object projectLock = this.getLock(project.getMiproject().getName(), this.fileSystemLocks); + public List<String> listAllLibraries(final String projectName) throws ProjectNotExistingException { + final Object projectLock = this.getLock(projectName, this.fileSystemLocks); synchronized (projectLock) { - return this.projectDAO.listAllLibraries(project); + return this.fsManager.listAllLibraries(projectName); } } @Override public Collection<String> listAllProjects() { - return this.projectDAO.listAllProjects(); + return this.fsManager.listAllProjects(); } @Override @@ -315,35 +338,4 @@ public class ProjectServiceImpl implements IProjectService { return this.acManager.getLogEntries(projectName); } } - - /* - * (non-Javadoc) - * - * @see kieker.webgui.service.IProjectService#editProject(kieker.webgui.domain.Project) - */ - @Override - @PreAuthorize("isAuthenticated()") - public void editProject(final Project project) throws IOException, ProjectNotExistingException { - final Object projectLock = this.getLock(project.getMiproject().getName(), this.fileSystemLocks); - - synchronized (projectLock) { - this.projectDAO.saveProject(project, 0, true); - } - } - - /* - * (non-Javadoc) - * - * @see kieker.webgui.service.IProjectService#editProject(kieker.webgui.domain.Project, long) - */ - @Override - @PreAuthorize("isAuthenticated()") - public void editProject(final Project project, final long timestamp) throws IOException, ProjectNotExistingException, NewerProjectException { - final Object projectLock = this.getLock(project.getMiproject().getName(), this.fileSystemLocks); - - synchronized (projectLock) { - this.projectDAO.saveProject(project, timestamp, false); - } - } - } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/DerbyUserDAO.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/impl/UserManagerImpl.java similarity index 50% rename from Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/DerbyUserDAO.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/common/impl/UserManagerImpl.java index b5dfae5b..8054f581 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/DerbyUserDAO.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/impl/UserManagerImpl.java @@ -13,7 +13,8 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package kieker.webgui.persistence.impl; + +package kieker.webgui.common.impl; import java.sql.Connection; import java.sql.PreparedStatement; @@ -26,155 +27,104 @@ import java.util.TreeMap; import javax.sql.DataSource; -import org.springframework.beans.factory.DisposableBean; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.jdbc.datasource.DataSourceUtils; import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.stereotype.Component; -import org.springframework.transaction.annotation.Transactional; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; -import kieker.webgui.common.exception.DataAccessException; -import kieker.webgui.domain.User; -import kieker.webgui.domain.User.Role; -import kieker.webgui.persistence.IUserDAO; - -/** - * This is an implementation of the {@link IUserDAO} interface, which uses Apache Derby to store the users. It is a Spring managed singleton bean. - * - * @author Nils Christian Ehmke - */ -// FIXME Transactional annotation don't work yet -@Component -@Scope("singleton") -public class DerbyUserDAO implements IUserDAO, InitializingBean, DisposableBean { - - private static final Log LOG = LogFactory.getLog(DerbyUserDAO.class); - - @Autowired - private DataSource userDataSource; +import kieker.webgui.common.IUserManager; +import kieker.webgui.common.Role; +import kieker.webgui.common.User; + +public class UserManagerImpl implements IUserManager { + + private static final Log LOG = LogFactory.getLog(UserManagerImpl.class); + private DataSource dataSource; private Connection connection; /** * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> */ - public DerbyUserDAO() { + public UserManagerImpl() { // No code necessary } - /* - * (non-Javadoc) - * - * @see org.springframework.beans.factory.DisposableBean#destroy() + /** + * This method initializes the object.. <b>Do not call this method manually. It will only be accessed by Spring.</b> */ - @Override - public void destroy() throws Exception { - this.connection.close(); + public void initialize() { + try { + this.connection = this.dataSource.getConnection(); + } catch (final SQLException ex) { + UserManagerImpl.LOG.error("Could not establish database connection.", ex); + } } - /* - * (non-Javadoc) - * - * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() - */ - @Override - public void afterPropertiesSet() throws Exception { - this.connection = DataSourceUtils.getConnection(this.userDataSource); + public void destroy() { + try { + this.connection.close(); + } catch (final SQLException ex) { + UserManagerImpl.LOG.error("Could not close database connection.", ex); + } + } + + public void setDataSource(final DataSource dataSource) { + this.dataSource = dataSource; } - /* - * (non-Javadoc) - * - * @see kieker.webgui.persistence.IUserDAO#addUser(kieker.webgui.domain.User) - */ @Override @PreAuthorize("hasRole('ROLE_ADMIN')") - @Transactional - public void addUser(final User user) throws DataAccessException { + public void addUser(final String username, final String password, final List<Role> roles) { PreparedStatement userCmd = null; PreparedStatement roleCmd = null; - try { - // Prepare both statements - userCmd = this.connection.prepareStatement("INSERT INTO KIEKERUser (name, password, enabled) VALUES (?, ?, ?)"); + userCmd = this.connection.prepareStatement("INSERT INTO KIEKERUser (name, password, enabled) VALUES (?, ?, True)"); roleCmd = this.connection.prepareStatement("INSERT INTO Userroles (name, role) VALUES (?, ?)"); - // Add the user itself to the database - userCmd.setString(1, user.getName()); - userCmd.setString(2, user.getPassword()); - userCmd.setBoolean(3, user.isEnabled()); + userCmd.setString(1, username); + userCmd.setString(2, password); userCmd.execute(); - // Now the roles - roleCmd.setString(1, user.getName()); - for (final Role role : user.getRoles()) { + roleCmd.setString(1, username); + for (final Role role : roles) { roleCmd.setInt(2, role.getID()); roleCmd.execute(); } } catch (final SQLException ex) { - throw new DataAccessException("Could not add user to the database.", ex); + UserManagerImpl.LOG.error("Could not add user to the database.", ex); } finally { if (userCmd != null) { try { userCmd.close(); } catch (final SQLException ex) { - // Log the exception, but don't inform the upper layer about this - DerbyUserDAO.LOG.warn("Could not close prepared statement.", ex); + UserManagerImpl.LOG.error("Could not close prepared statement.", ex); } } if (roleCmd != null) { try { roleCmd.close(); } catch (final SQLException ex) { - // Log the exception, but don't inform the upper layer about this - DerbyUserDAO.LOG.warn("Could not close prepared statement.", ex); + UserManagerImpl.LOG.error("Could not close prepared statement.", ex); } } } } - /* - * (non-Javadoc) - * - * @see kieker.webgui.persistence.IUserDAO#editUser(kieker.webgui.domain.User) - */ @Override @PreAuthorize("hasRole('ROLE_ADMIN')") - @Transactional - public void editUserWithPassword(final User user) throws DataAccessException { + public void removeUser(final String username) { // TODO Auto-generated method stub - } - @Override - @PreAuthorize("hasRole('ROLE_ADMIN')") - @Transactional - public void editUserWithoutPassword(final User user) throws DataAccessException { - // TODO Auto-generated method stub } - /* - * (non-Javadoc) - * - * @see kieker.webgui.persistence.IUserDAO#deleteUser(kieker.webgui.domain.User) - */ @Override @PreAuthorize("hasRole('ROLE_ADMIN')") - @Transactional - public void deleteUser(final User user) throws DataAccessException { + public void editUser(final String username, final String password, final Role... roles) { // TODO Auto-generated method stub + } - /* - * (non-Javadoc) - * - * @see kieker.webgui.persistence.IUserDAO#getUsers() - */ @Override @PreAuthorize("hasRole('ROLE_ADMIN')") - @Transactional(readOnly = true) public List<User> getUsers() { // FIXME Users without roles final List<User> result = new ArrayList<User>(); @@ -202,26 +152,24 @@ public class DerbyUserDAO implements IUserDAO, InitializingBean, DisposableBean } else { final List<Role> roles = new ArrayList<Role>(); roles.add(role); - tempMap.put(username, new User(username, "", roles, enabled)); + tempMap.put(username, new User(username, roles, enabled)); } } // Now convert the map to the list result.addAll(tempMap.values()); } catch (final SQLException ex) { - throw new DataAccessException("Could not receive user list.", ex); + UserManagerImpl.LOG.error("Could not receive user list.", ex); } finally { try { if (queryResult != null) { queryResult.close(); } } catch (final SQLException ex) { - // Log the exception, but don't inform the upper layer about this - DerbyUserDAO.LOG.warn("Could not close query result.", ex); + UserManagerImpl.LOG.error("Could not close query result.", ex); } } return result; } - } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/impl/package-info.java similarity index 89% rename from Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/package-info.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/common/impl/package-info.java index 4540acaa..54cf3cb2 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/package-info.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/impl/package-info.java @@ -15,8 +15,7 @@ ***************************************************************************/ /** - * This package contains the implementation of the services. - * * @author Nils Christian Ehmke + * */ -package kieker.webgui.service.impl; \ No newline at end of file +package kieker.webgui.common.impl; \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/ACManager.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/ACManager.java similarity index 96% rename from Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/ACManager.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/common/util/ACManager.java index a5639873..6d03d916 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/ACManager.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/ACManager.java @@ -14,20 +14,17 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.service.impl.util; +package kieker.webgui.common.util; import java.util.concurrent.ConcurrentHashMap; import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; import kieker.analysis.AnalysisController.STATE; import kieker.webgui.common.exception.AnalysisInitializationException; import kieker.webgui.common.exception.AnalysisStateException; import kieker.webgui.common.exception.DisplayNotFoundException; import kieker.webgui.common.exception.ProjectNotExistingException; -import kieker.webgui.persistence.IProjectDAO; /** * This manager is responsible for the currently used and running instances of {@code AnalysisController}. It supplies methods to check the states of analysis, @@ -35,8 +32,6 @@ import kieker.webgui.persistence.IProjectDAO; * * @author Nils Christian Ehmke */ -@Component -@Scope("singleton") public final class ACManager { /** * This list contains the current analysis controllers and their corresponding threads. Not every project does have a controller, but every project can have @@ -44,7 +39,7 @@ public final class ACManager { */ private final ConcurrentHashMap<String, Analysis> analyses = new ConcurrentHashMap<String, Analysis>(); @Autowired - private IProjectDAO projectDAO; + private FSManager fsManager; /** * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> @@ -53,6 +48,10 @@ public final class ACManager { // No code necessary. } + public void setFsManager(final FSManager fsManager) { + this.fsManager = fsManager; + } + /** * This method initializes the analysis for the given project. * @@ -74,7 +73,7 @@ public final class ACManager { throw new AnalysisStateException("The analysis has not been cleaned yet."); } - final Analysis analysis = new Analysis(classLoader, this.projectDAO.getProjectFile(projectName)); + final Analysis analysis = new Analysis(classLoader, this.fsManager.getProjectFile(projectName)); this.analyses.put(projectName, analysis); } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/Analysis.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/Analysis.java similarity index 99% rename from Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/Analysis.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/common/util/Analysis.java index bf72d284..74180ef3 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/Analysis.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/Analysis.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.service.impl.util; +package kieker.webgui.common.util; import java.io.File; import java.lang.reflect.InvocationTargetException; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/FSProjectDAOImpl.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/FSManager.java similarity index 84% rename from Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/FSProjectDAOImpl.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/common/util/FSManager.java index df2085ed..d5716a93 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/FSProjectDAOImpl.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/FSManager.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.persistence.impl; +package kieker.webgui.common.util; import java.io.BufferedInputStream; import java.io.BufferedOutputStream; @@ -34,13 +34,11 @@ import java.util.ArrayList; import java.util.Collection; import java.util.List; -import org.springframework.beans.factory.InitializingBean; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.AnalysisController; +import kieker.analysis.model.analysisMetaModel.MIAnalysisMetaModelFactory; import kieker.analysis.model.analysisMetaModel.MIDependency; import kieker.analysis.model.analysisMetaModel.MIProject; +import kieker.analysis.model.analysisMetaModel.impl.MAnalysisMetaModelFactory; import kieker.common.logging.Log; import kieker.common.logging.LogFactory; import kieker.webgui.common.ClassAndMethodContainer; @@ -48,21 +46,19 @@ import kieker.webgui.common.exception.LibraryAlreadyExistingException; import kieker.webgui.common.exception.NewerProjectException; import kieker.webgui.common.exception.ProjectAlreadyExistingException; import kieker.webgui.common.exception.ProjectNotExistingException; -import kieker.webgui.domain.Project; -import kieker.webgui.persistence.IProjectDAO; import org.primefaces.model.UploadedFile; /** - * This is an implementation of the {@link IProjectDAO} interface, which uses the file system to store the projects. + * This is a singleton class for the access to the file system. It makes sure that the necessary directories for the execution of the application exist. <b>Do + * not</b> remove directories created from this manager during runtime! Directories are created during first access to the class.<br> + * This class <b>does not</b> use any kind of synchronization to handle the access to the projects. * * @author Nils Christian Ehmke */ -@Component -@Scope("singleton") -public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { +public final class FSManager { - private static final Log LOG = LogFactory.getLog(FSProjectDAOImpl.class); + private static final Log LOG = LogFactory.getLog(FSManager.class); private static final String KAX_EXTENSION = "kax"; private static final String LIB_EXTENSION = "jar"; private static final String LIB_DIRECTORY = "lib"; @@ -76,13 +72,30 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { */ private static final int BUF_SIZE_BYTES = 1024 * 1024; + private final MIAnalysisMetaModelFactory factory = new MAnalysisMetaModelFactory(); + /** * Default constructor. <b>Do not use this constructor. This bean is Spring managed.</b> */ - public FSProjectDAOImpl() { + public FSManager() { // no code necessary } + /** + * This method initializes the class. Normally this method should be called via the @PostConstruction annotation, but for unknown reason it does only work for + * beans. + */ + protected void initialize() { + // Check for our root-directory and create it if necessary + final File rootDir = new File(FSManager.ROOT_DIRECTORY); + if (!rootDir.exists()) { + final boolean result = rootDir.mkdir(); + if (!result) { + FSManager.LOG.error("Could not create root directory."); + } + } + } + /** * This method adds a new project to the application. It creates an empty, but nevertheless valid kax-file to the file system. If the method fails due to an * {@link IOException}, it will make sure that the project-directories will be removed as if the method would never have been called. @@ -94,14 +107,15 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @throws IOException * If something went wrong during the creation of the project. */ - @Override - public void addProject(final Project project) throws ProjectAlreadyExistingException, IOException { - final String projectName = project.getMiproject().getName(); + public void addProject(final String projectName) throws ProjectAlreadyExistingException, IOException { // Assemble all necessary paths and files for the given project final File projectDir = this.assembleProjectDir(projectName); final File projectFile = this.assembleKaxFile(projectName); final File libDir = this.assembleLibDir(projectName); + // We need an "empty" project in order to save it. + final MIProject emptyProject = this.factory.createProject(); + // Make sure that the project doesn't exist already if (projectDir.exists()) { throw new ProjectAlreadyExistingException("The project with the name '" + projectName + "' exists already."); @@ -111,7 +125,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { // Try to create the directories if (projectDir.mkdir() && libDir.mkdir()) { // Try to save the file - AnalysisController.saveToFile(projectFile, project.getMiproject()); + AnalysisController.saveToFile(projectFile, emptyProject); } else { // The directories could not be created throw new IOException("Project-Directories could not be created."); @@ -147,7 +161,6 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @throws IOException * If something went wrong during the creation of the target-project or during the loading of the source-project. */ - @Override public void copyProject(final String originalProjectName, final String newProjectName) throws ProjectNotExistingException, ProjectAlreadyExistingException, IOException { // Get the necessary paths @@ -203,15 +216,14 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @throws IOException * If something went wrong during the opening of the project. */ - @Override - public Project openProject(final String projectName) throws ProjectNotExistingException, IOException { + public MIProject openProject(final String projectName) throws ProjectNotExistingException, IOException { if (projectName == null) { throw new IOException("Project is null"); } try { // Load the project - return new Project(AnalysisController.loadFromFile(this.assembleKaxFile(projectName).getAbsoluteFile())); + return AnalysisController.loadFromFile(this.assembleKaxFile(projectName).getAbsoluteFile()); } catch (final FileNotFoundException ex) { throw new ProjectNotExistingException("A project with the name '" + projectName + "' does not exist.", ex); } @@ -232,7 +244,6 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @throws IOException * If something went wrong during the opening of the project. This can also mean that the given {@link ClassAndMethodContainer} is somehow invalid. */ - @Override public Object openProject(final String projectName, final ClassAndMethodContainer classAndMethodContainer) throws ProjectNotExistingException, IOException { if (projectName == null) { throw new IOException("Project is null"); @@ -269,23 +280,21 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @throws NewerProjectException * If the project on the file system is newer and the overwriteNewerProject-flag has not been set. */ - @Override - public void saveProject(final Project project, final long timeStamp, final boolean overwriteNewerProject) throws ProjectNotExistingException, IOException, - NewerProjectException { - final String projectName = project.getMiproject().getName(); + public void saveProject(final String projectName, final MIProject project, final long timeStamp, final boolean overwriteNewerProject) throws + ProjectNotExistingException, IOException, NewerProjectException { // Check whether the project exists if (!this.projectExists(projectName)) { throw new ProjectNotExistingException("A project with the name '" + projectName + "' does not exist."); } // Check for a newer version first - final long currTimeStamp = this.getCurrTimestamp(projectName); + final long currTimeStamp = this.getCurrTimeStamp(projectName); if (!overwriteNewerProject && (currTimeStamp > timeStamp)) { throw new NewerProjectException("The project with the name '" + projectName + "' has a newer version on the FS."); } // Try to save it. - AnalysisController.saveToFile(this.assembleKaxFile(projectName), project.getMiproject()); + AnalysisController.saveToFile(this.assembleKaxFile(projectName), project); } /** @@ -297,8 +306,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @throws ProjectNotExistingException * If a project with the given name does not exist. */ - @Override - public long getCurrTimestamp(final String projectName) throws ProjectNotExistingException { + public long getCurrTimeStamp(final String projectName) throws ProjectNotExistingException { // Check whether the project exists if (!this.projectExists(projectName)) { throw new ProjectNotExistingException("A project with the name '" + projectName + "' does not exist."); @@ -320,9 +328,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @throws LibraryAlreadyExistingException * If a library with the same name exists already. */ - @Override - public void uploadLibrary(final UploadedFile file, final Project project) throws ProjectNotExistingException, IOException, LibraryAlreadyExistingException { - final String projectName = project.getMiproject().getName(); + public void uploadLibrary(final UploadedFile file, final String projectName) throws ProjectNotExistingException, IOException, LibraryAlreadyExistingException { // Check whether the project exists if (!this.projectExists(projectName)) { throw new ProjectNotExistingException("A project with the name '" + projectName + "' does not exist."); @@ -344,7 +350,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { // Get the streams. in = new BufferedInputStream(file.getInputstream()); out = new BufferedOutputStream(new FileOutputStream(dstFile)); - final byte[] buf = new byte[FSProjectDAOImpl.BUF_SIZE_BYTES]; + final byte[] buf = new byte[FSManager.BUF_SIZE_BYTES]; int count; // Transfer the file. @@ -388,9 +394,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @throws IOException * If something went wrong during the initialization of the class loader. */ - @Override - public ClassLoader getClassLoader(final Project project) throws ProjectNotExistingException, IOException { - final String projectName = project.getMiproject().getName(); + public ClassLoader getClassLoader(final String projectName) throws ProjectNotExistingException, IOException { // Check whether the project exists if (!this.projectExists(projectName)) { throw new ProjectNotExistingException("A project with the name '" + projectName + "' does not exist."); @@ -401,11 +405,11 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { // Collect all libraries of the project // Run through the libs and put them into our list. - final File libDir = new File(FSProjectDAOImpl.ROOT_DIRECTORY + File.separator + projectName + File.separator + FSProjectDAOImpl.LIB_DIRECTORY); + final File libDir = new File(FSManager.ROOT_DIRECTORY + File.separator + projectName + File.separator + FSManager.LIB_DIRECTORY); final File[] files = libDir.listFiles(); if (files != null) { for (final File file : files) { - if (file.getName().endsWith("." + FSProjectDAOImpl.LIB_EXTENSION)) { + if (file.getName().endsWith("." + FSManager.LIB_EXTENSION)) { try { libs.add(file.toURL()); } catch (final MalformedURLException ex) { @@ -432,9 +436,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @throws ProjectNotExistingException * If a project with the given name does not exist. */ - @Override - public List<String> listAllLibraries(final Project project) throws ProjectNotExistingException { - final String projectName = project.getMiproject().getName(); + public List<String> listAllLibraries(final String projectName) throws ProjectNotExistingException { // Check whether the project exists if (!this.projectExists(projectName)) { throw new ProjectNotExistingException("A project with the name '" + projectName + "' does not exist."); @@ -446,7 +448,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { final File[] files = this.assembleLibDir(projectName).listFiles(); if (files != null) { for (final File file : files) { - if (file.getName().endsWith("." + FSProjectDAOImpl.LIB_EXTENSION)) { + if (file.getName().endsWith("." + FSManager.LIB_EXTENSION)) { result.add(file.getName()); } } @@ -460,12 +462,11 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * * @return A list containing all available project names. */ - @Override public Collection<String> listAllProjects() { final List<String> result = new ArrayList<String>(); // Get all directories within our root-dir - final File[] files = new File(FSProjectDAOImpl.ROOT_DIRECTORY).listFiles(); + final File[] files = new File(FSManager.ROOT_DIRECTORY).listFiles(); for (final File file : files) { if (file.isDirectory()) { result.add(file.getName()); @@ -504,7 +505,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { result = dst.setLastModified(src.lastModified()); } catch (final IOException ex) { - FSProjectDAOImpl.LOG.error("An IO error occured", ex); + FSManager.LOG.error("An IO error occured", ex); result = false; } finally { // Try to close the streams @@ -512,7 +513,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { try { fileInputStream.close(); } catch (final IOException ex) { - FSProjectDAOImpl.LOG.error("An IO error occured", ex); + FSManager.LOG.error("An IO error occured", ex); result = false; } } @@ -520,7 +521,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { try { fileOutputStream.close(); } catch (final IOException ex) { - FSProjectDAOImpl.LOG.error("An IO error occured", ex); + FSManager.LOG.error("An IO error occured", ex); result = false; } } @@ -546,7 +547,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { private void transfer(final FileChannel fileChannel, final ByteChannel byteChannel, final long lengthInBytes) throws IOException { long overallBytesTransfered = 0L; while (overallBytesTransfered < lengthInBytes) { - final long count = Math.min(FSProjectDAOImpl.BUF_SIZE_BYTES, lengthInBytes - overallBytesTransfered); + final long count = Math.min(FSManager.BUF_SIZE_BYTES, lengthInBytes - overallBytesTransfered); final long bytesTransfered = fileChannel.transferTo(overallBytesTransfered, count, byteChannel); overallBytesTransfered += bytesTransfered; } @@ -574,10 +575,8 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @throws MalformedURLException * If the URL is for some reason invalid. */ - @Override - public URL getURL(final MIDependency lib, final Project project) throws MalformedURLException { - final String projectName = project.getMiproject().getName(); - final File file = new File(FSProjectDAOImpl.ROOT_DIRECTORY + File.separator + projectName + File.separator + FSProjectDAOImpl.LIB_DIRECTORY + File.separator + public URL getURL(final MIDependency lib, final String project) throws MalformedURLException { + final File file = new File(FSManager.ROOT_DIRECTORY + File.separator + project + File.separator + FSManager.LIB_DIRECTORY + File.separator + lib.getFilePath()); return file.toURL(); } @@ -590,7 +589,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @return The directory of the project. */ private File assembleProjectDir(final String projectName) { - return new File(FSProjectDAOImpl.ROOT_DIRECTORY + File.separator + projectName); + return new File(FSManager.ROOT_DIRECTORY + File.separator + projectName); } /** @@ -601,7 +600,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @return The kax-file of the project. */ private File assembleKaxFile(final String projectName) { - return new File(FSProjectDAOImpl.ROOT_DIRECTORY + File.separator + projectName + File.separator + projectName + "." + FSProjectDAOImpl.KAX_EXTENSION); + return new File(FSManager.ROOT_DIRECTORY + File.separator + projectName + File.separator + projectName + "." + FSManager.KAX_EXTENSION); } /** @@ -612,7 +611,7 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * @return The library directory of the project. */ private File assembleLibDir(final String projectName) { - return new File(FSProjectDAOImpl.ROOT_DIRECTORY + File.separator + projectName + File.separator + FSProjectDAOImpl.LIB_DIRECTORY); + return new File(FSManager.ROOT_DIRECTORY + File.separator + projectName + File.separator + FSManager.LIB_DIRECTORY); } /** @@ -620,9 +619,8 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * * @return The kieker library. */ - @Override public URL getKiekerURL() { - return Thread.currentThread().getContextClassLoader().getResource(FSProjectDAOImpl.KIEKER_LIB); + return Thread.currentThread().getContextClassLoader().getResource(FSManager.KIEKER_LIB); } /** @@ -632,7 +630,6 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { * The name of the project. * @return The kax-file of the project. */ - @Override public File getProjectFile(final String projectName) { return this.assembleKaxFile(projectName); } @@ -671,21 +668,4 @@ public class FSProjectDAOImpl implements IProjectDAO, InitializingBean { } } - /* - * (non-Javadoc) - * - * @see org.springframework.beans.factory.InitializingBean#afterPropertiesSet() - */ - @Override - public void afterPropertiesSet() throws Exception { - // Check for our root-directory and create it if necessary - final File rootDir = new File(FSProjectDAOImpl.ROOT_DIRECTORY); - if (!rootDir.exists()) { - final boolean result = rootDir.mkdir(); - if (!result) { - FSProjectDAOImpl.LOG.error("Could not create root directory."); - } - } - } - } diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/PluginFinder.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/PluginFinder.java similarity index 96% rename from Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/PluginFinder.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/common/util/PluginFinder.java index f1eb7e7b..8e414cb1 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/PluginFinder.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/PluginFinder.java @@ -13,7 +13,7 @@ * See the License for the specific language governing permissions and * limitations under the License. ***************************************************************************/ -package kieker.webgui.service.impl.util; +package kieker.webgui.common.util; import java.io.IOException; import java.net.URL; @@ -22,9 +22,6 @@ import java.util.List; import java.util.jar.JarEntry; import java.util.jar.JarInputStream; -import org.springframework.context.annotation.Scope; -import org.springframework.stereotype.Component; - import kieker.analysis.plugin.AbstractPlugin; import kieker.analysis.repository.AbstractRepository; import kieker.webgui.common.ClassAndMethodContainer; @@ -34,8 +31,6 @@ import kieker.webgui.common.ClassAndMethodContainer; * * @author Nils Christian Ehmke */ -@Component -@Scope("singleton") public final class PluginFinder { /** diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/ViewScope.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/ViewScope.java similarity index 98% rename from Kieker.WebGUI/src/main/java/kieker/webgui/common/ViewScope.java rename to Kieker.WebGUI/src/main/java/kieker/webgui/common/util/ViewScope.java index 652aa84f..d16f3ce1 100644 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/common/ViewScope.java +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/ViewScope.java @@ -14,7 +14,7 @@ * limitations under the License. ***************************************************************************/ -package kieker.webgui.common; +package kieker.webgui.common.util; import java.util.Map; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/package-info.java new file mode 100644 index 00000000..06fc0c4f --- /dev/null +++ b/Kieker.WebGUI/src/main/java/kieker/webgui/common/util/package-info.java @@ -0,0 +1,23 @@ +/*************************************************************************** + * 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. + ***************************************************************************/ + +/** + * This package contains utility classes, which are used in the parent-package. The classes within this package are not for public use. They should only be used by + * the classes in {@code kieker.webgui.common}. + * + * @author Nils Christian Ehmke + */ +package kieker.webgui.common.util; diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/Project.java b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/Project.java deleted file mode 100644 index 24eeafe6..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/Project.java +++ /dev/null @@ -1,48 +0,0 @@ -/*************************************************************************** - * 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.domain; - -import kieker.analysis.model.analysisMetaModel.MIProject; - -public class Project { - - private MIProject miproject; - - public Project(final MIProject project) { - this.miproject = project; - } - - /** - * Getter for the property {@link Project#miproject}. - * - * @return The current value of the property. - */ - public MIProject getMiproject() { - return this.miproject; - } - - /** - * Setter for the property {@link Project#miproject}. - * - * @param miproject - * The new value of the property. - */ - public void setMiproject(final MIProject miproject) { - this.miproject = miproject; - } - -} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/User.java b/Kieker.WebGUI/src/main/java/kieker/webgui/domain/User.java deleted file mode 100644 index 93f57f73..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/domain/User.java +++ /dev/null @@ -1,133 +0,0 @@ -/*************************************************************************** - * 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.domain; - -import java.util.List; - -public class User { - - private String name; - private String password; - private List<Role> roles; - private boolean enabled; - - public User(final String name, final String password, final List<Role> roles, final boolean enabled) { - this.name = name; - this.password = password; - this.roles = roles; - this.enabled = enabled; - } - - /** - * Getter for the property {@link User#name}. - * - * @return The current value of the property. - */ - public String getName() { - return this.name; - } - - /** - * Setter for the property {@link User#name}. - * - * @param name - * The new value of the property. - */ - public void setName(final String name) { - this.name = name; - } - - /** - * Getter for the property {@link User#password}. - * - * @return The current value of the property. - */ - public String getPassword() { - return this.password; - } - - /** - * Setter for the property {@link User#password}. - * - * @param password - * The new value of the property. - */ - public void setPassword(final String password) { - this.password = password; - } - - /** - * Getter for the property {@link User#roles}. - * - * @return The current value of the property. - */ - public List<Role> getRoles() { - return this.roles; - } - - /** - * Setter for the property {@link User#roles}. - * - * @param roles - * The new value of the property. - */ - public void setRoles(final List<Role> roles) { - this.roles = roles; - } - - /** - * Getter for the property {@link User#enabled}. - * - * @return The current value of the property. - */ - public boolean isEnabled() { - return this.enabled; - } - - /** - * Setter for the property {@link User#enabled}. - * - * @param enabled - * The new value of the property. - */ - public void setEnabled(final boolean enabled) { - this.enabled = enabled; - } - - public static enum Role { - - ROLE_USER(1), ROLE_ADMIN(2); - - private int id; - - private Role(final int id) { - this.id = id; - } - - public int getID() { - return this.id; - } - - public static Role fromID(final int id) { - if (id == 2) { - return Role.ROLE_ADMIN; - } else { - return Role.ROLE_USER; - } - } - } -} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IProjectDAO.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IProjectDAO.java deleted file mode 100644 index e1e0cd17..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IProjectDAO.java +++ /dev/null @@ -1,101 +0,0 @@ -/*************************************************************************** - * 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.persistence; - -import java.io.File; -import java.io.IOException; -import java.net.MalformedURLException; -import java.net.URL; -import java.util.Collection; -import java.util.List; - -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.transaction.annotation.Transactional; - -import kieker.analysis.model.analysisMetaModel.MIDependency; -import kieker.webgui.common.ClassAndMethodContainer; -import kieker.webgui.common.exception.LibraryAlreadyExistingException; -import kieker.webgui.common.exception.NewerProjectException; -import kieker.webgui.common.exception.ProjectAlreadyExistingException; -import kieker.webgui.common.exception.ProjectNotExistingException; -import kieker.webgui.domain.Project; - -import org.primefaces.model.UploadedFile; - -/** - * This is the interface for the project data access object. The implementing class will be responsible for managing projects in a transactional way. This interface - * will only be accessible by authenticated users. - * - * @author Nils Christian Ehmke - */ -public interface IProjectDAO { - - @PreAuthorize("isAuthenticated()") - @Transactional - public void addProject(final Project project) throws IOException, ProjectAlreadyExistingException; - - @PreAuthorize("isAuthenticated()") - @Transactional - public void saveProject(final Project project, final long timeStamp, final boolean overwriteNewerProject) throws ProjectNotExistingException, IOException, - NewerProjectException; - - @PreAuthorize("isAuthenticated()") - @Transactional - public void copyProject(final String srcProjectName, final String dstProjectName) throws IOException, ProjectNotExistingException, - ProjectAlreadyExistingException; - - @PreAuthorize("isAuthenticated()") - @Transactional - public Project openProject(final String projectName) throws IOException, ProjectNotExistingException; - - @PreAuthorize("isAuthenticated()") - @Transactional - public Object openProject(final String projectName, final ClassAndMethodContainer classAndMethodContainer) throws IOException, ProjectNotExistingException; - - @PreAuthorize("isAuthenticated()") - @Transactional - public long getCurrTimestamp(final String projectName) throws IOException, ProjectNotExistingException; - - @PreAuthorize("isAuthenticated()") - @Transactional - public void uploadLibrary(final UploadedFile file, final Project project) throws IOException, ProjectNotExistingException, LibraryAlreadyExistingException; - - @PreAuthorize("isAuthenticated()") - @Transactional - public ClassLoader getClassLoader(final Project project) throws IOException, ProjectNotExistingException; - - @PreAuthorize("isAuthenticated()") - @Transactional - public Collection<String> listAllProjects(); - - @PreAuthorize("isAuthenticated()") - @Transactional - public File getProjectFile(final String projectName); - - @PreAuthorize("isAuthenticated()") - @Transactional - public URL getKiekerURL(); - - @PreAuthorize("isAuthenticated()") - @Transactional - public URL getURL(final MIDependency lib, final Project project) throws MalformedURLException; - - @PreAuthorize("isAuthenticated()") - @Transactional - public List<String> listAllLibraries(final Project project) throws ProjectNotExistingException; - -} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IUserDAO.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IUserDAO.java deleted file mode 100644 index c8e14118..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/IUserDAO.java +++ /dev/null @@ -1,55 +0,0 @@ -/*************************************************************************** - * 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.persistence; - -import java.util.List; - -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.transaction.annotation.Transactional; - -import kieker.webgui.common.exception.DataAccessException; -import kieker.webgui.domain.User; - -/** - * This is the interface for the user data access object. The implementing class will be responsible for managing user in a transactional way. This interface will - * only be accessible by administrators. - * - * @author Nils Christian Ehmke - */ -public interface IUserDAO { - - @PreAuthorize("hasRole('ROLE_ADMIN')") - @Transactional() - public void addUser(final User user) throws DataAccessException; - - @PreAuthorize("hasRole('ROLE_ADMIN')") - @Transactional - public void editUserWithoutPassword(final User user) throws DataAccessException; - - @PreAuthorize("hasRole('ROLE_ADMIN')") - @Transactional - public void editUserWithPassword(final User user) throws DataAccessException; - - @PreAuthorize("hasRole('ROLE_ADMIN')") - @Transactional - public void deleteUser(final User user) throws DataAccessException; - - @PreAuthorize("hasRole('ROLE_ADMIN')") - @Transactional(readOnly = true) - public List<User> getUsers(); - -} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/package-info.java deleted file mode 100644 index 7ab7acc6..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/impl/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/*************************************************************************** - * 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. - ***************************************************************************/ - -/** - * This package contains the implementation of the persistence. - * - * @author Nils Christian Ehmke - */ -package kieker.webgui.persistence.impl; \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/package-info.java deleted file mode 100644 index 88d0eda3..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/persistence/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/*************************************************************************** - * 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. - ***************************************************************************/ - -/** - * This package contains the interfaces of the persistence layer of the web application. It is the undermost layer. - * - * @author Nils Christian Ehmke - */ -package kieker.webgui.persistence; \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/IProjectService.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/IProjectService.java deleted file mode 100644 index 7663c50a..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/IProjectService.java +++ /dev/null @@ -1,124 +0,0 @@ -/*************************************************************************** - * 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.service; - -import java.io.IOException; -import java.util.Collection; -import java.util.List; - -import org.springframework.security.access.prepost.PreAuthorize; - -import kieker.analysis.AnalysisController.STATE; -import kieker.analysis.model.analysisMetaModel.MIDependency; -import kieker.analysis.plugin.AbstractPlugin; -import kieker.analysis.repository.AbstractRepository; -import kieker.webgui.common.ClassAndMethodContainer; -import kieker.webgui.common.exception.AnalysisInitializationException; -import kieker.webgui.common.exception.AnalysisStateException; -import kieker.webgui.common.exception.DisplayNotFoundException; -import kieker.webgui.common.exception.LibraryAlreadyExistingException; -import kieker.webgui.common.exception.LibraryLoadException; -import kieker.webgui.common.exception.NewerProjectException; -import kieker.webgui.common.exception.ProjectAlreadyExistingException; -import kieker.webgui.common.exception.ProjectNotExistingException; -import kieker.webgui.domain.Project; - -import org.primefaces.model.UploadedFile; - -/** - * This is the interface for the project service, which is responsible for managing the available projects. This interface will only be accessible by authenticated - * users. - * - * @author Nils Christian Ehmke - */ -public interface IProjectService { - - @PreAuthorize("isAuthenticated()") - public void addProject(final Project project) throws IOException, ProjectAlreadyExistingException; - - @PreAuthorize("isAuthenticated()") - public void editProject(final Project project) throws IOException, ProjectNotExistingException; - - @PreAuthorize("isAuthenticated()") - public void editProject(final Project project, final long timestamp) throws IOException, ProjectNotExistingException, NewerProjectException; - - @PreAuthorize("isAuthenticated()") - public void copyProject(final String srcProjectName, final String dstProjectName) throws IOException, ProjectNotExistingException, - ProjectAlreadyExistingException; - - @PreAuthorize("isAuthenticated()") - public Project openProject(final String projectName) throws IOException, ProjectNotExistingException; - - @PreAuthorize("isAuthenticated()") - public Object openProject(final String projectName, final ClassAndMethodContainer classAndMethodContainer) throws IOException, ProjectNotExistingException; - - @PreAuthorize("isAuthenticated()") - public long getCurrTimestamp(final String projectName) throws IOException, ProjectNotExistingException; - - @PreAuthorize("isAuthenticated()") - public void uploadLibrary(final UploadedFile file, final Project project) throws IOException, ProjectNotExistingException, LibraryAlreadyExistingException; - - @PreAuthorize("isAuthenticated()") - public ClassLoader getClassLoader(final Project project) throws IOException, ProjectNotExistingException; - - @PreAuthorize("isAuthenticated()") - public ClassLoader getClassLoader(final String projectName) throws IOException, ProjectNotExistingException; - - @PreAuthorize("isAuthenticated()") - public List<Class<AbstractRepository>> getAllRepositoriesWithinLib(final MIDependency lib, final Project project, final ClassLoader classLoader, - final ClassAndMethodContainer classAndMethodContainer) throws LibraryLoadException; - - @PreAuthorize("isAuthenticated()") - public List<Class<AbstractPlugin>> getAllPluginsWithinLib(final MIDependency lib, final Project project, final ClassLoader classLoader, - final ClassAndMethodContainer classAndMethodContainer) throws LibraryLoadException; - - @PreAuthorize("isAuthenticated()") - public List<Class<AbstractRepository>> getAllRepositoriesWithinKiekerLib(final ClassLoader classLoader, final ClassAndMethodContainer classAndMethodContainer) - throws LibraryLoadException; - - @PreAuthorize("isAuthenticated()") - public List<Class<AbstractPlugin>> getAllPluginsWithinKiekerLib(final ClassLoader classLoader, final ClassAndMethodContainer classAndMethodContainer) - throws LibraryLoadException; - - @PreAuthorize("isAuthenticated()") - public Collection<String> listAllProjects(); - - @PreAuthorize("isAuthenticated()") - public void initializeAnalysis(final String projectName, final ClassLoader classLoader) throws ProjectNotExistingException, AnalysisStateException, - AnalysisInitializationException; - - @PreAuthorize("isAuthenticated()") - public void cleanAnalysis(final String projectName) throws ProjectNotExistingException, AnalysisStateException; - - @PreAuthorize("isAuthenticated()") - public void startAnalysis(final String projectName) throws ProjectNotExistingException, AnalysisStateException; - - @PreAuthorize("isAuthenticated()") - public void stopAnalysis(final String projectName) throws ProjectNotExistingException, AnalysisStateException; - - @PreAuthorize("isAuthenticated()") - public Object getDisplay(final String projectName, final String viewName, final String displayName) throws ProjectNotExistingException, DisplayNotFoundException; - - @PreAuthorize("isAuthenticated()") - public STATE getCurrentState(final String projectName) throws ProjectNotExistingException; - - @PreAuthorize("isAuthenticated()") - public Object[] getLogEntries(final String projectName) throws AnalysisStateException; - - @PreAuthorize("isAuthenticated()") - public List<String> listAllLibraries(final Project project) throws ProjectNotExistingException; -} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/UserServiceImpl.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/UserServiceImpl.java deleted file mode 100644 index 70209205..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/UserServiceImpl.java +++ /dev/null @@ -1,97 +0,0 @@ -/*************************************************************************** - * 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.service.impl; - -import java.util.List; - -import org.springframework.beans.factory.annotation.Autowired; -import org.springframework.context.annotation.Scope; -import org.springframework.security.access.prepost.PreAuthorize; -import org.springframework.stereotype.Service; - -import kieker.webgui.common.exception.DataAccessException; -import kieker.webgui.domain.User; -import kieker.webgui.persistence.IUserDAO; -import kieker.webgui.service.IUserService; - -@Service -@Scope("singleton") -public class UserServiceImpl implements IUserService { - - @Autowired - private IUserDAO userDAO; - - public UserServiceImpl() { - // No code necessary - } - - /* - * (non-Javadoc) - * - * @see kieker.webgui.service.IUserService#addUser(kieker.webgui.domain.User) - */ - @Override - @PreAuthorize("hasRole('ROLE_ADMIN')") - public void addUser(final User user) { - this.userDAO.addUser(user); - } - - /* - * (non-Javadoc) - * - * @see kieker.webgui.service.IUserService#editUserWithoutPassword(kieker.webgui.domain.User) - */ - @Override - @PreAuthorize("hasRole('ROLE_ADMIN')") - public void editUserWithoutPassword(final User user) throws DataAccessException { - this.userDAO.editUserWithoutPassword(user); - } - - /* - * (non-Javadoc) - * - * @see kieker.webgui.service.IUserService#editUserWithPassword(kieker.webgui.domain.User) - */ - @Override - @PreAuthorize("hasRole('ROLE_ADMIN')") - public void editUserWithPassword(final User user) throws DataAccessException { - this.userDAO.editUserWithPassword(user); - } - - /* - * (non-Javadoc) - * - * @see kieker.webgui.service.IUserService#deleteUser(kieker.webgui.domain.User) - */ - @Override - @PreAuthorize("hasRole('ROLE_ADMIN')") - public void deleteUser(final User user) { - this.userDAO.deleteUser(user); - } - - /* - * (non-Javadoc) - * - * @see kieker.webgui.service.IUserService#getUsers() - */ - @Override - @PreAuthorize("hasRole('ROLE_ADMIN')") - public List<User> getUsers() { - return this.userDAO.getUsers(); - } - -} diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/package-info.java deleted file mode 100644 index c5ce6121..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/impl/util/package-info.java +++ /dev/null @@ -1,7 +0,0 @@ -/** - * - */ -/** - * @author Nils Christian Ehmke - */ -package kieker.webgui.service.impl.util; \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/java/kieker/webgui/service/package-info.java b/Kieker.WebGUI/src/main/java/kieker/webgui/service/package-info.java deleted file mode 100644 index 03503ece..00000000 --- a/Kieker.WebGUI/src/main/java/kieker/webgui/service/package-info.java +++ /dev/null @@ -1,22 +0,0 @@ -/*************************************************************************** - * 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. - ***************************************************************************/ - -/** - * This package contains the interfaces of the service layer of the web application. It is directly above the persistence layer. - * - * @author Nils Christian Ehmke - */ -package kieker.webgui.service; \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/resources/global.properties b/Kieker.WebGUI/src/main/resources/global.properties index dc015ce3..58f3a8d0 100644 --- a/Kieker.WebGUI/src/main/resources/global.properties +++ b/Kieker.WebGUI/src/main/resources/global.properties @@ -23,12 +23,3 @@ kieker.webgui.config.analysisEditor.defaultGridColor = 0080FF #------------------------------------------------------------------------------ kieker.webgui.page.projectOverview = projectOverview - -#------------------------------------------------------------------------------ -# -# Some common information. -# -#------------------------------------------------------------------------------ - -kieker.url = http://www.kieker-monitoring.net/ -kieker.webgui.version = 1.7-SNAPSHOT \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/resources/lang/AccessDeniedPage_de.properties b/Kieker.WebGUI/src/main/resources/lang/AccessDeniedPage_de.properties index 2fbb56db..f7f3558b 100644 --- a/Kieker.WebGUI/src/main/resources/lang/AccessDeniedPage_de.properties +++ b/Kieker.WebGUI/src/main/resources/lang/AccessDeniedPage_de.properties @@ -1,8 +1,8 @@ #------------------------------------------------------------------------------ # -# Diese Datei beinhaltet s\u00e4mtliche Nachrichten, Buttonbeschriftungen etc., +# Diese Datei beinhaltet sämtliche Nachrichten, Buttonbeschriftungen etc., # welche innerhalb der Zugriff-Verweigert-Seite benutzt werden. # #------------------------------------------------------------------------------ -accessDenied = Zugriff verweigert! \ No newline at end of file +accessDenied = Zugriff verweigert! \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/resources/lang/AnalysisEditorPage_de.properties b/Kieker.WebGUI/src/main/resources/lang/AnalysisEditorPage_de.properties index 08fce9bc..5c386367 100644 --- a/Kieker.WebGUI/src/main/resources/lang/AnalysisEditorPage_de.properties +++ b/Kieker.WebGUI/src/main/resources/lang/AnalysisEditorPage_de.properties @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ # -# Diese Datei beinhaltet s\u00e4mtliche Nachrichten, Buttonbeschriftungen etc., +# Diese Datei beinhaltet sämtliche Nachrichten, Buttonbeschriftungen etc., # welche innerhalb der Seite des Analyseeditors benutzt werden. # #------------------------------------------------------------------------------ @@ -10,7 +10,7 @@ manageLibraries = Bibliotheken Verwalten graph = Graph analysisEditorScaleToFit = An Fenstergr\u00f6\u00dfe Anpassen grid = Gitter -snap = Einrasten +snap = Einrasten autoLayout = Auto-Layout disable = Deaktivieren diff --git a/Kieker.WebGUI/src/main/resources/lang/CockpitEditorPage_de.properties b/Kieker.WebGUI/src/main/resources/lang/CockpitEditorPage_de.properties index 6563bc54..bdab2198 100644 --- a/Kieker.WebGUI/src/main/resources/lang/CockpitEditorPage_de.properties +++ b/Kieker.WebGUI/src/main/resources/lang/CockpitEditorPage_de.properties @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ # -# Diese Datei beinhaltet s\u00e4mtliche Nachrichten, Buttonbeschriftungen etc., +# Diese Datei beinhaltet sämtliche Nachrichten, Buttonbeschriftungen etc., # welche innerhalb der Seite des Cockpiteditors benutzt werden. # #------------------------------------------------------------------------------ @@ -8,4 +8,4 @@ selectView = Ansicht Selektieren copyView = Ansicht Kopieren renameView = Ansicht Umbenennen -deleteView = Ansicht L\u00f6schen \ No newline at end of file +deleteView = Ansicht Löschen \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/resources/lang/CockpitPage_de.properties b/Kieker.WebGUI/src/main/resources/lang/CockpitPage_de.properties index 815bdc98..2e3d90c2 100644 --- a/Kieker.WebGUI/src/main/resources/lang/CockpitPage_de.properties +++ b/Kieker.WebGUI/src/main/resources/lang/CockpitPage_de.properties @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ # -# Diese Datei beinhaltet s\u00e4mtliche Nachrichten, Buttonbeschriftungen etc., +# Diese Datei beinhaltet sämtliche Nachrichten, Buttonbeschriftungen etc., # welche innerhalb des Cockpits benutzt werden. # #------------------------------------------------------------------------------ \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/resources/lang/Common_de.properties b/Kieker.WebGUI/src/main/resources/lang/Common_de.properties index e6225fee..edcc9c75 100644 --- a/Kieker.WebGUI/src/main/resources/lang/Common_de.properties +++ b/Kieker.WebGUI/src/main/resources/lang/Common_de.properties @@ -14,7 +14,7 @@ choose = Durchsuchen file = Datei settings = Einstellungen -help = Hilfe +help = Hilfe userGuide = User Guide about = \u00dcber... @@ -23,14 +23,13 @@ analysis = Analyse analysisController = Analyse Controller cockpitEditor = Cockpit Editor cockpit = Cockpit -userManagement = User Management saveProject = Projekt Speichern saveProjectAs = Projekt Speichern Unter reloadProject = Projekt Neu Laden closeProject = Projekt schlie\u00dfen -noRecordsFound = Keine Eintr\u00e4ge vorhanden. +noRecordsFound = Keine Einträge vorhanden. properties = Eigenschaften property = Eigenschaft @@ -59,14 +58,14 @@ gridColor = Gitterfarbe # #------------------------------------------------------------------------------ -msgProjectLoadingException = Beim Laden des Projekts ist ein Fehler aufgetreten. Bitte \u00fcberpr\u00fcfen Sie den Log f\u00fcr weitere Details. +msgProjectLoadingException = Beim Laden des Projekts ist ein Fehler aufgetreten. Bitte überprüfen Sie den Log für weitere Details. msgProjectSaved = Das Projekt wurde erfolgreich gespeichert. -msgPluginCreationException = Beim Erzeugen des Plugins ist ein Fehler aufgetreten. Bitte \u00fcberpr\u00fcfen Sie die Abh\u00e4ngigkeiten und den Log f\u00fcr weitere Details. -msgRepositoryCreationException = Beim Erzeugen des Repositories ist ein Fehler aufgetreten. Bitte \u00fcberpr\u00fcfen Sie die Abh\u00e4ngigkeiten und den Log f\u00fcr weitere Details. +msgPluginCreationException = Beim Erzeugen des Plugins ist ein Fehler aufgetreten. Bitte überprüfen Sie die Abhängigkeiten und den Log für weitere Details. +msgRepositoryCreationException = Beim Erzeugen des Repositories ist ein Fehler aufgetreten. Bitte überprüfen Sie die Abhängigkeiten und den Log für weitere Details. msgLibraryUploaded = Die Bibliothek wurde erfolgreich hochgeladen. msgProjectCreated = Das Projekt wurde erfolgreich erstellt. -msgProjectSavingException = Beim Speichern des Projekts ist ein Fehler aufgetreten. Bitte \u00fcberpr\u00fcfen Sie den Log f\u00fcr weitere Details. +msgProjectSavingException = Beim Speichern des Projekts ist ein Fehler aufgetreten. Bitte überprüfen Sie den Log für weitere Details. msgProjectNotExistingException = Das aktuelle Projekt existiert nicht. msgProjectModified = Das Projekt wurde in der Zwischenzeit au\u00dferhalb dieses Editors modifiziert. msgLibraryExistingException = Eine Bibliothek mit dem gleichen Namen existiert bereits. -msgLibraryUploadingException = Beim Hochladen der Bibliothek ist ein Fehler aufgetreten. Bitte \u00fcberpr\u00fcfen Sie den Log f\u00fcr weitere Details. \ No newline at end of file +msgLibraryUploadingException = Beim Hochladen der Bibliothek ist ein Fehler aufgetreten. Bitte überprüfen Sie den Log für weitere Details. \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/resources/lang/Common_en.properties b/Kieker.WebGUI/src/main/resources/lang/Common_en.properties index 8ba2c5c4..8e8211b5 100644 --- a/Kieker.WebGUI/src/main/resources/lang/Common_en.properties +++ b/Kieker.WebGUI/src/main/resources/lang/Common_en.properties @@ -23,8 +23,7 @@ analysis = Analysis analysisController = Analysis Controller cockpitEditor = Cockpit Editor cockpit = Cockpit -userManagement = User Management - + saveProject = Save Project saveProjectAs = Save Project As reloadProject = Reload Project diff --git a/Kieker.WebGUI/src/main/resources/lang/ControllerPage_de.properties b/Kieker.WebGUI/src/main/resources/lang/ControllerPage_de.properties index 2c4b72f5..cec041b9 100644 --- a/Kieker.WebGUI/src/main/resources/lang/ControllerPage_de.properties +++ b/Kieker.WebGUI/src/main/resources/lang/ControllerPage_de.properties @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------ # -# Diese Datei beinhaltet s\u00e4mtliche Nachrichten, Buttonbeschriftungen etc., -# welche innerhalb der Seite f\u00fcr die Analysesteuerung benutzt werden. +# Diese Datei beinhaltet sämtliche Nachrichten, Buttonbeschriftungen etc., +# welche innerhalb der Seite für die Analysesteuerung benutzt werden. # #------------------------------------------------------------------------------ @@ -12,10 +12,10 @@ analysisControllerStopAnalysis = Analyse Stoppen analysisControllerMsgNotInstantiated = Zeigt an, dass der AnalysisController noch nicht instanziiert wurde. analysisControllerMsgReady = Zeigt an, dass der AnalysisController zwar instanziiert, jedoch noch nicht gestartet wurde. -analysisControllerMsgRunning = Zeigt an, dass der AnalysisController gestartet wurde und zur Zeit l\u00e4uft. -analysisControllerMsgFailed = Zeigt an, dass der AnalysisController terminiert oder abgest\u00fcrzt ist. +analysisControllerMsgRunning = Zeigt an, dass der AnalysisController gestartet wurde und zur Zeit läuft. +analysisControllerMsgFailed = Zeigt an, dass der AnalysisController terminiert oder abgestürzt ist. -control = Steuerung +control = Steuerung analysisControllerLog = AnalysisController Log -personalLog = Pers\u00f6nlicher Log \ No newline at end of file +personalLog = Persönlicher Log \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/resources/lang/LoginPage_de.properties b/Kieker.WebGUI/src/main/resources/lang/LoginPage_de.properties index dad9351c..beef4292 100644 --- a/Kieker.WebGUI/src/main/resources/lang/LoginPage_de.properties +++ b/Kieker.WebGUI/src/main/resources/lang/LoginPage_de.properties @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ # -# Diese Datei beinhaltet s\u00e4mtliche Nachrichten, Buttonbeschriftungen etc., +# Diese Datei beinhaltet sämtliche Nachrichten, Buttonbeschriftungen etc., # welche innerhalb der Anmeldeseite benutzt werden. # #------------------------------------------------------------------------------ @@ -12,4 +12,4 @@ password = Passwort login = Anmelden -hint = Hinweis: Die Kieker.WebGUI ben\u00f6tigt Cookies und JavaScript, um korrekt zu funktionieren. Bitte stellen Sie sicher, dass beides aktiviert ist. \ No newline at end of file +hint = Hinweis: Die Kieker.WebGUI benötigt Cookies und JavaScript, um korrekt zu funktionieren. Bitte stellen Sie sicher, dass beides aktiviert ist. \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/resources/lang/ProjectOverviewPage_de.properties b/Kieker.WebGUI/src/main/resources/lang/ProjectOverviewPage_de.properties index 5e43c362..dd9d1586 100644 --- a/Kieker.WebGUI/src/main/resources/lang/ProjectOverviewPage_de.properties +++ b/Kieker.WebGUI/src/main/resources/lang/ProjectOverviewPage_de.properties @@ -1,7 +1,7 @@ #------------------------------------------------------------------------------ # -# Diese Datei beinhaltet s\u00e4mtliche Nachrichten, Buttonbeschriftungen etc., -# welche innerhalb der Projekt\u00fcbersichtsseite benutzt werden. +# Diese Datei beinhaltet sämtliche Nachrichten, Buttonbeschriftungen etc., +# welche innerhalb der Projektübersichtsseite benutzt werden. # #------------------------------------------------------------------------------ @@ -13,7 +13,7 @@ projectName = Projektname state = Status lastModification = Letzte \u00c4nderung owner = Besitzer - + copyProject = Projekt Kopieren renameProject = Projekt Umbenennen deleteProject = Projekt L\u00f6schen diff --git a/Kieker.WebGUI/src/main/resources/lang/UserManagementPage_de.properties b/Kieker.WebGUI/src/main/resources/lang/UserManagementPage_de.properties index 383c3a34..f5aadf0c 100644 --- a/Kieker.WebGUI/src/main/resources/lang/UserManagementPage_de.properties +++ b/Kieker.WebGUI/src/main/resources/lang/UserManagementPage_de.properties @@ -1,6 +1,6 @@ #------------------------------------------------------------------------------ # -# Diese Datei beinhaltet s\u00e4mtliche Nachrichten, Buttonbeschriftungen etc., +# Diese Datei beinhaltet sämtliche Nachrichten, Buttonbeschriftungen etc., # welche innerhalb der Benutzerverwaltungsseite benutzt werden. # #------------------------------------------------------------------------------ @@ -12,8 +12,8 @@ updateUserList = Benutzerliste Aktualisieren editUser = Benutzer Bearbeiten disableUser = Benutzer Deaktivieren enableUser = Benutzer Aktivieren -deleteUser = Benutzer L\u00f6schen - +deleteUser = Benutzer Löschen + username = Benutzername userroles = Benutzerrollen enabled = Aktiviert \ No newline at end of file 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 aac88a49..5807c106 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/faces-config.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/faces-config.xml @@ -1,8 +1,5 @@ <?xml version='1.0' encoding='UTF-8'?> -<!-- - This file contains the configuration for JSF. This means that it contains some localization work, some delegation to the Spring framework and the navigation cases, - which can be used to navigate between the pages. ---> + <faces-config version="2.1" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -78,5 +75,4 @@ <to-view-id>/pages/admin/UserManagementPage.xhtml</to-view-id> </navigation-case> </navigation-rule> - </faces-config> \ No newline at end of file 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 0bbeae5b..1301bdbd 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/pretty-config.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/pretty-config.xml @@ -1,17 +1,19 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - This file contains the configuration for Prettyfaces. This means we use some mappings to make sure that we have more "pretty" looking urls. Be careful if you - change something in here, as the patterns in the Spring Security configuration has to be modified as well! Otherwise you could destroy the security system. ---> <pretty-config xmlns="http://ocpsoft.com/prettyfaces/3.3.2" 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="/pages/" /> <view-id value="/faces/pages/ProjectOverviewPage.xhtml" /> </url-mapping> + <!-- The following mapping is very important! It makes sure that no one can access the root directory of the application. --> + <url-mapping id="home-redirect"> + <pattern value="/" /> + <view-id value="/faces/pages/ProjectOverviewPage.xhtml" /> + </url-mapping> + <url-mapping id="projectOverview"> <pattern value="/pages/projectOverview" /> <view-id value="/faces/pages/ProjectOverviewPage.xhtml" /> @@ -51,11 +53,4 @@ <pattern value="/pages/admin/userManagement" /> <view-id value="/faces/pages/admin/UserManagementPage.xhtml" /> </url-mapping> - - <!-- The following mapping is very important! It makes sure that no one can access the root directory of the application. --> - <url-mapping id="home-redirect"> - <pattern value="/" /> - <view-id value="/faces/pages/ProjectOverviewPage.xhtml" /> - </url-mapping> - </pretty-config> \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-bean-config.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-bean-config.xml index dce0d39d..dfe8bd88 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-bean-config.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-bean-config.xml @@ -1,27 +1,25 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - This file contains the bean configuration for the Spring framework. Technically we initialize only very few beans in here explicitly. Most of the beans and - services will be localized automatically via annotations. You will see them in the source code. ---> +<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:util="http://www.springframework.org/schema/util" - 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/util http://www.springframework.org/schema/util/spring-util-3.1.xsd - http://www.springframework.org/schema/context http://www.springframework.org/schema/context/spring-context-3.1.xsd"> + http://www.springframework.org/schema/util http://www.springframework.org/schema/util/spring-util-3.1.xsd"> - <!-- This is for the properties-files. --> - <bean id="globalPropertiesPlaceholder" 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="globalPropertiesBean" class="kieker.webgui.business.beans.application.GlobalPropertiesBean"> + <bean id="pluginFinder" class="kieker.webgui.common.util.PluginFinder" /> + <bean id="fsManager" class="kieker.webgui.common.util.FSManager" init-method="initialize"/> + <bean id="acManager" class="kieker.webgui.common.util.ACManager"> + <property name="fsManager" ref="fsManager" /> + </bean> + <bean id="projectManager" class="kieker.webgui.common.impl.ProjectManagerImpl"> + <property name="fsManager" ref="fsManager" /> + <property name="acManager" ref="acManager" /> + <property name="pluginFinder" ref="pluginFinder" /> + </bean> + <bean id="projectsBean" class="kieker.webgui.beans.application.ProjectsBean" init-method="initialize"> + <property name="projectManagerFacade" ref="projectManager" /> + </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}"/> @@ -30,11 +28,8 @@ <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}"/> - <property name="version" value="${kieker.webgui.version}"/> - <property name="kiekerUrl" value="${kieker.url}"/> </bean> - - <bean id="themeSwitcherBean" class="kieker.webgui.business.beans.application.ThemeSwitcherBean"> + <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> @@ -71,13 +66,49 @@ </map> </property> </bean> + <bean destroy-method="destroy" init-method="initialize" id="userManager" class="kieker.webgui.common.impl.UserManagerImpl"> + <property name="dataSource" ref="userDataSource" /> + </bean> - <!-- The enums. --> - <util:constant id="ROLE_USER" static-field="kieker.webgui.domain.User.Role.ROLE_USER"/> - <util:constant id="ROLE_ADMIN" static-field="kieker.webgui.domain.User.Role.ROLE_ADMIN"/> + <!-- The session scoped beans. --> + <bean id="userBean" init-method="initialize" class="kieker.webgui.beans.session.UserBean" scope="session"> + <property name="globalPropertiesBean" ref="globalPropertiesBean"/> + </bean> - <!-- Search the whole(!) project for beans. --> - <context:component-scan base-package="kieker.webgui" /> - <context:annotation-config /> - + <!-- The view scoped beans. --> + <bean id="currentAnalysisEditorBean" class="kieker.webgui.beans.view.CurrentAnalysisEditorBean" scope="view"> + <property name="globalPropertiesBean" ref="globalPropertiesBean"/> + <property name="projectManagerFacade" ref="projectManager" /> + <property name="projectsBean" ref="projectsBean" /> + <property name="currentAnalysisEditorGraphBean" ref="currentAnalysisEditorGraphBean" /> + <property name="userBean" ref="userBean" /> + </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="projectManager" /> + </bean> + <bean id="currentCockpitEditorBean" class="kieker.webgui.beans.view.CurrentCockpitEditorBean" scope="view"> + <property name="globalPropertiesBean" ref="globalPropertiesBean"/> + <property name="projectManagerFacade" ref="projectManager" /> + <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="projectManager" /> + </bean> + <bean id="currentProjectOverviewBean" class="kieker.webgui.beans.view.CurrentProjectOverviewBean" scope="view" init-method="initialialize"> + <property name="projectsBean" ref="projectsBean"/> + </bean> + <bean id="currentUserManagementBean" class="kieker.webgui.beans.view.CurrentUserManagementBean" init-method="initialialize" scope="view"> + <property name="userManagerFacade" ref="userManager"/> + </bean> + + <!-- The request scoped beans. --> + <bean id="stringBean" class="kieker.webgui.beans.request.StringBean" scope="request"/> + <bean id="newUserBean" class="kieker.webgui.beans.request.NewUserBean" scope="request"/> + + <!-- The enums. --> + <util:constant id="ROLE_USER" static-field="kieker.webgui.common.Role.ROLE_USER"/> + <util:constant id="ROLE_ADMIN" static-field="kieker.webgui.common.Role.ROLE_ADMIN"/> </beans> diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-common-config.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-common-config.xml index 50e88767..b3006a95 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-common-config.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-common-config.xml @@ -1,7 +1,3 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - This file contains some common configuration for the Spring framework. ---> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd"> @@ -11,11 +7,18 @@ <property name="scopes"> <map> <entry key="view"> - <bean class="kieker.webgui.common.ViewScope"/> + <bean class="kieker.webgui.common.util.ViewScope"/> </entry> </map> </property> </bean> - + <!-- This is for the properties-files. --> + <bean id="globalPropertiesPlaceholder" class="org.springframework.beans.factory.config.PropertyPlaceholderConfigurer"> + <property name="locations"> + <list> + <value>classpath:global.properties</value> + </list> + </property> + </bean> </beans> \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-database-config.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-database-config.xml index 1f0c7f0c..7eb459b5 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-database-config.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-database-config.xml @@ -1,23 +1,18 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - This file contains the configuration of the database. ---> +<?xml version="1.0" encoding="UTF-8"?> <beans xmlns="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:jdbc="http://www.springframework.org/schema/jdbc" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-2.5.xsd http://www.springframework.org/schema/jdbc http://www.springframework.org/schema/jdbc/spring-jdbc-3.0.xsd"> - <!-- The database. --> + <!-- The database and the transaction manager. --> <bean id="userDataSource" class="org.springframework.jdbc.datasource.DriverManagerDataSource"> <property name="driverClassName" value="org.apache.derby.jdbc.EmbeddedDriver" /> <property name="url" value="jdbc:derby:user;create=true" /> </bean> - <!-- This part will try to create the tables and add some test data. This should be removed for the release. --> <jdbc:initialize-database ignore-failures="ALL" data-source="userDataSource"> <jdbc:script location="classpath:sql/tables.sql"/> <jdbc:script location="classpath:sql/test-data.sql"/> - </jdbc:initialize-database> - + </jdbc:initialize-database> </beans> diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-security-config.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-security-config.xml index e788440a..990ee356 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-security-config.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-security-config.xml @@ -1,15 +1,11 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - This file contains the configuration of the security part of Spring. Be very careful if you change something in here. This is critical code! ---> +<?xml version="1.0" encoding="UTF-8"?> <beans:beans xmlns="http://www.springframework.org/schema/security" xmlns:beans="http://www.springframework.org/schema/beans" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.springframework.org/schema/beans http://www.springframework.org/schema/beans/spring-beans-3.1.xsd - http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> + http://www.springframework.org/schema/security http://www.springframework.org/schema/security/spring-security-3.1.xsd"> <http use-expressions="true" access-denied-page="/accessDenied" > - <!-- The following is the part for the login itself. --> <form-login login-page="/login" default-target-url="/pages/" authentication-failure-url="/login?state=fail"/> <intercept-url pattern="/login" access="permitAll"/> <intercept-url pattern="/faces/pages/LoginPage.xhtml" access="permitAll"/> @@ -31,15 +27,18 @@ <logout logout-success-url="/login?state=logout" /> </http> - <!-- Enable the annotations for the security system. --> <global-method-security pre-post-annotations="enabled"/> - <!-- The following part makes sure that the database is used to get the user authentication and authorities. --> <authentication-manager> <authentication-provider> - <jdbc-user-service data-source-ref="userDataSource" - users-by-username-query="SELECT name, password, enabled FROM KIEKERUser WHERE name=?" - authorities-by-username-query="SELECT u.name, r.Role FROM KIEKERUser u, Userroles ur, Roles r WHERE u.name=ur.name AND r.ID = ur.role AND u.name=?" + <jdbc-user-service data-source-ref="userDataSource" + users-by-username-query=" + select name, password, enabled + from KIEKERUser where name=?" + + authorities-by-username-query=" + select u.name, r.Role from KIEKERUser u, Userroles ur, Roles r + where u.name=ur.name and r.ID = ur.role and u.name=?" /> </authentication-provider> </authentication-manager> diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-security-taglib.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-security-taglib.xml index 84ccbaef..c6fc52a8 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-security-taglib.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/spring-security-taglib.xml @@ -1,7 +1,4 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - This file contains some manual tagging to make sure that the security part works. ---> +<?xml version="1.0"?> <!DOCTYPE facelet-taglib PUBLIC "-//Sun Microsystems, Inc.//DTD Facelet Taglib 1.0//EN" "http://java.sun.com/dtd/facelet-taglib_1_0.dtd"> diff --git a/Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml b/Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml index c7e804f5..d323eaec 100644 --- a/Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml +++ b/Kieker.WebGUI/src/main/webapp/WEB-INF/web.xml @@ -1,8 +1,4 @@ -<?xml version='1.0' encoding='UTF-8'?> -<!-- - This file contains the core configuration of the whole web application. Be careful if you change something in here. An exchange of codeparts could destroy the - security system for example. ---> +<?xml version="1.0" encoding="UTF-8"?> <web-app version="3.0" xmlns="http://java.sun.com/xml/ns/javaee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" @@ -26,13 +22,11 @@ <param-value>#{userBean.lookAndFeel}</param-value> </context-param> - <!-- This is for the security system. --> <context-param> <param-name>javax.faces.FACELETS_LIBRARIES</param-name> <param-value>/WEB-INF/spring-security-taglib.xml</param-value> </context-param> - <!-- This is for the security system. It has to be the first filter in order to work correctly. --> <filter> <filter-name>springSecurityFilterChain</filter-name> <filter-class>org.springframework.web.filter.DelegatingFilterProxy</filter-class> diff --git a/Kieker.WebGUI/src/main/webapp/css/AccessDeniedPage.css b/Kieker.WebGUI/src/main/webapp/css/AccessDeniedPage.css index 7f324f8f..7eac351d 100644 --- a/Kieker.WebGUI/src/main/webapp/css/AccessDeniedPage.css +++ b/Kieker.WebGUI/src/main/webapp/css/AccessDeniedPage.css @@ -1,9 +1,4 @@ @charset "UTF-8"; -/* - Author : Nils Christian Ehmke - Description: - This file contains the css parts for the access denied page. -*/ .hint-label { font-size: 25px; diff --git a/Kieker.WebGUI/src/main/webapp/css/AnalysisEditorPage.css b/Kieker.WebGUI/src/main/webapp/css/AnalysisEditorPage.css index facc9e83..1889c5a7 100644 --- a/Kieker.WebGUI/src/main/webapp/css/AnalysisEditorPage.css +++ b/Kieker.WebGUI/src/main/webapp/css/AnalysisEditorPage.css @@ -1,9 +1,4 @@ @charset "UTF-8"; -/* - Author : Nils Christian Ehmke - Description: - This file contains the css parts for the analysis editor page. -*/ /* This is necessary to remove the border from the datalist */ .ui-datalist * { diff --git a/Kieker.WebGUI/src/main/webapp/css/CockpitEditorPage.css b/Kieker.WebGUI/src/main/webapp/css/CockpitEditorPage.css index 8cb1a77f..b8ba3d16 100644 --- a/Kieker.WebGUI/src/main/webapp/css/CockpitEditorPage.css +++ b/Kieker.WebGUI/src/main/webapp/css/CockpitEditorPage.css @@ -1,9 +1,4 @@ @charset "UTF-8"; -/* - Author : Nils Christian Ehmke - Description: - This file contains the css parts for the cockpit editor page. -*/ /* This is necessary to remove the border from the datalist */ .ui-datalist * { diff --git a/Kieker.WebGUI/src/main/webapp/css/CockpitPage.css b/Kieker.WebGUI/src/main/webapp/css/CockpitPage.css index 11c5dfa7..f76427d5 100644 --- a/Kieker.WebGUI/src/main/webapp/css/CockpitPage.css +++ b/Kieker.WebGUI/src/main/webapp/css/CockpitPage.css @@ -1,9 +1,4 @@ @charset "UTF-8"; -/* - Author : Nils Christian Ehmke - Description: - This file contains the css parts for the cockpit page. -*/ ui-dashboard-column { width: 50% diff --git a/Kieker.WebGUI/src/main/webapp/css/Common.css b/Kieker.WebGUI/src/main/webapp/css/Common.css index a3e897c4..6cf1da11 100644 --- a/Kieker.WebGUI/src/main/webapp/css/Common.css +++ b/Kieker.WebGUI/src/main/webapp/css/Common.css @@ -1,9 +1,4 @@ @charset "UTF-8"; -/* - Author : Nils Christian Ehmke - Description: - This file contains the css parts for the common template. -*/ .ui-growl { width: 500px diff --git a/Kieker.WebGUI/src/main/webapp/css/ControllerPage.css b/Kieker.WebGUI/src/main/webapp/css/ControllerPage.css index 73439da3..03bb3631 100644 --- a/Kieker.WebGUI/src/main/webapp/css/ControllerPage.css +++ b/Kieker.WebGUI/src/main/webapp/css/ControllerPage.css @@ -1,6 +1 @@ -@charset "UTF-8"; -/* - Author : Nils Christian Ehmke - Description: - This file contains the css parts for the controller page. -*/ \ No newline at end of file +@charset "UTF-8"; \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/webapp/css/DefaultTemplate.css b/Kieker.WebGUI/src/main/webapp/css/DefaultTemplate.css index fb85f101..e1616250 100644 --- a/Kieker.WebGUI/src/main/webapp/css/DefaultTemplate.css +++ b/Kieker.WebGUI/src/main/webapp/css/DefaultTemplate.css @@ -1,8 +1,10 @@ @charset "UTF-8"; /* + Document : DefaultTemplate + Created on : 24.10.2012, 15:14:21 Author : Nils Christian Ehmke Description: - This file contains the css parts for the default template. + Purpose of the stylesheet follows. */ root { diff --git a/Kieker.WebGUI/src/main/webapp/css/FlowEditor.css b/Kieker.WebGUI/src/main/webapp/css/FlowEditor.css index 478a35f4..eb0b8e77 100644 --- a/Kieker.WebGUI/src/main/webapp/css/FlowEditor.css +++ b/Kieker.WebGUI/src/main/webapp/css/FlowEditor.css @@ -1,9 +1,4 @@ @charset "UTF-8"; -/* - Author : Nils Christian Ehmke - Description: - This file contains the css parts for the flow editor within the analysis editor page. -*/ #inner-details { font-size:12px; diff --git a/Kieker.WebGUI/src/main/webapp/css/Icons.css b/Kieker.WebGUI/src/main/webapp/css/Icons.css index 020bb58f..88818fe7 100644 --- a/Kieker.WebGUI/src/main/webapp/css/Icons.css +++ b/Kieker.WebGUI/src/main/webapp/css/Icons.css @@ -1,9 +1,4 @@ @charset "UTF-8"; -/* - Author : Nils Christian Ehmke - Description: - This file contains the css parts for icons. -*/ .ui-icon-close { background: url('../img/icons/Close.png') no-repeat !important; diff --git a/Kieker.WebGUI/src/main/webapp/css/LoginPage.css b/Kieker.WebGUI/src/main/webapp/css/LoginPage.css index fbb42cc7..ad91576c 100644 --- a/Kieker.WebGUI/src/main/webapp/css/LoginPage.css +++ b/Kieker.WebGUI/src/main/webapp/css/LoginPage.css @@ -1,9 +1,4 @@ @charset "UTF-8"; -/* - Author : Nils Christian Ehmke - Description: - This file contains the css parts for the login page. -*/ .ui-panel { font-size: 12px; diff --git a/Kieker.WebGUI/src/main/webapp/css/ProjectOverviewPage.css b/Kieker.WebGUI/src/main/webapp/css/ProjectOverviewPage.css index 36f5ee7f..f506fa16 100644 --- a/Kieker.WebGUI/src/main/webapp/css/ProjectOverviewPage.css +++ b/Kieker.WebGUI/src/main/webapp/css/ProjectOverviewPage.css @@ -1,9 +1,4 @@ @charset "UTF-8"; -/* - Author : Nils Christian Ehmke - Description: - This file contains the css parts for the project overview page. -*/ .ui-datatable-header { font-size: 12px; diff --git a/Kieker.WebGUI/src/main/webapp/css/UserManagement.css b/Kieker.WebGUI/src/main/webapp/css/UserManagement.css index 3f6c34fd..5b51f2ee 100644 --- a/Kieker.WebGUI/src/main/webapp/css/UserManagement.css +++ b/Kieker.WebGUI/src/main/webapp/css/UserManagement.css @@ -1,8 +1,9 @@ -@charset "UTF-8"; /* + Document : UserManagement + Created on : 24.10.2012, 21:58:57 Author : Nils Christian Ehmke Description: - This file contains the css parts for the user management page. + Purpose of the stylesheet follows. */ .col1 { diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/AboutDialog.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/AboutDialog.xhtml index 04e21cbc..c37c126e 100644 --- a/Kieker.WebGUI/src/main/webapp/dialogs/AboutDialog.xhtml +++ b/Kieker.WebGUI/src/main/webapp/dialogs/AboutDialog.xhtml @@ -6,7 +6,6 @@ xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> - <!-- This is the dialog showing some information about the web application. --> <p:dialog header="#{localizedMessages.about}" resizable="false" modal="true" widgetVar="aboutDlg"> <h:form> <img src="#{root}/img/kieker-logo-transparent.png" alt="Kieker-Logo" width="491" height="150" /> @@ -14,12 +13,12 @@ <h:outputText value="Kieker.WebGUI" /> <br /> <br /> - <h:outputText value="Version: #{globalPropertiesBean.version}" /> + <h:outputText value="Version: 1.7-SNAPSHOT" /> <br /> <h:outputText value="Copyright (c) 2012 Kieker Project" /> <br /> <br /> - <a href="#{globalPropertiesBean.kiekerUrl}">#{globalPropertiesBean.kiekerUrl}</a> + <a href="http://www.kieker-monitoring.net/">http://www.kieker-monitoring.net/</a> <hr/> <div style="text-align: right"> <p:commandButton value="Ok" oncomplete="aboutDlg.hide()" /> diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/AnalysisEditorPageDialogs.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/AnalysisEditorPageDialogs.xhtml index fb7d6d13..3bb92495 100644 --- a/Kieker.WebGUI/src/main/webapp/dialogs/AnalysisEditorPageDialogs.xhtml +++ b/Kieker.WebGUI/src/main/webapp/dialogs/AnalysisEditorPageDialogs.xhtml @@ -1,12 +1,9 @@ -<?xml version='1.0' encoding='UTF-8' ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> - <!-- This is the dialog to upload and manage libraries for the current project. --> <p:dialog id="manageLibrariesDlg" header="#{localizedMessages.libraries}" resizable="false" modal="true" widgetVar="manageLibrariesDialog"> <h:form id="dependenciesForm"> <p:dataTable id="currentDependencies" value="#{currentAnalysisEditorBean.libraries}" var="dependency" paginator="true" rows="10" paginatorTemplate="{CurrentPageReport} {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}" > @@ -44,7 +41,6 @@ </div> </p:dialog> - <!-- This is the dialog to ask the user in case that the project has been modified in the meantime. --> <p:dialog header="#{localizedMessages.saveProject}" resizable="false" modal="true" widgetVar="forceSaveDlg"> <h:form> <div style="text-align: center"> diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/CockpitEditorPageDialogs.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/CockpitEditorPageDialogs.xhtml index c9d09eac..7e8beecc 100644 --- a/Kieker.WebGUI/src/main/webapp/dialogs/CockpitEditorPageDialogs.xhtml +++ b/Kieker.WebGUI/src/main/webapp/dialogs/CockpitEditorPageDialogs.xhtml @@ -1,11 +1,10 @@ -<?xml version='1.0' encoding='UTF-8' ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> + <!-- ******************************************************************************** --> <!-- This is the dialog to create a new view. --> <p:dialog id="newViewDlg" header="New View" resizable="false" modal="true" widgetVar="newViewDialog"> <!-- Make sure that closing the dialog also clears the input field. --> @@ -25,19 +24,5 @@ </div> </h:form> </p:dialog> - - <!-- This is the dialog to ask the user in case that the project has been modified in the meantime. --> - <p:dialog header="Save Project" resizable="false" modal="true" widgetVar="forceSaveDlg"> - <h:form> - <div style="text-align: center"> - <h:outputText value="The project has been modified externally in the meanwhile. Do you want to overwrite the changes?" /> - </div> - <hr/> - <div style="text-align: right"> - <p:commandButton value="Yes" action="#{currentCockpitEditorBean.saveProject(true)}" oncomplete="forceSaveDlg.hide()" update=":messages" /> - <p:spacer width="10px" height="10" /> - <p:commandButton value="Cancel" onclick="forceSaveDlg.hide()" /> - </div> - </h:form> - </p:dialog> + </ui:composition> \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/ProjectOverviewPageDialogs.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/ProjectOverviewPageDialogs.xhtml index f5b44705..25ae3ba6 100644 --- a/Kieker.WebGUI/src/main/webapp/dialogs/ProjectOverviewPageDialogs.xhtml +++ b/Kieker.WebGUI/src/main/webapp/dialogs/ProjectOverviewPageDialogs.xhtml @@ -1,11 +1,10 @@ -<?xml version='1.0' encoding='UTF-8' ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" xmlns:ui="http://java.sun.com/jsf/facelets" xmlns:p="http://primefaces.org/ui"> + <!-- ******************************************************************************** --> <!-- This is the dialog to create a new project. --> <p:dialog id="newProjectDlg" header="#{localizedProjectOverviewMessages.newProject}" resizable="false" modal="true" widgetVar="newProjectDialog"> <!-- Make sure that closing of the dialog also clears the input field. --> @@ -23,8 +22,8 @@ </div> </h:form> </p:dialog> + <!-- ******************************************************************************** --> - <!-- This is the dialog to rename an existing project. --> <p:dialog id="renameProjectDlg" header="#{localizedProjectOverviewMessages.renameProject}" resizable="false" modal="true" widgetVar="renameProjectDialog"> <!-- Make sure that closing of the dialog also clears the input field. --> <p:ajax event="close" update="renameProjectDialogForm:renameProjectInputText" /> @@ -42,8 +41,8 @@ </h:form> </p:dialog> - <!-- This is the dialog to delete an existing project. --> <p:dialog id="deleteProjectDlg" header="#{localizedProjectOverviewMessages.deleteProject}" resizable="false" modal="true" widgetVar="deleteProjectDialog"> + <h:form id="deleteProjectDialogForm"> <div style="text-align: center"> <h:outputText value="#{localizedProjectOverviewMessages.msgReallyDeleteProject}" /> @@ -56,7 +55,6 @@ </h:form> </p:dialog> - <!-- This is the dialog to copy an existing project. --> <p:dialog id="copyProjectDlg" header="#{localizedProjectOverviewMessages.copyProject}" resizable="false" modal="true" widgetVar="copyProjectDialog"> <!-- Make sure that closing of the dialog also clears the input field. --> <p:ajax event="close" update="copyProjectDialogForm:copyProjectDialogInputText" /> @@ -74,5 +72,17 @@ </h:form> </p:dialog> - + <p:dialog header="Save Project" resizable="false" modal="true" widgetVar="forceSaveDlg"> + <h:form> + <div style="text-align: center"> + <h:outputText value="The project has been modified externally in the meanwhile. Do you want to overwrite the changes?" /> + </div> + <hr/> + <div style="text-align: right"> + <p:commandButton value="Yes" action="#{currentCockpitEditorBean.saveProject(true)}" oncomplete="forceSaveDlg.hide()" update=":messages" /> + <p:spacer width="10px" height="10" /> + <p:commandButton value="Cancel" onclick="forceSaveDlg.hide()" /> + </div> + </h:form> + </p:dialog> </ui:composition> \ No newline at end of file diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/SettingsDialog.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/SettingsDialog.xhtml index 0229f2a7..bc4bdcdf 100644 --- a/Kieker.WebGUI/src/main/webapp/dialogs/SettingsDialog.xhtml +++ b/Kieker.WebGUI/src/main/webapp/dialogs/SettingsDialog.xhtml @@ -1,6 +1,3 @@ -<?xml version='1.0' encoding='UTF-8' ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> - <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" @@ -8,7 +5,6 @@ xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"> - <!-- This is the dialog for the configuration. --> <p:dialog id="settingsDialog" header="#{localizedMessages.settings}" resizable="false" modal="true" widgetVar="settingsDlg"> <h:form> <p:tabView> @@ -47,8 +43,6 @@ </p:tab> <p:tab title="#{localizedMessages.cockpit}" disabled="true"> </p:tab> - <p:tab title="#{localizedMessages.userManagement}" disabled="true"> - </p:tab> </p:tabView> <hr/> <div style="text-align: right"> diff --git a/Kieker.WebGUI/src/main/webapp/dialogs/UserManagementDialogs.xhtml b/Kieker.WebGUI/src/main/webapp/dialogs/UserManagementDialogs.xhtml index 6d2e6648..2106604a 100644 --- a/Kieker.WebGUI/src/main/webapp/dialogs/UserManagementDialogs.xhtml +++ b/Kieker.WebGUI/src/main/webapp/dialogs/UserManagementDialogs.xhtml @@ -1,5 +1,3 @@ -<?xml version='1.0' encoding='UTF-8' ?> -<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> <ui:composition xmlns="http://www.w3.org/1999/xhtml" xmlns:h="http://java.sun.com/jsf/html" @@ -7,7 +5,6 @@ xmlns:f="http://java.sun.com/jsf/core" xmlns:p="http://primefaces.org/ui"> - <!-- This is the dialog for a new user. --> <p:dialog id="newUserDialog" header="Neuer Benutzer" resizable="false" modal="true" widgetVar="newUserDlg"> <!-- Make sure that closing of the dialog also clears the input field. --> <p:ajax event="close" update=":newUserDialogForm" /> diff --git a/Kieker.WebGUI/src/main/webapp/templates/PagesTemplate.xhtml b/Kieker.WebGUI/src/main/webapp/templates/PagesTemplate.xhtml index 36868c32..1c09d653 100644 --- a/Kieker.WebGUI/src/main/webapp/templates/PagesTemplate.xhtml +++ b/Kieker.WebGUI/src/main/webapp/templates/PagesTemplate.xhtml @@ -42,7 +42,7 @@ </p:button> <c:if test="#{sec:areAnyGranted('ROLE_ADMIN')}"> <p:separator/> - <p:button styleClass="perspective-button" icon="ui-icon-userManagement" value="#{localizedMessages.userManagement}" outcome="userManagement" disabled="#{pagename == 'userManagement'}" /> + <p:button styleClass="perspective-button" icon="ui-icon-userManagement" value="User Management" outcome="userManagement" disabled="#{pagename == 'userManagement'}" /> </c:if> </p:toolbarGroup> </p:toolbar> -- GitLab