From: <ra...@us...> - 2009-03-21 18:01:53
|
Revision: 2196 http://itracker.svn.sourceforge.net/itracker/?rev=2196&view=rev Author: ranks Date: 2009-03-21 18:01:36 +0000 (Sat, 21 Mar 2009) Log Message: ----------- final 3.0.1 changes fixing admin home, selenium tests, code cleanums Modified Paths: -------------- itracker/trunk/pom.xml itracker/trunk/src/main/java/org/itracker/core/ApplicationInitialization.java itracker/trunk/src/main/java/org/itracker/services/IssueService.java itracker/trunk/src/main/java/org/itracker/services/implementations/ConfigurationServiceImpl.java itracker/trunk/src/main/java/org/itracker/services/implementations/IssueServiceImpl.java itracker/trunk/src/main/java/org/itracker/services/util/HTMLUtilities.java itracker/trunk/src/main/java/org/itracker/web/actions/admin/AdminHomeAction.java itracker/trunk/src/main/java/org/itracker/web/actions/project/EditIssueActionUtil.java itracker/trunk/src/main/webapp/module-admin/admin_configuration/edit_customfield.jsp itracker/trunk/src/main/webapp/module-admin/adminhome.jsp itracker/trunk/src/site/apt/site.apt itracker/trunk/src/site/site.xml itracker/trunk/src/site/xdoc/configuration.xml itracker/trunk/src/site/xdoc/index.xml itracker/trunk/src/site/xdoc/install.xml itracker/trunk/src/site/xdoc/migration/migrate2.4-3.0.xml itracker/trunk/src/site/xdoc/release-notes/index.xml itracker/trunk/src/site/xdoc/release-notes/itracker-3.0-rc1.xml itracker/trunk/src/site/xdoc/release-notes/itracker-3.0-rc2.xml itracker/trunk/src/site/xdoc/release-notes/itracker-3.0-rc3.xml itracker/trunk/src/site/xdoc/release-notes/itracker-3.0-stable.xml itracker/trunk/src/site/xdoc/screenshots/screenshots.xml itracker/trunk/src/test/java/org/itracker/core/resources/ITrackerResourcesTest.java itracker/trunk/src/test/java/org/itracker/selenium/CreateIssueTest.java itracker/trunk/src/test/java/org/itracker/services/implementations/IssueServiceTest.java itracker/trunk/src/test/resources/configuration.properties Added Paths: ----------- itracker/trunk/src/site/xdoc/release-notes/itracker-3.0.1.xml Property Changed: ---------------- itracker/trunk/ itracker/trunk/src/main/webapp/META-INF/ Property changes on: itracker/trunk ___________________________________________________________________ Added: svn:ignore + .settings target .classpath .project Modified: itracker/trunk/pom.xml =================================================================== --- itracker/trunk/pom.xml 2009-03-18 18:40:30 UTC (rev 2195) +++ itracker/trunk/pom.xml 2009-03-21 18:01:36 UTC (rev 2196) @@ -5,7 +5,7 @@ <artifactId>itracker</artifactId> <packaging>war</packaging> <name>itracker</name> - <version>3.0.1-SNAPSHOT</version> + <version>3.0.1</version> <url>http://itracker.sourceforge.net/</url> <properties> <clover.maven.charset>UTF-8</clover.maven.charset> @@ -55,7 +55,7 @@ <id>ranks</id> <name>Marco Glur</name> <email>ra...@ro...</email> - <organization>R.‚àö√≤.S.A. Creation. Technology. Intelligence. AG, Zurich</organization> + <organization>R.Ø.S.A. Creation. Technology. Intelligence. AG, Zurich</organization> <organizationUrl>http://rosa.com/</organizationUrl> <roles> <role>Developer</role> @@ -66,7 +66,7 @@ <id>MarkyGoldstein</id> <name>Marky Goldstein</name> <email>re...@ro...</email> - <organization>R.‚àö√≤.S.A. Creation. Technology. Intelligence. AG, Zurich</organization> + <organization>R.Ø.S.A. Creation. Technology. Intelligence. AG, Zurich</organization> <organizationUrl>http://www.rosa.com</organizationUrl> <timezone>1</timezone> <roles> Modified: itracker/trunk/src/main/java/org/itracker/core/ApplicationInitialization.java =================================================================== --- itracker/trunk/src/main/java/org/itracker/core/ApplicationInitialization.java 2009-03-18 18:40:30 UTC (rev 2195) +++ itracker/trunk/src/main/java/org/itracker/core/ApplicationInitialization.java 2009-03-21 18:01:36 UTC (rev 2196) @@ -1,165 +1,117 @@ -/* - * This software was designed and created by Jason Carroll. - * Copyright (c) 2002, 2003, 2004 Jason Carroll. - * The author can be reached at jca...@co... - * ITracker website: http://www.cowsultants.com - * ITracker forums: http://www.cowsultants.com/phpBB/index.php - * - * This program is free software; you can redistribute it and/or modify - * it only under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -package org.itracker.core; - -import java.io.File; -import java.io.FileInputStream; -import java.io.IOException; - -import org.apache.log4j.Logger; -import org.itracker.core.resources.ITrackerResources; -import org.itracker.model.User; -import org.itracker.persistence.dao.NoSuchEntityException; -import org.itracker.services.ConfigurationService; -import org.itracker.services.IssueService; -import org.itracker.services.ReportService; -import org.itracker.services.UserService; -import org.itracker.services.exceptions.PasswordException; -import org.itracker.services.exceptions.UserException; -import org.itracker.services.util.SystemConfigurationUtilities; -import org.itracker.services.util.UserUtilities; - - -/** - * TODO: Add Javadocs here: please comment this for documentation reasons. What is this Class used for? - * - * It seems like this gets started when the application starts up... - * - * What's the general idea? - * - * Why is processAttachmentFiles commented and therefore not used currently? - * Where does itracker store its attachments? - * What's the idea behind the attachment_dir ? - * - * @author ready - * - */ - -public class ApplicationInitialization { - - private final Logger logger; - private UserService userService; - private ConfigurationService configurationService; - - public ApplicationInitialization(UserService userService, ConfigurationService configurationService, ReportService reportService) { - this.userService = userService; - this.configurationService = configurationService; - this.logger = Logger.getLogger(getClass()); - init(); - } - - public void init() { - try { - ITrackerResources.setDefaultLocale(configurationService.getProperty("default_locale", ITrackerResources.DEFAULT_LOCALE)); - logger.info("Set system default locale to '" + ITrackerResources.getDefaultLocale() + "'"); - - logger.info("Checking and initializing languages in the database."); - SystemConfigurationUtilities.initializeAllLanguages(configurationService, false); - - logger.info("Checking and initializing default system configuration in the database."); - configurationService.initializeConfiguration(); - -// logger.info("Checking for issue attachment files."); -// processAttachmentFiles(configurationService.getProperty("attachment_dir", IssueAttachmentUtilities.DEFAULT_ATTACHMENT_DIR)); - - logger.info("Setting up cached configuration entries"); - configurationService.resetConfigurationCache(); - - // Preinitialize all of the PDF fonts available. Do it in a - // separate thread to speed up the rest of the startup. - // TODO: I think this should be removed... why do we need to pre-init ? (rjst) - // old code to pre-init fonts for jfree reports. make sure we can delete it - // BaseFontFactory fontFactory = BaseFontFactory.getFontFactory(); - // fontFactory.registerDefaultFontPath(); - - // check for and create admin user, if so configured - createAdminUser(configurationService); - } catch (PasswordException pe) { - logger.info("Unable to create admin user. Error: " + pe.getMessage()); - } catch (UserException ue) { - logger.warn("Exception while creating admin user.", ue); - } - } - - /** - * Check if we should create the admin user, if so, do it. - * - * @param configurationService - * @throws PasswordException - * @throws UserException - */ - private void createAdminUser(ConfigurationService configurationService) throws PasswordException, UserException { - boolean createAdmin = configurationService.getBooleanProperty("create_super_user", false); - if (createAdmin) { - logger.info("Create default admin user option set to true. Checking for existing admin user."); - try { - userService.getUserByLogin("admin"); - } catch (NoSuchEntityException e) { - logger.debug("Attempting to create admin user."); - User adminUser = new User("admin", UserUtilities.encryptPassword("admin"), "Super", "User", - "", true); - userService.createUser(adminUser); - } - } - } - - @SuppressWarnings("unused") - private void processAttachmentFiles(String attachmentDirectory) { - if (attachmentDirectory == null || attachmentDirectory.equals("")) { - return; - } - - try { - File directory = new File(attachmentDirectory.replace('/', File.separatorChar)); - if (directory == null || !directory.isDirectory()) { - throw new Exception("Invalid attachment directory."); - } - File[] attachments = directory.listFiles(); - - IssueService issueService = null; - - for (int i = 0; i < attachments.length; i++) { - try { - if (attachments[i].length() > Integer.MAX_VALUE) { - throw new IOException("File too large to load."); - } - byte[] data = new byte[(int) attachments[i].length()]; - FileInputStream fis = new FileInputStream(attachments[i]); - int bytesRead = fis.read(data); - fis.close(); - if (bytesRead != data.length) { - throw new IOException( - "The number of bytes read from the file, did not match the size of the file."); - } - //FIXME: Null pointer access: The variable issueService can only be null at this location. - if (issueService.setIssueAttachmentData(attachments[i].getName(), data)) { - // attachments[i].delete(); - logger.debug("Successfully moved attachment " + attachments[i].getName() - + " to the database."); - } - } catch (IOException ioe) { - logger.error("Unable to save attachment: " + ioe.getMessage()); - } - } - } catch (Exception e) { - logger.error("Unable to check for existing file attachments: " + e.getMessage()); - } - } - -} +/* + * This software was designed and created by Jason Carroll. + * Copyright (c) 2002, 2003, 2004 Jason Carroll. + * The author can be reached at jca...@co... + * ITracker website: http://www.cowsultants.com + * ITracker forums: http://www.cowsultants.com/phpBB/index.php + * + * This program is free software; you can redistribute it and/or modify + * it only under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +package org.itracker.core; + +import org.apache.log4j.Logger; +import org.itracker.core.resources.ITrackerResources; +import org.itracker.model.User; +import org.itracker.persistence.dao.NoSuchEntityException; +import org.itracker.services.ConfigurationService; +import org.itracker.services.ReportService; +import org.itracker.services.UserService; +import org.itracker.services.exceptions.PasswordException; +import org.itracker.services.exceptions.UserException; +import org.itracker.services.util.SystemConfigurationUtilities; +import org.itracker.services.util.UserUtilities; + + +/** + * TODO: Add Javadocs here: please comment this for documentation reasons. What is this Class used for? + * + * It seems like this gets started when the application starts up... + * + * What's the general idea? + * + * Why is processAttachmentFiles commented and therefore not used currently? + * Where does itracker store its attachments? + * What's the idea behind the attachment_dir ? + * + * @author ready + * + */ + +public class ApplicationInitialization { + + private final Logger logger; + private UserService userService; + private ConfigurationService configurationService; + + public ApplicationInitialization(UserService userService, ConfigurationService configurationService, ReportService reportService) { + this.userService = userService; + this.configurationService = configurationService; + this.logger = Logger.getLogger(getClass()); + init(); + } + + public void init() { + try { + ITrackerResources.setDefaultLocale(configurationService.getProperty("default_locale", ITrackerResources.DEFAULT_LOCALE)); + logger.info("Set system default locale to '" + ITrackerResources.getDefaultLocale() + "'"); + + logger.info("Checking and initializing languages in the database."); + SystemConfigurationUtilities.initializeAllLanguages(configurationService, false); + + logger.info("Checking and initializing default system configuration in the database."); + configurationService.initializeConfiguration(); + +// logger.info("Checking for issue attachment files."); +// processAttachmentFiles(configurationService.getProperty("attachment_dir", IssueAttachmentUtilities.DEFAULT_ATTACHMENT_DIR)); + + logger.info("Setting up cached configuration entries"); + configurationService.resetConfigurationCache(); + + // Preinitialize all of the PDF fonts available. Do it in a + // separate thread to speed up the rest of the startup. + // TODO: I think this should be removed... why do we need to pre-init ? (rjst) + // old code to pre-init fonts for jfree reports. make sure we can delete it + // BaseFontFactory fontFactory = BaseFontFactory.getFontFactory(); + // fontFactory.registerDefaultFontPath(); + + // check for and create admin user, if so configured + createAdminUser(configurationService); + } catch (PasswordException pe) { + logger.info("Unable to create admin user. Error: " + pe.getMessage()); + } catch (UserException ue) { + logger.warn("Exception while creating admin user.", ue); + } + } + + /** + * Check if we should create the admin user, if so, do it. + * + * @param configurationService + * @throws PasswordException + * @throws UserException + */ + private void createAdminUser(ConfigurationService configurationService) throws PasswordException, UserException { + boolean createAdmin = configurationService.getBooleanProperty("create_super_user", false); + if (createAdmin) { + logger.info("Create default admin user option set to true. Checking for existing admin user."); + try { + userService.getUserByLogin("admin"); + } catch (NoSuchEntityException e) { + logger.debug("Attempting to create admin user."); + User adminUser = new User("admin", UserUtilities.encryptPassword("admin"), "Super", "User", + "", true); + userService.createUser(adminUser); + } + } + } + +} Modified: itracker/trunk/src/main/java/org/itracker/services/IssueService.java =================================================================== --- itracker/trunk/src/main/java/org/itracker/services/IssueService.java 2009-03-18 18:40:30 UTC (rev 2195) +++ itracker/trunk/src/main/java/org/itracker/services/IssueService.java 2009-03-21 18:01:36 UTC (rev 2196) @@ -1,324 +1,327 @@ -/* - * This software was designed and created by Jason Carroll. - * Copyright (c) 2002, 2003, 2004 Jason Carroll. - * The author can be reached at jca...@co... - * ITracker website: http://www.cowsultants.com - * ITracker forums: http://www.cowsultants.com/phpBB/index.php - * - * This program is free software; you can redistribute it and/or modify - * it only under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -package org.itracker.services; - -import java.util.Date; -import java.util.HashSet; -import java.util.List; -import java.util.Map; -import java.util.Set; - -import org.itracker.model.Component; -import org.itracker.model.Issue; -import org.itracker.model.IssueActivity; -import org.itracker.model.IssueAttachment; -import org.itracker.model.IssueField; -import org.itracker.model.IssueHistory; -import org.itracker.model.IssueRelation; -import org.itracker.model.IssueSearchQuery; -import org.itracker.model.PermissionType; -import org.itracker.model.Project; -import org.itracker.model.User; -import org.itracker.model.Version; -import org.itracker.services.exceptions.IssueSearchException; -import org.itracker.services.exceptions.ProjectException; - -public interface IssueService { - - Issue getIssue(Integer issueId); - - /** - * @deprecated Don't use due to EXPENSIVE memory use. - * @return - */ - List<Issue> getAllIssues(); - - - Long getNumberIssues(); - - /** - * Returns an array of issues that are currently at the given status. - * @param status the status to search for - * @return an array of issues with the given status - */ - List<Issue> getIssuesWithStatus(int status); - - /** - * Returns an array of issues that are currently at the given status or a status - * less than the given status. - * @param status the status to search for - * @return an array of issues with the given status or lower - */ - List<Issue> getIssuesWithStatusLessThan(int status); - - /** - * Returns an array of issues that are currently at the given severity. - * @param severity the severity to search for - * @return an array of issues with the given severity - */ - List<Issue> getIssuesWithSeverity(int severity); - - List<Issue> getIssuesByProjectId(Integer projectId); - - List<Issue> getIssuesByProjectId(Integer projectId, int status); - - List<Issue> getIssuesCreatedByUser(Integer userId); - - List<Issue> getIssuesCreatedByUser(Integer userId, boolean availableProjectsOnly); - - List<Issue> getIssuesOwnedByUser(Integer userId); - - List<Issue> getIssuesOwnedByUser(Integer userId, boolean availableProjectsOnly); - - List<Issue> getIssuesWatchedByUser(Integer userId); - - List<Issue> getIssuesWatchedByUser(Integer userId, boolean availableProjectsOnly); - - List<Issue> getUnassignedIssues(); - - List<Issue> getUnassignedIssues(boolean availableProjectsOnly); - /** - * Creates a new issue in a project. - * @param model an Issue representing the new issue information - * @param projectId the projectId the issue belongs to - * @param userId the id of registered creator of the new issue - * @param createdById the id of the actual creator of the issue. This would normally be the same as the userId. - * @return an Issue containing the newly created issue, or null if the create failed - */ - Issue createIssue(Issue issue, Integer projectId, Integer userId, Integer createdById) - throws ProjectException; - - /** - * Save a modified issue to the persistence layer - * - * @param issueDirty the changed, unsaved issue to update on persistency layer - * @param userId the user-id of the changer - * - */ - Issue updateIssue(Issue issue, Integer userId) throws ProjectException; - Issue systemUpdateIssue(Issue issue, Integer userId) throws ProjectException; - - /** - * Moves an issues from its current project to a new project. - * @param issue an Issue of the issue to move - * @param projectId the id of the target project - * @param userId the id of the user that is moving the issue - * @return an Issue of the issue after it has been moved - */ - Issue moveIssue(Issue issue, Integer projectId, Integer userId); - - /** - * - * @param issueId - * @param userId - * @return - */ - boolean assignIssue(Integer issueId, Integer userId); - - /** - * - * @param issueId - * @param userId - * @param assignedByUserId - * @return - */ - boolean assignIssue(Integer issueId, Integer userId, Integer assignedByUserId); - - /** - * TODO: Add Javadocs here: document this whole class.describe what is the use for this method. - * @param issueId - * @param fields - * @return - */ - boolean setIssueFields(Integer issueId, List<IssueField> fields); - - boolean setIssueComponents(Integer issueId, HashSet<Integer> componentIds, Integer userId); - - boolean setIssueVersions(Integer issueId, HashSet<Integer> versionIds, Integer userId); - - boolean addIssueHistory(IssueHistory history); - - boolean addIssueRelation(Integer issueId, Integer relatedIssueId, int relationType, Integer userId); - - //boolean addIssueActivity(IssueActivityModel model); - -// void updateIssueActivityNotification(Integer issueId, boolean notificationSent); - - boolean addIssueAttachment(IssueAttachment attachment, byte[] data); - - /** - * Updates the binary data of the attachment stored in the database. - * @param attachmentId the id of the attachment to update - * @param data a byte arrray of the binary data for the attachment - * @return true if the update was successful - */ - boolean setIssueAttachmentData(Integer attachmentId, byte[] data); - - /** - * Updates the binary data of the attachment stored in the database. Used mainly - * to take an existing attachment stored on the filesystem and move it into - * the database. - * @param fileName the filename listed in the database for the localtion of the attachment. - * This is the name that was previously used to store the data on the - * filesystem, not the original filename of the attachment. - * @param data a byte arrray of the binary data for the attachment - * @return true if the update was successful - */ - boolean setIssueAttachmentData(String fileName, byte[] data); - -// boolean addIssueNotification(Notification notification); - - boolean removeIssueAttachment(Integer attachmentId); - - //TODO: shall we deprecate this one? why do we need to give it a userId? - Integer removeIssueHistoryEntry(Integer entryId, Integer userId); - - void removeIssueRelation(Integer relationId, Integer userId); - - Project getIssueProject(Integer issueId); - - List<Component> getIssueComponents(Integer issueId); - - HashSet<Integer> getIssueComponentIds(Integer issueId); - - List<Version> getIssueVersions(Integer issueId); - - HashSet<Integer> getIssueVersionIds(Integer issueId); - - User getIssueCreator(Integer issueId); - - User getIssueOwner(Integer issueId); - - IssueRelation getIssueRelation(Integer relationId); - - List<IssueActivity> getIssueActivity(Integer issueId); - - List<IssueActivity> getIssueActivity(Integer issueId, boolean notificationSent); - - List<IssueAttachment> getAllIssueAttachments(); - -// /** -// * @deprecated use the methods getAllIssueAttachmentSize and getAllIssueAttachmentCount instead. -// * @return -// */ -// long[] getAllIssueAttachmentsSizeAndCount(); - - Long getAllIssueAttachmentSize(); - -// /** -// * @deprecated use getAllIssueAttachmentSize instead. -// * @return -// */ -// Long totalSystemIssuesAttachmentSize(); -// /** -// * @deprecated use getAllIssuesAttachmentCount instead -// * @return -// */ -// Long countSystemIssuesAttachments(); - - Long getAllIssueAttachmentCount(); - - - IssueAttachment getIssueAttachment(Integer attachmentId); - - /** - * Returns the binary data for an attachment. - * @param attachmentId the id of the attachment to obtain the data for - * @return a byte array containing the attachment data - */ - byte[] getIssueAttachmentData(Integer attachmentId); - - List<IssueAttachment> getIssueAttachments(Integer issueId); - - int getIssueAttachmentCount(Integer issueId); - - /** - * Returns the latest issue history entry for a particular issue. - * @param issueId the id of the issue to return the history entry for. - * @return the latest IssueHistory, or null if no entries could be found - */ - IssueHistory getLastIssueHistory(Integer issueId); - - List<IssueHistory> getIssueHistory(Integer issueId); - -// /** -// * @deprecated Moved to NotificationService -// * Retrieves the primary issue notifications. Primary notifications -// * are defined as the issue owner (or creator if not assigned), and any project owners. -// * This should encompass the list of people that should be notified so that action -// * can be taken on an issue that needs immediate attention. -// * @param issueId the id of the issue to find notifications for -// * @returns an array of NotificationModels -// */ -// List<Notification> getPrimaryIssueNotifications(Integer issueId); -// -// /** -// * Retrieves all notifications for an issue where the notification's user is also active. -// * @param issueId the id of the issue to find notifications for -// * @returns an array of NotificationModels -// * @deprecated Moved to NotificationService -// */ -// List<Notification> getIssueNotifications(Integer issueId); -// -// /** -// * Retrieves an array of issue notifications. The notifications by default -// * is the creator and owner of the issue, all project admins for the issue's project, -// * and anyone else that has a notfication on file. -// * @param issueId the id of the issue to find notifications for -// * @param pimaryOnly only include the primary notifications -// * @param activeOnly only include the notification if the user is currently active (not locked or deleted) -// * @returns an array of NotificationModels -// * @see org.itracker.services.implementations.IssueServiceImpl#getPrimaryIssueNotifications -// * @deprecated moved to NotificationService -// */ -// boolean removeIssueNotification(Integer notificationId); -// -// /** -// * @deprecated Moved to NotificationService -// * @param issueId -// * @param primaryOnly -// * @param activeOnly -// * @return -// */ -// List<Notification> getIssueNotifications(Integer issueId, boolean primaryOnly, boolean activeOnly); -// /** -// * @deprecated Moved to NotificationService -// * @param issueId -// * @param userId -// * @return -// */ -// boolean hasIssueNotification(Integer issueId, Integer userId); - - - int getOpenIssueCountByProjectId(Integer projectId); - - int getResolvedIssueCountByProjectId(Integer projectId); - - int getTotalIssueCountByProjectId(Integer projectId); - - Date getLatestIssueDateByProjectId(Integer projectId); - - boolean canViewIssue(Integer issueId, User user); - - boolean canViewIssue(Issue issue, User user); - - public List<Issue> searchIssues(IssueSearchQuery queryModel, User user, Map<Integer, Set<PermissionType>> userPermissions) throws IssueSearchException; - - -} +/* + * This software was designed and created by Jason Carroll. + * Copyright (c) 2002, 2003, 2004 Jason Carroll. + * The author can be reached at jca...@co... + * ITracker website: http://www.cowsultants.com + * ITracker forums: http://www.cowsultants.com/phpBB/index.php + * + * This program is free software; you can redistribute it and/or modify + * it only under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +package org.itracker.services; + +import java.util.Date; +import java.util.HashSet; +import java.util.List; +import java.util.Map; +import java.util.Set; + +import org.itracker.model.Component; +import org.itracker.model.Issue; +import org.itracker.model.IssueActivity; +import org.itracker.model.IssueAttachment; +import org.itracker.model.IssueField; +import org.itracker.model.IssueHistory; +import org.itracker.model.IssueRelation; +import org.itracker.model.IssueSearchQuery; +import org.itracker.model.PermissionType; +import org.itracker.model.Project; +import org.itracker.model.User; +import org.itracker.model.Version; +import org.itracker.services.exceptions.IssueSearchException; +import org.itracker.services.exceptions.ProjectException; + +public interface IssueService { + + Issue getIssue(Integer issueId); + + /** + * @deprecated Don't use due to EXPENSIVE memory use. + * @return + */ + List<Issue> getAllIssues(); + + + Long getNumberIssues(); + + /** + * Returns an array of issues that are currently at the given status. + * @param status the status to search for + * @return an array of issues with the given status + */ + List<Issue> getIssuesWithStatus(int status); + + /** + * Returns an array of issues that are currently at the given status or a status + * less than the given status. + * @param status the status to search for + * @return an array of issues with the given status or lower + */ + List<Issue> getIssuesWithStatusLessThan(int status); + + /** + * Returns an array of issues that are currently at the given severity. + * @param severity the severity to search for + * @return an array of issues with the given severity + */ + List<Issue> getIssuesWithSeverity(int severity); + + List<Issue> getIssuesByProjectId(Integer projectId); + + List<Issue> getIssuesByProjectId(Integer projectId, int status); + + List<Issue> getIssuesCreatedByUser(Integer userId); + + List<Issue> getIssuesCreatedByUser(Integer userId, boolean availableProjectsOnly); + + List<Issue> getIssuesOwnedByUser(Integer userId); + + List<Issue> getIssuesOwnedByUser(Integer userId, boolean availableProjectsOnly); + + List<Issue> getIssuesWatchedByUser(Integer userId); + + List<Issue> getIssuesWatchedByUser(Integer userId, boolean availableProjectsOnly); + + List<Issue> getUnassignedIssues(); + + List<Issue> getUnassignedIssues(boolean availableProjectsOnly); + /** + * Creates a new issue in a project. + * @param model an Issue representing the new issue information + * @param projectId the projectId the issue belongs to + * @param userId the id of registered creator of the new issue + * @param createdById the id of the actual creator of the issue. This would normally be the same as the userId. + * @return an Issue containing the newly created issue, or null if the create failed + */ + Issue createIssue(Issue issue, Integer projectId, Integer userId, Integer createdById) + throws ProjectException; + + /** + * Save a modified issue to the persistence layer + * + * @param issueDirty the changed, unsaved issue to update on persistency layer + * @param userId the user-id of the changer + * + */ + Issue updateIssue(Issue issue, Integer userId) throws ProjectException; + Issue systemUpdateIssue(Issue issue, Integer userId) throws ProjectException; + + /** + * Moves an issues from its current project to a new project. + * @param issue an Issue of the issue to move + * @param projectId the id of the target project + * @param userId the id of the user that is moving the issue + * @return an Issue of the issue after it has been moved + */ + Issue moveIssue(Issue issue, Integer projectId, Integer userId); + + /** + * + * @param issueId + * @param userId + * @return + */ + boolean assignIssue(Integer issueId, Integer userId); + + /** + * + * @param issueId + * @param userId + * @param assignedByUserId + * @return + */ + boolean assignIssue(Integer issueId, Integer userId, Integer assignedByUserId); + + /** + * TODO: Add Javadocs here: document this whole class.describe what is the use for this method. + * @param issueId + * @param fields + * @return + */ + boolean setIssueFields(Integer issueId, List<IssueField> fields); + + boolean setIssueComponents(Integer issueId, HashSet<Integer> componentIds, Integer userId); + + boolean setIssueVersions(Integer issueId, HashSet<Integer> versionIds, Integer userId); + + boolean addIssueHistory(IssueHistory history); + + boolean addIssueRelation(Integer issueId, Integer relatedIssueId, int relationType, Integer userId); + + //boolean addIssueActivity(IssueActivityModel model); + +// void updateIssueActivityNotification(Integer issueId, boolean notificationSent); + + boolean addIssueAttachment(IssueAttachment attachment, byte[] data); + + /** + * Updates the binary data of the attachment stored in the database. + * @param attachmentId the id of the attachment to update + * @param data a byte arrray of the binary data for the attachment + * @return true if the update was successful + */ + boolean setIssueAttachmentData(Integer attachmentId, byte[] data); + + /** + * Updates the binary data of the attachment stored in the database. Used mainly + * to take an existing attachment stored on the filesystem and move it into + * the database. + * @param fileName the filename listed in the database for the localtion of the attachment. + * This is the name that was previously used to store the data on the + * filesystem, not the original filename of the attachment. + * @param data a byte arrray of the binary data for the attachment + * @return true if the update was successful + */ + boolean setIssueAttachmentData(String fileName, byte[] data); + +// boolean addIssueNotification(Notification notification); + + boolean removeIssueAttachment(Integer attachmentId); + + //TODO: shall we deprecate this one? why do we need to give it a userId? + Integer removeIssueHistoryEntry(Integer entryId, Integer userId); + + void removeIssueRelation(Integer relationId, Integer userId); + + Project getIssueProject(Integer issueId); + + List<Component> getIssueComponents(Integer issueId); + + HashSet<Integer> getIssueComponentIds(Integer issueId); + + List<Version> getIssueVersions(Integer issueId); + + HashSet<Integer> getIssueVersionIds(Integer issueId); + + User getIssueCreator(Integer issueId); + + User getIssueOwner(Integer issueId); + + IssueRelation getIssueRelation(Integer relationId); + + List<IssueActivity> getIssueActivity(Integer issueId); + + List<IssueActivity> getIssueActivity(Integer issueId, boolean notificationSent); + /** + * @deprecated + * @return + */ + List<IssueAttachment> getAllIssueAttachments(); + +// /** +// * @deprecated use the methods getAllIssueAttachmentSize and getAllIssueAttachmentCount instead. +// * @return +// */ +// long[] getAllIssueAttachmentsSizeAndCount(); + + Long getAllIssueAttachmentSize(); + +// /** +// * @deprecated use getAllIssueAttachmentSize instead. +// * @return +// */ +// Long totalSystemIssuesAttachmentSize(); +// /** +// * @deprecated use getAllIssuesAttachmentCount instead +// * @return +// */ +// Long countSystemIssuesAttachments(); + + Long getAllIssueAttachmentCount(); + + + IssueAttachment getIssueAttachment(Integer attachmentId); + + /** + * Returns the binary data for an attachment. + * @param attachmentId the id of the attachment to obtain the data for + * @return a byte array containing the attachment data + */ + byte[] getIssueAttachmentData(Integer attachmentId); + + List<IssueAttachment> getIssueAttachments(Integer issueId); + + int getIssueAttachmentCount(Integer issueId); + + /** + * Returns the latest issue history entry for a particular issue. + * @param issueId the id of the issue to return the history entry for. + * @return the latest IssueHistory, or null if no entries could be found + */ + IssueHistory getLastIssueHistory(Integer issueId); + + List<IssueHistory> getIssueHistory(Integer issueId); + +// /** +// * @deprecated Moved to NotificationService +// * Retrieves the primary issue notifications. Primary notifications +// * are defined as the issue owner (or creator if not assigned), and any project owners. +// * This should encompass the list of people that should be notified so that action +// * can be taken on an issue that needs immediate attention. +// * @param issueId the id of the issue to find notifications for +// * @returns an array of NotificationModels +// */ +// List<Notification> getPrimaryIssueNotifications(Integer issueId); +// +// /** +// * Retrieves all notifications for an issue where the notification's user is also active. +// * @param issueId the id of the issue to find notifications for +// * @returns an array of NotificationModels +// * @deprecated Moved to NotificationService +// */ +// List<Notification> getIssueNotifications(Integer issueId); +// +// /** +// * Retrieves an array of issue notifications. The notifications by default +// * is the creator and owner of the issue, all project admins for the issue's project, +// * and anyone else that has a notfication on file. +// * @param issueId the id of the issue to find notifications for +// * @param pimaryOnly only include the primary notifications +// * @param activeOnly only include the notification if the user is currently active (not locked or deleted) +// * @returns an array of NotificationModels +// * @see org.itracker.services.implementations.IssueServiceImpl#getPrimaryIssueNotifications +// * @deprecated moved to NotificationService +// */ +// boolean removeIssueNotification(Integer notificationId); +// +// /** +// * @deprecated Moved to NotificationService +// * @param issueId +// * @param primaryOnly +// * @param activeOnly +// * @return +// */ +// List<Notification> getIssueNotifications(Integer issueId, boolean primaryOnly, boolean activeOnly); +// /** +// * @deprecated Moved to NotificationService +// * @param issueId +// * @param userId +// * @return +// */ +// boolean hasIssueNotification(Integer issueId, Integer userId); + + + int getOpenIssueCountByProjectId(Integer projectId); + + int getResolvedIssueCountByProjectId(Integer projectId); + + int getTotalIssueCountByProjectId(Integer projectId); + + Date getLatestIssueDateByProjectId(Integer projectId); + + boolean canViewIssue(Integer issueId, User user); + + boolean canViewIssue(Issue issue, User user); + + public List<Issue> searchIssues(IssueSearchQuery queryModel, User user, Map<Integer, Set<PermissionType>> userPermissions) throws IssueSearchException; + + +} Modified: itracker/trunk/src/main/java/org/itracker/services/implementations/ConfigurationServiceImpl.java =================================================================== --- itracker/trunk/src/main/java/org/itracker/services/implementations/ConfigurationServiceImpl.java 2009-03-18 18:40:30 UTC (rev 2195) +++ itracker/trunk/src/main/java/org/itracker/services/implementations/ConfigurationServiceImpl.java 2009-03-21 18:01:36 UTC (rev 2196) @@ -976,12 +976,15 @@ if (locale == null || locale.equals("")) { locale = ITrackerResources.BASE_LOCALE; } + Collection<Language> items = languageDAO.findByLocale(locale); for (Iterator<Language> iter = items.iterator(); iter.hasNext();) { Language item = (Language) iter.next(); keys.put(item.getResourceKey(), item.getResourceValue()); } + + return keys; } Modified: itracker/trunk/src/main/java/org/itracker/services/implementations/IssueServiceImpl.java =================================================================== --- itracker/trunk/src/main/java/org/itracker/services/implementations/IssueServiceImpl.java 2009-03-18 18:40:30 UTC (rev 2195) +++ itracker/trunk/src/main/java/org/itracker/services/implementations/IssueServiceImpl.java 2009-03-21 18:01:36 UTC (rev 2196) @@ -1677,7 +1677,7 @@ */ public Long getAllIssueAttachmentSize() { - return getIssueAttachmentDAO().countAll().longValue(); + return getIssueAttachmentDAO().totalAttachmentsSize().longValue() / 1024; } Modified: itracker/trunk/src/main/java/org/itracker/services/util/HTMLUtilities.java =================================================================== --- itracker/trunk/src/main/java/org/itracker/services/util/HTMLUtilities.java 2009-03-18 18:40:30 UTC (rev 2195) +++ itracker/trunk/src/main/java/org/itracker/services/util/HTMLUtilities.java 2009-03-21 18:01:36 UTC (rev 2196) @@ -1,163 +1,189 @@ -/* - * This software was designed and created by Jason Carroll. - * Copyright (c) 2002, 2003, 2004 Jason Carroll. - * The author can be reached at jca...@co... - * ITracker website: http://www.cowsultants.com - * ITracker forums: http://www.cowsultants.com/phpBB/index.php - * - * This program is free software; you can redistribute it and/or modify - * it only under the terms of the GNU General Public License as published by - * the Free Software Foundation; either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - */ - -package org.itracker.services.util; - -import org.apache.log4j.Logger; -import org.apache.oro.text.regex.MalformedPatternException; -import org.apache.oro.text.regex.Pattern; -import org.apache.oro.text.regex.PatternCompiler; -import org.apache.oro.text.regex.Perl5Compiler; -import org.apache.oro.text.regex.Perl5Matcher; -import org.apache.oro.text.regex.Perl5Substitution; -import org.apache.oro.text.regex.Util; - -public class HTMLUtilities { - - private static final Logger logger = Logger.getLogger(HTMLUtilities.class); - private static Perl5Matcher matcher = new Perl5Matcher(); - private static PatternCompiler compiler = new Perl5Compiler(); - private static Pattern pattern = null; - - static { - try { - pattern = compiler.compile("<[\\w/].*?>", Perl5Compiler.CASE_INSENSITIVE_MASK); - } catch(MalformedPatternException mpe) { - logger.error("Invalid pattern in HTMLUtilities. " + mpe.getMessage()); - } - } - - public static String removeQuotes(String input) { - StringBuffer sb = new StringBuffer(input.length()); - int len = input.length(); - char c; - - for(int i = 0; i < len; i++) { - c = input.charAt(i); - if (c == '\'') { - sb.append("''"); - } else { - sb.append(c); - } - } - return sb.toString(); - } - - public static String handleQuotes(String input) { - if(input == null || "".equals(input) || input.indexOf('"') == -1) { - return input; - } - - StringBuffer buf = new StringBuffer(); - - char[] chars = input.toCharArray(); - for(int i = 0; i < chars.length; i++) { - if(chars[i] == '"') { - buf.append("""); - } else { - buf.append(chars[i]); - } - } - - return buf.toString(); - } - - public static String escapeNewlines(String input) { - if(input == null || "".equals(input) || input.indexOf('\n') == -1) { - return input; - } - - StringBuffer buf = new StringBuffer(); - char[] chars = input.toCharArray(); - for(int i = 0; i < chars.length; i++) { - if(chars[i] == '\r') { - continue; - } else if(chars[i] == '\n') { - buf.append("\\n"); - } else { - buf.append(chars[i]); - } - } - return buf.toString(); - } - - public static String newlinesToBreaks(String input) { - if(input == null || "".equals(input) || input.indexOf('\n') == -1) { - return input; - } - - StringBuffer buf = new StringBuffer(); - char[] chars = input.toCharArray(); - for(int i = 0; i < chars.length; i++) { - if(chars[i] == '\r') { - continue; - } else if(chars[i] == '\n') { - buf.append("<br>"); - } else { - buf.append(chars[i]); - } - } - return buf.toString(); - } - - public static String removeMarkup(String input) { - String output = (input == null ? "" : input); - - if(pattern != null && matcher != null && output != null && ! output.equals("")) { - output = Util.substitute(matcher, pattern, new Perl5Substitution(), output, Util.SUBSTITUTE_ALL); - } else { - logger.debug("Failed removing markup. Pattern = " + pattern + " Output = " + output); - } - - return output; - } - - public static String escapeTags(String input) { - StringBuffer sb = new StringBuffer(input.length()); - int len = input.length(); - char c; - - for(int i = 0; i < len; i++) { - c = input.charAt(i); - if (c == '"') { - sb.append("""); - } else if (c == '&') { - sb.append("&"); - } else if (c == '<') { - sb.append("<"); - } else if (c == '>') { - sb.append(">"); - } else { - int ci = 0xffff & c; - if (ci < 160 ) { - // nothing special only 7 Bit - sb.append(c); - } else { - // Not 7 Bit use the unicode system - sb.append("&#"); - sb.append(new Integer(ci).toString()); - sb.append(';'); - } - } - } - - return sb.toString(); - } -} - +/* + * This software was designed and created by Jason Carroll. + * Copyright (c) 2002, 2003, 2004 Jason Carroll. + * The author can be reached at jca...@co... + * ITracker website: http://www.cowsultants.com + * ITracker forums: http://www.cowsultants.com/phpBB/index.php + * + * This program is free software; you can redistribute it and/or modify + * it only under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + */ + +package org.itracker.services.util; + +import java.text.DateFormat; +import java.text.SimpleDateFormat; +import java.util.StringTokenizer; + +import org.apache.log4j.Logger; +import org.apache.oro.text.regex.MalformedPatternException; +import org.apache.oro.text.regex.Pattern; +import org.apache.oro.text.regex.PatternCompiler; +import org.apache.oro.text.regex.Perl5Compiler; +import org.apache.oro.text.regex.Perl5Matcher; +import org.apache.oro.text.regex.Perl5Substitution; +import org.apache.oro.text.regex.Util; + +public class HTMLUtilities { + + private static final Logger logger = Logger.getLogger(HTMLUtilities.class); + private static Perl5Matcher matcher = new Perl5Matcher(); + private static PatternCompiler compiler = new Perl5Compiler(); + private static Pattern pattern = null; + + static { + try { + pattern = compiler.compile("<[\\w/].*?>", Perl5Compiler.CASE_INSENSITIVE_MASK); + } catch(MalformedPatternException mpe) { + logger.error("Invalid pattern in HTMLUtilities. " + mpe.getMessage()); + } + } + + public static String removeQuotes(String input) { + StringBuffer sb = new StringBuffer(input.length()); + int len = input.length(); + char c; + + for(int i = 0; i < len; i++) { + c = input.charAt(i); + if (c == '\'') { + sb.append("''"); + } else { + sb.append(c); + } + } + return sb.toString(); + } + + public static String handleQuotes(String input) { + if(input == null || "".equals(input) || input.indexOf('"') == -1) { + return input; + } + + StringBuffer buf = new StringBuffer(); + + char[] chars = input.toCharArray(); + for(int i = 0; i < chars.length; i++) { + if(chars[i] == '"') { + buf.append("""); + } else { + buf.append(chars[i]); + } + } + + return buf.toString(); + } + + public static String escapeNewlines(String input) { + if(input == null || "".equals(input) || input.indexOf('\n') == -1) { + return input; + } + + StringBuffer buf = new StringBuffer(); + char[] chars = input.toCharArray(); + for(int i = 0; i < chars.length; i++) { + if(chars[i] == '\r') { + continue; + } else if(chars[i] == '\n') { + buf.append("\\n"); + } else { + buf.append(chars[i]); + } + } + return buf.toString(); + } + + public static String newlinesToBreaks(String input) { + if(input == null || "".equals(input) || input.indexOf('\n') == -1) { + return input; + } + + StringBuffer buf = new StringBuffer(); + char[] chars = input.toCharArray(); + for(int i = 0; i < chars.length; i++) { + if(chars[i] == '\r') { + continue; + } else if(chars[i] == '\n') { + buf.append("<br>"); + } else { + buf.append(chars[i]); + } + } + return buf.toString(); + } + + public static String removeMarkup(String input) { + String output = (input == null ? "" : input); + + if(pattern != null && matcher != null && output != null && ! output.equals("")) { + output = Util.substitute(matcher, pattern, new Perl5Substitution(), output, Util.SUBSTITUTE_ALL); + } else { + logger.debug("Failed removing markup. Pattern = " + pattern + " Output = " + output); + } + + return output; + } + + public static String escapeTags(String input) { + StringBuffer sb = new StringBuffer(input.length()); + int len = input.length(); + char c; + + for(int i = 0; i < len; i++) { + c = input.charAt(i); + if (c == '"') { + sb.append("""); + } else if (c == '&') { + sb.append("&"); + } else if (c == '<') { + sb.append("<"); + } else if (c == '>') { + sb.append(">"); + } else { + int ci = 0xffff & c; + if (ci < 160 ) { + // nothing special only 7 Bit + sb.append(c); + } else { + // Not 7 Bit use the unicode system + sb.append("&#"); + sb.append(new Integer(ci).toString()); + sb.append(';'); + } + } + } + + return sb.toString(); + } + + /** + * format a itracker date format for scal datepicker + * + * @see http://scal.fieldguidetoprogrammers.com + * + * @param format + * @return + */ + public static final String getJSDateFormat(String format) { + + + String f = format.replace('m', 'n'); + + + f = format.toLowerCase(); + + return f; + + + } + +} + \ No newline at end of file Modified: itracker/trunk/src/main/java/org/itracker/web/actions/admin/AdminHomeAction.java =================================================================== --- itracker/trunk/src/main/java/org/itracker/web/actions/admin/AdminHomeAction.java 2009-03-18 18:40:30 UTC (rev 2195) +++ itracker/trunk/src/main/java/org/itracker/web/actions/admin/AdminHomeAction.java 2009-03-21 18:01:36 UTC (rev 2196) @@ -1,176 +1,212 @@ -package org.itracker.web.actions.admin; - -import java.util.Date; -import java.util.Map; -import java.util.Set; - -import javax.servlet.http.HttpServletRequest; -import javax.servlet.http.HttpServletResponse; - -import org.apache.log4j.Level; -import org.apache.log4j.Logger; -import org.apache.struts.action.ActionForm; -import org.apache.struts.action.ActionForward; -import org.apache.struts.action.ActionMapping; -import org.itracker.model.PermissionType; -import org.itracker.services.ConfigurationService; -import org.itracker.services.IssueService; -import org.itracker.services.ProjectService; -import org.itracker.services.util.ReportUtilities; -import org.itracker.services.util.SystemConfigurationUtilities; -import org.itracker.services.util.UserUtilities; -import org.itracker.web.actions.base.ItrackerBaseAction; -import org.itracker.web.util.RequestHelper; -import org.itracker.web.util.ServletContextUtils; -import org.itracker.web.util.SessionManager; - -public class AdminHomeAction extends ItrackerBaseAction { - - private static final Logger log = Logger.getLogger(AdminHomeAction.class); - - public ActionForward execute(ActionMapping mapping, ActionForm form, - HttpServletRequest request, HttpServletResponse response) - throws Exception { - final Map<Integer, Set<PermissionType>> permissions = RequestHelper - .getUserPermissions(request.getSession()); - - - - if (!UserUtilities.hasPermission(permissions, - UserUtilities.PERMISSION_USER_ADMIN)) { - - mapping.findForward("listprojectadmin"); - } - - execSetupJspEnv(request); - - return mapping.findForward("adminhome"); - } - - - /** - * This utility has to be called for any page forwarding to the admin-home, before forwarding. Else the page will contain no data. - * - * @param request - */ - public static final void execSetupJspEnv(HttpServletRequest request) { - Date time_millies = new Date(System.currentTimeMillis()); - // super.executeAlways(mapping, form, request, response); - - IssueService issueService = ServletContextUtils.getItrackerServices() - .getIssueService(); -// ProjectService projectService = ServletContextUtils.getItrackerServices() -// .getProjectService(); -// ReportService reportService = ServletContextUtils.getItrackerServices() -// .getReportService(); - ConfigurationService configurationService = ServletContextUtils.getItrackerServices() - .getConfigurationService(); -// UserService userService = ServletContextUtils.getItrackerServices().getUserService(); - - - ProjectService projectService2 = ServletContextUtils - .getItrackerServices().getProjectService(); - - String exportReport = "type=all&reportOutput=XML&reportId=" - + ReportUtilities.REPORT_EXPORT_XML; - - logTimeMillies("execute: looked up services", time_millies, log, - Level.INFO); - Integer numberOfWorkflowScripts = configurationService - .getWorkflowScripts().size(); - request - .setAttribute("numberOfWorkflowScripts", - numberOfWorkflowScripts); - logTimeMillies("execute: looked up numberOfWorkflowScripts", - time_millies, log, Level.INFO); - - Integer numberDefinedKeys = configurationService - .getNumberDefinedKeys(null); - request.setAttribute("numberDefinedKeys", numberDefinedKeys); - logTimeMillies("execute: looked up numberDefinedKeys", time_millies, - log, Level.INFO); - - Integer numberOfStatuses = configurationService - .getConfigurationItemsByType( - SystemConfigurationUtilities.TYPE_STATUS).size(); - request.setAttribute("numberOfStatuses", numberOfStatuses); - logTimeMillies("execute: looked up numberOfStatuses", time_millies, - log, Level.INFO); - - Integer numberOfSeverities = configurationService - .getConfigurationItemsByType( - SystemConfigurationUtilities.TYPE_SEVERITY).size(); - request.setAttribute("numberOfSeverities", numberOfSeverities); - logTimeMillies("execute: looked up numberOfSeverities", time_millies, - log, Level.INFO); - - Integer numberOfResolutions = configurationService - .getConfigurationItemsByType( - SystemConfigurationUtilities.TYPE_RESOLUTION).size(); - request.setAttribute("numberOfResolutions", numberOfResolutions); - logTimeMillies("execute: looked up numberOfResolutions", time_millies, - log, Level.INFO); - - Integer numberOfCustomProjectFields = configurationService - .getCustomFields().size(); - request.setAttribute("numberOfCustomProjectFields", - numberOfCustomProjectFields); - logTimeMillies("execute: looked up numberOfCustomProjectFields", - time_millies, log, Level.INFO); - - Integer numberofActiveSesssions = SessionManager.getNumActiveSessions(); - request - .setAttribute("numberofActiveSesssions", - numberofActiveSesssions); - logTimeMillies("execute: looked up numberofActiveSesssions", - time_millies, log, Level.INFO); - - Long allIssueAttachmentsTotalNumber = issueService - .getAllIssueAttachmentCount(); - request.setAttribute("allIssueAttachmentsTotalNumber", - allIssueAttachmentsTotalNumber); - logTimeMillies("execute: looked up allIssueAttachmentsTotalNumber", - time_millies, log, Level.INFO); - - // TODO: performance issue when attachments size needs to be calculated - // over many issues ! - // select sum(size... [truncated message content] |