You can subscribe to this list here.
2005 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(217) |
Nov
(180) |
Dec
(71) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2006 |
Jan
(58) |
Feb
(370) |
Mar
(105) |
Apr
(165) |
May
(93) |
Jun
(37) |
Jul
|
Aug
(21) |
Sep
(131) |
Oct
(40) |
Nov
(113) |
Dec
(401) |
2007 |
Jan
(180) |
Feb
(4) |
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(3) |
2008 |
Jan
(163) |
Feb
(78) |
Mar
|
Apr
(4) |
May
(28) |
Jun
(2) |
Jul
|
Aug
|
Sep
(96) |
Oct
(189) |
Nov
(413) |
Dec
(121) |
2009 |
Jan
(34) |
Feb
(18) |
Mar
(24) |
Apr
(16) |
May
(3) |
Jun
|
Jul
(1) |
Aug
|
Sep
|
Oct
|
Nov
|
Dec
(13) |
2010 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
(1) |
Jul
|
Aug
|
Sep
|
Oct
|
Nov
|
Dec
|
2011 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
|
Aug
(1) |
Sep
(3) |
Oct
(16) |
Nov
|
Dec
|
2012 |
Jan
|
Feb
|
Mar
|
Apr
(5) |
May
(35) |
Jun
|
Jul
(17) |
Aug
(7) |
Sep
|
Oct
(9) |
Nov
|
Dec
|
From: Ricardo T. <rj...@us...> - 2005-10-24 23:14:25
|
Update of /cvsroot/itracker/itracker/web/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11697/WEB-INF Modified Files: Tag: itrackerhibernate applicationContext.xml Log Message: configured hibernate to check and update table structure on startup turned on spring property override by default Index: applicationContext.xml =================================================================== RCS file: /cvsroot/itracker/itracker/web/WEB-INF/Attic/applicationContext.xml,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** applicationContext.xml 24 Oct 2005 20:31:17 -0000 1.1.2.3 --- applicationContext.xml 24 Oct 2005 23:14:17 -0000 1.1.2.4 *************** *** 432,437 **** <prop key="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</prop> <!-- remove this, it's just for development --> ! <!-- prop key="hibernate.cglib.use_reflection_optimizer">false</prop --> ! <!-- prop key="hibernate.hbm2ddl.auto">true</prop --> <prop key="hibernate.show_sql">true</prop> <!-- prop key="hibernate.cache.provider_class">net.sf.hibernate.cache.EhCacheProvider</prop --> --- 432,437 ---- <prop key="hibernate.dialect">net.sf.hibernate.dialect.MySQLDialect</prop> <!-- remove this, it's just for development --> ! <!-- prop key="hibernate.cglib.use_reflection_optimizer">false</prop --> ! <prop key="hibernate.hbm2ddl.auto">update</prop> <prop key="hibernate.show_sql">true</prop> <!-- prop key="hibernate.cache.provider_class">net.sf.hibernate.cache.EhCacheProvider</prop --> *************** *** 475,483 **** <!-- Override properties specified in this file with properties from a properties file --> <!-- Usefull for db passwords, etc.. --> ! <!-- bean id="myOverride" class="org.springframework.beans.factory.config.PropertyOverrideConfigurer"> <property name="location"> <value>/server.properties</value> </property> ! </bean --> </beans> --- 475,483 ---- <!-- Override properties specified in this file with properties from a properties file --> <!-- Usefull for db passwords, etc.. --> ! <bean id="myOverride" class="org.springframework.beans.factory.config.PropertyOverrideConfigurer"> <property name="location"> <value>/server.properties</value> </property> ! </bean> </beans> |
From: Ricardo T. <rj...@us...> - 2005-10-24 20:35:21
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5922/cowsultants/itracker/ejb/beans/session Modified Files: Tag: itrackerhibernate IssueHandlerBean.java IssueSearchBean.java SpringFactories.java Added Files: Tag: itrackerhibernate ITrackerServices.java ITrackerServicesImpl.java Log Message: now creating service layer only once, and reusing through all application changed some actions to show how to access it --- NEW FILE: ITrackerServicesImpl.java --- package cowsultants.itracker.ejb.beans.session; import cowsultants.itracker.ejb.client.interfaces.IssueHandler; import net.sf.hibernate.SessionFactory; /** * Service layer is a bit messy. The are *Factories, which work mainly as data access objects, * and *Handlers, that work as the service layer. It's messy because it was a straight EJB migration, * and they were not refactored yet. * * @author ricardo * */ public class ITrackerServicesImpl implements ITrackerServices { private UserFactory userFactory; private ScheduledTaskFactory scheduledTaskFactory; private ConfigurationFactory configurationFactory; private LanguageFactory languageFactory; private CustomFieldFactory customFieldFactory; private ReportFactory reportFactory; private ProjectFactory projectFactory; private UserPreferencesFactory userPreferencesFactory; private PermissionFactory permissionFactory; private IssueFactory issueFactory; private IssueHistoryFactory issueHistoryFactory; private NotificationFactory notificationFactory; private WorkflowScriptFactory workflowScriptFactory; private SessionFactory sessionFactory; private IssueHandler issueHandler; public ScheduledTaskFactory getScheduledTaskFactory() { return scheduledTaskFactory; } public void setScheduledTaskFactory(ScheduledTaskFactory scheduledTaskFactory) { this.scheduledTaskFactory = scheduledTaskFactory; } public ConfigurationFactory getConfigurationFactory() { return configurationFactory; } public void setConfigurationFactory(ConfigurationFactory configurationFactory) { this.configurationFactory = configurationFactory; } public LanguageFactory getLanguageFactory() { return languageFactory; } public void setLanguageFactory(LanguageFactory languageFactory) { this.languageFactory = languageFactory; } public CustomFieldFactory getCustomFieldFactory() { return customFieldFactory; } public void setCustomFieldFactory(CustomFieldFactory customFieldFactory) { this.customFieldFactory = customFieldFactory; } public UserFactory getUserFactory() { return userFactory; } public void setUserFactory(UserFactory userFactory) { this.userFactory = userFactory; } public ReportFactory getReportFactory() { return reportFactory; } public void setReportFactory(ReportFactory reportFactory) { this.reportFactory = reportFactory; } public ProjectFactory getProjectFactory() { return projectFactory; } public void setProjectFactory(ProjectFactory projectFactory) { this.projectFactory = projectFactory; } public UserPreferencesFactory getUserPreferencesFactory() { return userPreferencesFactory; } public void setUserPreferencesFactory(UserPreferencesFactory userPreferencesFactory) { this.userPreferencesFactory = userPreferencesFactory; } public PermissionFactory getPermissionFactory() { return permissionFactory; } public void setPermissionFactory(PermissionFactory permissionFactory) { this.permissionFactory = permissionFactory; } public IssueFactory getIssueFactory() { return issueFactory; } public void setIssueFactory(IssueFactory issueFactory) { this.issueFactory = issueFactory; } public IssueHistoryFactory getIssueHistoryFactory() { return issueHistoryFactory; } public void setIssueHistoryFactory(IssueHistoryFactory issueHistoryFactory) { this.issueHistoryFactory = issueHistoryFactory; } public NotificationFactory getNotificationFactory() { return notificationFactory; } public void setNotificationFactory(NotificationFactory notificationFactory) { this.notificationFactory = notificationFactory; } public IssueRelationFactory getIssueRelationFactory() { return null; } public ComponentFactory getComponentFactory() { // TODO Auto-generated method stub return null; } public WorkflowScriptFactory getWorkflowScriptFactory() { return(workflowScriptFactory); } public void setWorkflowScriptFactory(WorkflowScriptFactory workflowScriptFactory) { this.workflowScriptFactory = workflowScriptFactory; } public void setSessionFactory(SessionFactory sessionFactory) { this.sessionFactory = sessionFactory; } public SessionFactory getSessionFactory() { return sessionFactory; } public IssueHandler getIssueHandler() { return issueHandler; } public void setIssueHandler(IssueHandler issueHandler) { this.issueHandler = issueHandler; } } Index: SpringFactories.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session/Attic/SpringFactories.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** SpringFactories.java 13 Oct 2005 14:11:31 -0000 1.1.2.2 --- SpringFactories.java 24 Oct 2005 20:35:12 -0000 1.1.2.3 *************** *** 3,7 **** import net.sf.hibernate.SessionFactory; ! public class SpringFactories { --- 3,13 ---- import net.sf.hibernate.SessionFactory; ! /** ! * @deprecated now services are being created only one, via spring. they are being injected into other ! * services via spring, and also obtained by actions ! * ! * @author ricardo ! * ! */ public class SpringFactories { *************** *** 59,63 **** public void setUserFactory(UserFactory userFactory) { this.userFactory = userFactory; ! } public static ReportFactory getReportFactory() { --- 65,69 ---- public void setUserFactory(UserFactory userFactory) { this.userFactory = userFactory; ! } public static ReportFactory getReportFactory() { Index: IssueHandlerBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session/IssueHandlerBean.java,v retrieving revision 1.57.4.3 retrieving revision 1.57.4.4 diff -C2 -d -r1.57.4.3 -r1.57.4.4 *** IssueHandlerBean.java 23 Oct 2005 20:33:28 -0000 1.57.4.3 --- IssueHandlerBean.java 24 Oct 2005 20:35:12 -0000 1.57.4.4 *************** *** 1 **** ! /* * 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 cowsultants.itracker.ejb.beans.session; import java.sql.Timestamp; import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Vector; import javax.naming.InitialContext; import cowsultants.itracker.ejb.beans.entity.ComponentBean; import cowsultants.itracker.ejb.beans.entity.CustomFieldBean; import cowsultants.itracker.ejb.beans.entity.IssueActivityBean; import cowsultants.itracker.ejb.beans.entity.IssueAttachmentBean; import cowsultants.itracker.ejb.beans.entity.IssueBean; import cowsultants.itracker.ejb.beans.entity.IssueFieldBean; import cowsultants.itracker.ejb.beans.entity.IssueHistoryBean; import cowsultants.itracker.ejb.beans.entity.IssueRelationBean; import cowsultants.itracker.ejb.beans.entity.NotificationBean; import cowsultants.itracker.ejb.beans.entity.ProjectBean; import cowsultants.itracker.ejb.beans.entity.UserBean; import cowsultants.itracker.ejb.beans.entity.VersionBean; import cowsultants.itracker.ejb.beans.message.NotificationMessageBean; import cowsultants.itracker.ejb.client.exceptions.IssueException; import cowsultants.itracker.ejb.client.interfaces.IssueHandler; import cowsultants.itracker.ejb.client.models.ComponentModel; import cowsultants.itracker.ejb.client.models.IssueAttachmentModel; import cowsultants.itracker.ejb.client.models.IssueFieldModel; import cowsultants.itracker.ejb.client.models.IssueHistoryModel; import cowsultants.itracker.ejb.client.models.IssueModel; import cowsultants.itracker.ejb.client.models.IssueRelationModel; import cowsultants.itracker.ejb.client.models.NotificationModel; import cowsultants.itracker.ejb.client.models.ProjectModel; import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.models.VersionModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.ejb.client.util.AuthenticationConstants; import cowsultants.itracker.ejb.client.util.IssueUtilities; import cowsultants.itracker.ejb.client.util.Logger; import cowsultants.itracker.ejb.client.util.NotificationUtilities; import cowsultants.itracker.ejb.client.util.ProjectUtilities; import cowsultants.itracker.ejb.client.util.UserUtilities; public class IssueHandlerBean implements IssueHandler { private static String notificationFactoryName = NotificationMessageBean.DEFAULT_CONNECTION_FACTORY; private static String notificationQueueName = NotificationMessageBean.DEFAULT_QUEUE_NAME; private static String systemBaseURL = ""; private InitialContext ic; private CustomFieldFactory cfHome = null; private UserFactory ufHome = null; private ProjectFactory pfHome = null; private IssueFactory ifHome = null; private IssueHistoryFactory ihfHome = null; private NotificationFactory nfHome = null; private IssueRelationFactory issuerelationfactory = null; private ComponentFactory componentFactory = null; public IssueHandlerBean() { ufHome = SpringFactories.getUserFactory(); pfHome = SpringFactories.getProjectFactory(); ifHome = SpringFactories.getIssueFactory(); ihfHome = SpringFactories.getIssueHistoryFactory(); nfHome = SpringFactories.getNotificationFactory(); issuerelationfactory = SpringFactories.getIssueRelationFactory(); componentFactory = SpringFactories.getComponentFactory(); cfHome = SpringFactories.getCustomFieldFactory(); } public IssueModel getIssue(Integer issueId) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(issueId); return issue.getModel(); } public IssueModel[] getAllIssues() throws DataException { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = ifHome.findAll(); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } public int getNumberIssues() throws DataException { Collection issues = ifHome.findAll(); return issues.size(); } public IssueModel[] getIssuesCreatedByUser(Integer userId) throws DataException { return getIssuesCreatedByUser(userId, true); } public IssueModel[] getIssuesCreatedByUser(Integer userId, boolean availableProjectsOnly) throws DataException { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = (availableProjectsOnly ? ifHome.findByCreatorInAvailableProjects(userId, IssueUtilities.STATUS_CLOSED) : ifHome.findByCreator(userId, IssueUtilities.STATUS_CLOSED)); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } public IssueModel[] getIssuesOwnedByUser(Integer userId) throws DataException { return getIssuesOwnedByUser(userId, true); } public IssueModel[] getIssuesOwnedByUser(Integer userId, boolean availableProjectsOnly) throws DataException { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = (availableProjectsOnly ? ifHome.findByOwnerInAvailableProjects(userId, IssueUtilities.STATUS_RESOLVED) : ifHome.findByOwner(userId, IssueUtilities.STATUS_RESOLVED)); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } public IssueModel[] getIssuesWatchedByUser(Integer userId) throws DataException { return getIssuesWatchedByUser(userId, true); } public IssueModel[] getIssuesWatchedByUser(Integer userId, boolean availableProjectsOnly) throws DataException { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = (availableProjectsOnly ? ifHome.findByNotificationInAvailableProjects(userId, IssueUtilities.STATUS_CLOSED) : ifHome.findByNotification(userId, IssueUtilities.STATUS_CLOSED)); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } public IssueModel[] getUnassignedIssues() throws DataException { return getUnassignedIssues(true); } public IssueModel[] getUnassignedIssues(boolean availableProjectsOnly) throws DataException { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = (availableProjectsOnly ? ifHome .findByStatusLessThanEqualToInAvailableProjects(IssueUtilities.STATUS_UNASSIGNED) : ifHome .findByStatusLessThanEqualTo(IssueUtilities.STATUS_UNASSIGNED)); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } /** * * Returns all issues with a status equal to the given status number * * * * @param status * * the status to compare * * @return an array of IssueModels that match the criteria * */ public IssueModel[] getIssuesWithStatus(int status) { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = ifHome.findByStatus(status); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } /** * * Returns all issues with a status less than the given status number * * * * @param status * * the status to compare * * @return an array of IssueModels that match the criteria * * @throws DataException * */ public IssueModel[] getIssuesWithStatusLessThan(int status) throws DataException { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = ifHome.findByStatusLessThan(status); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } /** * * Returns all issues with a severity equal to the given severity number * * * * @param severity * * the severity to compare * * @return an array of IssueModels that match the criteria * */ public IssueModel[] getIssuesWithSeverity(int severity) { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = ifHome.findBySeverity(severity); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } public IssueModel[] getIssuesByProjectId(Integer projectId) { return getIssuesByProjectId(projectId, IssueUtilities.STATUS_END); } public IssueModel[] getIssuesByProjectId(Integer projectId, int status) { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = ifHome.findByProjectIdAndLowerStatus(projectId, status); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } public UserModel getIssueCreator(Integer issueId) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(issueId); UserBean user = issue.getCreator(); return (user != null ? user.getModel() : null); } public UserModel getIssueOwner(Integer issueId) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(issueId); UserBean user = issue.getOwner(); return (user != null ? user.getModel() : null); } public ComponentModel[] getIssueComponents(Integer issueId) throws DataException { int i = 0; ComponentModel[] componentArray = new ComponentModel[0]; IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection components = issue.getComponents(); componentArray = new ComponentModel[components.size()]; for (Iterator iterator = components.iterator(); iterator.hasNext(); i++) { componentArray[i] = ((ComponentBean) iterator.next()).getModel(); } return componentArray; } public VersionModel[] getIssueVersions(Integer issueId) throws DataException { int i = 0; VersionModel[] versionArray = new VersionModel[0]; IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection versions = issue.getVersions(); versionArray = new VersionModel[versions.size()]; for (Iterator iterator = versions.iterator(); iterator.hasNext(); i++) { versionArray[i] = ((VersionBean) iterator.next()).getModel(); } return versionArray; } public IssueAttachmentModel[] getIssueAttachments(Integer issueId) throws DataException { int i = 0; IssueAttachmentModel[] attachmentsArray = new IssueAttachmentModel[0]; IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection attachments = issue.getAttachments(); attachmentsArray = new IssueAttachmentModel[attachments.size()]; for (Iterator iterator = attachments.iterator(); iterator.hasNext(); i++) { attachmentsArray[i] = ((IssueAttachmentBean) iterator.next()).getModel(); } return attachmentsArray; } /** * Old implementation is left here, commented, because it checked for * history entry status. This feature was not finished, I think (RJST) */ public IssueHistoryModel[] getIssueHistory(Integer issueId) { return (ifHome.findByPrimaryKey(issueId).getModel().getHistory()); /* * int i = 0; * * IssueHistoryModel[] historyArray = new IssueHistoryModel[0]; * * Vector results = new Vector(); * * new IssueBean().getModel().getHistory() * * Collection history = ifHome.findByIssueId(issueId); * * historyArray = new IssueHistoryModel[history.size()]; * * for (Iterator iterator = history.iterator(); iterator.hasNext(); i++) { * * IssueHistoryBean entry = (IssueHistoryBean) iterator.next(); * * if (entry.getStatus() == IssueUtilities.HISTORY_STATUS_AVAILABLE) { * * results.addElement(entry.getModel()); } } * * historyArray = new IssueHistoryModel[results.size()]; * * results.copyInto(historyArray); * * * * return historyArray; */ } public IssueModel createIssue(IssueModel model, Integer projectId, Integer userId, Integer createdById) throws DataException { try { ProjectBean project = pfHome.findByPrimaryKey(projectId); UserBean creator = ufHome.findByPrimaryKey(userId); if (project.getStatus() != ProjectUtilities.STATUS_ACTIVE) { throw new IssueException("Project is not active."); } IssueBean issue = new IssueBean(); if (issue != null) { if (createdById == null || createdById.equals(userId)) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_ISSUE_CREATED); activity.setUser(creator); activity.setIssue(issue); } else { UserBean createdBy = ufHome.findByPrimaryKey(createdById); IssueActivityBean activity = new IssueActivityBean(); activity.setDescription(ITrackerResources.getString("itracker.activity.system.createdfor") + " " + creator.getFirstName() + " " + creator.getLastName()); activity.setUser(createdBy); activity.setIssue(issue); NotificationModel watchModel = new NotificationModel(); watchModel.setUserId(createdById); watchModel.setIssueId(issue.getId()); watchModel.setNotificationRole(NotificationUtilities.ROLE_IP); addIssueNotification(watchModel); } issue.setModel(model); issue.setProject(project); issue.setCreator(creator); // save issue.setCreateDate(new Timestamp(new Date().getTime())); ifHome.save(issue); return issue.getModel(); } } catch (IssueException ie) { Logger.logInfo("Error while creating new issue: " + ie.getMessage()); } return null; } public IssueModel updateIssue(IssueModel model, Integer userId) throws DataException { try { String existingTargetVersion = null; IssueBean issue = ifHome.findByPrimaryKey(model.getId()); UserBean user = ufHome.findByPrimaryKey(userId); if (issue.getProject().getStatus() != ProjectUtilities.STATUS_ACTIVE) { throw new IssueException("Project is not active."); } if (issue.getDescription() != null && model.getDescription() != null && !issue.getDescription().equalsIgnoreCase(model.getDescription())) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_DESCRIPTION_CHANGE); activity.setDescription(ITrackerResources.getString("itracker.web.generic.from") + ": " + issue.getDescription()); activity.setUser(user); activity.setIssue(issue); } if (issue.getResolution() != null && model.getResolution() != null && !issue.getResolution().equalsIgnoreCase(model.getResolution())) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_RESOLUTION_CHANGE); activity.setDescription(ITrackerResources.getString("itracker.web.generic.from") + ": " + issue.getResolution()); activity.setIssue(issue); activity.setUser(user); } if (issue.getStatus() != model.getStatus() && model.getStatus() != -1) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_STATUS_CHANGE); activity.setDescription(IssueUtilities.getStatusName(issue.getStatus()) + " " + ITrackerResources.getString("itracker.web.generic.to") + " " + IssueUtilities.getStatusName(model.getStatus())); activity.setIssue(issue); activity.setUser(user); } if (issue.getSeverity() != model.getSeverity() && model.getSeverity() != -1) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_SEVERITY_CHANGE); activity.setDescription(IssueUtilities.getSeverityName(issue.getSeverity()) + " " + ITrackerResources.getString("itracker.web.generic.to") + " " + IssueUtilities.getSeverityName(model.getSeverity())); activity.setIssue(issue); activity.setUser(user); } if (issue.getTargetVersion() != null && model.getTargetVersion() != null && !issue.getTargetVersion().getId().equals(model.getTargetVersionId())) { existingTargetVersion = issue.getTargetVersion().getNumber(); } issue.setModel(model); if (model.getTargetVersion() != null) { VersionBean version = VersionFactory.findByPrimaryKey(model.getTargetVersionId()); issue.setTargetVersion(version); IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_TARGETVERSION_CHANGE); String description = existingTargetVersion + " " + ITrackerResources.getString("itracker.web.generic.to") + " "; description += version.getNumber(); activity.setDescription(description); activity.setUser(user); activity.setIssue(issue); } else { issue.setTargetVersion(null); } // save ifHome.saveOrUpdate(issue); return issue.getModel(); } catch (IssueException ie) { Logger.logInfo("Error while updating new issue: " + ie.getMessage()); } return null; } /** * * Moves an issues from its current project to a new project. * * * * @param issue * * an IssueModel 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 IssueModel of the issue after it has been moved * * @throws DataException * */ public IssueModel moveIssue(IssueModel model, Integer projectId, Integer userId) throws DataException { if (model == null) { return null; } IssueBean issue = ifHome.findByPrimaryKey(model.getId()); ProjectBean project = pfHome.findByPrimaryKey(projectId); UserBean user = ufHome.findByPrimaryKey(userId); IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_ISSUE_MOVE); activity.setDescription(model.getProjectName() + " " + ITrackerResources.getString("itracker.web.generic.to") + " " + project.getName()); activity.setUser(user); activity.setIssue(issue); issue.setProject(project); // The versions and components are per project so we need to delete // these setIssueComponents(issue.getId(), new HashSet(), userId); setIssueVersions(issue.getId(), new HashSet(), userId); return issue.getModel(); } public boolean deleteIssue(IssueModel model) throws DataException { if (model != null) { IssueBean issue = ifHome.findByPrimaryKey(model.getId()); ifHome.delete(issue); return true; } return false; } /** * this should not exist. adding an history entry should be adding the history entry * to the domain object and saving the object... */ public boolean addIssueHistory(IssueHistoryModel model) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(model.getIssueId()); UserBean user = ufHome.findByPrimaryKey(model.getUserId()); IssueHistoryBean history = new IssueHistoryBean(); history.setModel(model); history.setIssue(issue); history.setUser(user); history.setCreateDate(new Timestamp(new Date().getTime())); ifHome.saveOrUpdate(history); return true; } public boolean setIssueFields(Integer issueId, IssueFieldModel[] fields) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection issueFields = issue.getFields(); for (Iterator iter = issueFields.iterator(); iter.hasNext();) { // try { IssueFieldBean field = (IssueFieldBean) iter.next(); // iter.remove(); // field.remove(); // } catch(RemoveException re) { // Logger.logInfo("Unable to remove issue field value. Manual // database cleanup may be necessary."); // } } if (fields.length > 0) { for (int i = 0; i < fields.length; i++) { IssueFieldBean field = new IssueFieldBean(); CustomFieldBean customField = cfHome.findByPrimaryKey(fields[i].getCustomFieldId()); field.setModel(fields[i]); field.setCustomField(customField); field.setIssue(issue); field.setDateValue(new Timestamp(new Date().getTime())); issueFields.add(field); } } return true; } public boolean setIssueComponents(Integer issueId, HashSet componentIds, Integer userId) throws DataException { boolean wasChanged = false; StringBuffer changesBuf = new StringBuffer(); IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection components = issue.getComponents(); if (componentIds.isEmpty() && components != null && !components.isEmpty()) { wasChanged = true; changesBuf.append(ITrackerResources.getString("itracker.web.generic.all") + " " + ITrackerResources.getString("itracker.web.generic.removed")); components.clear(); } else { for (Iterator iterator = components.iterator(); iterator.hasNext();) { ComponentBean component = (ComponentBean) iterator.next(); if (componentIds.contains(component.getId())) { componentIds.remove(component.getId()); } else { wasChanged = true; changesBuf.append(ITrackerResources.getString("itracker.web.generic.removed") + ": " + component.getName() + "; "); iterator.remove(); } } for (Iterator iterator = componentIds.iterator(); iterator.hasNext();) { Integer componentId = (Integer) iterator.next(); ComponentBean component = componentFactory.findByPrimaryKey(componentId); wasChanged = true; changesBuf.append(ITrackerResources.getString("itracker.web.generic.added") + ": " + component.getName() + "; "); components.add(component); } } if (wasChanged) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_COMPONENTS_MODIFIED); activity.setDescription(changesBuf.toString()); activity.setIssue(issue); // activity.setUser(); // userId); -> I think we need to set user here } return true; } public boolean setIssueVersions(Integer issueId, HashSet versionIds, Integer userId) throws DataException { boolean wasChanged = false; StringBuffer changesBuf = new StringBuffer(); IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection versions = issue.getVersions(); if (versionIds.isEmpty() && versions != null && !versions.isEmpty()) { wasChanged = true; changesBuf.append(ITrackerResources.getString("itracker.web.generic.all") + " " + ITrackerResources.getString("itracker.web.generic.removed")); versions.clear(); } else { for (Iterator iterator = versions.iterator(); iterator.hasNext();) { VersionBean version = (VersionBean) iterator.next(); if (versionIds.contains(version.getId())) { versionIds.remove(version.getId()); } else { wasChanged = true; changesBuf.append(ITrackerResources.getString("itracker.web.generic.removed") + ": " + version.getNumber() + "; "); iterator.remove(); } } for (Iterator iterator = versionIds.iterator(); iterator.hasNext();) { Integer versionId = (Integer) iterator.next(); VersionBean version = VersionFactory.findByPrimaryKey(versionId); wasChanged = true; changesBuf.append(ITrackerResources.getString("itracker.web.generic.added") + ": " + version.getNumber() + "; "); versions.add(version); } } if (wasChanged) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_VERSIONS_MODIFIED); activity.setDescription(changesBuf.toString()); activity.setIssue(issue); // need to set user here // userId); } return true; } public IssueRelationModel getIssueRelation(Integer relationId) throws DataException { IssueRelationBean issueRelation = issuerelationfactory.findByPrimaryKey(relationId); return issueRelation.getModel(); } public boolean addIssueRelation(Integer issueId, Integer relatedIssueId, int relationType, Integer userId) throws DataException { if (issueId != null && relatedIssueId != null) { int matchingRelationType = IssueUtilities.getMatchingRelationType(relationType); // if(matchingRelationType < 0) { // throw new CreateException("Unable to find matching relation type // for type: " + relationType); // } IssueBean issue = ifHome.findByPrimaryKey(issueId); IssueBean relatedIssue = ifHome.findByPrimaryKey(relatedIssueId); IssueRelationBean relationA = new IssueRelationBean(); relationA.setRelationType(relationType); // relationA.setMatchingRelationId(relationBId); relationA.setIssue(issue); relationA.setRelatedIssue(relatedIssue); relationA.setLastModifiedDate(new java.sql.Timestamp(new java.util.Date().getTime())); IssueRelationBean relationB = new IssueRelationBean(); relationB.setRelationType(matchingRelationType); // relationB.setMatchingRelationId(relationAId); relationB.setIssue(relatedIssue); relationB.setRelatedIssue(issue); relationB.setLastModifiedDate(new java.sql.Timestamp(new java.util.Date().getTime())); IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_RELATION_ADDED); activity.setDescription(ITrackerResources.getString("itracker.activity.relation.add")); // probably add this to description // new Object[] {IssueUtilities.getRelationName(relationType), // relatedIssueId }; activity.setIssue(issue); // need to set user here... userId); // need to save here activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_RELATION_ADDED); activity.setDescription(ITrackerResources.getString("itracker.activity.relation.add", new Object[] { IssueUtilities.getRelationName(matchingRelationType) })); activity.setIssue(relatedIssue); // net to save and set user here.. userId); return true; } return false; } public Integer removeIssueRelation(Integer relationId, Integer userId) { Integer issueId = new Integer(-1); try { IssueRelationBean issueRelation = issuerelationfactory.findByPrimaryKey(relationId); issueId = issueRelation.getIssue().getId(); Integer relatedIssueId = issueRelation.getRelatedIssue().getId(); Integer matchingRelationId = issueRelation.getMatchingRelationId(); if (matchingRelationId != null) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_RELATION_REMOVED); activity.setDescription(ITrackerResources.getString("itracker.activity.relation.removed", issueId .toString())); // need to fix the commented code and save // activity.setIssue(relatedIssueId); // activity.setUser(userId); // IssueRelationFactory.remove(matchingRelationId); } IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_RELATION_REMOVED); activity.setDescription(ITrackerResources.getString("itracker.activity.relation.removed", relatedIssueId .toString())); // activity.setIssue(issueId); // activity.setUser(userId); // irHome.remove(relationId); // need to save } catch (Exception e) { Logger.logDebug("Exception while removing issue relation.", e); } return issueId; } public boolean assignIssue(Integer issueId, Integer userId) throws DataException { return assignIssue(issueId, userId, userId); } public boolean assignIssue(Integer issueId, Integer userId, Integer assignedByUserId) throws DataException { if (userId.intValue() == -1) { return unassignIssue(issueId, assignedByUserId); } UserBean assignedByUser; IssueBean issue = ifHome.findByPrimaryKey(issueId); UserBean user = ufHome.findByPrimaryKey(userId); if (assignedByUserId.equals(userId)) { assignedByUser = user; } else { assignedByUser = ufHome.findByPrimaryKey(assignedByUserId); } UserBean currOwner = issue.getOwner(); if (currOwner == null || !currOwner.getId().equals(user.getId())) { if (currOwner != null && !hasIssueNotification(issueId, currOwner.getId(), NotificationUtilities.ROLE_CONTRIBUTER)) { NotificationBean notification = new NotificationBean(); NotificationModel model = new NotificationModel(NotificationUtilities.ROLE_CONTRIBUTER); notification.setModel(model); notification.setIssue(issue); notification.setUser(currOwner); } IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_OWNER_CHANGE); activity.setDescription((currOwner == null ? "[" + ITrackerResources.getString("itracker.web.generic.unassigned") + "]" : currOwner.getLogin()) + " " + ITrackerResources.getString("itracker.web.generic.to") + " " + user.getLogin()); activity.setUser(assignedByUser); activity.setIssue(issue); issue.setOwner(user); if (issue.getStatus() < IssueUtilities.STATUS_ASSIGNED) { issue.setStatus(IssueUtilities.STATUS_ASSIGNED); } } return true; } public boolean unassignIssue(Integer issueId, Integer assignedByUserId) throws DataException { UserBean assignedByUser = ufHome.findByPrimaryKey(assignedByUserId); IssueBean issue = ifHome.findByPrimaryKey(issueId); if (issue.getOwner() != null) { if (!hasIssueNotification(issueId, issue.getOwner().getId(), NotificationUtilities.ROLE_CONTRIBUTER)) { NotificationBean notification = new NotificationBean(); NotificationModel model = new NotificationModel(NotificationUtilities.ROLE_CONTRIBUTER); notification.setModel(model); notification.setIssue(issue); notification.setUser(issue.getOwner()); } IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_OWNER_CHANGE); activity.setDescription((issue.getOwner() == null ? "[" + ITrackerResources.getString("itracker.web.generic.unassigned") + "]" : issue.getOwner() .getLogin()) + " " + ITrackerResources.getString("itracker.web.generic.to") + " [" + ITrackerResources.getString("itracker.web.generic.unassigned") + "]"); activity.setUser(assignedByUser); activity.setIssue(issue); issue.setOwner(null); if (issue.getStatus() >= IssueUtilities.STATUS_ASSIGNED) { issue.setStatus(IssueUtilities.STATUS_UNASSIGNED); } } return true; } /* * public boolean addIssueActivity(IssueActivityModel model) throws * DataException { * * IssueBean issue = ifHome.findByPrimaryKey(model.getIssueId()); * * UserBean user = ufHome.findByPrimaryKey(model.getUserId()); * * //return addIssueActivity(model, issue, user); return * addIssueActivity(null, issue, user); } */ /* * public boolean addIssueActivity(IssueActivityModel model, IssueBean * issue) throws DataException { * * UserBean user = ufHome.findByPrimaryKey(model.getUserId()); * * return true;//addIssueActivity(model, issue, user); } */ /** * I think this entire method is useless - RJST * * @param model * @param issue * @param user * @return */ /* * public boolean addIssueActivity(IssueActivityBean model, IssueBean issue, * UserBean user) { * * IssueActivityBean activity = new IssueActivityBean(); * * //activity.setModel(model); * * activity.setIssue(issue); * * activity.setUser(user); * * return true; } */ public void updateIssueActivityNotification(Integer issueId, boolean notificationSent) { if (issueId == null) { return; } Collection activity = IssueActivityFactory.findByIssueId(issueId); for (Iterator iter = activity.iterator(); iter.hasNext();) { ((IssueActivityBean) iter.next()).setNotificationSent((notificationSent ? 1 : 0)); } } public boolean addIssueAttachment(IssueAttachmentModel model, byte[] data) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(model.getIssueId()); UserBean user = ufHome.findByPrimaryKey(model.getUserId()); IssueAttachmentBean attachment = new IssueAttachmentBean(); model.setFileName("attachment" + attachment.getId()); attachment.setModel(model); attachment.setFileData((data == null ? new byte[0] : data)); attachment.setIssue(issue); attachment.setUser(user); return true; } public boolean setIssueAttachmentData(Integer attachmentId, byte[] data) { if (attachmentId != null && data != null) { IssueAttachmentBean attachment = IssueAttachmentFactory.findByPrimaryKey(attachmentId); attachment.setFileData(data); return true; } return false; } public boolean setIssueAttachmentData(String fileName, byte[] data) { if (fileName != null && data != null) { IssueAttachmentBean attachment = IssueAttachmentFactory.findByFileName(fileName); attachment.setFileData(data); return true; } return false; } public boolean removeIssueAttachment(Integer attachmentId) { IssueAttachmentFactory.remove(attachmentId); return true; } public Integer removeIssueHistoryEntry(Integer entryId, Integer userId) throws DataException { IssueHistoryBean history = ihfHome.findByPrimaryKey(entryId); if (history != null) { history.setStatus(IssueUtilities.HISTORY_STATUS_REMOVED); history.setLastModifiedDate(new Timestamp(new Date().getTime())); IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_REMOVE_HISTORY); activity.setDescription(ITrackerResources.getString("itracker.web.generic.entry") + " " + entryId + " " + ITrackerResources.getString("itracker.web.generic.removed") + "."); // need to fix this - RJST // activity.setIssue(history.getIssue().getId()); // activity.setUser(userId); return history.getIssue().getId(); } return new Integer(-1); } public ProjectModel getIssueProject(Integer issueId) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(issueId); ProjectBean project = issue.getProject(); return (project != null ? project.getModel() : null); } public HashSet getIssueComponentIds(Integer issueId) throws DataException { HashSet componentIds = new HashSet(); IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection components = issue.getComponents(); for (Iterator iterator = components.iterator(); iterator.hasNext();) { componentIds.add(((ComponentBean) iterator.next()).getId()); } return componentIds; } public HashSet getIssueVersionIds(Integer issueId) throws DataException { HashSet versionIds = new HashSet(); IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection versions = issue.getVersions(); for (Iterator iterator = versions.iterator(); iterator.hasNext();) { versionIds.add(((VersionBean) iterator.next()).getId()); } return versionIds; } public IssueActivityBean[] getIssueActivity(Integer issueId) { int i = 0; IssueActivityBean[] activityArray = new IssueActivityBean[0]; Collection activity = IssueActivityFactory.findByIssueId(issueId); activityArray = new IssueActivityBean[activity.size()]; for (Iterator iterator = activity.iterator(); iterator.hasNext(); i++) { activityArray[i] = ((IssueActivityBean) iterator.next());// .getModel(); } return activityArray; } public IssueActivityBean[] getIssueActivity(Integer issueId, boolean notificationSent) { int i = 0; IssueActivityBean[] activityArray = new IssueActivityBean[0]; Collection activity = IssueActivityFactory.findByIssueIdAndNotification(issueId, (notificationSent ? 1 : 0)); activityArray = new IssueActivityBean[activity.size()]; for (Iterator iterator = activity.iterator(); iterator.hasNext(); i++) { activityArray[i] = ((IssueActivityBean) iterator.next());// .getModel(); } return activityArray; } public IssueAttachmentModel[] getAllIssueAttachments() { int i = 0; IssueAttachmentModel[] attachmentArray = new IssueAttachmentModel[0]; Collection attachments = IssueAttachmentFactory.findAll(); attachmentArray = new IssueAttachmentModel[attachments.size()]; for (Iterator iterator = attachments.iterator(); iterator.hasNext(); i++) { attachmentArray[i] = ((IssueAttachmentBean) iterator.next()).getModel(); } return attachmentArray; } public long[] getAllIssueAttachmentsSizeAndCount() { long[] sizeAndCount = new long[2]; int i = 0; Collection attachments = IssueAttachmentFactory.findAll(); sizeAndCount[1] = attachments.size(); for (Iterator iterator = attachments.iterator(); iterator.hasNext(); i++) { sizeAndCount[0] += ((IssueAttachmentBean) iterator.next()).getSize(); } return sizeAndCount; } public IssueAttachmentModel getIssueAttachment(Integer attachmentId) { IssueAttachmentModel attachmentModel = null; IssueAttachmentBean attachment = IssueAttachmentFactory.findByPrimaryKey(attachmentId); attachmentModel = attachment.getModel(); return attachmentModel; } public byte[] getIssueAttachmentData(Integer attachmentId) { byte[] data = new byte[0]; IssueAttachmentBean attachment = IssueAttachmentFactory.findByPrimaryKey(attachmentId); data = attachment.getFileData(); return data; } public int getIssueAttachmentCount(Integer issueId) throws DataException { int i = 0; IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection attachments = issue.getAttachments(); i = attachments.size(); return i; } /** * * 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 IssueHistoryModel, or null if no entries could be * * found * * @throws DataException * */ public IssueHistoryModel getLastIssueHistory(Integer issueId) throws DataException { IssueHistoryModel model = null; IssueHistoryBean lastEntry = null; Collection history = ihfHome.findByIssueId(issueId); Iterator iterator = history.iterator(); while (iterator.hasNext()) { IssueHistoryBean nextEntry = (IssueHistoryBean) iterator.next(); if (nextEntry != null) { if (lastEntry == null && nextEntry.getLastModifiedDate() != null) { lastEntry = nextEntry; } else if (nextEntry.getLastModifiedDate() != null && nextEntry.getLastModifiedDate().equals(lastEntry.getLastModifiedDate()) && nextEntry.getId().compareTo(lastEntry.getId()) > 0) { lastEntry = nextEntry; } else if (nextEntry.getLastModifiedDate() != null && nextEntry.getLastModifiedDate().after(lastEntry.getLastModifiedDate())) { lastEntry = nextEntry; } } } if (lastEntry != null) { model = lastEntry.getModel(); } return model; } /** * * 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 * * @throws DataException * * @returns an array of NotificationModels * */ public NotificationModel[] getPrimaryIssueNotifications(Integer issueId) throws DataException { return getIssueNotifications(issueId, true, false); } /** * * 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 * * @throws DataException * * @returns an array of NotificationModels * */ public NotificationModel[] getIssueNotifications(Integer issueId) throws DataException { return getIssueNotifications(issueId, false, true); } /** * * 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) * * @throws DataException * * @returns an array of NotificationModels * * @see IssueHandlerBean#getPrimaryIssueNotifications * */ public NotificationModel[] getIssueNotifications(Integer issueId, boolean primaryOnly, boolean activeOnly) throws DataException { NotificationModel[] notificationArray = new NotificationModel[0]; Vector notificationVector = new Vector(); IssueBean issue = null; if (!primaryOnly) { Collection notifications = nfHome.findByIssueId(issueId); for (Iterator iterator = notifications.iterator(); iterator.hasNext();) { NotificationBean notification = (NotificationBean) iterator.next(); UserBean notificationUser = notification.getUser(); if (!activeOnly || notificationUser.getStatus() == UserUtilities.STATUS_ACTIVE) { notificationVector.add(notification.getModel()); } } } // Now add in other notifications like owner, creator, project owners, // etc... boolean hasOwner = false; issue = ifHome.findByPrimaryKey(issueId); if (issue.getOwner() != null) { UserModel ownerModel = issue.getOwner().getModel(); if (ownerModel != null && (!activeOnly || ownerModel.getStatus() == UserUtilities.STATUS_ACTIVE)) { notificationVector.add(new NotificationModel(ownerModel, issueId, NotificationUtilities.ROLE_OWNER)); hasOwner = true; } } if (!primaryOnly || !hasOwner) { UserModel creatorModel = issue.getCreator().getModel(); if (creatorModel != null && (!activeOnly || creatorModel.getStatus() == UserUtilities.STATUS_ACTIVE)) { notificationVector .add(new NotificationModel(creatorModel, issueId, NotificationUtilities.ROLE_CREATOR)); } } if (issue != null) { ProjectBean project = pfHome.findByPrimaryKey(issue.getProject().getId()); Collection projectOwners = project.getOwners(); for (Iterator iterator = projectOwners.iterator(); iterator.hasNext();) { UserBean projectOwner = (UserBean) iterator.next(); if (projectOwner != null && (!activeOnly || projectOwner.getStatus() == UserUtilities.STATUS_ACTIVE)) { notificationVector.add(new NotificationModel(projectOwner.getModel(), issueId, NotificationUtilities.ROLE_PO)); } } } notificationArray = new NotificationModel[notificationVector.size()]; notificationVector.copyInto(notificationArray); return notificationArray; } public boolean addIssueNotification(NotificationModel model) throws DataException { if (model != null) { UserBean user = ufHome.findByPrimaryKey(model.getUserId()); IssueBean issue = ifHome.findByPrimaryKey(model.getIssueId()); NotificationBean notification = new NotificationBean(); notification.setModel(model); notification.setIssue(issue); notification.setUser(user); return true; } return false; } public boolean hasIssueNotification(Integer issueId, Integer userId) throws DataException { return hasIssueNotification(issueId, userId, NotificationUtilities.ROLE_ANY); } public boolean hasIssueNotification(Integer issueId, Integer userId, int role) throws DataException { if (issueId != null && userId != null) { NotificationModel[] notifications = getIssueNotifications(issueId, false, false); for (int i = 0; i < notifications.length; i++) { if (role == NotificationUtilities.ROLE_ANY || notifications[i].getNotificationRole() == role) { if (notifications[i].getUserId().equals(userId)) { return true; } } } } return false; } public int getOpenIssueCountByProjectId(Integer projectId) { Collection issues = ifHome.findByProjectIdAndLowerStatus(projectId, IssueUtilities.STATUS_RESOLVED); return issues.size(); } public int getResolvedIssueCountByProjectId(Integer projectId) { Collection issues = ifHome.findByProjectIdAndHigherStatus(projectId, IssueUtilities.STATUS_RESOLVED); return issues.size(); } public int getTotalIssueCountByProjectId(Integer projectId) { Collection issues = ifHome.findByProjectId(projectId); return issues.size(); } public Date getLatestIssueDateByProjectId(Integer projectId) { return ifHome.latestModificationDate(projectId); } public void sendNotification(Integer issueId, int type, String baseURL) { sendNotification(issueId, type, baseURL, null, null); } public void sendNotification(Integer issueId, int type, String baseURL, HashSet addresses, Integer lastModifiedDays) { // notifications are disabled for now /* * try { * * QueueConnectionFactory factory = (QueueConnectionFactory) * ic.lookup("java:comp/env/" + notificationFactoryName); *... [truncated message content] |
From: Ricardo T. <rj...@us...> - 2005-10-24 20:35:21
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5922/cowsultants/itracker/web/actions Modified Files: Tag: itrackerhibernate CreateIssueAction.java EditIssueAction.java EditIssueFormAction.java ITrackerAction.java MoveIssueAction.java MoveIssueFormAction.java WatchIssueAction.java Log Message: now creating service layer only once, and reusing through all application changed some actions to show how to access it Index: MoveIssueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/MoveIssueAction.java,v retrieving revision 1.6.4.1 retrieving revision 1.6.4.2 diff -C2 -d -r1.6.4.1 -r1.6.4.2 *** MoveIssueAction.java 11 Oct 2005 01:21:04 -0000 1.6.4.1 --- MoveIssueAction.java 24 Oct 2005 20:35:12 -0000 1.6.4.2 *************** *** 61,65 **** try { ! IssueHandler ih = new IssueHandlerBean(); Integer issueId = (Integer) PropertyUtils.getSimpleProperty(form, "issueId"); --- 61,65 ---- try { ! IssueHandler ih = getITrackerServices().getIssueHandler(); Integer issueId = (Integer) PropertyUtils.getSimpleProperty(form, "issueId"); Index: EditIssueFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditIssueFormAction.java,v retrieving revision 1.19.4.3 retrieving revision 1.19.4.4 diff -C2 -d -r1.19.4.3 -r1.19.4.4 *** EditIssueFormAction.java 22 Oct 2005 16:49:43 -0000 1.19.4.3 --- EditIssueFormAction.java 24 Oct 2005 20:35:12 -0000 1.19.4.4 *************** *** 81,85 **** try { ! IssueHandler ih = new IssueHandlerBean(); UserHandler uh = new UserHandlerBean(); --- 81,85 ---- try { ! IssueHandler ih = getITrackerServices().getIssueHandler(); UserHandler uh = new UserHandlerBean(); Index: WatchIssueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/WatchIssueAction.java,v retrieving revision 1.6.4.2 retrieving revision 1.6.4.3 diff -C2 -d -r1.6.4.2 -r1.6.4.3 *** WatchIssueAction.java 23 Oct 2005 22:58:05 -0000 1.6.4.2 --- WatchIssueAction.java 24 Oct 2005 20:35:12 -0000 1.6.4.3 *************** *** 57,61 **** try { ! IssueHandler ih = new IssueHandlerBean(); Integer issueId = new Integer((request.getParameter("id") == null ? "-1" : (request.getParameter("id")))); --- 57,61 ---- try { ! IssueHandler ih = getITrackerServices().getIssueHandler(); Integer issueId = new Integer((request.getParameter("id") == null ? "-1" : (request.getParameter("id")))); Index: CreateIssueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/CreateIssueAction.java,v retrieving revision 1.15.4.3 retrieving revision 1.15.4.4 diff -C2 -d -r1.15.4.3 -r1.15.4.4 *** CreateIssueAction.java 23 Oct 2005 20:41:29 -0000 1.15.4.3 --- CreateIssueAction.java 24 Oct 2005 20:35:12 -0000 1.15.4.4 *************** *** 80,84 **** try { ! IssueHandler ih = new IssueHandlerBean(); ProjectHandler ph = new ProjectHandlerBean(); --- 80,84 ---- try { ! IssueHandler ih = getITrackerServices().getIssueHandler(); ProjectHandler ph = new ProjectHandlerBean(); Index: EditIssueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditIssueAction.java,v retrieving revision 1.21.4.3 retrieving revision 1.21.4.4 diff -C2 -d -r1.21.4.3 -r1.21.4.4 *** EditIssueAction.java 23 Oct 2005 20:33:28 -0000 1.21.4.3 --- EditIssueAction.java 24 Oct 2005 20:35:12 -0000 1.21.4.4 *************** *** 40,44 **** import org.apache.struts.validator.DynaValidatorForm; - import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; import cowsultants.itracker.ejb.client.interfaces.IssueHandler; import cowsultants.itracker.ejb.client.models.CustomFieldModel; --- 40,43 ---- *************** *** 81,85 **** try { ! IssueHandler ih = new IssueHandlerBean(); HttpSession session = request.getSession(true); --- 80,84 ---- try { ! IssueHandler ih = this.getITrackerServices().getIssueHandler(); HttpSession session = request.getSession(true); Index: ITrackerAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/ITrackerAction.java,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.2 diff -C2 -d -r1.7.4.1 -r1.7.4.2 *** ITrackerAction.java 11 Oct 2005 01:21:04 -0000 1.7.4.1 --- ITrackerAction.java 24 Oct 2005 20:35:12 -0000 1.7.4.2 *************** *** 22,25 **** --- 22,26 ---- import java.util.HashMap; + import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 28,32 **** --- 29,37 ---- import org.apache.struts.action.Action; + import org.apache.struts.action.ActionServlet; + import org.springframework.web.context.WebApplicationContext; + import org.springframework.web.context.support.WebApplicationContextUtils; + import cowsultants.itracker.ejb.beans.session.ITrackerServices; import cowsultants.itracker.ejb.beans.session.SystemConfigurationBean; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; *************** *** 39,42 **** --- 44,48 ---- protected static boolean allowSaveLogin = true; + // TODO remove this - RJST static { SystemConfiguration sc = new SystemConfigurationBean(); *************** *** 44,47 **** --- 50,55 ---- } + private ITrackerServices itrackerServices; + protected boolean hasPermission(int[] permissionsNeeded, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { *************** *** 87,90 **** --- 95,111 ---- + request.getContextPath(); } + + public void setServlet(ActionServlet actionServlet) { + super.setServlet(actionServlet); + if (actionServlet != null) { + ServletContext servletContext = actionServlet.getServletContext(); + WebApplicationContext wac = WebApplicationContextUtils.getRequiredWebApplicationContext(servletContext); + this.itrackerServices = (ITrackerServices) wac.getBean("itrackerServices"); + } + } + + protected ITrackerServices getITrackerServices() { + return itrackerServices; + } } Index: MoveIssueFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/MoveIssueFormAction.java,v retrieving revision 1.8.4.1 retrieving revision 1.8.4.2 diff -C2 -d -r1.8.4.1 -r1.8.4.2 *** MoveIssueFormAction.java 11 Oct 2005 01:21:04 -0000 1.8.4.1 --- MoveIssueFormAction.java 24 Oct 2005 20:35:12 -0000 1.8.4.2 *************** *** 59,63 **** try { ! IssueHandler ih = new IssueHandlerBean(); ProjectHandler ph = new ProjectHandlerBean(); --- 59,63 ---- try { ! IssueHandler ih = getITrackerServices().getIssueHandler(); ProjectHandler ph = new ProjectHandlerBean(); |
From: Ricardo T. <rj...@us...> - 2005-10-24 20:31:25
|
Update of /cvsroot/itracker/itracker/web/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4880/WEB-INF Modified Files: Tag: itrackerhibernate applicationContext.xml Log Message: now creating service layer only once, and reusing through all application Index: applicationContext.xml =================================================================== RCS file: /cvsroot/itracker/itracker/web/WEB-INF/Attic/applicationContext.xml,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** applicationContext.xml 13 Oct 2005 14:11:31 -0000 1.1.2.2 --- applicationContext.xml 24 Oct 2005 20:31:17 -0000 1.1.2.3 *************** *** 464,470 **** --- 464,476 ---- </bean> + <bean id="itrackerServices" class="cowsultants.itracker.ejb.beans.session.ITrackerServicesImpl" autowire="byName"> + </bean> + <bean id="applicationInitialization" class="cowsultants.itracker.web.servlets.ApplicationInitialization" autowire="constructor"> </bean> + <bean id="issueHandler" class="cowsultants.itracker.ejb.beans.session.IssueHandlerBean" autowire="byName"> + </bean> + <!-- Override properties specified in this file with properties from a properties file --> <!-- Usefull for db passwords, etc.. --> |
From: Ricardo T. <rj...@us...> - 2005-10-24 20:30:55
|
Update of /cvsroot/itracker/itracker/web/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4777/WEB-INF Modified Files: Tag: itrackerhibernate web.xml Log Message: cleanup. removed old commented configs Index: web.xml =================================================================== RCS file: /cvsroot/itracker/itracker/web/WEB-INF/Attic/web.xml,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** web.xml 11 Oct 2005 01:43:47 -0000 1.1.2.1 --- web.xml 24 Oct 2005 20:30:41 -0000 1.1.2.2 *************** *** 13,27 **** <context-param> <param-name>webmaster</param-name> ! <param-value>jca...@co...</param-value> ! </context-param> ! ! <!-- context-param> ! <param-name>locatorFactorySelector</param-name> ! <param-value>classpath*:/WEB-INF/beanRefFactory.xml</param-value> </context-param> - <context-param> - <param-name>parentContextKey</param-name> - <param-value>itracker</param-value> - </context-param --> <!-- Authentication against windows smb server --> --- 13,18 ---- <context-param> <param-name>webmaster</param-name> ! <param-value>itr...@it...</param-value> </context-param> <!-- Authentication against windows smb server --> *************** *** 53,60 **** <description>Open session in view</description> <filter-class>org.springframework.orm.hibernate.support.OpenSessionInViewFilter</filter-class> - <!-- init-param> - <param-name>singleSession</param-name> - <param-value>false</param-value> - </init-param --> </filter> --- 44,47 ---- *************** *** 78,93 **** <listener-class>org.springframework.web.context.ContextLoaderListener</listener-class> </listener> - - <!-- servlet> - <servlet-name>ContextLoaderServlet</servlet-name> - <servlet-class>org.springframework.web.context.ContextLoaderServlet</servlet-class> - <load-on-startup>2</load-on-startup> - </servlet --> - - <!-- servlet> - <servlet-name>ApplicationInitialization</servlet-name> - <servlet-class>cowsultants.itracker.web.servlets.ApplicationInitialization</servlet-class> - <load-on-startup>3</load-on-startup> - </servlet --> <servlet> --- 65,68 ---- |
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9278 Modified Files: Tag: itrackerhibernate AddIssueRelationAction.java AssignIssueAction.java CreateLanguageKeyAction.java DisplayReportAction.java EditComponentAction.java EditComponentFormAction.java EditConfigurationAction.java EditConfigurationFormAction.java EditCustomFieldAction.java EditCustomFieldFormAction.java EditCustomFieldValueAction.java EditCustomFieldValueFormAction.java EditLanguageAction.java EditLanguageFormAction.java EditPreferencesAction.java EditPreferencesFormAction.java EditProjectAction.java EditTaskAction.java EditTaskFormAction.java EditUserAction.java EditVersionAction.java EditWorkflowScriptAction.java EditWorkflowScriptFormAction.java ExportAttachmentsAction.java ExportLanguageAction.java ExportReportAction.java LockUserAction.java LoginAction.java OrderConfigurationItemAction.java OrderCustomFieldValueAction.java RemoveConfigurationItemAction.java RemoveCustomFieldAction.java RemoveCustomFieldValueAction.java RemoveHistoryEntryAction.java RemoveIssueAttachmentAction.java RemoveReportAction.java RemoveTaskAction.java SelfRegisterAction.java UnlockUserAction.java WatchIssueAction.java Log Message: Applied changes to move from ejb to hibernate. Instead of retrieving a XYZHandler by it's home interface a XYZHandlerBean is instantiated. Index: EditVersionAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditVersionAction.java,v retrieving revision 1.10.4.2 retrieving revision 1.10.4.3 diff -C2 -d -r1.10.4.2 -r1.10.4.3 *** EditVersionAction.java 16 Oct 2005 12:08:45 -0000 1.10.4.2 --- EditVersionAction.java 23 Oct 2005 22:58:05 -0000 1.10.4.3 *************** *** 19,27 **** package cowsultants.itracker.web.actions; import java.io.IOException; import java.util.HashMap; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 19,26 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.ProjectHandlerBean; import java.io.IOException; import java.util.HashMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 37,41 **** import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; - import cowsultants.itracker.ejb.client.interfaces.ProjectHandlerHome; import cowsultants.itracker.ejb.client.models.ProjectModel; import cowsultants.itracker.ejb.client.models.VersionModel; --- 36,39 ---- *************** *** 44,48 **** import cowsultants.itracker.web.util.Constants; - public class EditVersionAction extends ITrackerAction { --- 42,45 ---- *************** *** 65,73 **** ProjectModel project = null; try { ! InitialContext ic = new InitialContext(); ! ! Object phRef = ic.lookup("java:comp/env/" + ProjectHandler.JNDI_NAME); ! ProjectHandlerHome phHome = (ProjectHandlerHome) PortableRemoteObject.narrow(phRef, ProjectHandlerHome.class); ! ProjectHandler ph = phHome.create(); HttpSession session = request.getSession(true); --- 62,66 ---- ProjectModel project = null; try { ! ProjectHandler ph = new ProjectHandlerBean(); HttpSession session = request.getSession(true); Index: RemoveCustomFieldAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/RemoveCustomFieldAction.java,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.3 diff -C2 -d -r1.4.4.2 -r1.4.4.3 *** RemoveCustomFieldAction.java 23 Oct 2005 12:46:01 -0000 1.4.4.2 --- RemoveCustomFieldAction.java 23 Oct 2005 22:58:05 -0000 1.4.4.3 *************** *** 62,69 **** try { - InitialContext ic = new InitialContext(); - - Object scRef = ic.lookup("java:comp/env/" + SystemConfiguration.JNDI_NAME); - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 62,65 ---- Index: RemoveTaskAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/RemoveTaskAction.java,v retrieving revision 1.8.4.2 retrieving revision 1.8.4.3 diff -C2 -d -r1.8.4.2 -r1.8.4.3 *** RemoveTaskAction.java 13 Oct 2005 13:24:06 -0000 1.8.4.2 --- RemoveTaskAction.java 23 Oct 2005 22:58:05 -0000 1.8.4.3 *************** *** 19,27 **** package cowsultants.itracker.web.actions; import java.io.IOException; import java.util.HashMap; - - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 19,25 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.SchedulerHandlerBean; import java.io.IOException; import java.util.HashMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 36,40 **** import cowsultants.itracker.ejb.client.interfaces.SchedulerHandler; - import cowsultants.itracker.ejb.client.interfaces.SchedulerHandlerHome; import cowsultants.itracker.ejb.client.util.Logger; import cowsultants.itracker.ejb.client.util.UserUtilities; --- 34,37 ---- *************** *** 42,46 **** import cowsultants.itracker.web.util.Constants; - public class RemoveTaskAction extends ITrackerAction { --- 39,42 ---- *************** *** 62,70 **** } ! InitialContext ic = new InitialContext(); ! ! Object shRef = ic.lookup("java:comp/env/" + SchedulerHandler.JNDI_NAME); ! SchedulerHandlerHome shHome = (SchedulerHandlerHome) PortableRemoteObject.narrow(shRef, SchedulerHandlerHome.class); ! SchedulerHandler sh = shHome.create(); Integer taskId = new Integer((request.getParameter("id") == null ? "-1" : request.getParameter("id"))); --- 58,62 ---- } ! SchedulerHandler sh = new SchedulerHandlerBean(); Integer taskId = new Integer((request.getParameter("id") == null ? "-1" : request.getParameter("id"))); Index: EditConfigurationAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditConfigurationAction.java,v retrieving revision 1.10.4.3 retrieving revision 1.10.4.4 diff -C2 -d -r1.10.4.3 -r1.10.4.4 *** EditConfigurationAction.java 22 Oct 2005 16:37:28 -0000 1.10.4.3 --- EditConfigurationAction.java 23 Oct 2005 22:58:05 -0000 1.10.4.4 *************** *** 19,28 **** package cowsultants.itracker.web.actions; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 19,27 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; import java.io.IOException; import java.util.HashMap; import java.util.Iterator; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 41,45 **** import cowsultants.itracker.ejb.client.exceptions.SystemConfigurationException; import cowsultants.itracker.ejb.client.interfaces.IssueHandler; - import cowsultants.itracker.ejb.client.interfaces.IssueHandlerHome; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.models.ConfigurationModel; --- 40,43 ---- *************** *** 53,57 **** import cowsultants.itracker.web.util.Constants; - public class EditConfigurationAction extends ITrackerAction { --- 51,54 ---- *************** *** 73,79 **** try { - InitialContext ic = new InitialContext(); - - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 70,73 ---- *************** *** 162,168 **** Integer currUserId = (currUser == null ? new Integer(-1) : currUser.getId()); ! Object ihRef = ic.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); ! IssueHandlerHome ihHome = (IssueHandlerHome) PortableRemoteObject.narrow(ihRef, IssueHandlerHome.class); ! IssueHandler ih = ihHome.create(); IssueModel[] issues = ih.getIssuesWithStatus(currStatus); for(int i = 0; i < issues.length; i++) { --- 156,161 ---- Integer currUserId = (currUser == null ? new Integer(-1) : currUser.getId()); ! IssueHandler ih = new IssueHandlerBean(); ! IssueModel[] issues = ih.getIssuesWithStatus(currStatus); for(int i = 0; i < issues.length; i++) { Index: EditCustomFieldFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditCustomFieldFormAction.java,v retrieving revision 1.5.4.2 retrieving revision 1.5.4.3 diff -C2 -d -r1.5.4.2 -r1.5.4.3 *** EditCustomFieldFormAction.java 13 Oct 2005 14:25:54 -0000 1.5.4.2 --- EditCustomFieldFormAction.java 23 Oct 2005 22:58:05 -0000 1.5.4.3 *************** *** 64,71 **** try { - //InitialContext ic = new InitialContext(); - - //Object scRef = ic.lookup("java:comp/env/" + SystemConfiguration.JNDI_NAME); - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 64,67 ---- Index: EditCustomFieldValueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditCustomFieldValueAction.java,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.2 diff -C2 -d -r1.7.4.1 -r1.7.4.2 *** EditCustomFieldValueAction.java 11 Oct 2005 01:21:04 -0000 1.7.4.1 --- EditCustomFieldValueAction.java 23 Oct 2005 22:58:05 -0000 1.7.4.2 *************** *** 73,80 **** try { - //InitialContext ic = new InitialContext(); - - //Object scRef = ic.lookup("java:comp/env/" + SystemConfiguration.JNDI_NAME); - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 73,76 ---- Index: EditWorkflowScriptAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditWorkflowScriptAction.java,v retrieving revision 1.5.4.2 retrieving revision 1.5.4.3 diff -C2 -d -r1.5.4.2 -r1.5.4.3 *** EditWorkflowScriptAction.java 16 Oct 2005 12:08:45 -0000 1.5.4.2 --- EditWorkflowScriptAction.java 23 Oct 2005 22:58:05 -0000 1.5.4.3 *************** *** 68,72 **** WorkflowScriptModel script = null; try { - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 68,71 ---- Index: EditPreferencesFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditPreferencesFormAction.java,v retrieving revision 1.14.4.1 retrieving revision 1.14.4.2 diff -C2 -d -r1.14.4.1 -r1.14.4.2 *** EditPreferencesFormAction.java 11 Oct 2005 01:21:04 -0000 1.14.4.1 --- EditPreferencesFormAction.java 23 Oct 2005 22:58:05 -0000 1.14.4.2 *************** *** 57,64 **** try { - //InitialContext ic = new InitialContext(); - - //Object uhRef = ic.lookup("java:comp/env/" + UserHandler.JNDI_NAME); - //UserHandlerHome uhHome = (UserHandlerHome) PortableRemoteObject.narrow(uhRef, UserHandlerHome.class); UserHandler uh = new UserHandlerBean(); --- 57,60 ---- Index: RemoveHistoryEntryAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/RemoveHistoryEntryAction.java,v retrieving revision 1.6.4.2 retrieving revision 1.6.4.3 diff -C2 -d -r1.6.4.2 -r1.6.4.3 *** RemoveHistoryEntryAction.java 16 Oct 2005 12:08:45 -0000 1.6.4.2 --- RemoveHistoryEntryAction.java 23 Oct 2005 22:58:05 -0000 1.6.4.3 *************** *** 19,26 **** package cowsultants.itracker.web.actions; import java.io.IOException; - - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 19,24 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 36,45 **** import cowsultants.itracker.ejb.client.interfaces.IssueHandler; - import cowsultants.itracker.ejb.client.interfaces.IssueHandlerHome; import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.util.Logger; import cowsultants.itracker.web.util.Constants; - public class RemoveHistoryEntryAction extends ITrackerAction { --- 34,41 ---- *************** *** 55,63 **** try { ! InitialContext ic = new InitialContext(); ! ! Object ihRef = ic.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); ! IssueHandlerHome ihHome = (IssueHandlerHome) PortableRemoteObject.narrow(ihRef, IssueHandlerHome.class); ! IssueHandler ih = ihHome.create(); Integer historyId = (Integer) PropertyUtils.getSimpleProperty(form, "historyId"); --- 51,55 ---- try { ! IssueHandler ih = new IssueHandlerBean(); Integer historyId = (Integer) PropertyUtils.getSimpleProperty(form, "historyId"); Index: EditComponentFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditComponentFormAction.java,v retrieving revision 1.7.4.2 retrieving revision 1.7.4.3 diff -C2 -d -r1.7.4.2 -r1.7.4.3 *** EditComponentFormAction.java 16 Oct 2005 12:08:45 -0000 1.7.4.2 --- EditComponentFormAction.java 23 Oct 2005 22:58:05 -0000 1.7.4.3 *************** *** 19,27 **** package cowsultants.itracker.web.actions; import java.io.IOException; import java.util.HashMap; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 19,26 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.ProjectHandlerBean; import java.io.IOException; import java.util.HashMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 38,42 **** import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; - import cowsultants.itracker.ejb.client.interfaces.ProjectHandlerHome; import cowsultants.itracker.ejb.client.models.ComponentModel; import cowsultants.itracker.ejb.client.models.ProjectModel; --- 37,40 ---- *************** *** 45,49 **** import cowsultants.itracker.web.util.Constants; - public class EditComponentFormAction extends ITrackerAction { --- 43,46 ---- *************** *** 59,67 **** try { ! InitialContext ic = new InitialContext(); ! ! Object phRef = ic.lookup("java:comp/env/" + ProjectHandler.JNDI_NAME); ! ProjectHandlerHome phHome = (ProjectHandlerHome) PortableRemoteObject.narrow(phRef, ProjectHandlerHome.class); ! ProjectHandler ph = phHome.create(); HttpSession session = request.getSession(true); --- 56,60 ---- try { ! ProjectHandler ph = new ProjectHandlerBean(); HttpSession session = request.getSession(true); Index: WatchIssueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/WatchIssueAction.java,v retrieving revision 1.6.4.1 retrieving revision 1.6.4.2 diff -C2 -d -r1.6.4.1 -r1.6.4.2 *** WatchIssueAction.java 11 Oct 2005 01:21:05 -0000 1.6.4.1 --- WatchIssueAction.java 23 Oct 2005 22:58:05 -0000 1.6.4.2 *************** *** 57,63 **** try { - //InitialContext ic = new InitialContext(); - - //Object ihRef = ic.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); IssueHandler ih = new IssueHandlerBean(); --- 57,60 ---- Index: OrderCustomFieldValueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/OrderCustomFieldValueAction.java,v retrieving revision 1.6.4.2 retrieving revision 1.6.4.3 diff -C2 -d -r1.6.4.2 -r1.6.4.3 *** OrderCustomFieldValueAction.java 23 Oct 2005 12:46:01 -0000 1.6.4.2 --- OrderCustomFieldValueAction.java 23 Oct 2005 22:58:05 -0000 1.6.4.3 *************** *** 60,67 **** try { - InitialContext ic = new InitialContext(); - - Object scRef = ic.lookup("java:comp/env/" + SystemConfiguration.JNDI_NAME); - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 60,63 ---- Index: EditLanguageFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditLanguageFormAction.java,v retrieving revision 1.7.4.2 retrieving revision 1.7.4.3 diff -C2 -d -r1.7.4.2 -r1.7.4.3 *** EditLanguageFormAction.java 16 Oct 2005 12:08:45 -0000 1.7.4.2 --- EditLanguageFormAction.java 23 Oct 2005 22:58:05 -0000 1.7.4.3 *************** *** 62,66 **** try { - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 62,65 ---- Index: EditTaskFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditTaskFormAction.java,v retrieving revision 1.9.4.2 retrieving revision 1.9.4.3 diff -C2 -d -r1.9.4.2 -r1.9.4.3 *** EditTaskFormAction.java 16 Oct 2005 12:08:45 -0000 1.9.4.2 --- EditTaskFormAction.java 23 Oct 2005 22:58:05 -0000 1.9.4.3 *************** *** 19,27 **** package cowsultants.itracker.web.actions; import java.io.IOException; import java.util.HashMap; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 19,27 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.SchedulerHandlerBean; + import cowsultants.itracker.ejb.client.interfaces.SchedulerHandler; import java.io.IOException; import java.util.HashMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 36,42 **** import org.apache.struts.action.ActionMapping; import org.apache.struts.validator.DynaValidatorForm; - - import cowsultants.itracker.ejb.client.interfaces.SchedulerHandler; - import cowsultants.itracker.ejb.client.interfaces.SchedulerHandlerHome; import cowsultants.itracker.ejb.client.models.ScheduledTaskModel; import cowsultants.itracker.ejb.client.util.Logger; --- 36,39 ---- *************** *** 45,49 **** import cowsultants.itracker.web.util.Constants; - public class EditTaskFormAction extends ITrackerAction { --- 42,45 ---- *************** *** 59,68 **** try { ! InitialContext ic = new InitialContext(); ! ! Object shRef = ic.lookup("java:comp/env/" + SchedulerHandler.JNDI_NAME); ! SchedulerHandlerHome shHome = (SchedulerHandlerHome) PortableRemoteObject.narrow(shRef, SchedulerHandlerHome.class); ! SchedulerHandler sh = shHome.create(); ! HttpSession session = request.getSession(true); HashMap userPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); --- 55,60 ---- try { ! ! SchedulerHandler sh = new SchedulerHandlerBean(); HttpSession session = request.getSession(true); HashMap userPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); Index: ExportLanguageAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/ExportLanguageAction.java,v retrieving revision 1.9.4.2 retrieving revision 1.9.4.3 diff -C2 -d -r1.9.4.2 -r1.9.4.3 *** ExportLanguageAction.java 16 Oct 2005 12:08:45 -0000 1.9.4.2 --- ExportLanguageAction.java 23 Oct 2005 22:58:05 -0000 1.9.4.3 *************** *** 59,63 **** try { - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 59,62 ---- Index: EditComponentAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditComponentAction.java,v retrieving revision 1.8.4.2 retrieving revision 1.8.4.3 diff -C2 -d -r1.8.4.2 -r1.8.4.3 *** EditComponentAction.java 16 Oct 2005 12:08:45 -0000 1.8.4.2 --- EditComponentAction.java 23 Oct 2005 22:58:05 -0000 1.8.4.3 *************** *** 19,27 **** package cowsultants.itracker.web.actions; import java.io.IOException; import java.util.HashMap; - - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 19,25 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.ProjectHandlerBean; import java.io.IOException; import java.util.HashMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 37,41 **** import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; - import cowsultants.itracker.ejb.client.interfaces.ProjectHandlerHome; import cowsultants.itracker.ejb.client.models.ComponentModel; import cowsultants.itracker.ejb.client.models.ProjectModel; --- 35,38 ---- *************** *** 44,48 **** import cowsultants.itracker.web.util.Constants; - public class EditComponentAction extends ITrackerAction { --- 41,44 ---- *************** *** 65,73 **** ProjectModel project = null; try { ! InitialContext ic = new InitialContext(); ! ! Object phRef = ic.lookup("java:comp/env/" + ProjectHandler.JNDI_NAME); ! ProjectHandlerHome phHome = (ProjectHandlerHome) PortableRemoteObject.narrow(phRef, ProjectHandlerHome.class); ! ProjectHandler ph = phHome.create(); HttpSession session = request.getSession(true); --- 61,65 ---- ProjectModel project = null; try { ! ProjectHandler ph = new ProjectHandlerBean(); HttpSession session = request.getSession(true); Index: EditUserAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditUserAction.java,v retrieving revision 1.16.4.2 retrieving revision 1.16.4.3 diff -C2 -d -r1.16.4.2 -r1.16.4.3 *** EditUserAction.java 13 Oct 2005 14:25:54 -0000 1.16.4.2 --- EditUserAction.java 23 Oct 2005 22:58:05 -0000 1.16.4.3 *************** *** 19,22 **** --- 19,23 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.UserHandlerBean; import java.io.IOException; import java.util.HashMap; *************** *** 24,29 **** import java.util.Vector; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 25,28 ---- *************** *** 39,43 **** import cowsultants.itracker.ejb.client.exceptions.UserException; import cowsultants.itracker.ejb.client.interfaces.UserHandler; - import cowsultants.itracker.ejb.client.interfaces.UserHandlerHome; import cowsultants.itracker.ejb.client.models.PermissionModel; import cowsultants.itracker.ejb.client.models.UserModel; --- 38,41 ---- *************** *** 48,52 **** import cowsultants.itracker.web.util.SessionManager; - public class EditUserAction extends ITrackerAction { --- 46,49 ---- *************** *** 79,87 **** try { ! InitialContext ic = new InitialContext(); ! ! Object uhRef = ic.lookup("java:comp/env/" + UserHandler.JNDI_NAME); ! UserHandlerHome uhHome = (UserHandlerHome) PortableRemoteObject.narrow(uhRef, UserHandlerHome.class); ! UserHandler uh = uhHome.create(); UserModel editUser = new UserModel(); --- 76,80 ---- try { ! UserHandler uh = new UserHandlerBean(); UserModel editUser = new UserModel(); Index: RemoveCustomFieldValueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/RemoveCustomFieldValueAction.java,v retrieving revision 1.5.4.2 retrieving revision 1.5.4.3 diff -C2 -d -r1.5.4.2 -r1.5.4.3 *** RemoveCustomFieldValueAction.java 16 Oct 2005 12:08:45 -0000 1.5.4.2 --- RemoveCustomFieldValueAction.java 23 Oct 2005 22:58:05 -0000 1.5.4.3 *************** *** 63,67 **** try { - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 63,66 ---- Index: OrderConfigurationItemAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/OrderConfigurationItemAction.java,v retrieving revision 1.7.4.2 retrieving revision 1.7.4.3 diff -C2 -d -r1.7.4.2 -r1.7.4.3 *** OrderConfigurationItemAction.java 16 Oct 2005 12:08:45 -0000 1.7.4.2 --- OrderConfigurationItemAction.java 23 Oct 2005 22:58:05 -0000 1.7.4.3 *************** *** 58,62 **** try { - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 58,61 ---- Index: ExportAttachmentsAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/ExportAttachmentsAction.java,v retrieving revision 1.6.4.2 retrieving revision 1.6.4.3 diff -C2 -d -r1.6.4.2 -r1.6.4.3 *** ExportAttachmentsAction.java 13 Oct 2005 14:25:54 -0000 1.6.4.2 --- ExportAttachmentsAction.java 23 Oct 2005 22:58:05 -0000 1.6.4.3 *************** *** 19,28 **** package cowsultants.itracker.web.actions; import java.io.IOException; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; --- 19,27 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; import java.io.IOException; import java.util.zip.ZipEntry; import java.util.zip.ZipOutputStream; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; *************** *** 37,46 **** import cowsultants.itracker.ejb.client.interfaces.IssueHandler; - import cowsultants.itracker.ejb.client.interfaces.IssueHandlerHome; import cowsultants.itracker.ejb.client.models.IssueAttachmentModel; import cowsultants.itracker.ejb.client.util.Logger; import cowsultants.itracker.ejb.client.util.UserUtilities; - public class ExportAttachmentsAction extends ITrackerAction { --- 36,43 ---- *************** *** 60,68 **** try { ! InitialContext ic = new InitialContext(); ! ! Object ihRef = ic.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); ! IssueHandlerHome ihHome = (IssueHandlerHome) PortableRemoteObject.narrow(ihRef, IssueHandlerHome.class); ! IssueHandler ih = ihHome.create(); IssueAttachmentModel[] attachments = ih.getAllIssueAttachments(); --- 57,61 ---- try { ! IssueHandler ih = new IssueHandlerBean(); IssueAttachmentModel[] attachments = ih.getAllIssueAttachments(); Index: RemoveIssueAttachmentAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/RemoveIssueAttachmentAction.java,v retrieving revision 1.7.4.2 retrieving revision 1.7.4.3 diff -C2 -d -r1.7.4.2 -r1.7.4.3 *** RemoveIssueAttachmentAction.java 16 Oct 2005 12:08:45 -0000 1.7.4.2 --- RemoveIssueAttachmentAction.java 23 Oct 2005 22:58:05 -0000 1.7.4.3 *************** *** 19,27 **** package cowsultants.itracker.web.actions; import java.io.File; import java.io.IOException; - - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 19,25 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; import java.io.File; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 36,40 **** import cowsultants.itracker.ejb.beans.session.SystemConfigurationBean; import cowsultants.itracker.ejb.client.interfaces.IssueHandler; - import cowsultants.itracker.ejb.client.interfaces.IssueHandlerHome; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.models.IssueAttachmentModel; --- 34,37 ---- *************** *** 42,46 **** import cowsultants.itracker.ejb.client.util.UserUtilities; - public class RemoveIssueAttachmentAction extends ITrackerAction { --- 39,42 ---- *************** *** 60,69 **** try { ! InitialContext ic = new InitialContext(); ! ! Object ihRef = ic.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); ! IssueHandlerHome ihHome = (IssueHandlerHome) PortableRemoteObject.narrow(ihRef, IssueHandlerHome.class); ! IssueHandler ih = ihHome.create(); ! try { Integer attachmentId = new Integer((request.getParameter("id") == null ? "-1" : request.getParameter("id"))); --- 56,61 ---- try { ! IssueHandler ih = new IssueHandlerBean(); ! try { Integer attachmentId = new Integer((request.getParameter("id") == null ? "-1" : request.getParameter("id"))); *************** *** 71,75 **** if(attachment != null) { - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 63,66 ---- Index: EditProjectAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditProjectAction.java,v retrieving revision 1.11.4.2 retrieving revision 1.11.4.3 diff -C2 -d -r1.11.4.2 -r1.11.4.3 *** EditProjectAction.java 13 Oct 2005 13:24:06 -0000 1.11.4.2 --- EditProjectAction.java 23 Oct 2005 22:58:05 -0000 1.11.4.3 *************** *** 23,28 **** import java.util.HashSet; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 23,26 ---- *************** *** 38,44 **** import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; ! import cowsultants.itracker.ejb.client.interfaces.ProjectHandlerHome; import cowsultants.itracker.ejb.client.interfaces.UserHandler; ! import cowsultants.itracker.ejb.client.interfaces.UserHandlerHome; import cowsultants.itracker.ejb.client.models.PermissionModel; import cowsultants.itracker.ejb.client.models.ProjectModel; --- 36,42 ---- import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; ! import cowsultants.itracker.ejb.beans.session.ProjectHandlerBean; import cowsultants.itracker.ejb.client.interfaces.UserHandler; ! import cowsultants.itracker.ejb.beans.session.UserHandlerBean; import cowsultants.itracker.ejb.client.models.PermissionModel; import cowsultants.itracker.ejb.client.models.ProjectModel; *************** *** 49,54 **** import cowsultants.itracker.web.util.Constants; import cowsultants.itracker.web.util.SessionManager; - - public class EditProjectAction extends ITrackerAction { --- 47,50 ---- *************** *** 70,83 **** ProjectModel project = null; try { ! InitialContext ic = new InitialContext(); ! ! Object phRef = ic.lookup("java:comp/env/" + ProjectHandler.JNDI_NAME); ! ProjectHandlerHome phHome = (ProjectHandlerHome) PortableRemoteObject.narrow(phRef, ProjectHandlerHome.class); ! ProjectHandler ph = phHome.create(); ! ! Object uhRef = ic.lookup("java:comp/env/" + UserHandler.JNDI_NAME); ! UserHandlerHome uhHome = (UserHandlerHome) PortableRemoteObject.narrow(uhRef, UserHandlerHome.class); ! UserHandler uh = uhHome.create(); ! HttpSession session = request.getSession(true); HashMap userPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); --- 66,72 ---- ProjectModel project = null; try { ! ProjectHandler ph = new ProjectHandlerBean(); ! UserHandler uh = new UserHandlerBean(); ! HttpSession session = request.getSession(true); HashMap userPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); *************** *** 130,133 **** --- 119,123 ---- throw new Exception("Error creating new project."); } + ph.updateProject(project); ph.setProjectOwners(project, owners); ph.setProjectFields(project, fields); Index: EditWorkflowScriptFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditWorkflowScriptFormAction.java,v retrieving revision 1.6.4.2 retrieving revision 1.6.4.3 diff -C2 -d -r1.6.4.2 -r1.6.4.3 *** EditWorkflowScriptFormAction.java 16 Oct 2005 12:08:45 -0000 1.6.4.2 --- EditWorkflowScriptFormAction.java 23 Oct 2005 22:58:05 -0000 1.6.4.3 *************** *** 68,72 **** WorkflowScriptModel workflowScript = new WorkflowScriptModel(); if ("update".equals(action)) { - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 68,71 ---- Index: UnlockUserAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/UnlockUserAction.java,v retrieving revision 1.5.4.2 retrieving revision 1.5.4.3 diff -C2 -d -r1.5.4.2 -r1.5.4.3 *** UnlockUserAction.java 13 Oct 2005 13:24:06 -0000 1.5.4.2 --- UnlockUserAction.java 23 Oct 2005 22:58:05 -0000 1.5.4.3 *************** *** 19,26 **** package cowsultants.itracker.web.actions; import java.io.IOException; - - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 19,24 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.UserHandlerBean; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 34,41 **** import cowsultants.itracker.ejb.client.interfaces.UserHandler; - import cowsultants.itracker.ejb.client.interfaces.UserHandlerHome; import cowsultants.itracker.ejb.client.util.UserUtilities; - public class UnlockUserAction extends ITrackerAction { --- 32,37 ---- *************** *** 55,63 **** try { ! InitialContext ic = new InitialContext(); ! ! Object uhRef = ic.lookup("java:comp/env/" + UserHandler.JNDI_NAME); ! UserHandlerHome uhHome = (UserHandlerHome) PortableRemoteObject.narrow(uhRef, UserHandlerHome.class); ! UserHandler uh = uhHome.create(); Integer userId = new Integer((request.getParameter("id") == null ? "-1" : (request.getParameter("id")))); --- 51,55 ---- try { ! UserHandler uh = new UserHandlerBean(); Integer userId = new Integer((request.getParameter("id") == null ? "-1" : (request.getParameter("id")))); Index: EditCustomFieldValueFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditCustomFieldValueFormAction.java,v retrieving revision 1.5.4.2 retrieving revision 1.5.4.3 diff -C2 -d -r1.5.4.2 -r1.5.4.3 *** EditCustomFieldValueFormAction.java 16 Oct 2005 12:08:45 -0000 1.5.4.2 --- EditCustomFieldValueFormAction.java 23 Oct 2005 22:58:05 -0000 1.5.4.3 *************** *** 61,68 **** try { - //InitialContext ic = new InitialContext(); - - //Object scRef = ic.lookup("java:comp/env/" + SystemConfiguration.JNDI_NAME); - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 61,64 ---- Index: AddIssueRelationAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/AddIssueRelationAction.java,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.3 diff -C2 -d -r1.4.4.2 -r1.4.4.3 *** AddIssueRelationAction.java 13 Oct 2005 14:25:54 -0000 1.4.4.2 --- AddIssueRelationAction.java 23 Oct 2005 22:58:05 -0000 1.4.4.3 *************** *** 19,27 **** package cowsultants.itracker.web.actions; import java.io.IOException; import java.util.HashMap; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 19,26 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; import java.io.IOException; import java.util.HashMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 60,69 **** try { - InitialContext ic = new InitialContext(); - - Object ihRef = ic.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); - IssueHandlerHome ihHome = (IssueHandlerHome) PortableRemoteObject.narrow(ihRef, IssueHandlerHome.class); - IssueHandler ih = ihHome.create(); caller = (String) PropertyUtils.getSimpleProperty(form, "caller"); issueId = (Integer) PropertyUtils.getSimpleProperty(form, "issueId"); --- 59,65 ---- try { + IssueHandler ih = new IssueHandlerBean(); + caller = (String) PropertyUtils.getSimpleProperty(form, "caller"); issueId = (Integer) PropertyUtils.getSimpleProperty(form, "issueId"); Index: EditTaskAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditTaskAction.java,v retrieving revision 1.9.4.2 retrieving revision 1.9.4.3 diff -C2 -d -r1.9.4.2 -r1.9.4.3 *** EditTaskAction.java 13 Oct 2005 13:24:06 -0000 1.9.4.2 --- EditTaskAction.java 23 Oct 2005 22:58:05 -0000 1.9.4.3 *************** *** 19,27 **** package cowsultants.itracker.web.actions; import java.io.IOException; import java.util.HashMap; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 19,26 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.SchedulerHandlerBean; import java.io.IOException; import java.util.HashMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 37,41 **** import cowsultants.itracker.ejb.client.interfaces.SchedulerHandler; - import cowsultants.itracker.ejb.client.interfaces.SchedulerHandlerHome; import cowsultants.itracker.ejb.client.models.ScheduledTaskModel; import cowsultants.itracker.ejb.client.util.Logger; --- 36,39 ---- *************** *** 44,48 **** import cowsultants.itracker.web.util.Constants; - public class EditTaskAction extends ITrackerAction { --- 42,45 ---- *************** *** 65,73 **** ScheduledTaskModel task = null; try { - InitialContext ic = new InitialContext(); ! Object shRef = ic.lookup("java:comp/env/" + SchedulerHandler.JNDI_NAME); ! SchedulerHandlerHome shHome = (SchedulerHandlerHome) PortableRemoteObject.narrow(shRef, SchedulerHandlerHome.class); ! SchedulerHandler sh = shHome.create(); HashMap userPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); --- 62,67 ---- ScheduledTaskModel task = null; try { ! SchedulerHandler sh = new SchedulerHandlerBean(); HashMap userPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); Index: LoginAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/LoginAction.java,v retrieving revision 1.20.4.1 retrieving revision 1.20.4.2 diff -C2 -d -r1.20.4.1 -r1.20.4.2 *** LoginAction.java 11 Oct 2005 01:21:04 -0000 1.20.4.1 --- LoginAction.java 23 Oct 2005 22:58:05 -0000 1.20.4.2 *************** *** 23,29 **** import javax.ejb.CreateException; ! import javax.naming.InitialContext; import javax.naming.NamingException; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.Cookie; --- 23,28 ---- import javax.ejb.CreateException; ! //import javax.naming.InitialContext; import javax.naming.NamingException; import javax.servlet.ServletException; import javax.servlet.http.Cookie; *************** *** 45,49 **** import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.interfaces.UserHandler; - import cowsultants.itracker.ejb.client.interfaces.UserHandlerHome; import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.models.UserPreferencesModel; --- 44,47 ---- *************** *** 56,60 **** import cowsultants.itracker.web.util.SessionManager; import cowsultants.itracker.web.util.SessionTracker; - public class LoginAction extends ITrackerAction { private static int SESSION_TIMEOUT = 30; --- 54,57 ---- *************** *** 207,217 **** public UserModel setupSession(String login, HttpServletRequest request, HttpServletResponse response) throws DataException { ! try { ! InitialContext ic = new InitialContext(); ! ! Object uhRef = ic.lookup("java:comp/env/" + UserHandler.JNDI_NAME); ! UserHandlerHome uhHome = (UserHandlerHome) PortableRemoteObject.narrow(uhRef, UserHandlerHome.class); ! UserHandler uh = uhHome.create(); ! UserModel user = uh.getUserByLogin(login); if (user != null) { --- 204,208 ---- public UserModel setupSession(String login, HttpServletRequest request, HttpServletResponse response) throws DataException { ! UserHandler uh = new UserHandlerBean(); UserModel user = uh.getUserByLogin(login); if (user != null) { *************** *** 231,239 **** return setupSession(user, encPassword, request, response); } - } catch (NamingException ne) { - Logger.logError("Could not locate session EJB for login reset.", ne); - } catch (CreateException ce) { - Logger.logError("Could not create session EJB for login reset.", ce); - } return null; } --- 222,225 ---- *************** *** 245,252 **** } - //InitialContext ic = new InitialContext(); - - //Object uhRef = ic.lookup("java:comp/env/" + UserHandler.JNDI_NAME); - //UserHandlerHome uhHome = (UserHandlerHome) PortableRemoteObject.narrow(uhRef, UserHandlerHome.class); UserHandler uh = new UserHandlerBean(); --- 231,234 ---- Index: EditConfigurationFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditConfigurationFormAction.java,v retrieving revision 1.7.4.2 retrieving revision 1.7.4.3 diff -C2 -d -r1.7.4.2 -r1.7.4.3 *** EditConfigurationFormAction.java 16 Oct 2005 12:08:45 -0000 1.7.4.2 --- EditConfigurationFormAction.java 23 Oct 2005 22:58:05 -0000 1.7.4.3 *************** *** 61,66 **** try { - //Object scRef = ic.lookup("java:comp/env/" + SystemConfiguration.JNDI_NAME); - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 61,64 ---- Index: CreateLanguageKeyAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/CreateLanguageKeyAction.java,v retrieving revision 1.7.4.2 retrieving revision 1.7.4.3 diff -C2 -d -r1.7.4.2 -r1.7.4.3 *** CreateLanguageKeyAction.java 13 Oct 2005 13:24:06 -0000 1.7.4.2 --- CreateLanguageKeyAction.java 23 Oct 2005 22:58:05 -0000 1.7.4.3 *************** *** 59,65 **** try { - //InitialContext ic = new InitialContext(); - - //Object scRef = ic.lookup("java:comp/env/" + SystemConfiguration.JNDI_NAME); SystemConfiguration sc = new SystemConfigurationBean(); --- 59,62 ---- Index: DisplayReportAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/DisplayReportAction.java,v retrieving revision 1.19.4.2 retrieving revision 1.19.4.3 diff -C2 -d -r1.19.4.2 -r1.19.4.3 *** DisplayReportAction.java 16 Oct 2005 12:08:45 -0000 1.19.4.2 --- DisplayReportAction.java 23 Oct 2005 22:58:05 -0000 1.19.4.3 *************** *** 19,22 **** --- 19,24 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; + import cowsultants.itracker.ejb.beans.session.ReportHandlerBean; import java.io.IOException; import java.io.PrintWriter; *************** *** 26,31 **** import java.util.Vector; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 28,31 ---- *************** *** 44,50 **** import cowsultants.itracker.ejb.client.exceptions.ReportException; import cowsultants.itracker.ejb.client.interfaces.IssueHandler; - import cowsultants.itracker.ejb.client.interfaces.IssueHandlerHome; import cowsultants.itracker.ejb.client.interfaces.ReportHandler; - import cowsultants.itracker.ejb.client.interfaces.ReportHandlerHome; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.models.IssueModel; --- 44,48 ---- *************** *** 63,67 **** import cowsultants.itracker.web.util.Constants; - public class DisplayReportAction extends ITrackerAction { --- 61,64 ---- *************** *** 92,101 **** } ! ! InitialContext ic = new InitialContext(); ! Object ihRef = ic.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); ! IssueHandlerHome ihHome = (IssueHandlerHome) PortableRemoteObject.narrow(ihRef, IssueHandlerHome.class); ! IssueHandler ih = ihHome.create(); ! reportData = ih.getAllIssues(); Arrays.sort(reportData, new IssueModel.CompareById()); --- 89,93 ---- } ! IssueHandler ih = new IssueHandlerBean(); reportData = ih.getAllIssues(); Arrays.sort(reportData, new IssueModel.CompareById()); *************** *** 105,114 **** // issues for them, check which ones the user can see, and then create a new array of issues Vector reportDataVector = new Vector(); ! ! InitialContext ic = new InitialContext(); ! Object ihRef = ic.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); ! IssueHandlerHome ihHome = (IssueHandlerHome) PortableRemoteObject.narrow(ihRef, IssueHandlerHome.class); ! IssueHandler ih = ihHome.create(); ! UserModel currUser = (UserModel) session.getAttribute(Constants.USER_KEY); HashMap currPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); --- 97,103 ---- // issues for them, check which ones the user can see, and then create a new array of issues Vector reportDataVector = new Vector(); ! ! IssueHandler ih = new IssueHandlerBean(); ! UserModel currUser = (UserModel) session.getAttribute(Constants.USER_KEY); HashMap currPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); *************** *** 150,154 **** Logger.logDebug("Issue export requested."); - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); SystemConfigurationModel config = sc.getSystemConfiguration(ImportExportTags.EXPORT_LOCALE); --- 139,142 ---- *************** *** 162,169 **** Logger.logDebug("Defined report (" + reportId + ") requested."); ! InitialContext ic = new InitialContext(); ! Object rhRef = ic.lookup("java:comp/env/" + ReportHandler.JNDI_NAME); ! ReportHandlerHome rhHome = (ReportHandlerHome) PortableRemoteObject.narrow(rhRef, ReportHandlerHome.class); ! ReportHandler rh = rhHome.create(); ReportModel reportModel = rh.getReport(reportId); --- 150,154 ---- Logger.logDebug("Defined report (" + reportId + ") requested."); ! ReportHandler rh = new ReportHandlerBean(); ReportModel reportModel = rh.getReport(reportId); Index: AssignIssueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/AssignIssueAction.java,v retrieving revision 1.5.4.2 retrieving revision 1.5.4.3 diff -C2 -d -r1.5.4.2 -r1.5.4.3 *** AssignIssueAction.java 13 Oct 2005 13:24:06 -0000 1.5.4.2 --- AssignIssueAction.java 23 Oct 2005 22:58:05 -0000 1.5.4.3 *************** *** 19,27 **** package cowsultants.itracker.web.actions; import java.io.IOException; import java.util.HashMap; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 19,27 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; + import cowsultants.itracker.ejb.beans.session.ProjectHandlerBean; import java.io.IOException; import java.util.HashMap; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 38,44 **** import cowsultants.itracker.ejb.client.interfaces.IssueHandler; - import cowsultants.itracker.ejb.client.interfaces.IssueHandlerHome; import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; - import cowsultants.itracker.ejb.client.interfaces.ProjectHandlerHome; import cowsultants.itracker.ejb.client.models.ProjectModel; import cowsultants.itracker.ejb.client.models.UserModel; --- 38,42 ---- *************** *** 48,52 **** import cowsultants.itracker.web.util.Constants; - public class AssignIssueAction extends ITrackerAction { --- 46,49 ---- *************** *** 62,74 **** try { ! InitialContext ic = new InitialContext(); ! ! Object ihRef = ic.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); ! IssueHandlerHome ihHome = (IssueHandlerHome) PortableRemoteObject.narrow(ihRef, IssueHandlerHome.class); ! IssueHandler ih = ihHome.create(); ! ! Object phRef = ic.lookup("java:comp/env/" + ProjectHandler.JNDI_NAME); ! ProjectHandlerHome phHome = (ProjectHandlerHome) PortableRemoteObject.narrow(phRef, ProjectHandlerHome.class); ! ProjectHandler ph = phHome.create(); Integer defaultValue = new Integer(-1); --- 59,64 ---- try { ! IssueHandler ih = new IssueHandlerBean(); ! ProjectHandler ph = new ProjectHandlerBean(); Integer defaultValue = new Integer(-1); Index: ExportReportAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/ExportReportAction.java,v retrieving revision 1.9.4.2 retrieving revision 1.9.4.3 diff -C2 -d -r1.9.4.2 -r1.9.4.3 *** ExportReportAction.java 13 Oct 2005 14:25:54 -0000 1.9.4.2 --- ExportReportAction.java 23 Oct 2005 22:58:05 -0000 1.9.4.3 *************** *** 19,26 **** package cowsultants.itracker.web.actions; import java.io.IOException; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; --- 19,25 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.session.ReportHandlerBean; import java.io.IOException; import javax.servlet.ServletException; import javax.servlet.ServletOutputStream; *************** *** 36,40 **** import cowsultants.itracker.ejb.client.interfaces.ReportHandler; - import cowsultants.itracker.ejb.client.interfaces.ReportHandlerHome; import cowsultants.itracker.ejb.client.models.ReportModel; import cowsultants.itracker.ejb.client.util.Base64; --- 35,38 ---- *************** *** 42,46 **** import cowsultants.itracker.ejb.client.util.UserUtilities; - public class ExportReportAction extends ITrackerAction { --- 40,43 ---- *************** *** 64,72 **** errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("itracker.web.error.invalidreport")); } else { ! InitialContext ic = new InitialContext(); ! ! Object rhRef = ic.lookup("java:comp/env/" + ReportHandler.JNDI_NAME); ! ReportHandlerHome rhHome = (ReportHandlerHome) PortableRemoteObject.narrow(rhRef, ReportHandlerHome.class); ! ReportHandler rh = rhHome.create(); ReportModel report = rh.getReport(reportId); --- 61,65 ---- errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("itracker.web.error.invalidreport")); } else { ! ReportHandler rh = new ReportHandlerBean(); ReportModel report = rh.getReport(reportId); Index: EditPreferencesAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditPreferencesAction.java,v retrieving revision 1.20.4.1 retrieving revision 1.20.4.2 diff -C2 -d -r1.20.4.1 -r1.20.4.2 *** EditPreferencesAction.java 11 Oct 2005 01:21:04 -0000 1.20.4.1 --- EditPreferencesAction.java 23 Oct 2005 22:58:05 -0000 1.20.4.2 *************** *** 72,79 **** UserModel user = null; try { - //InitialContext ic = new InitialContext(); - - //Object uhRef = ic.lookup("java:comp/env/" + UserHandler.JNDI_NAME); - //UserHandlerHome uhHome = (UserHandlerHome) PortableRemoteObject.narrow(uhRef, UserHandlerHome.class); UserHandler uh = new UserHandlerBean(); --- 72,75 ---- Index: EditCustomFieldAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditCustomFieldAction.java,v retrieving revision 1.7.4.2 retrieving revision 1.7.4.3 diff -C2 -d -r1.7.4.2 -r1.7.4.3 *** EditCustomFieldAction.java 16 Oct 2005 12:08:45 -0000 1.7.4.2 --- EditCustomFieldAction.java 23 Oct 2005 22:58:05 -0000 1.7.4.3 *************** *** 62,66 **** resetToken(request); try { - //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 62,65 ---- Index: SelfRegisterAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/SelfRegisterAction.java,v retrieving revision 1.8.4.2 retrieving revision 1.8.4.3 diff -C2 -d -r1.8.4.2 -r1.8.4.3 *** SelfRegisterAction.java 16 Oct 2005 12:08:45 -0000 1.8.4.2 --- SelfRegisterAction.java 23 Oct 2005 22:58:05 -0000 1.8.4.3 *************** *** 21,26 **** import java.io.IOException; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 21,24 ---- *************** *** 34,41 **** import cowsultants.itracker.ejb.beans.session.SystemConfigurationBean; import cowsultants.it... [truncated message content] |
From: Ricardo T. <ric...@em...> - 2005-10-23 22:48:47
|
Hi, Does anyone know if sourceforge is about to launch it's SVN service, or if it will take longer ? There are a few refactorings we should do, but doing them in CVS gives me a headache :) 1) changing the com.cowsultants pakage -> org.itracker 2) merging the current branch back to head. If SVN is about to come we could wait, otherwise we'll just have to do them in CVS. Can you check with sourceforge, Marky ? Ricardo |
From: Ricardo T. <rj...@us...> - 2005-10-23 22:32:57
|
Update of /cvsroot/itracker/itracker/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5236 Modified Files: Tag: itrackerhibernate index.jsp Log Message: removed custom buttons committed by mistake Index: index.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/index.jsp,v retrieving revision 1.34.4.1 retrieving revision 1.34.4.2 diff -C2 -d -r1.34.4.1 -r1.34.4.2 *** index.jsp 11 Oct 2005 01:21:05 -0000 1.34.4.1 --- index.jsp 23 Oct 2005 22:32:49 -0000 1.34.4.2 *************** *** 100,111 **** <br> </logic:messagesPresent> - - <p/> - <center> - <button class="button" title="Criar" alt="Criar">Criar pedido helpdesk SI</button> - <button class="button" title="Criar" alt="Criar">Criar requisição SI</button> - </center> - <p/> - <table border="0" cellspacing="0" cellpadding="0" width="90%" align="center"> <% if(! UserUtilities.hideIndexSection(UserUtilities.PREF_HIDE_ASSIGNED, hiddenSections)) { %> --- 100,103 ---- |
From: Ricardo T. <rj...@us...> - 2005-10-23 22:32:30
|
Update of /cvsroot/itracker/itracker/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5138 Modified Files: Tag: itrackerhibernate edit_issue.jsp Log Message: editing issues now works Index: edit_issue.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/edit_issue.jsp,v retrieving revision 1.62.4.1 retrieving revision 1.62.4.2 diff -C2 -d -r1.62.4.1 -r1.62.4.2 *** edit_issue.jsp 23 Oct 2005 14:26:35 -0000 1.62.4.1 --- edit_issue.jsp 23 Oct 2005 22:32:22 -0000 1.62.4.2 *************** *** 6,11 **** <%@ page import="java.util.*" %> - <%@ page import="javax.naming.*" %> - <%@ page import="javax.rmi.*" %> <%@ page import="org.apache.struts.util.*" %> <%@ page import="cowsultants.itracker.ejb.client.models.*" %> --- 6,9 ---- *************** *** 19,27 **** <% ! InitialContext ic = new InitialContext(); ! ! Object ihRef = ic.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); ! IssueHandlerHome ihHome = (IssueHandlerHome) PortableRemoteObject.narrow(ihRef, IssueHandlerHome.class); ! IssueHandler ih = ihHome.create(); IssueModel issue = (IssueModel) session.getAttribute(Constants.ISSUE_KEY); --- 17,21 ---- <% ! IssueHandler ih = new IssueHandlerBean(); IssueModel issue = (IssueModel) session.getAttribute(Constants.ISSUE_KEY); |
From: Ricardo T. <ric...@em...> - 2005-10-23 21:53:59
|
Hi, Do any of you know how to reach gundee or tyler ? These were guys interested in ITracker in the past, perhaps they would be interested to help again. Ricardo |
From: Ricardo T. <ric...@em...> - 2005-10-23 21:43:04
|
Hi, Our migration seems to be going reasonably well. ITracker base functionality is working again. So at this point i'd like to discuss project status with you : -We have a maintainer again (that being Marky) -We have a fronted guy again (that being Marky) -We have someone taking care (at least temporarily) of ITracker architecture and backend -We have two more contributors, that being Marc and Steve, who have provided contributions, fixes and valuable opinions and sugestions -We have some more people on the list, that while at this point haven't made code contributions, have made other type of contributions, like Jason (the original author), Fernando and Eiving. -Group code has been donated by Jayr Al-Dyn, which means probably the next release will have group support in it -We have almost completed a technical migration from an EJB codebase to a Spring/Hibernate one. At this point what I'd like to do is two things : 1) Discuss what we need to make the next release. Some issues : -Some organization stuff. We need a web site up, we need forums, we need trackers on Sourceforge. Marky is handling all this. I whish we could have some mockups of the site he plans to air, so we could give our opinion. As for the other issues, ITracker still looks dead from an end-user point of view, we should change that ASAP. -Wide testing. It would be good if we could get people to test it, and enter bugs in the bug tracker Marky is setting up on sourceforge. -Identify all tasks leading to the release, and hoping people will pick them up. -Release number. Marky has been calling it 2.6, but I must agree with Fernando when he says that it should be 3.0. It is a complete rewrite of the persistence layer of the app, and complete change of supported infra-structure. While this release will be a drop in replacement for 2.5 (that never was released), it's sufficiently different that we should break the major number. 2) Discuss the future. -From this group, I'm probably the one with the more in depth knowledge of the ITracker code base (except for Jason, of course), so I'd like to launch the architecture discussion. While I agree with Marky in that we shouldn't do work on future issues at this point, I feel the discussion is important because I know the architecture is one of the issues that shapes contributor's opinion of the project. -We already lost (I hope temporarily) one contributor with a lot of experience in technology (that being Fernando, an old colleague of mine) because he feels the code base is so bad it would be better to rewrite. While I disagree with him, because I feel rewrites in open source tend to loose focus and gradual refactoring works better -Fernando still has a point in the fact that the code base is very bad. I hope Jason won't take this the wrong way, I admire his work in that he built it all by himself, and we've all written less than good code at one point or another. Actually he was learning EJB when he did it. Also, the code base it pretty old and has never been refactored. -I have a lot of ideas how we could improve this app (I've done this before to other apps, professionaly), but would like to discuss it with everybody, so we could have a proper architecture document, an plan the next releases (by refactoring and new features). -I think the proper way to do that would be instant messaging kind of "meeting", where the problems would be addressed and discussed, and possible ways to mitigate them would surface from discussion. We aren't in a hurry for this, so we can surely arrange for a date that would be good for everyone. It would also be interesting to know at that stage who can contribute what. Here are some of the problems I've been finding in the code base this far, and should drive the refactoring : -Extremely bad in terms of performance. Those of you with big installs probably feel this already. The strategy is always getting all stuff out of the database, and filtering in code. Of course with 10K issues this grinds things to a halt. The worst problem here isn't even this, but the fact that for each item, usually getModel() is call, which transverses to dependent entities, so not even hibernate lazy loading is helping us here. To fix this will require a combination of killing value objects (we don't need them anyway), improving some queries and improving code at some hot spots (such as the issue pagination code). -Authentication. This is another very bad point. Authentication is hard coded everywhere, making maintenance and adding new authorization features horrible. We should aim for a pluggable authorization framework, in the likes of acegi. -Bad OO design. We have a very fat services layer, and an anemic domain model (http://www.martinfowler.com/bliki/AnemicDomainModel.html - for those unfamiliar with this recurrent problem). This was made worst by EJB, that encourages non-OO design. Just an example from my last encounter with them, just a while ago : If you try to add an history entry to an issue, you have to call a method called addHistoryEntry in the services layer. You obviously shouldn't do that, you should just issue.addHistoryEntry(history) and save the issue. We can do the later with the current codebase, but there's 10 tons of code doing the former. This will result in actually removing a good part of the service layer. -Bad custom field data model. Anyone who has tried to do reporting based on custom field and had to do string substitutions on SQL to find issues IDs will agree with me here. -Too many features done in code. Anyone that has used quartz scheduler certainly doesn't want to maintain his own scheduler. At this point we have our own scheduler, our own pluggable authentication framework, etc.. -Marky has commented on the low quality of the JSPs. I am not a frontend expert (although I've written and managed some frontend projects), but what he says makes sense. Here are some of the new features that are discussed more ofter : -Other GUIs, like Swing, Eclipse (partially done) and portal (JSR-168) interface -Groups (in progress) -Integration with Version Control, for people using ITracker for code bugs/features -Better permission mechanism -Possibility to have security levels for history entries I'd like for the new releases to be a mixture of refactoring and new features, and that we would be able to attract more developers, so we can move ITracker forward, together, in a true community spirit ! Ricardo |
From: Ricardo T. <rj...@us...> - 2005-10-23 20:41:37
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14418/cowsultants/itracker/web/actions Modified Files: Tag: itrackerhibernate CreateIssueAction.java Log Message: creating new issues now works again Index: CreateIssueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/CreateIssueAction.java,v retrieving revision 1.15.4.2 retrieving revision 1.15.4.3 diff -C2 -d -r1.15.4.2 -r1.15.4.3 *** CreateIssueAction.java 22 Oct 2005 16:37:28 -0000 1.15.4.2 --- CreateIssueAction.java 23 Oct 2005 20:41:29 -0000 1.15.4.3 *************** *** 113,120 **** Integer creator = currUserId; ! if(UserUtilities.hasPermission(currPermissions, projectId, UserUtilities.PERMISSION_CREATE_OTHERS)) { creator = (Integer) PropertyUtils.getSimpleProperty(form, "creatorId"); Logger.logDebug("New issue creator set to " + creator + ". Issue created by " + currUserId); ! } issue = ih.createIssue(issue, projectId, (creator == null ? currUserId : creator), currUserId); --- 113,121 ---- Integer creator = currUserId; ! // TODO temporarily disabled creating issues as another user ! /*if(UserUtilities.hasPermission(currPermissions, projectId, UserUtilities.PERMISSION_CREATE_OTHERS)) { creator = (Integer) PropertyUtils.getSimpleProperty(form, "creatorId"); Logger.logDebug("New issue creator set to " + creator + ". Issue created by " + currUserId); ! }*/ issue = ih.createIssue(issue, projectId, (creator == null ? currUserId : creator), currUserId); |
From: Ricardo T. <rj...@us...> - 2005-10-23 20:33:39
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12774/cowsultants/itracker/ejb/beans/session Modified Files: Tag: itrackerhibernate IssueHandlerBean.java UserHandlerBean.java Log Message: editing issues (including adding history entries) is working again. sending of notifications had to be temporarily disabled. Index: IssueHandlerBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session/IssueHandlerBean.java,v retrieving revision 1.57.4.2 retrieving revision 1.57.4.3 diff -C2 -d -r1.57.4.2 -r1.57.4.3 *** IssueHandlerBean.java 22 Oct 2005 16:37:28 -0000 1.57.4.2 --- IssueHandlerBean.java 23 Oct 2005 20:33:28 -0000 1.57.4.3 *************** *** 1,1109 **** ! /* ! * 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 [...1082 lines suppressed...] ! Logger.logWarn("Error sending notification message", jmse); ! } ! } ! ! public boolean canViewIssue(Integer issueId, UserModel user) throws DataException { ! IssueModel issue = getIssue(issueId); ! HashMap permissions = ufHome.getUserPermissions(user, AuthenticationConstants.REQ_SOURCE_WEB); ! return IssueUtilities.canViewIssue(issue, user.getId(), permissions); ! } ! ! public boolean canViewIssue(IssueModel issue, UserModel user) { ! ! HashMap permissions = ufHome.getUserPermissions(user, AuthenticationConstants.REQ_SOURCE_WEB); ! return IssueUtilities.canViewIssue(issue, user.getId(), permissions); ! } ! ! } --- 1 ---- ! /* * 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 cowsultants.itracker.ejb.beans.session; import java.sql.Timestamp; import java.util.Collection; import java.util.Date; import java.util.HashMap; import java.util.HashSet; import java.util.Iterator; import java.util.Vector; import javax.naming.InitialContext; import cowsultants.itracker.ejb.beans.entity.ComponentBean; import cowsultants.itracker.ejb.beans.entity.CustomFieldBean; import cowsultants.itracker.ejb.beans.entity.IssueActivityBean; import cowsultants.itracker.ejb.beans.entity.IssueAttachmentBean; import cowsultants.itracker.ejb.beans.entity.IssueBean; import cowsultants.itracker.ejb.beans.entity.IssueFieldBean; import cowsultants.itracker.ejb.beans.entity.IssueHistoryBean; import cowsultants.itracker.ejb.beans.entity.IssueRelationBean; import cowsultants.itracker.ejb.beans.entity.NotificationBean; import cowsultants.itracker.ejb.beans.entity.ProjectBean; import cowsultants.itracker.ejb.beans.entity.UserBean; import cowsultants.itracker.ejb.beans.entity.VersionBean; import cowsultants.itracker.ejb.beans.message.NotificationMessageBean; import cowsultants.itracker.ejb.client.exceptions.IssueException; import cowsultants.itracker.ejb.client.interfaces.IssueHandler; import cowsultants.itracker.ejb.client.models.ComponentModel; import cowsultants.itracker.ejb.client.models.IssueAttachmentModel; import cowsultants.itracker.ejb.client.models.IssueFieldModel; import cowsultants.itracker.ejb.client.models.IssueHistoryModel; import cowsultants.itracker.ejb.client.models.IssueModel; import cowsultants.itracker.ejb.client.models.IssueRelationModel; import cowsultants.itracker.ejb.client.models.NotificationModel; import cowsultants.itracker.ejb.client.models.ProjectModel; import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.models.VersionModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.ejb.client.util.AuthenticationConstants; import cowsultants.itracker.ejb.client.util.IssueUtilities; import cowsultants.itracker.ejb.client.util.Logger; import cowsultants.itracker.ejb.client.util.NotificationUtilities; import cowsultants.itracker.ejb.client.util.ProjectUtilities; import cowsultants.itracker.ejb.client.util.UserUtilities; public class IssueHandlerBean implements IssueHandler { private static String notificationFactoryName = NotificationMessageBean.DEFAULT_CONNECTION_FACTORY; private static String notificationQueueName = NotificationMessageBean.DEFAULT_QUEUE_NAME; private static String systemBaseURL = ""; private InitialContext ic; private CustomFieldFactory cfHome = null; private UserFactory ufHome = null; private ProjectFactory pfHome = null; private IssueFactory ifHome = null; private IssueHistoryFactory ihfHome = null; private NotificationFactory nfHome = null; private IssueRelationFactory issuerelationfactory = null; private ComponentFactory componentFactory = null; public IssueHandlerBean() { ufHome = SpringFactories.getUserFactory(); pfHome = SpringFactories.getProjectFactory(); ifHome = SpringFactories.getIssueFactory(); ihfHome = SpringFactories.getIssueHistoryFactory(); nfHome = SpringFactories.getNotificationFactory(); issuerelationfactory = SpringFactories.getIssueRelationFactory(); componentFactory = SpringFactories.getComponentFactory(); cfHome = SpringFactories.getCustomFieldFactory(); } public IssueModel getIssue(Integer issueId) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(issueId); return issue.getModel(); } public IssueModel[] getAllIssues() throws DataException { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = ifHome.findAll(); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } public int getNumberIssues() throws DataException { Collection issues = ifHome.findAll(); return issues.size(); } public IssueModel[] getIssuesCreatedByUser(Integer userId) throws DataException { return getIssuesCreatedByUser(userId, true); } public IssueModel[] getIssuesCreatedByUser(Integer userId, boolean availableProjectsOnly) throws DataException { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = (availableProjectsOnly ? ifHome.findByCreatorInAvailableProjects(userId, IssueUtilities.STATUS_CLOSED) : ifHome.findByCreator(userId, IssueUtilities.STATUS_CLOSED)); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } public IssueModel[] getIssuesOwnedByUser(Integer userId) throws DataException { return getIssuesOwnedByUser(userId, true); } public IssueModel[] getIssuesOwnedByUser(Integer userId, boolean availableProjectsOnly) throws DataException { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = (availableProjectsOnly ? ifHome.findByOwnerInAvailableProjects(userId, IssueUtilities.STATUS_RESOLVED) : ifHome.findByOwner(userId, IssueUtilities.STATUS_RESOLVED)); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } public IssueModel[] getIssuesWatchedByUser(Integer userId) throws DataException { return getIssuesWatchedByUser(userId, true); } public IssueModel[] getIssuesWatchedByUser(Integer userId, boolean availableProjectsOnly) throws DataException { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = (availableProjectsOnly ? ifHome.findByNotificationInAvailableProjects(userId, IssueUtilities.STATUS_CLOSED) : ifHome.findByNotification(userId, IssueUtilities.STATUS_CLOSED)); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } public IssueModel[] getUnassignedIssues() throws DataException { return getUnassignedIssues(true); } public IssueModel[] getUnassignedIssues(boolean availableProjectsOnly) throws DataException { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = (availableProjectsOnly ? ifHome .findByStatusLessThanEqualToInAvailableProjects(IssueUtilities.STATUS_UNASSIGNED) : ifHome .findByStatusLessThanEqualTo(IssueUtilities.STATUS_UNASSIGNED)); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } /** * * Returns all issues with a status equal to the given status number * * * * @param status * * the status to compare * * @return an array of IssueModels that match the criteria * */ public IssueModel[] getIssuesWithStatus(int status) { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = ifHome.findByStatus(status); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } /** * * Returns all issues with a status less than the given status number * * * * @param status * * the status to compare * * @return an array of IssueModels that match the criteria * * @throws DataException * */ public IssueModel[] getIssuesWithStatusLessThan(int status) throws DataException { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = ifHome.findByStatusLessThan(status); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } /** * * Returns all issues with a severity equal to the given severity number * * * * @param severity * * the severity to compare * * @return an array of IssueModels that match the criteria * */ public IssueModel[] getIssuesWithSeverity(int severity) { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = ifHome.findBySeverity(severity); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } public IssueModel[] getIssuesByProjectId(Integer projectId) { return getIssuesByProjectId(projectId, IssueUtilities.STATUS_END); } public IssueModel[] getIssuesByProjectId(Integer projectId, int status) { int i = 0; IssueModel[] issueArray = new IssueModel[0]; Collection issues = ifHome.findByProjectIdAndLowerStatus(projectId, status); issueArray = new IssueModel[issues.size()]; for (Iterator iterator = issues.iterator(); iterator.hasNext(); i++) { issueArray[i] = ((IssueBean) iterator.next()).getModel(); } return issueArray; } public UserModel getIssueCreator(Integer issueId) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(issueId); UserBean user = issue.getCreator(); return (user != null ? user.getModel() : null); } public UserModel getIssueOwner(Integer issueId) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(issueId); UserBean user = issue.getOwner(); return (user != null ? user.getModel() : null); } public ComponentModel[] getIssueComponents(Integer issueId) throws DataException { int i = 0; ComponentModel[] componentArray = new ComponentModel[0]; IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection components = issue.getComponents(); componentArray = new ComponentModel[components.size()]; for (Iterator iterator = components.iterator(); iterator.hasNext(); i++) { componentArray[i] = ((ComponentBean) iterator.next()).getModel(); } return componentArray; } public VersionModel[] getIssueVersions(Integer issueId) throws DataException { int i = 0; VersionModel[] versionArray = new VersionModel[0]; IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection versions = issue.getVersions(); versionArray = new VersionModel[versions.size()]; for (Iterator iterator = versions.iterator(); iterator.hasNext(); i++) { versionArray[i] = ((VersionBean) iterator.next()).getModel(); } return versionArray; } public IssueAttachmentModel[] getIssueAttachments(Integer issueId) throws DataException { int i = 0; IssueAttachmentModel[] attachmentsArray = new IssueAttachmentModel[0]; IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection attachments = issue.getAttachments(); attachmentsArray = new IssueAttachmentModel[attachments.size()]; for (Iterator iterator = attachments.iterator(); iterator.hasNext(); i++) { attachmentsArray[i] = ((IssueAttachmentBean) iterator.next()).getModel(); } return attachmentsArray; } /** * Old implementation is left here, commented, because it checked for * history entry status. This feature was not finished, I think (RJST) */ public IssueHistoryModel[] getIssueHistory(Integer issueId) { return (ifHome.findByPrimaryKey(issueId).getModel().getHistory()); /* * int i = 0; * * IssueHistoryModel[] historyArray = new IssueHistoryModel[0]; * * Vector results = new Vector(); * * new IssueBean().getModel().getHistory() * * Collection history = ifHome.findByIssueId(issueId); * * historyArray = new IssueHistoryModel[history.size()]; * * for (Iterator iterator = history.iterator(); iterator.hasNext(); i++) { * * IssueHistoryBean entry = (IssueHistoryBean) iterator.next(); * * if (entry.getStatus() == IssueUtilities.HISTORY_STATUS_AVAILABLE) { * * results.addElement(entry.getModel()); } } * * historyArray = new IssueHistoryModel[results.size()]; * * results.copyInto(historyArray); * * * * return historyArray; */ } public IssueModel createIssue(IssueModel model, Integer projectId, Integer userId, Integer createdById) throws DataException { try { ProjectBean project = pfHome.findByPrimaryKey(projectId); UserBean creator = ufHome.findByPrimaryKey(userId); if (project.getStatus() != ProjectUtilities.STATUS_ACTIVE) { throw new IssueException("Project is not active."); } IssueBean issue = new IssueBean(); if (issue != null) { if (createdById == null || createdById.equals(userId)) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_ISSUE_CREATED); activity.setUser(creator); activity.setIssue(issue); } else { UserBean createdBy = ufHome.findByPrimaryKey(createdById); IssueActivityBean activity = new IssueActivityBean(); activity.setDescription(ITrackerResources.getString("itracker.activity.system.createdfor") + " " + creator.getFirstName() + " " + creator.getLastName()); activity.setUser(createdBy); activity.setIssue(issue); NotificationModel watchModel = new NotificationModel(); watchModel.setUserId(createdById); watchModel.setIssueId(issue.getId()); watchModel.setNotificationRole(NotificationUtilities.ROLE_IP); addIssueNotification(watchModel); } issue.setModel(model); issue.setProject(project); issue.setCreator(creator); // save issue.setCreateDate(new Timestamp(new Date().getTime())); ifHome.save(issue); return issue.getModel(); } } catch (IssueException ie) { Logger.logInfo("Error while creating new issue: " + ie.getMessage()); } return null; } public IssueModel updateIssue(IssueModel model, Integer userId) throws DataException { try { String existingTargetVersion = null; IssueBean issue = ifHome.findByPrimaryKey(model.getId()); UserBean user = ufHome.findByPrimaryKey(userId); if (issue.getProject().getStatus() != ProjectUtilities.STATUS_ACTIVE) { throw new IssueException("Project is not active."); } if (issue.getDescription() != null && model.getDescription() != null && !issue.getDescription().equalsIgnoreCase(model.getDescription())) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_DESCRIPTION_CHANGE); activity.setDescription(ITrackerResources.getString("itracker.web.generic.from") + ": " + issue.getDescription()); activity.setUser(user); activity.setIssue(issue); } if (issue.getResolution() != null && model.getResolution() != null && !issue.getResolution().equalsIgnoreCase(model.getResolution())) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_RESOLUTION_CHANGE); activity.setDescription(ITrackerResources.getString("itracker.web.generic.from") + ": " + issue.getResolution()); activity.setIssue(issue); activity.setUser(user); } if (issue.getStatus() != model.getStatus() && model.getStatus() != -1) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_STATUS_CHANGE); activity.setDescription(IssueUtilities.getStatusName(issue.getStatus()) + " " + ITrackerResources.getString("itracker.web.generic.to") + " " + IssueUtilities.getStatusName(model.getStatus())); activity.setIssue(issue); activity.setUser(user); } if (issue.getSeverity() != model.getSeverity() && model.getSeverity() != -1) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_SEVERITY_CHANGE); activity.setDescription(IssueUtilities.getSeverityName(issue.getSeverity()) + " " + ITrackerResources.getString("itracker.web.generic.to") + " " + IssueUtilities.getSeverityName(model.getSeverity())); activity.setIssue(issue); activity.setUser(user); } if (issue.getTargetVersion() != null && model.getTargetVersion() != null && !issue.getTargetVersion().getId().equals(model.getTargetVersionId())) { existingTargetVersion = issue.getTargetVersion().getNumber(); } issue.setModel(model); if (model.getTargetVersion() != null) { VersionBean version = VersionFactory.findByPrimaryKey(model.getTargetVersionId()); issue.setTargetVersion(version); IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_TARGETVERSION_CHANGE); String description = existingTargetVersion + " " + ITrackerResources.getString("itracker.web.generic.to") + " "; description += version.getNumber(); activity.setDescription(description); activity.setUser(user); activity.setIssue(issue); } else { issue.setTargetVersion(null); } // save ifHome.saveOrUpdate(issue); return issue.getModel(); } catch (IssueException ie) { Logger.logInfo("Error while updating new issue: " + ie.getMessage()); } return null; } /** * * Moves an issues from its current project to a new project. * * * * @param issue * * an IssueModel 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 IssueModel of the issue after it has been moved * * @throws DataException * */ public IssueModel moveIssue(IssueModel model, Integer projectId, Integer userId) throws DataException { if (model == null) { return null; } IssueBean issue = ifHome.findByPrimaryKey(model.getId()); ProjectBean project = pfHome.findByPrimaryKey(projectId); UserBean user = ufHome.findByPrimaryKey(userId); IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_ISSUE_MOVE); activity.setDescription(model.getProjectName() + " " + ITrackerResources.getString("itracker.web.generic.to") + " " + project.getName()); activity.setUser(user); activity.setIssue(issue); issue.setProject(project); // The versions and components are per project so we need to delete // these setIssueComponents(issue.getId(), new HashSet(), userId); setIssueVersions(issue.getId(), new HashSet(), userId); return issue.getModel(); } public boolean deleteIssue(IssueModel model) throws DataException { if (model != null) { IssueBean issue = ifHome.findByPrimaryKey(model.getId()); ifHome.delete(issue); return true; } return false; } /** * this should not exist. adding an history entry should be adding the history entry * to the domain object and saving the object... */ public boolean addIssueHistory(IssueHistoryModel model) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(model.getIssueId()); UserBean user = ufHome.findByPrimaryKey(model.getUserId()); IssueHistoryBean history = new IssueHistoryBean(); history.setModel(model); history.setIssue(issue); history.setUser(user); history.setCreateDate(new Timestamp(new Date().getTime())); ifHome.saveOrUpdate(history); return true; } public boolean setIssueFields(Integer issueId, IssueFieldModel[] fields) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection issueFields = issue.getFields(); for (Iterator iter = issueFields.iterator(); iter.hasNext();) { // try { IssueFieldBean field = (IssueFieldBean) iter.next(); // iter.remove(); // field.remove(); // } catch(RemoveException re) { // Logger.logInfo("Unable to remove issue field value. Manual // database cleanup may be necessary."); // } } if (fields.length > 0) { for (int i = 0; i < fields.length; i++) { IssueFieldBean field = new IssueFieldBean(); CustomFieldBean customField = cfHome.findByPrimaryKey(fields[i].getCustomFieldId()); field.setModel(fields[i]); field.setCustomField(customField); field.setIssue(issue); field.setDateValue(new Timestamp(new Date().getTime())); issueFields.add(field); } } return true; } public boolean setIssueComponents(Integer issueId, HashSet componentIds, Integer userId) throws DataException { boolean wasChanged = false; StringBuffer changesBuf = new StringBuffer(); IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection components = issue.getComponents(); if (componentIds.isEmpty() && components != null && !components.isEmpty()) { wasChanged = true; changesBuf.append(ITrackerResources.getString("itracker.web.generic.all") + " " + ITrackerResources.getString("itracker.web.generic.removed")); components.clear(); } else { for (Iterator iterator = components.iterator(); iterator.hasNext();) { ComponentBean component = (ComponentBean) iterator.next(); if (componentIds.contains(component.getId())) { componentIds.remove(component.getId()); } else { wasChanged = true; changesBuf.append(ITrackerResources.getString("itracker.web.generic.removed") + ": " + component.getName() + "; "); iterator.remove(); } } for (Iterator iterator = componentIds.iterator(); iterator.hasNext();) { Integer componentId = (Integer) iterator.next(); ComponentBean component = componentFactory.findByPrimaryKey(componentId); wasChanged = true; changesBuf.append(ITrackerResources.getString("itracker.web.generic.added") + ": " + component.getName() + "; "); components.add(component); } } if (wasChanged) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_COMPONENTS_MODIFIED); activity.setDescription(changesBuf.toString()); activity.setIssue(issue); // activity.setUser(); // userId); -> I think we need to set user here } return true; } public boolean setIssueVersions(Integer issueId, HashSet versionIds, Integer userId) throws DataException { boolean wasChanged = false; StringBuffer changesBuf = new StringBuffer(); IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection versions = issue.getVersions(); if (versionIds.isEmpty() && versions != null && !versions.isEmpty()) { wasChanged = true; changesBuf.append(ITrackerResources.getString("itracker.web.generic.all") + " " + ITrackerResources.getString("itracker.web.generic.removed")); versions.clear(); } else { for (Iterator iterator = versions.iterator(); iterator.hasNext();) { VersionBean version = (VersionBean) iterator.next(); if (versionIds.contains(version.getId())) { versionIds.remove(version.getId()); } else { wasChanged = true; changesBuf.append(ITrackerResources.getString("itracker.web.generic.removed") + ": " + version.getNumber() + "; "); iterator.remove(); } } for (Iterator iterator = versionIds.iterator(); iterator.hasNext();) { Integer versionId = (Integer) iterator.next(); VersionBean version = VersionFactory.findByPrimaryKey(versionId); wasChanged = true; changesBuf.append(ITrackerResources.getString("itracker.web.generic.added") + ": " + version.getNumber() + "; "); versions.add(version); } } if (wasChanged) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_VERSIONS_MODIFIED); activity.setDescription(changesBuf.toString()); activity.setIssue(issue); // need to set user here // userId); } return true; } public IssueRelationModel getIssueRelation(Integer relationId) throws DataException { IssueRelationBean issueRelation = issuerelationfactory.findByPrimaryKey(relationId); return issueRelation.getModel(); } public boolean addIssueRelation(Integer issueId, Integer relatedIssueId, int relationType, Integer userId) throws DataException { if (issueId != null && relatedIssueId != null) { int matchingRelationType = IssueUtilities.getMatchingRelationType(relationType); // if(matchingRelationType < 0) { // throw new CreateException("Unable to find matching relation type // for type: " + relationType); // } IssueBean issue = ifHome.findByPrimaryKey(issueId); IssueBean relatedIssue = ifHome.findByPrimaryKey(relatedIssueId); IssueRelationBean relationA = new IssueRelationBean(); relationA.setRelationType(relationType); // relationA.setMatchingRelationId(relationBId); relationA.setIssue(issue); relationA.setRelatedIssue(relatedIssue); relationA.setLastModifiedDate(new java.sql.Timestamp(new java.util.Date().getTime())); IssueRelationBean relationB = new IssueRelationBean(); relationB.setRelationType(matchingRelationType); // relationB.setMatchingRelationId(relationAId); relationB.setIssue(relatedIssue); relationB.setRelatedIssue(issue); relationB.setLastModifiedDate(new java.sql.Timestamp(new java.util.Date().getTime())); IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_RELATION_ADDED); activity.setDescription(ITrackerResources.getString("itracker.activity.relation.add")); // probably add this to description // new Object[] {IssueUtilities.getRelationName(relationType), // relatedIssueId }; activity.setIssue(issue); // need to set user here... userId); // need to save here activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_RELATION_ADDED); activity.setDescription(ITrackerResources.getString("itracker.activity.relation.add", new Object[] { IssueUtilities.getRelationName(matchingRelationType) })); activity.setIssue(relatedIssue); // net to save and set user here.. userId); return true; } return false; } public Integer removeIssueRelation(Integer relationId, Integer userId) { Integer issueId = new Integer(-1); try { IssueRelationBean issueRelation = issuerelationfactory.findByPrimaryKey(relationId); issueId = issueRelation.getIssue().getId(); Integer relatedIssueId = issueRelation.getRelatedIssue().getId(); Integer matchingRelationId = issueRelation.getMatchingRelationId(); if (matchingRelationId != null) { IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_RELATION_REMOVED); activity.setDescription(ITrackerResources.getString("itracker.activity.relation.removed", issueId .toString())); // need to fix the commented code and save // activity.setIssue(relatedIssueId); // activity.setUser(userId); // IssueRelationFactory.remove(matchingRelationId); } IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_RELATION_REMOVED); activity.setDescription(ITrackerResources.getString("itracker.activity.relation.removed", relatedIssueId .toString())); // activity.setIssue(issueId); // activity.setUser(userId); // irHome.remove(relationId); // need to save } catch (Exception e) { Logger.logDebug("Exception while removing issue relation.", e); } return issueId; } public boolean assignIssue(Integer issueId, Integer userId) throws DataException { return assignIssue(issueId, userId, userId); } public boolean assignIssue(Integer issueId, Integer userId, Integer assignedByUserId) throws DataException { if (userId.intValue() == -1) { return unassignIssue(issueId, assignedByUserId); } UserBean assignedByUser; IssueBean issue = ifHome.findByPrimaryKey(issueId); UserBean user = ufHome.findByPrimaryKey(userId); if (assignedByUserId.equals(userId)) { assignedByUser = user; } else { assignedByUser = ufHome.findByPrimaryKey(assignedByUserId); } UserBean currOwner = issue.getOwner(); if (currOwner == null || !currOwner.getId().equals(user.getId())) { if (currOwner != null && !hasIssueNotification(issueId, currOwner.getId(), NotificationUtilities.ROLE_CONTRIBUTER)) { NotificationBean notification = new NotificationBean(); NotificationModel model = new NotificationModel(NotificationUtilities.ROLE_CONTRIBUTER); notification.setModel(model); notification.setIssue(issue); notification.setUser(currOwner); } IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_OWNER_CHANGE); activity.setDescription((currOwner == null ? "[" + ITrackerResources.getString("itracker.web.generic.unassigned") + "]" : currOwner.getLogin()) + " " + ITrackerResources.getString("itracker.web.generic.to") + " " + user.getLogin()); activity.setUser(assignedByUser); activity.setIssue(issue); issue.setOwner(user); if (issue.getStatus() < IssueUtilities.STATUS_ASSIGNED) { issue.setStatus(IssueUtilities.STATUS_ASSIGNED); } } return true; } public boolean unassignIssue(Integer issueId, Integer assignedByUserId) throws DataException { UserBean assignedByUser = ufHome.findByPrimaryKey(assignedByUserId); IssueBean issue = ifHome.findByPrimaryKey(issueId); if (issue.getOwner() != null) { if (!hasIssueNotification(issueId, issue.getOwner().getId(), NotificationUtilities.ROLE_CONTRIBUTER)) { NotificationBean notification = new NotificationBean(); NotificationModel model = new NotificationModel(NotificationUtilities.ROLE_CONTRIBUTER); notification.setModel(model); notification.setIssue(issue); notification.setUser(issue.getOwner()); } IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_OWNER_CHANGE); activity.setDescription((issue.getOwner() == null ? "[" + ITrackerResources.getString("itracker.web.generic.unassigned") + "]" : issue.getOwner() .getLogin()) + " " + ITrackerResources.getString("itracker.web.generic.to") + " [" + ITrackerResources.getString("itracker.web.generic.unassigned") + "]"); activity.setUser(assignedByUser); activity.setIssue(issue); issue.setOwner(null); if (issue.getStatus() >= IssueUtilities.STATUS_ASSIGNED) { issue.setStatus(IssueUtilities.STATUS_UNASSIGNED); } } return true; } /* * public boolean addIssueActivity(IssueActivityModel model) throws * DataException { * * IssueBean issue = ifHome.findByPrimaryKey(model.getIssueId()); * * UserBean user = ufHome.findByPrimaryKey(model.getUserId()); * * //return addIssueActivity(model, issue, user); return * addIssueActivity(null, issue, user); } */ /* * public boolean addIssueActivity(IssueActivityModel model, IssueBean * issue) throws DataException { * * UserBean user = ufHome.findByPrimaryKey(model.getUserId()); * * return true;//addIssueActivity(model, issue, user); } */ /** * I think this entire method is useless - RJST * * @param model * @param issue * @param user * @return */ /* * public boolean addIssueActivity(IssueActivityBean model, IssueBean issue, * UserBean user) { * * IssueActivityBean activity = new IssueActivityBean(); * * //activity.setModel(model); * * activity.setIssue(issue); * * activity.setUser(user); * * return true; } */ public void updateIssueActivityNotification(Integer issueId, boolean notificationSent) { if (issueId == null) { return; } Collection activity = IssueActivityFactory.findByIssueId(issueId); for (Iterator iter = activity.iterator(); iter.hasNext();) { ((IssueActivityBean) iter.next()).setNotificationSent((notificationSent ? 1 : 0)); } } public boolean addIssueAttachment(IssueAttachmentModel model, byte[] data) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(model.getIssueId()); UserBean user = ufHome.findByPrimaryKey(model.getUserId()); IssueAttachmentBean attachment = new IssueAttachmentBean(); model.setFileName("attachment" + attachment.getId()); attachment.setModel(model); attachment.setFileData((data == null ? new byte[0] : data)); attachment.setIssue(issue); attachment.setUser(user); return true; } public boolean setIssueAttachmentData(Integer attachmentId, byte[] data) { if (attachmentId != null && data != null) { IssueAttachmentBean attachment = IssueAttachmentFactory.findByPrimaryKey(attachmentId); attachment.setFileData(data); return true; } return false; } public boolean setIssueAttachmentData(String fileName, byte[] data) { if (fileName != null && data != null) { IssueAttachmentBean attachment = IssueAttachmentFactory.findByFileName(fileName); attachment.setFileData(data); return true; } return false; } public boolean removeIssueAttachment(Integer attachmentId) { IssueAttachmentFactory.remove(attachmentId); return true; } public Integer removeIssueHistoryEntry(Integer entryId, Integer userId) throws DataException { IssueHistoryBean history = ihfHome.findByPrimaryKey(entryId); if (history != null) { history.setStatus(IssueUtilities.HISTORY_STATUS_REMOVED); history.setLastModifiedDate(new Timestamp(new Date().getTime())); IssueActivityBean activity = new IssueActivityBean(); activity.setType(IssueUtilities.ACTIVITY_REMOVE_HISTORY); activity.setDescription(ITrackerResources.getString("itracker.web.generic.entry") + " " + entryId + " " + ITrackerResources.getString("itracker.web.generic.removed") + "."); // need to fix this - RJST // activity.setIssue(history.getIssue().getId()); // activity.setUser(userId); return history.getIssue().getId(); } return new Integer(-1); } public ProjectModel getIssueProject(Integer issueId) throws DataException { IssueBean issue = ifHome.findByPrimaryKey(issueId); ProjectBean project = issue.getProject(); return (project != null ? project.getModel() : null); } public HashSet getIssueComponentIds(Integer issueId) throws DataException { HashSet componentIds = new HashSet(); IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection components = issue.getComponents(); for (Iterator iterator = components.iterator(); iterator.hasNext();) { componentIds.add(((ComponentBean) iterator.next()).getId()); } return componentIds; } public HashSet getIssueVersionIds(Integer issueId) throws DataException { HashSet versionIds = new HashSet(); IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection versions = issue.getVersions(); for (Iterator iterator = versions.iterator(); iterator.hasNext();) { versionIds.add(((VersionBean) iterator.next()).getId()); } return versionIds; } public IssueActivityBean[] getIssueActivity(Integer issueId) { int i = 0; IssueActivityBean[] activityArray = new IssueActivityBean[0]; Collection activity = IssueActivityFactory.findByIssueId(issueId); activityArray = new IssueActivityBean[activity.size()]; for (Iterator iterator = activity.iterator(); iterator.hasNext(); i++) { activityArray[i] = ((IssueActivityBean) iterator.next());// .getModel(); } return activityArray; } public IssueActivityBean[] getIssueActivity(Integer issueId, boolean notificationSent) { int i = 0; IssueActivityBean[] activityArray = new IssueActivityBean[0]; Collection activity = IssueActivityFactory.findByIssueIdAndNotification(issueId, (notificationSent ? 1 : 0)); activityArray = new IssueActivityBean[activity.size()]; for (Iterator iterator = activity.iterator(); iterator.hasNext(); i++) { activityArray[i] = ((IssueActivityBean) iterator.next());// .getModel(); } return activityArray; } public IssueAttachmentModel[] getAllIssueAttachments() { int i = 0; IssueAttachmentModel[] attachmentArray = new IssueAttachmentModel[0]; Collection attachments = IssueAttachmentFactory.findAll(); attachmentArray = new IssueAttachmentModel[attachments.size()]; for (Iterator iterator = attachments.iterator(); iterator.hasNext(); i++) { attachmentArray[i] = ((IssueAttachmentBean) iterator.next()).getModel(); } return attachmentArray; } public long[] getAllIssueAttachmentsSizeAndCount() { long[] sizeAndCount = new long[2]; int i = 0; Collection attachments = IssueAttachmentFactory.findAll(); sizeAndCount[1] = attachments.size(); for (Iterator iterator = attachments.iterator(); iterator.hasNext(); i++) { sizeAndCount[0] += ((IssueAttachmentBean) iterator.next()).getSize(); } return sizeAndCount; } public IssueAttachmentModel getIssueAttachment(Integer attachmentId) { IssueAttachmentModel attachmentModel = null; IssueAttachmentBean attachment = IssueAttachmentFactory.findByPrimaryKey(attachmentId); attachmentModel = attachment.getModel(); return attachmentModel; } public byte[] getIssueAttachmentData(Integer attachmentId) { byte[] data = new byte[0]; IssueAttachmentBean attachment = IssueAttachmentFactory.findByPrimaryKey(attachmentId); data = attachment.getFileData(); return data; } public int getIssueAttachmentCount(Integer issueId) throws DataException { int i = 0; IssueBean issue = ifHome.findByPrimaryKey(issueId); Collection attachments = issue.getAttachments(); i = attachments.size(); return i; } /** * * 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 IssueHistoryModel, or null if no entries could be * * found * * @throws DataException * */ public IssueHistoryModel getLastIssueHistory(Integer issueId) throws DataException { IssueHistoryModel model = null; IssueHistoryBean lastEntry = null; Collection history = ihfHome.findByIssueId(issueId); Iterator iterator = history.iterator(); while (iterator.hasNext()) { IssueHistoryBean nextEntry = (IssueHistoryBean) iterator.next(); if (nextEntry != null) { if (lastEntry == null && nextEntry.getLastModifiedDate() != null) { lastEntry = nextEntry; } else if (nextEntry.getLastModifiedDate() != null && nextEntry.getLastModifiedDate().equals(lastEntry.getLastModifiedDate()) && nextEntry.getId().compareTo(lastEntry.getId()) > 0) { lastEntry = nextEntry; } else if (nextEntry.getLastModifiedDate() != null && nextEntry.getLastModifiedDate().after(lastEntry.getLastModifiedDate())) { lastEntry = nextEntry; } } } if (lastEntry != null) { model = lastEntry.getModel(); } return model; } /** * * 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 * * @throws DataException * * @returns an array of NotificationModels * */ public NotificationModel[] getPrimaryIssueNotifications(Integer issueId) throws DataException { return getIssueNotifications(issueId, true, false); } /** * * 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 * * @throws DataException * * @returns an array of NotificationModels * */ public NotificationModel[] getIssueNotifications(Integer issueId) throws DataException { return getIssueNotifications(issueId, false, true); } /** * * 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) * * @throws DataException * * @returns an array of NotificationModels * * @see IssueHandlerBean#getPrimaryIssueNotifications * */ public NotificationModel[] getIssueNotifications(Integer issueId, boolean primaryOnly, boolean activeOnly) throws DataException { NotificationModel[] notificationArray = new NotificationModel[0]; Vector notificationVector = new Vector(); IssueBean issue = null; if (!primaryOnly) { Collection notifications = nfHome.findByIssueId(issueId); for (Iterator iterator = notifications.iterator(); iterator.hasNext();) { NotificationBean notification = (NotificationBean) iterator.next(); UserBean notificationUser = notification.getUser(); if (!activeOnly || notificationUser.getStatus() == UserUtilities.STATUS_ACTIVE) { notificationVector.add(notification.getModel()); } } } // Now add in other notifications like owner, creator, project owners, // etc... boolean hasOwner = false; issue = ifHome.findByPrimaryKey(issueId); if (issue.getOwner() != null) { UserModel ownerModel = issue.getOwner().getModel(); if (ownerModel != null && (!activeOnly || ownerModel.getStatus() == UserUtilities.STATUS_ACTIVE)) { notificationVector.add(new NotificationModel(ownerModel, issueId, NotificationUtilities.ROLE_OWNER)); hasOwner = true; } } if (!primaryOnly || !hasOwner) { UserModel creatorModel = issue.getCreator().getModel(); if (creatorModel != null && (!activeOnly || creatorModel.getStatus() == UserUtilities.STATUS_ACTIVE)) { notificationVector .add(new NotificationModel(creatorModel, issueId, NotificationUtilities.ROLE_CREATOR)); } } if (issue != null) { ProjectBean project = pfHome.findByPrimaryKey(issue.getProject().getId()); Collection projectOwners = project.getOwners(); for (Iterator iterator = projectOwners.iterator(); iterator.hasNext();) { UserBean projectOwner = (UserBean) iterator.next(); if (projectOwner != null && (!activeOnly || projectOwner.getStatus() == UserUtilities.STATUS_ACTIVE)) { notificationVector.add(new NotificationModel(projectOwner.getModel(), issueId, NotificationUtilities.ROLE_PO)); } } } notificationArray = new NotificationModel[notificationVector.size()]; notificationVector.copyInto(notificationArray); return notificationArray; } public boolean addIssueNotification(NotificationModel model) throws DataException { if (model != null) { UserBean user = ufHome.findByPrimaryKey(model.getUserId()); IssueBean issue = ifHome.findByPrimaryKey(model.getIssueId()); NotificationBean notification = new NotificationBean(); notification.setModel(model); notification.setIssue(issue); notification.setUser(user); return true; } return false; } public boolean hasIssueNotification(Integer issueId, Integer userId) throws DataException { return hasIssueNotification(issueId, userId, NotificationUtilities.ROLE_ANY); } public boolean hasIssueNotification(Integer issueId, Integer userId, int role) throws DataException { if (issueId != null && userId != null) { NotificationModel[] notifications = getIssueNotifications(issueId, false, false); for (int i = 0; i < notifications.length; i++) { if (role == NotificationUtilities.ROLE_ANY || notifications[i].getNotificationRole() == role) { if (notifications[i].getUserId().equals(userId)) { return true; } } } } return false; } public int getOpenIssueCountByProjectId(Integer projectId) { Collection issues = ifHome.findByProjectIdAndLowerStatus(projectId, IssueUtilities.STATUS_RESOLVED); return issues.size(); } public int getResolvedIssueCountByProjectId(Integer projectId) { Collection issues = ifHome.findByProjectIdAndHigherStatus(projectId, IssueUtilities.STATUS_RESOLVED); return issues.size(); } public int getTotalIssueCountByProjectId(Integer projectId) { Collection issues = ifHome.findByProjectId(projectId); return issues.size(); } public Date getLatestIssueDateByProjectId(Integer projectId) { return ifHome.latestModificationDate(projectId); } public void sendNotification(Integer issueId, int type, String baseURL) { sendNotification(issueId, type, baseURL, null, null); } public void sendNotification(Integer issueId, int type, String baseURL, HashSet addresses, Integer lastModifiedDays) { // notifications are disabled for now /* * try { * * QueueConnectionFactory factory = (QueueConnectionFactory) * ic.lookup("java:comp/env/" + notificationFactoryName); * * Queue notificationQueue = (Queue) ic.lookup("java:comp/env/" + * notificationQueueName); QueueConnection connect = * factory.createQueueConnection(); QueueSession session = * connect.createQueueSession(false, Session.AUTO_ACKNOWLEDGE); * QueueSender sender = session.createSender(notificationQueue); * MapMessage message = session.createMapMessage(); * message.setInt("issueId", issueId.intValue()); message.setInt("type", * type); message.setObject("lastModifiedDays", (lastModifiedDays == * null ? new Integer(-1) : lastModifiedDays)); * * if (systemBaseURL != null && !systemBaseURL.equals("")) { * * message.setString("baseURL", systemBaseURL); } else if (baseURL != * null) { * * message.setString("baseURL", baseURL); } * * if (addresses != null) { * * try { * * ByteArrayOutputStream baos = new ByteArrayOutputStream(); * * ObjectOutputStream oos = new ObjectOutputStream(baos); * * oos.writeObject(addresses); * * message.setObject("addresses", baos.toByteArray()); } catch * (Exception e) { * * Logger.logDebug("Unable to write address list for notification: " + * e.getMessage()); } } * * sender.send(message); } catch (NamingException ne) { * * Logger.logError("Error looking up ConnectionFactory/Queue " + * notificationFactoryName + "/" + notificationQueueName + ".", ne); } * catch (JMSException jmse) { * * Logger.logWarn("Error sending notification message", jmse); } */ } public boolean canViewIssue(Integer issueId, UserModel user) throws DataException { IssueModel issue = getIssue(issueId); HashMap permissions = ufHome.getUserPermissions(user, AuthenticationConstants.REQ_SOURCE_WEB); return IssueUtilities.canViewIssue(issue, user.getId(), permissions); } public boolean canViewIssue(IssueModel issue, UserModel user) { HashMap permissions = ufHome.getUserPermissions(user, AuthenticationConstants.REQ_SOURCE_WEB); return IssueUtilities.canViewIssue(issue, user.getId(), permissions); } } \ No newline at end of file Index: UserHandlerBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session/UserHandlerBean.java,v retrieving revision 1.44.4.2 retrieving revision 1.44.4.3 diff -C2 -d -r1.44.4.2 -r1.44.4.3 *** UserHandlerBean.java 21 Oct 2005 11:14:29 -0000 1.44.4.2 --- UserHandlerBean.java 23 Oct 2005 20:33:28 -0000 1.44.4.3 *************** *** 776,782 **** UserUtilities.PERMISSION_EDIT_USERS)) { users.add(creator); ! } ! UserModel owner = getUser(issue.getOwnerId()); ! if (owner != null) { users.add(owner); } --- 776,782 ---- UserUtilities.PERMISSION_EDIT_USERS)) { users.add(creator); ! } ! if (issue.getOwner() != null) { ! UserModel owner = getUser(issue.getOwnerId()); users.add(owner); } |
From: Ricardo T. <rj...@us...> - 2005-10-23 20:33:39
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv12774/cowsultants/itracker/web/actions Modified Files: Tag: itrackerhibernate EditIssueAction.java EditProjectFormAction.java Log Message: editing issues (including adding history entries) is working again. sending of notifications had to be temporarily disabled. Index: EditProjectFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditProjectFormAction.java,v retrieving revision 1.15.4.2 retrieving revision 1.15.4.3 diff -C2 -d -r1.15.4.2 -r1.15.4.3 *** EditProjectFormAction.java 13 Oct 2005 14:25:54 -0000 1.15.4.2 --- EditProjectFormAction.java 23 Oct 2005 20:33:28 -0000 1.15.4.3 *************** *** 22,27 **** import java.util.HashMap; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 22,25 ---- *************** *** 37,42 **** import org.apache.struts.validator.DynaValidatorForm; import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; - import cowsultants.itracker.ejb.client.interfaces.ProjectHandlerHome; import cowsultants.itracker.ejb.client.models.CustomFieldModel; import cowsultants.itracker.ejb.client.models.ProjectModel; --- 35,40 ---- import org.apache.struts.validator.DynaValidatorForm; + import cowsultants.itracker.ejb.beans.session.ProjectHandlerBean; import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; import cowsultants.itracker.ejb.client.models.CustomFieldModel; import cowsultants.itracker.ejb.client.models.ProjectModel; *************** *** 61,69 **** try { ! InitialContext ic = new InitialContext(); ! ! Object phRef = ic.lookup("java:comp/env/" + ProjectHandler.JNDI_NAME); ! ProjectHandlerHome phHome = (ProjectHandlerHome) PortableRemoteObject.narrow(phRef, ProjectHandlerHome.class); ! ProjectHandler ph = phHome.create(); HttpSession session = request.getSession(true); --- 59,63 ---- try { ! ProjectHandler ph = new ProjectHandlerBean(); HttpSession session = request.getSession(true); Index: EditIssueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditIssueAction.java,v retrieving revision 1.21.4.2 retrieving revision 1.21.4.3 diff -C2 -d -r1.21.4.2 -r1.21.4.3 *** EditIssueAction.java 23 Oct 2005 12:46:01 -0000 1.21.4.2 --- EditIssueAction.java 23 Oct 2005 20:33:28 -0000 1.21.4.3 *************** *** 26,31 **** import java.util.Vector; - import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 26,29 ---- *************** *** 42,49 **** import org.apache.struts.validator.DynaValidatorForm; import cowsultants.itracker.ejb.client.interfaces.IssueHandler; - import cowsultants.itracker.ejb.client.interfaces.IssueHandlerHome; - import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; - import cowsultants.itracker.ejb.client.interfaces.ProjectHandlerHome; import cowsultants.itracker.ejb.client.models.CustomFieldModel; import cowsultants.itracker.ejb.client.models.IssueAttachmentModel; --- 40,45 ---- import org.apache.struts.validator.DynaValidatorForm; + import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; import cowsultants.itracker.ejb.client.interfaces.IssueHandler; import cowsultants.itracker.ejb.client.models.CustomFieldModel; import cowsultants.itracker.ejb.client.models.IssueAttachmentModel; *************** *** 85,96 **** try { ! InitialContext ic = new InitialContext(); ! Object ihRef = ic.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); ! IssueHandlerHome ihHome = (IssueHandlerHome) PortableRemoteObject.narrow(ihRef, IssueHandlerHome.class); ! IssueHandler ih = ihHome.create(); ! ! Object phRef = ic.lookup("java:comp/env/" + ProjectHandler.JNDI_NAME); ! ProjectHandlerHome phHome = (ProjectHandlerHome) PortableRemoteObject.narrow(phRef, ProjectHandlerHome.class); ! ProjectHandler ph = phHome.create(); HttpSession session = request.getSession(true); --- 81,85 ---- try { ! IssueHandler ih = new IssueHandlerBean(); HttpSession session = request.getSession(true); |
From: Marky G. <mar...@us...> - 2005-10-23 17:56:45
|
Update of /cvsroot/itracker/itracker/sql/mysql/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11174/sql/mysql/install Added Files: Tag: itrackerhibernate create_itracker_core_caseproblemsdbonlinux.sql Log Message: renamed the file. --- NEW FILE: create_itracker_core_caseproblemsdbonlinux.sql --- create table IDSTORE ( id VARCHAR(80) PRIMARY KEY, name VARCHAR(80) UNIQUE, last_id VARCHAR(255) ) DEFAULT CHARACTER SET utf8 TYPE=innodb; insert into IDSTORE values ('1', 'idstore', '1'); create table ComponentBean ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255), description VARCHAR(255), status INT, create_date DATETIME, last_modified DATETIME, project_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table IssueBean ( id INT PRIMARY KEY AUTO_INCREMENT, severity INT, status INT, resolution VARCHAR(255), description VARCHAR(255), create_date DATETIME, last_modified DATETIME, target_version_id INT, creator_id INT, owner_id INT, project_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table IssueFieldBean ( id INT PRIMARY KEY AUTO_INCREMENT, field_id INT, string_value VARCHAR(255), int_value INT, date_value DATETIME, issue_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table IssueActivityBean ( id INT PRIMARY KEY AUTO_INCREMENT, activity_type INT, description VARCHAR(255), notification_sent INT, create_date DATETIME, last_modified DATETIME, issue_id INT, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table IssueAttachmentBean ( id INT PRIMARY KEY AUTO_INCREMENT, orig_file_name VARCHAR(255), attachment_type VARCHAR(255), file_name VARCHAR(255), description VARCHAR(255), file_size INT, file_data LONGBLOB, create_date DATETIME, last_modified DATETIME, issue_id INT, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table IssueHistoryBean ( id INT PRIMARY KEY AUTO_INCREMENT, description TEXT, status INT, create_date DATETIME, last_modified DATETIME, issue_id INT, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table IssueRelationBean ( id INT PRIMARY KEY AUTO_INCREMENT, issue_id INT, rel_issue_id INT, relation_type INT, matching_relation_id INT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8; create table NotificationBean ( id INT PRIMARY KEY AUTO_INCREMENT, user_role INT, create_date DATETIME, last_modified DATETIME, issue_id INT, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table PermissionBean ( id INT PRIMARY KEY AUTO_INCREMENT, permission_type INT, create_date DATETIME, last_modified DATETIME, project_id INT, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table ProjectBean ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255), description VARCHAR(255), status INT, options INT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table UserBean ( id INT PRIMARY KEY AUTO_INCREMENT, login VARCHAR(255), user_password VARCHAR(255), first_name VARCHAR(255), last_name VARCHAR(255), email VARCHAR(255), status INT, registration_type INT, super_user INT, create_date DATETIME, last_modified DATETIME, preferences_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table UserPreferencesBean ( id INT PRIMARY KEY AUTO_INCREMENT, save_login INT, user_locale VARCHAR(255), num_items_index INT, num_items_issue_list INT, show_closed INT, sort_column VARCHAR(255), hidden_index_sections INT, remember_last_search INT, use_text_actions INT, create_date DATETIME, last_modified DATETIME, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table VersionBean ( id INT PRIMARY KEY AUTO_INCREMENT, major INT, minor INT, version_number VARCHAR(255), description VARCHAR(255), status INT, create_date DATETIME, last_modified DATETIME, project_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table ScheduledTaskBean ( id INT PRIMARY KEY AUTO_INCREMENT, hours VARCHAR(255), minutes VARCHAR(255), days_of_month VARCHAR(255), months VARCHAR(255), weekdays VARCHAR(255), class_name VARCHAR(255), args TEXT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table ReportBean ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255), name_key VARCHAR(255), description VARCHAR(255), data_type INT, report_type INT, file_data LONGBLOB, class_name TEXT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table ConfigurationBean ( id INT PRIMARY KEY AUTO_INCREMENT, item_type INT, item_order INT, item_value VARCHAR(255), item_version VARCHAR(255), create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table CustomFieldBean ( id INT PRIMARY KEY AUTO_INCREMENT, field_type INT, date_format VARCHAR(255), is_required INT, sort_options_by_name INT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table CustomFieldValueBean ( id INT PRIMARY KEY AUTO_INCREMENT, option_value VARCHAR(255), sort_order INT, custom_field_id INT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table WorkflowScriptBean ( id INT PRIMARY KEY AUTO_INCREMENT, script_name VARCHAR(255), event_type INT, script_data TEXT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8; create table ProjectScriptBean ( id INT PRIMARY KEY AUTO_INCREMENT, project_id INT, field_id INT, script_id INT, script_priority INT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8; create table LanguageBean ( id INT PRIMARY KEY AUTO_INCREMENT, locale VARCHAR(255), resource_key VARCHAR(255), resource_value TEXT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table issue_component_rel ( issue_id INT, component_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table issue_version_rel ( issue_id INT, version_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table project_owner_rel ( project_id INT, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table project_field_rel ( project_id INT, field_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; |
From: Marky G. <mar...@us...> - 2005-10-23 17:56:15
|
Update of /cvsroot/itracker/itracker/sql/mysql In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11046/sql/mysql Modified Files: Tag: itrackerhibernate README.txt Log Message: updated README for MySQL Index: README.txt =================================================================== RCS file: /cvsroot/itracker/itracker/sql/mysql/Attic/README.txt,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** README.txt 20 Oct 2005 07:45:59 -0000 1.1.2.2 --- README.txt 23 Oct 2005 17:56:07 -0000 1.1.2.3 *************** *** 1 **** ! if you have problems running the create_itracker_core.sql Script in MySQL Query Browser tool, then try to run the script from the Shell mysql command. This should work. \ No newline at end of file --- 1,3 ---- ! Ff you have problems running the create_itracker_core.sql Script in MySQL Query Browser tool, then try to run the script from the Shell mysql command. This should work. ! ! If you run Linux for the DB, you might have to use caseproblemsdbonlinux.sql |
From: Marky G. <mar...@us...> - 2005-10-23 17:52:27
|
Update of /cvsroot/itracker/itracker/sql/mysql/install In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10347/sql/mysql/install Added Files: Tag: itrackerhibernate create_itracker_core_caseproblems.sql Log Message: again commit sql for mysql linux --- NEW FILE: create_itracker_core_caseproblems.sql --- create table IDSTORE ( id VARCHAR(80) PRIMARY KEY, name VARCHAR(80) UNIQUE, last_id VARCHAR(255) ) DEFAULT CHARACTER SET utf8 TYPE=innodb; insert into IDSTORE values ('1', 'idstore', '1'); create table ComponentBean ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255), description VARCHAR(255), status INT, create_date DATETIME, last_modified DATETIME, project_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table IssueBean ( id INT PRIMARY KEY AUTO_INCREMENT, severity INT, status INT, resolution VARCHAR(255), description VARCHAR(255), create_date DATETIME, last_modified DATETIME, target_version_id INT, creator_id INT, owner_id INT, project_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table IssueFieldBean ( id INT PRIMARY KEY AUTO_INCREMENT, field_id INT, string_value VARCHAR(255), int_value INT, date_value DATETIME, issue_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table IssueActivityBean ( id INT PRIMARY KEY AUTO_INCREMENT, activity_type INT, description VARCHAR(255), notification_sent INT, create_date DATETIME, last_modified DATETIME, issue_id INT, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table IssueAttachmentBean ( id INT PRIMARY KEY AUTO_INCREMENT, orig_file_name VARCHAR(255), attachment_type VARCHAR(255), file_name VARCHAR(255), description VARCHAR(255), file_size INT, file_data LONGBLOB, create_date DATETIME, last_modified DATETIME, issue_id INT, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table IssueHistoryBean ( id INT PRIMARY KEY AUTO_INCREMENT, description TEXT, status INT, create_date DATETIME, last_modified DATETIME, issue_id INT, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table IssueRelationBean ( id INT PRIMARY KEY AUTO_INCREMENT, issue_id INT, rel_issue_id INT, relation_type INT, matching_relation_id INT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8; create table NotificationBean ( id INT PRIMARY KEY AUTO_INCREMENT, user_role INT, create_date DATETIME, last_modified DATETIME, issue_id INT, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table PermissionBean ( id INT PRIMARY KEY AUTO_INCREMENT, permission_type INT, create_date DATETIME, last_modified DATETIME, project_id INT, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table ProjectBean ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255), description VARCHAR(255), status INT, options INT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table UserBean ( id INT PRIMARY KEY AUTO_INCREMENT, login VARCHAR(255), user_password VARCHAR(255), first_name VARCHAR(255), last_name VARCHAR(255), email VARCHAR(255), status INT, registration_type INT, super_user INT, create_date DATETIME, last_modified DATETIME, preferences_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table UserPreferencesBean ( id INT PRIMARY KEY AUTO_INCREMENT, save_login INT, user_locale VARCHAR(255), num_items_index INT, num_items_issue_list INT, show_closed INT, sort_column VARCHAR(255), hidden_index_sections INT, remember_last_search INT, use_text_actions INT, create_date DATETIME, last_modified DATETIME, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table VersionBean ( id INT PRIMARY KEY AUTO_INCREMENT, major INT, minor INT, version_number VARCHAR(255), description VARCHAR(255), status INT, create_date DATETIME, last_modified DATETIME, project_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table ScheduledTaskBean ( id INT PRIMARY KEY AUTO_INCREMENT, hours VARCHAR(255), minutes VARCHAR(255), days_of_month VARCHAR(255), months VARCHAR(255), weekdays VARCHAR(255), class_name VARCHAR(255), args TEXT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table ReportBean ( id INT PRIMARY KEY AUTO_INCREMENT, name VARCHAR(255), name_key VARCHAR(255), description VARCHAR(255), data_type INT, report_type INT, file_data LONGBLOB, class_name TEXT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table ConfigurationBean ( id INT PRIMARY KEY AUTO_INCREMENT, item_type INT, item_order INT, item_value VARCHAR(255), item_version VARCHAR(255), create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table CustomFieldBean ( id INT PRIMARY KEY AUTO_INCREMENT, field_type INT, date_format VARCHAR(255), is_required INT, sort_options_by_name INT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table CustomFieldValueBean ( id INT PRIMARY KEY AUTO_INCREMENT, option_value VARCHAR(255), sort_order INT, custom_field_id INT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table WorkflowScriptBean ( id INT PRIMARY KEY AUTO_INCREMENT, script_name VARCHAR(255), event_type INT, script_data TEXT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8; create table ProjectScriptBean ( id INT PRIMARY KEY AUTO_INCREMENT, project_id INT, field_id INT, script_id INT, script_priority INT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8; create table LanguageBean ( id INT PRIMARY KEY AUTO_INCREMENT, locale VARCHAR(255), resource_key VARCHAR(255), resource_value TEXT, create_date DATETIME, last_modified DATETIME ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table issue_component_rel ( issue_id INT, component_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table issue_version_rel ( issue_id INT, version_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table project_owner_rel ( project_id INT, user_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; create table project_field_rel ( project_id INT, field_id INT ) DEFAULT CHARACTER SET utf8 TYPE=innodb; |
From: Ricardo T. <rj...@us...> - 2005-10-23 15:42:26
|
Update of /cvsroot/itracker/itracker/web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14458/images Added Files: Tag: itrackerhibernate logo.gif Log Message: deleted logo by mistake...here it is --- NEW FILE: logo.gif --- (This appears to be a binary file; contents omitted.) |
From: Ricardo T. <rj...@us...> - 2005-10-23 15:38:54
|
Update of /cvsroot/itracker/itracker/web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13781/images Removed Files: Tag: itrackerhibernate logo.gif Log Message: deleted logo by mistake... --- logo.gif DELETED --- |
From: Ricardo T. <rj...@us...> - 2005-10-23 15:36:18
|
Update of /cvsroot/itracker/itracker/web/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13350/includes Removed Files: Tag: itrackerhibernate header_gruposumol.jsp Log Message: removed, committed by mistake --- header_gruposumol.jsp DELETED --- |
From: Ricardo T. <rj...@us...> - 2005-10-23 15:36:18
|
Update of /cvsroot/itracker/itracker/web/images In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13350/images Removed Files: Tag: itrackerhibernate logo_sumol.gif Log Message: removed, committed by mistake --- logo_sumol.gif DELETED --- |
From: Ricardo T. <rj...@us...> - 2005-10-23 15:34:00
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13106/cowsultants/itracker/ejb/beans/session Modified Files: Tag: itrackerhibernate BaseFactory.java BaseHibernateFactoryImpl.java IssueSearchBean.java Log Message: getting issue search to work again. since it worked via JDBC and not EJB, getting it to work required adding a method that returns a connection to the BaseFactory. this is of course bad, and the search should be refactored to work via HQL, and this method removed when possible Index: BaseHibernateFactoryImpl.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session/Attic/BaseHibernateFactoryImpl.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** BaseHibernateFactoryImpl.java 18 Oct 2005 22:43:46 -0000 1.1.2.1 --- BaseHibernateFactoryImpl.java 23 Oct 2005 15:33:52 -0000 1.1.2.2 *************** *** 1,4 **** --- 1,6 ---- package cowsultants.itracker.ejb.beans.session; + import java.sql.Connection; + import net.sf.hibernate.HibernateException; *************** *** 10,14 **** * @author rui silva */ ! public class BaseHibernateFactoryImpl extends HibernateDaoSupport { /** --- 12,16 ---- * @author rui silva */ ! public class BaseHibernateFactoryImpl extends HibernateDaoSupport implements BaseFactory { /** *************** *** 38,40 **** --- 40,46 ---- } + public Connection getConnection() { + return(getConnection()); + } + } Index: BaseFactory.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session/Attic/BaseFactory.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** BaseFactory.java 18 Oct 2005 22:43:46 -0000 1.1.2.1 --- BaseFactory.java 23 Oct 2005 15:33:52 -0000 1.1.2.2 *************** *** 1,7 **** --- 1,18 ---- package cowsultants.itracker.ejb.beans.session; + import java.sql.Connection; + public interface BaseFactory { public void save(Object object)throws DataException; public void saveOrUpdate(Object object) throws DataException; + + /** + * This method is a great bastardization of the architecture + * It's here temporarily because the search facility requires connections + * and operates on JDBC. This should be change to work via the service interfaces... + * + * @return + */ + public Connection getConnection(); } Index: IssueSearchBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session/IssueSearchBean.java,v retrieving revision 1.25.2.2 retrieving revision 1.25.2.3 diff -C2 -d -r1.25.2.2 -r1.25.2.3 *** IssueSearchBean.java 18 Oct 2005 20:47:05 -0000 1.25.2.2 --- IssueSearchBean.java 23 Oct 2005 15:33:52 -0000 1.25.2.3 *************** *** 26,37 **** import java.util.Vector; - import javax.ejb.CreateException; - import javax.naming.InitialContext; - import javax.naming.NamingException; import javax.sql.DataSource; import cowsultants.itracker.ejb.client.exceptions.IssueSearchException; import cowsultants.itracker.ejb.client.interfaces.IssueHandler; - import cowsultants.itracker.ejb.client.interfaces.IssueHandlerHome; import cowsultants.itracker.ejb.client.interfaces.IssueSearch; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; --- 26,33 ---- *************** *** 44,117 **** import cowsultants.itracker.ejb.client.util.SystemConfigurationUtilities; - public class IssueSearchBean implements IssueSearch { private static String componentbeanTableName; private static String componentbeanRelTableName; private static String issuebeanTableName; private static String issuehistorybeanTableName; private static String projectbeanTableName; private static String versionbeanTableName; private static String versionbeanRelTableName; private static DataSource ds; ! private InitialContext ic = null; ! private IssueHandlerHome ihHome = null; public IssueSearchBean() { ! try { ! ic = new InitialContext(); ! ihHome = null; ! SystemConfiguration sc = new SystemConfigurationBean(); ! componentbeanTableName = sc.getProperty("componentbean_table_name", SystemConfigurationUtilities.DEFAULT_COMPONENTBEAN_TABLE_NAME); ! componentbeanRelTableName = sc.getProperty("componentbean_rel_table_name", SystemConfigurationUtilities.DEFAULT_COMPONENTBEAN_REL_TABLE_NAME); ! issuebeanTableName = sc.getProperty("issuebean_table_name", SystemConfigurationUtilities.DEFAULT_ISSUEBEAN_TABLE_NAME); ! issuehistorybeanTableName = sc.getProperty("issuehistorybean_table_name", SystemConfigurationUtilities.DEFAULT_ISSUEHISTORYBEAN_TABLE_NAME); ! projectbeanTableName = sc.getProperty("projectbean_table_name", SystemConfigurationUtilities.DEFAULT_PROJECTBEAN_TABLE_NAME); ! versionbeanTableName = sc.getProperty("versionbean_table_name", SystemConfigurationUtilities.DEFAULT_VERSIONBEAN_TABLE_NAME); ! versionbeanRelTableName = sc.getProperty("versionbean_rel_table_name", SystemConfigurationUtilities.DEFAULT_VERSIONBEAN_REL_TABLE_NAME); - ds = (DataSource) ic.lookup(sc.getProperty("default_ds", SystemConfigurationUtilities.DEFAULT_DATASOURCE)); - } catch(NamingException ne) { - Logger.logError("Exception while looking up home interfaces.", ne); - } } ! public IssueModel[] searchIssues(IssueSearchQueryModel queryModel, UserModel user, HashMap permissions) throws IssueSearchException, DataException { ! Connection conn = null; ! if(queryModel == null) { throw new IssueSearchException("Null search query received.", IssueSearchException.ERROR_NULL_QUERY); } try { - conn = ds.getConnection(); - String queryString = ""; ! if(queryModel.getProjects() != null && queryModel.getProjects().length > 0) { Integer[] values = queryModel.getProjects(); queryString += " AND project_id IN ( "; ! for(int i = 0; i < values.length; i++) { ! queryString += (i == 0 ? "": ", ") + values[i].toString(); } queryString += " )"; } ! if(queryModel.getSeverities() != null && queryModel.getSeverities().length > 0) { Integer[] values = queryModel.getSeverities(); queryString += " AND severity IN ( "; ! for(int i = 0; i < values.length; i++) { ! queryString += (i == 0 ? "": ", ") + values[i].toString(); } queryString += " )"; } ! if(queryModel.getStatuses() != null && queryModel.getStatuses().length > 0) { Integer[] values = queryModel.getStatuses(); queryString += " AND i.status IN ( "; ! for(int i = 0; i < values.length; i++) { ! queryString += (i == 0 ? "": ", ") + values[i].toString(); } queryString += " )"; --- 40,120 ---- import cowsultants.itracker.ejb.client.util.SystemConfigurationUtilities; public class IssueSearchBean implements IssueSearch { private static String componentbeanTableName; + private static String componentbeanRelTableName; + private static String issuebeanTableName; + private static String issuehistorybeanTableName; + private static String projectbeanTableName; + private static String versionbeanTableName; + private static String versionbeanRelTableName; private static DataSource ds; ! private IssueHandler ihHome = null; public IssueSearchBean() { ! ihHome = new IssueHandlerBean(); ! SystemConfiguration sc = new SystemConfigurationBean(); ! componentbeanTableName = sc.getProperty("componentbean_table_name", ! SystemConfigurationUtilities.DEFAULT_COMPONENTBEAN_TABLE_NAME); ! componentbeanRelTableName = sc.getProperty("componentbean_rel_table_name", ! SystemConfigurationUtilities.DEFAULT_COMPONENTBEAN_REL_TABLE_NAME); ! issuebeanTableName = sc.getProperty("issuebean_table_name", ! SystemConfigurationUtilities.DEFAULT_ISSUEBEAN_TABLE_NAME); ! issuehistorybeanTableName = sc.getProperty("issuehistorybean_table_name", ! SystemConfigurationUtilities.DEFAULT_ISSUEHISTORYBEAN_TABLE_NAME); ! projectbeanTableName = sc.getProperty("projectbean_table_name", ! SystemConfigurationUtilities.DEFAULT_PROJECTBEAN_TABLE_NAME); ! versionbeanTableName = sc.getProperty("versionbean_table_name", ! SystemConfigurationUtilities.DEFAULT_VERSIONBEAN_TABLE_NAME); ! versionbeanRelTableName = sc.getProperty("versionbean_rel_table_name", ! SystemConfigurationUtilities.DEFAULT_VERSIONBEAN_REL_TABLE_NAME); } ! public IssueModel[] searchIssues(IssueSearchQueryModel queryModel, UserModel user, HashMap permissions) ! throws IssueSearchException, DataException { ! ! // TODO : this should not be done this way... Why are we querying in pure JDBC ! // legacy from EJB, because of finders ? ! Connection conn = SpringFactories.getIssueFactory().getConnection(); ! if (queryModel == null) { throw new IssueSearchException("Null search query received.", IssueSearchException.ERROR_NULL_QUERY); } try { String queryString = ""; ! if (queryModel.getProjects() != null && queryModel.getProjects().length > 0) { Integer[] values = queryModel.getProjects(); queryString += " AND project_id IN ( "; ! for (int i = 0; i < values.length; i++) { ! queryString += (i == 0 ? "" : ", ") + values[i].toString(); } queryString += " )"; } ! if (queryModel.getSeverities() != null && queryModel.getSeverities().length > 0) { Integer[] values = queryModel.getSeverities(); queryString += " AND severity IN ( "; ! for (int i = 0; i < values.length; i++) { ! queryString += (i == 0 ? "" : ", ") + values[i].toString(); } queryString += " )"; } ! if (queryModel.getStatuses() != null && queryModel.getStatuses().length > 0) { Integer[] values = queryModel.getStatuses(); queryString += " AND i.status IN ( "; ! for (int i = 0; i < values.length; i++) { ! queryString += (i == 0 ? "" : ", ") + values[i].toString(); } queryString += " )"; *************** *** 119,128 **** boolean hasComponents = false; ! if(queryModel.getComponents() != null && queryModel.getComponents().length > 0) { hasComponents = true; Integer[] values = queryModel.getComponents(); queryString += " AND c.component_id IN ( "; ! for(int i = 0; i < values.length; i++) { ! queryString += (i == 0 ? "": ", ") + values[i].toString(); } queryString += " )"; --- 122,131 ---- boolean hasComponents = false; ! if (queryModel.getComponents() != null && queryModel.getComponents().length > 0) { hasComponents = true; Integer[] values = queryModel.getComponents(); queryString += " AND c.component_id IN ( "; ! for (int i = 0; i < values.length; i++) { ! queryString += (i == 0 ? "" : ", ") + values[i].toString(); } queryString += " )"; *************** *** 130,177 **** boolean hasVersions = false; ! if(queryModel.getVersions() != null && queryModel.getVersions().length > 0) { hasVersions = true; Integer[] values = queryModel.getVersions(); queryString += " AND v.version_id IN ( "; ! for(int i = 0; i < values.length; i++) { ! queryString += (i == 0 ? "": ", ") + values[i].toString(); } queryString += " )"; } ! if(queryModel.getTargetVersion() != null && queryModel.getTargetVersion().intValue() > 0) { queryString += " AND i.target_version_id = " + queryModel.getTargetVersion(); } ! if(queryModel.getOwner() != null && queryModel.getOwner().intValue() > 0) { queryString += " AND i.owner_id = " + queryModel.getOwner(); } ! if(queryModel.getCreator() != null && queryModel.getCreator().intValue() > 0) { queryString += " AND i.creator_id = " + queryModel.getCreator(); } ! if(queryModel.getContributor() != null && queryModel.getContributor().intValue() > 0) { ! queryString += " AND (ih.user_id = " + queryModel.getContributor() + " OR i.creator_id = " + queryModel.getCreator() + " OR i.owner_id = " + queryModel.getOwner() + ")"; } ! if(queryModel.getText() != null && ! queryModel.getText().equals("")) { ! queryString += " AND (i.description like '%" + HTMLUtilities.removeQuotes(queryModel.getText()) + "%' OR " + ! "ih.description like '%" + HTMLUtilities.removeQuotes(queryModel.getText()) + "%')"; } ! if(queryModel.getResolution() != null && ! queryModel.getResolution().equals("")) { ! queryString += " AND i.resolution like '%" + HTMLUtilities.removeQuotes(queryModel.getResolution()) + "%'"; } ! queryString = "select distinct i.id as id from " + ! issuebeanTableName + " i, " + ! (hasComponents ? componentbeanRelTableName + " c, " : "") + ! (hasVersions ? versionbeanRelTableName + " v, " : "") + ! issuehistorybeanTableName + " ih " + ! "where ih.issue_id = i.id" + ! (hasComponents ? " AND i.id = c.issue_id" : "") + ! (hasVersions ? " AND i.id = v.issue_id" : "") + queryString; ! if(Logger.isLoggingDebug()) { Logger.logDebug("Searching for issues using the following query: " + queryString); } --- 133,180 ---- boolean hasVersions = false; ! if (queryModel.getVersions() != null && queryModel.getVersions().length > 0) { hasVersions = true; Integer[] values = queryModel.getVersions(); queryString += " AND v.version_id IN ( "; ! for (int i = 0; i < values.length; i++) { ! queryString += (i == 0 ? "" : ", ") + values[i].toString(); } queryString += " )"; } ! if (queryModel.getTargetVersion() != null && queryModel.getTargetVersion().intValue() > 0) { queryString += " AND i.target_version_id = " + queryModel.getTargetVersion(); } ! if (queryModel.getOwner() != null && queryModel.getOwner().intValue() > 0) { queryString += " AND i.owner_id = " + queryModel.getOwner(); } ! if (queryModel.getCreator() != null && queryModel.getCreator().intValue() > 0) { queryString += " AND i.creator_id = " + queryModel.getCreator(); } ! if (queryModel.getContributor() != null && queryModel.getContributor().intValue() > 0) { ! queryString += " AND (ih.user_id = " + queryModel.getContributor() + " OR i.creator_id = " ! + queryModel.getCreator() + " OR i.owner_id = " + queryModel.getOwner() + ")"; } ! if (queryModel.getText() != null && !queryModel.getText().equals("")) { ! queryString += " AND (i.description like '%" + HTMLUtilities.removeQuotes(queryModel.getText()) ! + "%' OR " + "ih.description like '%" + HTMLUtilities.removeQuotes(queryModel.getText()) ! + "%')"; } ! if (queryModel.getResolution() != null && !queryModel.getResolution().equals("")) { ! queryString += " AND i.resolution like '%" + HTMLUtilities.removeQuotes(queryModel.getResolution()) ! + "%'"; } ! queryString = "select distinct i.id as id from " + issuebeanTableName + " i, " ! + (hasComponents ? componentbeanRelTableName + " c, " : "") ! + (hasVersions ? versionbeanRelTableName + " v, " : "") + issuehistorybeanTableName + " ih " ! + "where ih.issue_id = i.id" + (hasComponents ? " AND i.id = c.issue_id" : "") ! + (hasVersions ? " AND i.id = v.issue_id" : "") + queryString; ! if (Logger.isLoggingDebug()) { Logger.logDebug("Searching for issues using the following query: " + queryString); } *************** *** 181,204 **** Vector issuesFound = new Vector(); ! while(rs.next()) { issuesFound.add(new Integer(rs.getInt("id"))); } rs.close(); pstmt.close(); ! if(conn != null) { conn.close(); } - IssueHandler ih = ihHome.create(); Vector issuesAvailable = new Vector(); ! for(int i = 0; i < issuesFound.size(); i++) { ! IssueModel issue = ih.getIssue((Integer) issuesFound.elementAt(i)); ! if(IssueUtilities.canViewIssue(issue, user, permissions)) { ! issuesAvailable.add(issue); ! if(Logger.isLoggingDebug()) { Logger.logDebug("Adding viewable issue " + issue.getId() + " to user results."); } ! } else if(Logger.isLoggingDebug()) { Logger.logDebug("Skipping nonviewable issue " + issue.getId()); } --- 184,206 ---- Vector issuesFound = new Vector(); ! while (rs.next()) { issuesFound.add(new Integer(rs.getInt("id"))); } rs.close(); pstmt.close(); ! if (conn != null) { conn.close(); } Vector issuesAvailable = new Vector(); ! for (int i = 0; i < issuesFound.size(); i++) { ! IssueModel issue = ihHome.getIssue((Integer) issuesFound.elementAt(i)); ! if (IssueUtilities.canViewIssue(issue, user, permissions)) { ! issuesAvailable.add(issue); ! if (Logger.isLoggingDebug()) { Logger.logDebug("Adding viewable issue " + issue.getId() + " to user results."); } ! } else if (Logger.isLoggingDebug()) { Logger.logDebug("Skipping nonviewable issue " + issue.getId()); } *************** *** 209,228 **** return issues; ! } catch(CreateException ce) { ! throw new IssueSearchException("CreateException caught while performing search. ", IssueSearchException.ERROR_EJB_EXCEPTION); ! } catch(SQLException sqle) { ! if(Logger.isLoggingDebug()) { Logger.logDebug("SQLException while searching for issue ids. " + sqle.getMessage()); } ! throw new IssueSearchException("SQL Exception caught while performing search.", IssueSearchException.ERROR_SQL_EXCEPTION); } finally { try { ! if(conn != null) { conn.close(); } ! } catch(SQLException sqle) { } } } } - \ No newline at end of file --- 211,228 ---- return issues; ! } catch (SQLException sqle) { ! if (Logger.isLoggingDebug()) { Logger.logDebug("SQLException while searching for issue ids. " + sqle.getMessage()); } ! throw new IssueSearchException("SQL Exception caught while performing search.", ! IssueSearchException.ERROR_SQL_EXCEPTION); } finally { try { ! if (conn != null) { conn.close(); } ! } catch (SQLException sqle) { } } } } |
From: Ricardo T. <rj...@us...> - 2005-10-23 15:34:00
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv13106/cowsultants/itracker/web/actions Modified Files: Tag: itrackerhibernate SearchIssuesAction.java SearchIssuesFormAction.java Log Message: getting issue search to work again. since it worked via JDBC and not EJB, getting it to work required adding a method that returns a connection to the BaseFactory. this is of course bad, and the search should be refactored to work via HQL, and this method removed when possible Index: SearchIssuesFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/SearchIssuesFormAction.java,v retrieving revision 1.12.4.2 retrieving revision 1.12.4.3 diff -C2 -d -r1.12.4.2 -r1.12.4.3 *** SearchIssuesFormAction.java 13 Oct 2005 14:25:54 -0000 1.12.4.2 --- SearchIssuesFormAction.java 23 Oct 2005 15:33:52 -0000 1.12.4.3 *************** *** 63,70 **** try { - //InitialContext ic = new InitialContext(); - - //Object phRef = ic.lookup("java:comp/env/" + ProjectHandler.JNDI_NAME); - //ProjectHandlerHome phHome = (ProjectHandlerHome) PortableRemoteObject.narrow(phRef, ProjectHandlerHome.class); ProjectHandler ph = new ProjectHandlerBean(); --- 63,66 ---- Index: SearchIssuesAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/SearchIssuesAction.java,v retrieving revision 1.16.4.4 retrieving revision 1.16.4.5 diff -C2 -d -r1.16.4.4 -r1.16.4.5 *** SearchIssuesAction.java 23 Oct 2005 12:46:01 -0000 1.16.4.4 --- SearchIssuesAction.java 23 Oct 2005 15:33:52 -0000 1.16.4.5 *************** *** 106,109 **** --- 106,110 ---- } } catch(Exception e) { + Logger.logError(e.getMessage(), e); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("itracker.web.error.system")); } |
From: Marky G. <mar...@us...> - 2005-10-23 14:56:01
|
Update of /cvsroot/itracker/itracker/web/admin In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5781/web/admin Modified Files: Tag: itrackerhibernate edit_configuration.jsp Log Message: corrected some error Index: edit_configuration.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/admin/edit_configuration.jsp,v retrieving revision 1.9.4.2 retrieving revision 1.9.4.3 diff -C2 -d -r1.9.4.2 -r1.9.4.3 *** edit_configuration.jsp 22 Oct 2005 16:03:59 -0000 1.9.4.2 --- edit_configuration.jsp 23 Oct 2005 14:55:53 -0000 1.9.4.3 *************** *** 7,11 **** <%@ page import="javax.naming.*" %> <%@ page import="javax.rmi.*" %> ! <%@ page import="cowsultants.itracker.ejb.beans.session.SystemConfigurationBean" %> <%@ page import="cowsultants.itracker.ejb.client.models.*" %> <%@ page import="cowsultants.itracker.ejb.client.interfaces.*" %> --- 7,11 ---- <%@ page import="javax.naming.*" %> <%@ page import="javax.rmi.*" %> ! <%@ page import="cowsultants.itracker.ejb.beans.session.*" %> <%@ page import="cowsultants.itracker.ejb.client.models.*" %> <%@ page import="cowsultants.itracker.ejb.client.interfaces.*" %> *************** *** 48,52 **** <table border="0" cellspacing="0" cellpadding="0" width="90%" align="center"> <% ! SystemConfiguration sc = SystemConfigurationBean(); HashMap languages = sc.getAvailableLanguages(); --- 48,53 ---- <table border="0" cellspacing="0" cellpadding="0" width="90%" align="center"> <% ! ! SystemConfiguration sc = new SystemConfigurationBean(); HashMap languages = sc.getAvailableLanguages(); |
From: Marky G. <mar...@us...> - 2005-10-23 14:55:48
|
Update of /cvsroot/itracker/itracker/web/help In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5744/web/help Modified Files: Tag: itrackerhibernate show_help.jsp Log Message: corrected some missspelling Index: show_help.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/help/show_help.jsp,v retrieving revision 1.12 retrieving revision 1.12.4.1 diff -C2 -d -r1.12 -r1.12.4.1 *** show_help.jsp 24 Aug 2004 12:34:06 -0000 1.12 --- show_help.jsp 23 Oct 2005 14:55:40 -0000 1.12.4.1 *************** *** 27,31 **** <td align="right" valign="bottom" class="headerText"><it:message key="itracker.web.showhelp.title"/></td> <tr> ! <tr><td colspan="2" class="listHeadingBackground"><html:img page="/iamges/blank.gif" height="2"/></td></tr> </table> <br/> --- 27,31 ---- <td align="right" valign="bottom" class="headerText"><it:message key="itracker.web.showhelp.title"/></td> <tr> ! <tr><td colspan="2" class="listHeadingBackground"><html:img page="/images/blank.gif" height="2"/></td></tr> </table> <br/> |