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-30 21:31:41
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25021/actions Modified Files: Tag: itrackerhibernate CreateIssueFormAction.java Log Message: removed reference to no longer used class Index: CreateIssueFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/CreateIssueFormAction.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 *** CreateIssueFormAction.java 29 Oct 2005 16:56:01 -0000 1.16.4.2 --- CreateIssueFormAction.java 30 Oct 2005 21:31:33 -0000 1.16.4.3 *************** *** 36,40 **** import org.apache.struts.validator.DynaValidatorForm; - import cowsultants.itracker.ejb.beans.session.UserHandlerBean; import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; import cowsultants.itracker.ejb.client.interfaces.UserHandler; --- 36,39 ---- |
From: Marc B. <mb...@us...> - 2005-10-30 18:46:47
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/message In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv24506 Modified Files: Tag: itrackerhibernate NotificationMessageBean.java Log Message: removed dependencies to IssueHandlerHome which has been removed Index: NotificationMessageBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/message/NotificationMessageBean.java,v retrieving revision 1.24.4.2 retrieving revision 1.24.4.3 diff -C2 -d -r1.24.4.2 -r1.24.4.3 *** NotificationMessageBean.java 22 Oct 2005 16:37:28 -0000 1.24.4.2 --- NotificationMessageBean.java 30 Oct 2005 18:46:36 -0000 1.24.4.3 *************** *** 31,40 **** import javax.naming.InitialContext; import javax.naming.NamingException; - import javax.rmi.PortableRemoteObject; import cowsultants.itracker.ejb.beans.entity.IssueActivityBean; 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.ComponentModel; --- 31,39 ---- import javax.naming.InitialContext; import javax.naming.NamingException; import cowsultants.itracker.ejb.beans.entity.IssueActivityBean; + import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; import cowsultants.itracker.ejb.beans.session.SystemConfigurationBean; import cowsultants.itracker.ejb.client.interfaces.IssueHandler; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.models.ComponentModel; *************** *** 61,65 **** MessageDrivenContext ejbContext; Context jndiContext; - IssueHandlerHome ihHome; String fromAddress = ""; --- 60,63 ---- *************** *** 73,78 **** jndiContext = new InitialContext(); - Object ihRef = jndiContext.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); - ihHome = (IssueHandlerHome) PortableRemoteObject.narrow(ihRef, IssueHandlerHome.class); SystemConfiguration sc = new SystemConfigurationBean(); --- 71,74 ---- *************** *** 145,149 **** } ! IssueHandler ih = ihHome.create(); if(addresses == null) { addresses = new HashSet(); --- 141,145 ---- } ! IssueHandler ih = new IssueHandlerBean(); if(addresses == null) { addresses = new HashSet(); *************** *** 247,249 **** } } ! } \ No newline at end of file --- 243,245 ---- } } ! } |
From: Marc B. <mb...@us...> - 2005-10-30 18:41:54
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/scheduler/tasks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23589 Modified Files: Tag: itrackerhibernate MailNotification.java Log Message: make compile. Just commented out as uh (UserHandler) does seem no to be used. Index: MailNotification.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/scheduler/tasks/Attic/MailNotification.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** MailNotification.java 29 Oct 2005 01:54:49 -0000 1.1.2.3 --- MailNotification.java 30 Oct 2005 18:41:46 -0000 1.1.2.4 *************** *** 167,171 **** IssueHandler ih = new IssueHandlerBean(); ProjectHandler ph = new ProjectHandlerBean(); ! UserHandler uh = new UserHandlerBean(); IssueModel issue = new IssueModel(); --- 167,171 ---- IssueHandler ih = new IssueHandlerBean(); ProjectHandler ph = new ProjectHandlerBean(); ! //UserHandler uh = new UserHandlerBean(); IssueModel issue = new IssueModel(); |
From: Marc B. <mb...@us...> - 2005-10-30 18:34:58
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22227 Modified Files: Tag: itrackerhibernate EditWorkflowScriptFormAction.java Log Message: compiles now Index: EditWorkflowScriptFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditWorkflowScriptFormAction.java,v retrieving revision 1.6.4.5 retrieving revision 1.6.4.6 diff -C2 -d -r1.6.4.5 -r1.6.4.6 *** EditWorkflowScriptFormAction.java 30 Oct 2005 01:35:28 -0000 1.6.4.5 --- EditWorkflowScriptFormAction.java 30 Oct 2005 18:34:50 -0000 1.6.4.6 *************** *** 68,72 **** WorkflowScriptModel workflowScript = new WorkflowScriptModel(); if ("update".equals(action)) { ! SystemConfiguration sc = getITrackerServices().getSystemConfigurationHandler(); --- 68,72 ---- WorkflowScriptModel workflowScript = new WorkflowScriptModel(); if ("update".equals(action)) { ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); |
From: Ricardo T. <rj...@us...> - 2005-10-30 17:11:18
|
Update of /cvsroot/itracker/itracker/web In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3349/web Modified Files: Tag: itrackerhibernate index.jsp Log Message: no longer instantiating service layer objetcs Index: index.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/index.jsp,v retrieving revision 1.34.4.5 retrieving revision 1.34.4.6 diff -C2 -d -r1.34.4.5 -r1.34.4.6 *** index.jsp 29 Oct 2005 11:40:27 -0000 1.34.4.5 --- index.jsp 30 Oct 2005 17:10:21 -0000 1.34.4.6 *************** *** 6,17 **** <%@ page import="java.util.Arrays" %> - <%@ page import="javax.naming.*" %> - <%@ page import="javax.rmi.*" %> <%@ page import="cowsultants.itracker.ejb.client.models.*" %> <%@ page import="cowsultants.itracker.ejb.client.util.*" %> <%@ page import="cowsultants.itracker.ejb.client.interfaces.*" %> <%@ page import="cowsultants.itracker.ejb.client.resources.ITrackerResources" %> - <%@ page import="org.springframework.beans.factory.access.*" %> - <%@ page import="cowsultants.itracker.ejb.beans.session.*" %> <it:checkLogin/> --- 6,13 ---- *************** *** 23,29 **** <% ! IssueHandler ih = new IssueHandlerBean(); ! ProjectHandler ph = new ProjectHandlerBean(); ! UserHandler uh = new UserHandlerBean(); Integer currUserId = currUser.getId(); UserPreferencesModel userPrefs = (UserPreferencesModel) session.getAttribute("preferences"); --- 19,25 ---- <% ! IssueHandler ih = ServletContextUtils.getItrackerServices(getServletContext()).getIssueHandler(); ! ProjectHandler ph = ServletContextUtils.getItrackerServices(getServletContext()).getProjectHandler(); ! UserHandler uh = ServletContextUtils.getItrackerServices(getServletContext()).getUserHandler(); Integer currUserId = currUser.getId(); UserPreferencesModel userPrefs = (UserPreferencesModel) session.getAttribute("preferences"); |
From: Ricardo T. <rj...@us...> - 2005-10-30 17:08:04
|
Update of /cvsroot/itracker/itracker/web/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2539/web/WEB-INF Modified Files: Tag: itrackerhibernate web.xml Log Message: removed a configured servlet that is no longer a servlet Index: web.xml =================================================================== RCS file: /cvsroot/itracker/itracker/web/WEB-INF/Attic/web.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 *** web.xml 29 Oct 2005 11:43:17 -0000 1.1.2.3 --- web.xml 30 Oct 2005 17:07:56 -0000 1.1.2.4 *************** *** 89,97 **** <servlet-class>cowsultants.itracker.web.servlets.ReportDownloadController</servlet-class> </servlet> - <servlet> - <servlet-name>SchedulerController</servlet-name> - <servlet-class>cowsultants.itracker.web.servlets.SchedulerController</servlet-class> - <load-on-startup>1</load-on-startup> - </servlet> <servlet-mapping> --- 89,92 ---- |
From: Ricardo T. <rj...@us...> - 2005-10-30 17:01:54
|
Update of /cvsroot/itracker/itracker/web/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32739/web/WEB-INF Modified Files: Tag: itrackerhibernate applicationContext.xml Log Message: more service layer objects created via spring more dependency injection, less spring factories based lookups Index: applicationContext.xml =================================================================== RCS file: /cvsroot/itracker/itracker/web/WEB-INF/Attic/applicationContext.xml,v retrieving revision 1.1.2.6 retrieving revision 1.1.2.7 diff -C2 -d -r1.1.2.6 -r1.1.2.7 *** applicationContext.xml 30 Oct 2005 15:31:16 -0000 1.1.2.6 --- applicationContext.xml 30 Oct 2005 17:01:42 -0000 1.1.2.7 *************** *** 20,25 **** <property name="sessionFactory"> <ref bean="sessionFactory"/> ! </property> ! </bean> <!-- The language factory --> --- 20,25 ---- <property name="sessionFactory"> <ref bean="sessionFactory"/> ! </property> ! </bean> <!-- The language factory --> *************** *** 59,70 **** <!-- The userpreferences factory --> ! <bean id="userPreferencesFactoryTarget" class="cowsultants.itracker.ejb.beans.session.UserPreferencesFactoryImpl"> <property name="sessionFactory"> <ref bean="sessionFactory"/> ! </property> </bean> <!-- The permission factory --> ! <bean id="permissionFactoryTarget" class="cowsultants.itracker.ejb.beans.session.PermissionFactoryImpl"> <property name="sessionFactory"> <ref bean="sessionFactory"/> --- 59,71 ---- <!-- The userpreferences factory --> ! <bean id="userPreferencesFactoryTarget" class="cowsultants.itracker.ejb.beans.session.UserPreferencesFactoryImpl" autowire="autodetect"> <property name="sessionFactory"> <ref bean="sessionFactory"/> ! </property> ! <constructor-arg ref="userFactory"/> </bean> <!-- The permission factory --> ! <bean id="permissionFactoryTarget" class="cowsultants.itracker.ejb.beans.session.PermissionFactoryImpl" autowire="byName"> <property name="sessionFactory"> <ref bean="sessionFactory"/> *************** *** 77,80 **** --- 78,82 ---- <ref bean="sessionFactory"/> </property> + <constructor-arg ref="userFactory"/> </bean> *************** *** 83,94 **** <property name="sessionFactory"> <ref bean="sessionFactory"/> ! </property> </bean> <!-- The notification factory --> ! <bean id="notificationFactoryTarget" class="cowsultants.itracker.ejb.beans.session.NotificationFactoryImpl"> <property name="sessionFactory"> <ref bean="sessionFactory"/> ! </property> </bean> --- 85,96 ---- <property name="sessionFactory"> <ref bean="sessionFactory"/> ! </property> </bean> <!-- The notification factory --> ! <bean id="notificationFactoryTarget" class="cowsultants.itracker.ejb.beans.session.NotificationFactoryImpl" autowire="byName"> <property name="sessionFactory"> <ref bean="sessionFactory"/> ! </property> </bean> *************** *** 97,101 **** <property name="sessionFactory"> <ref bean="sessionFactory"/> ! </property> </bean> --- 99,103 ---- <property name="sessionFactory"> <ref bean="sessionFactory"/> ! </property> </bean> *************** *** 104,108 **** <property name="sessionFactory"> <ref bean="sessionFactory"/> ! </property> </bean> --- 106,110 ---- <property name="sessionFactory"> <ref bean="sessionFactory"/> ! </property> </bean> *************** *** 122,126 **** <property name="postInterceptors"> <list> ! <ref bean="myHibernateInterceptor"/> </list> </property> --- 124,128 ---- <property name="postInterceptors"> <list> ! <ref bean="myHibernateInterceptor"/> </list> </property> *************** *** 450,460 **** </bean> - <!-- Hibernate interceptor, opens and closes sessions --> - <!-- bean id="OpenSessionInViewInterceptor" class="org.springframework.orm.hibernate.support.OpenSessionInViewInterceptor"> - <property name="sessionFactory"> - <ref bean="sessionFactory"/> - </property> - </bean --> - <bean id="transactionManager" class="org.springframework.orm.hibernate.HibernateTransactionManager"> <property name="sessionFactory"><ref local="sessionFactory"/></property> --- 452,455 ---- *************** *** 467,480 **** </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> ! <bean id="userHandler" class="cowsultants.itracker.ejb.beans.session.UserHandlerBean" autowire="byName"> </bean> <bean id="projectHandler" class="cowsultants.itracker.ejb.beans.session.ProjectHandlerBean" autowire="byName"> ! </bean> <!-- Override properties specified in this file with properties from a properties file --> <!-- Usefull for db passwords, etc.. --> --- 462,496 ---- </bean> ! <bean id="applicationInitialization" class="cowsultants.itracker.core.ApplicationInitialization" autowire="constructor"> </bean> ! <bean id="schedulerController" class="cowsultants.itracker.web.servlets.SchedulerController" autowire="autodetect"> </bean> ! ! <bean id="issueHandler" class="cowsultants.itracker.ejb.beans.session.IssueHandlerBean" autowire="byName"> </bean> + <bean id="projectHandler" class="cowsultants.itracker.ejb.beans.session.ProjectHandlerBean" autowire="byName"> ! </bean> + <bean id="systemConfiguration" class="cowsultants.itracker.ejb.beans.session.SystemConfigurationBean" autowire="byName"> + </bean> + + <bean id="userHandler" class="cowsultants.itracker.ejb.beans.session.UserHandlerBean" autowire="autodetect"> + <constructor-arg ref="userFactory"/> + </bean> + + <bean id="schedulerHandler" class="cowsultants.itracker.ejb.beans.session.SchedulerHandlerBean"> + <constructor-arg ref="scheduledTaskFactory"/> + </bean> + + <!-- Initialize ITracker Resources --> + <bean id="resources-init" class="org.springframework.beans.factory.config.MethodInvokingFactoryBean"> + <property name="staticMethod"> + <value>cowsultants.itracker.ejb.client.resources.ITrackerResources.setSystemConfiguration</value> + </property> + <property name="arguments" ref="systemConfiguration"/> + </bean> + <!-- Override properties specified in this file with properties from a properties file --> <!-- Usefull for db passwords, etc.. --> *************** *** 483,487 **** <value>/WEB-INF/server.properties</value> </property> ! </bean> </beans> --- 499,503 ---- <value>/WEB-INF/server.properties</value> </property> ! </bean> </beans> |
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv30547 Modified Files: Tag: itrackerhibernate IssueFactory.java IssueFactoryImpl.java IssueHandlerBean.java IssueHistoryFactoryImpl.java IssueSearchBean.java ITrackerServices.java ITrackerServicesImpl.java NotificationFactoryImpl.java PermissionFactory.java PermissionFactoryImpl.java ProjectHandlerBean.java SchedulerHandlerBean.java SpringFactories.java SystemConfigurationBean.java UserHandlerBean.java UserPreferencesFactoryImpl.java Log Message: removed several methods from springfactories now data access objects are injected by spring in the service layer objects fixed new project creation, user creation and editing Index: ITrackerServicesImpl.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session/Attic/ITrackerServicesImpl.java,v retrieving revision 1.1.2.3 retrieving revision 1.1.2.4 diff -C2 -d -r1.1.2.3 -r1.1.2.4 *** ITrackerServicesImpl.java 29 Oct 2005 00:36:16 -0000 1.1.2.3 --- ITrackerServicesImpl.java 30 Oct 2005 16:52:11 -0000 1.1.2.4 *************** *** 3,6 **** --- 3,7 ---- import cowsultants.itracker.ejb.client.interfaces.IssueHandler; import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; + import cowsultants.itracker.ejb.client.interfaces.SchedulerHandler; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.interfaces.UserHandler; *************** *** 36,39 **** --- 37,41 ---- private ProjectHandler projectHandler; private SystemConfiguration systemConfigurationHandler; + private SchedulerHandler schedulerHandler; public ScheduledTaskFactory getScheduledTaskFactory() { *************** *** 181,190 **** } ! public SystemConfiguration getSystemConfigurationHandler() { return systemConfigurationHandler; } ! public void setSystemConfigurationHandler(SystemConfiguration systemConfigurationHandler) { this.systemConfigurationHandler = systemConfigurationHandler; } } --- 183,200 ---- } ! public SystemConfiguration getSystemConfiguration() { return systemConfigurationHandler; } ! public void setSystemConfiguration(SystemConfiguration systemConfigurationHandler) { this.systemConfigurationHandler = systemConfigurationHandler; } + + public SchedulerHandler getSchedulerHandler() { + return schedulerHandler; + } + + public void setSchedulerHandler(SchedulerHandler schedulerHandler) { + this.schedulerHandler = schedulerHandler; + } } Index: UserPreferencesFactoryImpl.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session/Attic/UserPreferencesFactoryImpl.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 *** UserPreferencesFactoryImpl.java 11 Oct 2005 01:36:08 -0000 1.1.2.1 --- UserPreferencesFactoryImpl.java 30 Oct 2005 16:52:13 -0000 1.1.2.2 *************** *** 12,17 **** public class UserPreferencesFactoryImpl extends HibernateDaoSupport implements UserPreferencesFactory { public UserPreferencesBean findByUserId(Integer userId) throws DataException { ! UserBean user = SpringFactories.getUserFactory().findByPrimaryKey(userId); Criteria criteria = getSession().createCriteria(UserPreferencesBean.class); --- 12,24 ---- public class UserPreferencesFactoryImpl extends HibernateDaoSupport implements UserPreferencesFactory { + private UserFactory userFactory; + + public UserPreferencesFactoryImpl(UserFactory userFactory) { + super(); + this.userFactory = userFactory; + } + public UserPreferencesBean findByUserId(Integer userId) throws DataException { ! UserBean user = userFactory.findByPrimaryKey(userId); Criteria criteria = getSession().createCriteria(UserPreferencesBean.class); *************** *** 23,26 **** } } - } --- 30,32 ---- Index: SystemConfigurationBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session/SystemConfigurationBean.java,v retrieving revision 1.31.4.5 retrieving revision 1.31.4.6 diff -C2 -d -r1.31.4.5 -r1.31.4.6 *** SystemConfigurationBean.java 25 Oct 2005 22:14:18 -0000 1.31.4.5 --- SystemConfigurationBean.java 30 Oct 2005 16:52:11 -0000 1.31.4.6 *************** *** 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.Arrays; import java.util.Date; import java.util.Collection; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.Locale; import java.util.Properties; import java.util.Vector; import javax.naming.InitialContext; import cowsultants.itracker.ejb.beans.entity.ConfigurationBean; import cowsultants.itracker.ejb.beans.entity.CustomFieldBean; import cowsultants.itracker.ejb.beans.entity.CustomFieldValueBean; import cowsultants.itracker.ejb.beans.entity.LanguageBean; import cowsultants.itracker.ejb.beans.entity.WorkflowScriptBean; import cowsultants.itracker.ejb.client.exceptions.SystemConfigurationException; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.models.ConfigurationModel; import cowsultants.itracker.ejb.client.models.CustomFieldModel; import cowsultants.itracker.ejb.client.models.CustomFieldValueModel; import cowsultants.itracker.ejb.client.models.LanguageModel; import cowsultants.itracker.ejb.client.models.NameValuePairModel; import cowsultants.itracker.ejb.client.models.SystemConfigurationModel; import cowsultants.itracker.ejb.client.models.WorkflowScriptModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.ejb.client.util.IssueUtilities; import cowsultants.itracker.ejb.client.util.Logger; import cowsultants.itracker.ejb.client.util.SystemConfigurationUtilities; import cowsultants.itracker.ejb.util.PropertiesFileHandler; /** * * Implimetation of the SystemConfiguration Interface. * * @see SystemConfiguration * */ public class SystemConfigurationBean implements SystemConfiguration { private static Properties props = null; InitialContext ic = null; ConfigurationFactory cHome = null; CustomFieldFactory cfHome = null; CustomFieldValueFactory cfvHome = null; LanguageFactory lHome = null; WorkflowScriptFactory wsHome = null; public SystemConfigurationBean() { if (props == null) { props = new Properties(); // try { // ic = new InitialContext(); // NamingEnumeration bindings = ic.listBindings("java:comp/env"); // while(bindings.hasMoreElements()) { // try { // Binding namePair = (Binding) bindings.nextElement(); // Logger.logDebug("Setting property " + namePair.getName() + " from // env-entry to value '" + ((Object) // namePair.getObject()).toString() + "'"); // props.setProperty(namePair.getName(), ((Object) // namePair.getObject()).toString()); // } catch(ClassCastException cce) { // Logger.logError("ClassCastException while loading application // properties.", cce); // } // } // } catch(NamingException ne) { // Logger.logError("NamingException while loading application // properties.", ne); // } PropertiesFileHandler filePropertiesHandler = new PropertiesFileHandler(); filePropertiesHandler.addProperties("/itrackerApplication.properties"); filePropertiesHandler.addProperties("/itrackerVersion.properties"); Properties fileProps = filePropertiesHandler.getProperties(); for (Enumeration e = fileProps.propertyNames(); e.hasMoreElements();) { String propName = (String) e.nextElement(); Logger.logDebug("Setting property " + propName + " from file to value '" + fileProps.getProperty(propName) + "'"); props.setProperty(propName, fileProps.getProperty(propName)); } props.setProperty("start_time_millis", Long.toString(new java.util.Date().getTime())); /* * try { * * InitialContext ic = new InitialContext(); * * try { * * DataSource ds = (DataSource) * ic.lookup(props.getProperty("default_ds", * SystemConfigurationUtilities.DEFAULT_DATASOURCE)); } * catch(NamingException testne) { * * DataSource ds = (DataSource) ic.lookup("java:/" + * props.getProperty("default_ds")); * * props.setProperty("default_ds", "java:/" + * props.getProperty("default_ds")); * * Logger.logWarn("Error in datasource, changed to '" + * props.getProperty("default_ds") + "'"); } } catch(NamingException * ne) { * * Logger.logError("NamingException while checking DataSource.", * ne); } */ } // initialize Factories... cHome = SpringFactories.getConfigurationFactory(); lHome = SpringFactories.getLanguageFactory(); cfHome = SpringFactories.getCustomFieldFactory(); wsHome = SpringFactories.getWorkflowScriptFactory(); } public String getProperty(String name) { return props.getProperty(name); } public String getProperty(String name, String defaultValue) { return props.getProperty(name, defaultValue); } public boolean getBooleanProperty(String name, boolean defaultValue) { String value = props.getProperty(name); return (value == null ? defaultValue : new Boolean(value).booleanValue()); } public int getIntegerProperty(String name, int defaultValue) { String value = props.getProperty(name); try { return (value == null ? defaultValue : Integer.parseInt(value)); } catch (NumberFormatException nfe) { return defaultValue; } } public long getLongProperty(String name, long defaultValue) { String value = props.getProperty(name); try { return (value == null ? defaultValue : Long.parseLong(value)); } catch (NumberFormatException nfe) { return defaultValue; } } public Properties getProperties() { return props; } public ConfigurationModel getConfigurationItem(Integer id) { ConfigurationBean configItem = cHome.findByPrimaryKey(id); return configItem.getModel(); } public ConfigurationModel[] getConfigurationItemsByType(int type) throws DataException { ConfigurationModel[] items = new ConfigurationModel[0]; Collection configItems = cHome.findByType(type); items = new ConfigurationModel[configItems.size()]; int i = 0; for (Iterator iter = configItems.iterator(); iter.hasNext(); i++) { items[i] = ((ConfigurationBean) iter.next()).getModel(); } Arrays.sort(items, new ConfigurationModel()); return items; } public ConfigurationModel[] getConfigurationItemsByType(int type, Locale locale) throws DataException { ConfigurationModel[] items = getConfigurationItemsByType(type); for (int i = 0; i < items.length; i++) { if (items[i].getType() == SystemConfigurationUtilities.TYPE_STATUS) { items[i].setName(IssueUtilities.getStatusName(items[i].getValue(), locale)); } else if (items[i].getType() == SystemConfigurationUtilities.TYPE_SEVERITY) { items[i].setName(IssueUtilities.getSeverityName(items[i].getValue(), locale)); } else if (items[i].getType() == SystemConfigurationUtilities.TYPE_RESOLUTION) { items[i].setName(IssueUtilities.getResolutionName(items[i].getValue(), locale)); } } return items; } public ConfigurationModel createConfigurationItem(ConfigurationModel model) { ConfigurationBean configurationItem = new ConfigurationBean(); configurationItem.setModel(model); configurationItem.setCreateDate( new Timestamp( new Date().getTime())); cHome.saveOrUpdate(configurationItem); return configurationItem.getModel(); } public ConfigurationModel updateConfigurationItem(ConfigurationModel model) { if (model != null) { ConfigurationBean configurationItem = cHome.findByPrimaryKey(model.getId()); configurationItem.setModel(model); return configurationItem.getModel(); } return (null); } public ConfigurationModel[] updateConfigurationItems(ConfigurationModel[] models, int type) throws DataException { removeConfigurationItems(type); for (int i = 0; i < models.length; i++) { ConfigurationBean configurationItem = new ConfigurationBean(); configurationItem.setModel(models[i]); models[i] = configurationItem.getModel(); } Arrays.sort(models, new ConfigurationModel()); return models; // Logger.logDebug("Unable to create new language item."); // return new ConfigurationModel[0]; } public void removeConfigurationItem(Integer id) { // cHome.remove(id); // Logger.logDebug("Unable to remove configuration item " + id + "."); } public void removeConfigurationItems(int type) throws DataException { Collection currentItems = cHome.findByType(type); for (Iterator iter = currentItems.iterator(); iter.hasNext();) { ConfigurationBean config = (ConfigurationBean) iter.next(); // config.remove(); } } public void removeConfigurationItems(ConfigurationModel model) throws DataException { Vector currentIds = new Vector(); Collection currentItems = cHome.findByTypeAndValue(model.getType(), model.getValue()); for (Iterator iter = currentItems.iterator(); iter.hasNext();) { ConfigurationBean configItem = (ConfigurationBean) iter.next(); cHome.delete(configItem); } } public boolean configurationItemExists(ConfigurationModel model) throws DataException { if (model != null && model.getVersion() != null) { Collection configItems = cHome.findByTypeAndValue(model.getType(), model.getValue()); if (configItems != null && configItems.size() > 0) { return true; } } return false; } public boolean configurationItemUpToDate(ConfigurationModel model) throws DataException { long currentVersion = 0; if (model != null && model.getVersion() != null) { Collection configItems = cHome.findByTypeAndValue(model.getType(), model.getValue()); for (Iterator iter = configItems.iterator(); iter.hasNext();) { ConfigurationBean configItem = (ConfigurationBean) iter.next(); if (configItem != null) { currentVersion = Math.max(SystemConfigurationUtilities.getVersionAsLong(configItem.getVersion()), currentVersion); } } if (currentVersion >= SystemConfigurationUtilities.getVersionAsLong(model.getVersion())) { return true; } } return false; } public void resetConfigurationCache() throws DataException { IssueUtilities.setResolutions(getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_RESOLUTION)); IssueUtilities.setSeverities(getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_SEVERITY)); IssueUtilities.setStatuses(getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_STATUS)); IssueUtilities.setCustomFields(getCustomFields()); } public void resetConfigurationCache(int type) throws DataException { if (type == SystemConfigurationUtilities.TYPE_RESOLUTION) { IssueUtilities.setResolutions(getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_RESOLUTION)); } else if (type == SystemConfigurationUtilities.TYPE_SEVERITY) { IssueUtilities.setSeverities(getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_SEVERITY)); } else if (type == SystemConfigurationUtilities.TYPE_STATUS) { IssueUtilities.setStatuses(getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_STATUS)); } else if (type == SystemConfigurationUtilities.TYPE_CUSTOMFIELD) { IssueUtilities.setCustomFields(getCustomFields()); } } public WorkflowScriptModel getWorkflowScript(Integer id) { WorkflowScriptBean workflowScript = wsHome.findByPrimaryKey(id); return workflowScript.getModel(); } public WorkflowScriptModel[] getWorkflowScripts() { WorkflowScriptModel[] scripts = new WorkflowScriptModel[0]; Collection workflowScripts = wsHome.findAll(); scripts = new WorkflowScriptModel[workflowScripts.size()]; int i = 0; for (Iterator iter = workflowScripts.iterator(); iter.hasNext(); i++) { scripts[i] = ((WorkflowScriptBean) iter.next()).getModel(); } return scripts; } public WorkflowScriptModel createWorkflowScript(WorkflowScriptModel model) { // try { WorkflowScriptBean workflowScript = new WorkflowScriptBean(); workflowScript.setModel(model); model.setId(workflowScript.getId()); return workflowScript.getModel(); // } catch(CreateException ce) { // Logger.logDebug("Unable to create new workflow script.", ce); // } // return null; } public WorkflowScriptModel updateWorkflowScript(WorkflowScriptModel model) { if (model != null) { WorkflowScriptBean workflowScript = wsHome.findByPrimaryKey(model.getId()); workflowScript.setModel(model); return workflowScript.getModel(); } return null; } public CustomFieldModel getCustomField(Integer id) throws DataException { CustomFieldBean customField = cfHome.findByPrimaryKey(id); return customField.getModel(); } public CustomFieldModel[] getCustomFields() throws DataException { CustomFieldModel[] fields = new CustomFieldModel[0]; Collection customFields = cfHome.findAll(); fields = new CustomFieldModel[customFields.size()]; int i = 0; for (Iterator iter = customFields.iterator(); iter.hasNext(); i++) { fields[i] = ((CustomFieldBean) iter.next()).getModel(); } return fields; } public CustomFieldModel[] getCustomFields(Locale locale) throws DataException { CustomFieldModel[] fields = getCustomFields(); for (int i = 0; i < fields.length; i++) { fields[i].setLabels(locale); } return fields; } public CustomFieldModel createCustomField(CustomFieldModel model) throws DataException { CustomFieldBean customField = new CustomFieldBean(); customField.setModel(model); model.setId(customField.getId()); if (model.getOptions().length > 0) { removeCustomFieldValues(customField.getId()); CustomFieldValueModel[] newOptions = model.getOptions(); for (int i = 0; i < newOptions.length; i++) { newOptions[i].setCustomFieldId(customField.getId()); createCustomFieldValue(newOptions[i]); } } return customField.getModel(); // Logger.logDebug("Unable to create new custom field.", ce); } public CustomFieldModel updateCustomField(CustomFieldModel model) throws DataException { if (model != null) { CustomFieldBean customField = cfHome.findByPrimaryKey(model.getId()); customField.setModel(model); if (model.getOptions().length > 0) { removeCustomFieldValues(customField.getId()); CustomFieldValueModel[] newOptions = model.getOptions(); for (int i = 0; i < newOptions.length; i++) { createCustomFieldValue(newOptions[i]); } } return customField.getModel(); } return null; } public void removeCustomField(Integer customFieldId) throws DataException { CustomFieldBean customField = cfHome.findByPrimaryKey(customFieldId); // customField.remove(); } public CustomFieldValueModel getCustomFieldValue(Integer id) { // CustomFieldValueBean customFieldValue = cfvHome.findByPrimaryKey(id); // return customFieldValue.getModel(); return (null); } public CustomFieldValueModel createCustomFieldValue(CustomFieldValueModel model) throws DataException { if (model == null || model.getCustomFieldId() == null) { return null; } CustomFieldBean customField = cfHome.findByPrimaryKey(model.getCustomFieldId()); CustomFieldValueBean customFieldValue = new CustomFieldValueBean(); customFieldValue.setModel(model); customFieldValue.setCustomField(customField); return customFieldValue.getModel(); // Logger.logDebug("Unable to create new custom field value: " + // ce.getMessage()); // Logger.logDebug("Unable to create new custom field value, custom // field not found: " + fe.getMessage()); } public CustomFieldValueModel updateCustomFieldValue(CustomFieldValueModel model) { // if(model != null) { // CustomFieldValueBean customFieldValue = // cfvHome.findByPrimaryKey(model.getId()); // customFieldValue.setModel(model); // return customFieldValue.getModel(); // } return null; } public CustomFieldValueModel[] updateCustomFieldValues(Integer customFieldId, CustomFieldValueModel[] models) throws DataException { CustomFieldValueModel[] values = new CustomFieldValueModel[0]; if (customFieldId != null) { CustomFieldBean customField = cfHome.findByPrimaryKey(customFieldId); Collection currValues = customField.getValues(); for (Iterator iter = currValues.iterator(); iter.hasNext();) { if (models == null || models.length == 0) { // ((CustomFieldValueBean) iter.next()).remove(); } else { CustomFieldValueBean value = (CustomFieldValueBean) iter.next(); for (int i = 0; i < models.length; i++) { if (value.getId().equals(models[i].getId())) { value.setModel(models[i]); models[i] = value.getModel(); break; } } } } } Arrays.sort(models, new CustomFieldValueModel()); return models; } public void removeCustomFieldValue(Integer customFieldValueId) { // CustomFieldValueBean customFieldValue = // cfvHome.findByPrimaryKey(customFieldValueId); // customFieldValue.remove(); } public void removeCustomFieldValues(Integer customFieldId) { // Collection currentValues = cfvHome.findByCustomField(customFieldId); // for(Iterator iter = currentValues.iterator(); iter.hasNext(); ) { // // //((CustomFieldValueBean) iter.next()).remove(); // } } public LanguageModel getLanguageItemByKey(String key, Locale locale) throws DataException { LanguageModel model = null; if (key != null) { LanguageBean languageItem = lHome.findByKeyAndLocale(key, ITrackerResources.BASE_LOCALE); model = languageItem.getModel(); if (locale != null && !"".equals(locale.getLanguage())) { languageItem = lHome.findByKeyAndLocale(key, locale.getLanguage()); model = languageItem.getModel(); if (!"".equals(locale.getCountry())) { languageItem = lHome.findByKeyAndLocale(key, locale.toString()); model = languageItem.getModel(); } } } return model; } public LanguageModel[] getLanguageItemsByKey(String key) throws DataException { LanguageModel[] items = new LanguageModel[0]; Collection languageItems = lHome.findByKey(key); items = new LanguageModel[languageItems.size()]; int i = 0; for (Iterator iter = languageItems.iterator(); iter.hasNext(); i++) { items[i] = ((LanguageBean) iter.next()).getModel(); } return items; } public LanguageModel updateLanguageItem(LanguageModel model) throws DataException { LanguageBean languageItem; try { languageItem = lHome.findByKeyAndLocale(model.getResourceKey(), model.getLocale()); languageItem.setModel(model); } catch (NoSuchEntityException fe) { languageItem = new LanguageBean(); languageItem.setCreateDate(new Timestamp(new Date().getTime())); languageItem.setModel(model); lHome.saveOrUpdate(languageItem); } return languageItem.getModel(); } public void removeLanguageKey(String key) throws DataException { Vector currentIds = new Vector(); Collection languageItems = lHome.findByKey(key); for (Iterator iter = languageItems.iterator(); iter.hasNext();) { currentIds.add(((LanguageBean) iter.next()).getId()); } for (int i = 0; i < currentIds.size(); i++) { // lHome.remove((Integer) currentIds.elementAt(i)); } // } catch(FinderException ce) { // Logger.logDebug("Unable to find any language items with key" + key + // " for removal."); // } } public void removeLanguageItem(LanguageModel model) throws DataException { LanguageBean languageItem = lHome.findByKeyAndLocale(model.getResourceKey(), model.getLocale()); // lHome.remove(languageItem.getId()); // Logger.logDebug("Unable to remove language item " + model.toString() // + "."); } public String[] getSortedKeys() throws DataException { String[] sortedKeys = new String[0]; int i = 0; Collection items = lHome.findByLocale(ITrackerResources.BASE_LOCALE); sortedKeys = new String[items.size()]; for (Iterator iter = items.iterator(); iter.hasNext(); i++) { LanguageBean item = (LanguageBean) iter.next(); sortedKeys[i] = item.getResourceKey(); } // Now sort the list of keys in a logical manner Arrays.sort(sortedKeys); return sortedKeys; } public HashMap getDefinedKeys(String locale) throws DataException { HashMap keys = new HashMap(); if (locale == null || locale.equals("")) { locale = ITrackerResources.BASE_LOCALE; } Collection items = lHome.findByLocale(locale); for (Iterator iter = items.iterator(); iter.hasNext();) { LanguageBean item = (LanguageBean) iter.next(); keys.put(item.getResourceKey(), item.getResourceValue()); } return keys; } public NameValuePairModel[] getDefinedKeysAsArray(String locale) throws DataException { NameValuePairModel[] keys = new NameValuePairModel[0]; if (locale == null || locale.equals("")) { locale = ITrackerResources.BASE_LOCALE; } int i = 0; Collection items = lHome.findByLocale(locale); keys = new NameValuePairModel[items.size()]; for (Iterator iter = items.iterator(); iter.hasNext(); i++) { LanguageBean item = (LanguageBean) iter.next(); keys[i] = new NameValuePairModel(item.getResourceKey(), item.getResourceValue()); } Arrays.sort(keys, new NameValuePairModel()); return keys; } public int getNumberDefinedKeys(String locale) throws DataException { return getDefinedKeys(locale).size(); } public LanguageModel[] getLanguage(Locale locale) throws DataException { LanguageModel[] languageArray = new LanguageModel[0]; HashMap language = new HashMap(); Collection baseItems = lHome.findByLocale(ITrackerResources.BASE_LOCALE); for (Iterator iterator = baseItems.iterator(); iterator.hasNext();) { LanguageBean item = (LanguageBean) iterator.next(); language.put(item.getResourceKey(), item.getResourceValue()); } if (locale != null && !"".equals(locale.getLanguage())) { Collection languageItems = lHome.findByLocale(locale.getLanguage()); for (Iterator iterator = languageItems.iterator(); iterator.hasNext();) { LanguageBean item = (LanguageBean) iterator.next(); language.put(item.getResourceKey(), item.getResourceValue()); } if (!"".equals(locale.getCountry())) { Collection countryItems = lHome.findByLocale(locale.toString()); for (Iterator iterator = countryItems.iterator(); iterator.hasNext();) { LanguageBean item = (LanguageBean) iterator.next(); language.put(item.getResourceKey(), item.getResourceValue()); } } } languageArray = new LanguageModel[language.size()]; int i = 0; String localeString = (locale == null ? ITrackerResources.BASE_LOCALE : locale.toString()); for (Iterator iterator = language.keySet().iterator(); iterator.hasNext(); i++) { String key = (String) iterator.next(); languageArray[i] = new LanguageModel(localeString, key, (String) language.get(key)); } return languageArray; } public HashMap getAvailableLanguages() throws DataException { HashMap languages = new HashMap(); ConfigurationModel[] locales = getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_LOCALE); for (int i = 0; i < locales.length; i++) { if (ITrackerResources.BASE_LOCALE.equalsIgnoreCase(locales[i].getValue())) { continue; } if (locales[i].getValue().length() == 2) { languages.put(locales[i].getValue(), new Vector()); } } for (int i = 0; i < locales.length; i++) { if (ITrackerResources.BASE_LOCALE.equalsIgnoreCase(locales[i].getValue())) { continue; } String locale = locales[i].getValue(); if (locale.length() == 5 && locale.indexOf('_') == 2) { String baseLanguage = locale.substring(0, 2); Vector languageVector = (Vector) languages.get(baseLanguage); if (languageVector != null) { languageVector.addElement(locale); } } } return languages; } public int getNumberAvailableLanguages() throws DataException { int numLanguages = 0; HashMap availableLanguages = getAvailableLanguages(); for (Iterator iter = availableLanguages.keySet().iterator(); iter.hasNext();) { Vector language = (Vector) availableLanguages.get((String) iter.next()); if (language != null && language.size() > 0) { numLanguages += language.size(); } else { numLanguages += 1; } } return numLanguages; } public void updateLanguage(Locale locale, LanguageModel[] items) throws DataException { if (locale != null && items != null) { ConfigurationModel configItem = new ConfigurationModel(SystemConfigurationUtilities.TYPE_LOCALE, locale .toString(), props.getProperty("version")); updateLanguage(locale, items, configItem); } } public void updateLanguage(Locale locale, LanguageModel[] items, ConfigurationModel configItem) throws DataException { if (items == null || locale == null || configItem == null) { return; } for (int i = 0; i < items.length; i++) { if (items[i] != null) { if (items[i].getAction() == SystemConfigurationUtilities.ACTION_REMOVE) { removeLanguageItem(items[i]); } else { updateLanguageItem(items[i]); } } } removeConfigurationItems(configItem); createConfigurationItem(configItem); } public SystemConfigurationModel getSystemConfiguration(Locale locale) throws DataException { SystemConfigurationModel config = new SystemConfigurationModel(); // Load the basic system configuration ConfigurationModel[] resolutions = getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_RESOLUTION); for (int i = 0; i < resolutions.length; i++) { resolutions[i].setName(ITrackerResources.getString(SystemConfigurationUtilities .getLanguageKey(resolutions[i]), locale)); } config.setResolutions(resolutions); ConfigurationModel[] severities = getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_SEVERITY); for (int i = 0; i < severities.length; i++) { severities[i].setName(ITrackerResources.getString(SystemConfigurationUtilities .getLanguageKey(severities[i]), locale)); } config.setSeverities(severities); ConfigurationModel[] statuses = getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_STATUS); for (int i = 0; i < statuses.length; i++) { statuses[i].setName(ITrackerResources.getString(SystemConfigurationUtilities.getLanguageKey(statuses[i]), locale)); } config.setStatuses(statuses); // Now load the CustomFields config.setCustomFields(IssueUtilities.getCustomFields(locale)); // Now set the system version config.setVersion(props.getProperty("version")); return config; } public boolean initializeLocale(String locale, boolean forceReload) throws DataException { boolean result = false; ConfigurationModel localeConfig = new ConfigurationModel(SystemConfigurationUtilities.TYPE_LOCALE, locale, props.getProperty("version")); if (!configurationItemUpToDate(localeConfig) || forceReload) { Logger.logDebug("Loading database with locale " + locale); PropertiesFileHandler localePropertiesHandler = new PropertiesFileHandler( "/cowsultants/itracker/ejb/client/resources/ITracker" + (ITrackerResources.BASE_LOCALE.equals(locale) ? "" : "_" + locale) + ".properties"); if (localePropertiesHandler.hasProperties()) { Properties localeProperties = localePropertiesHandler.getProperties(); Logger.logDebug("Locale " + locale + " contains " + localeProperties.size() + " properties."); for (Enumeration propertiesEnumeration = localeProperties.propertyNames(); propertiesEnumeration .hasMoreElements();) { String key = (String) propertiesEnumeration.nextElement(); String value = localeProperties.getProperty(key); updateLanguageItem(new LanguageModel(locale, key, value)); } removeConfigurationItems(localeConfig); createConfigurationItem(localeConfig); ITrackerResources.clearBundle(ITrackerResources.getLocale(locale)); result = true; } else { Logger.logInfo("Locale " + locale + " contained no properties."); } } return result; } public void initializeConfiguration() { // Need to eventually add in code that detects the current version of // the config and update // if necessary try { ConfigurationModel[] initialized = getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_INITIALIZED); if (initialized == null || initialized.length != 1) { Logger.logDebug("System does not appear to be initialized, initializing system configuration."); LanguageModel[] baseLanguage = getLanguage(ITrackerResources.getLocale(ITrackerResources.BASE_LOCALE)); if (baseLanguage == null || baseLanguage.length == 0) { throw new SystemConfigurationException( "Languages must be initialized before the system configuration can be loaded."); } // Remove any previous configuration information, possibly left // over from previous failed initialization Logger.logDebug("Removing previous incomplete initialization information."); removeConfigurationItems(SystemConfigurationUtilities.TYPE_STATUS); removeConfigurationItems(SystemConfigurationUtilities.TYPE_SEVERITY); removeConfigurationItems(SystemConfigurationUtilities.TYPE_RESOLUTION); for (int i = 0; i < baseLanguage.length; i++) { if (baseLanguage[i].getResourceKey().startsWith(ITrackerResources.KEY_BASE_RESOLUTION)) { try { String resolutionString = baseLanguage[i].getResourceKey().substring(20); Logger.logDebug("Adding new configuration resolution value: " + resolutionString); int resolutionNumber = Integer.parseInt(resolutionString); createConfigurationItem(new ConfigurationModel( SystemConfigurationUtilities.TYPE_RESOLUTION, resolutionString, props .getProperty("version"), resolutionNumber)); } catch (Exception e) { Logger.logError("Unable to load resolution value: " + baseLanguage[i].getResourceKey(), e); } } if (baseLanguage[i].getResourceKey().startsWith(ITrackerResources.KEY_BASE_SEVERITY)) { try { String severityString = baseLanguage[i].getResourceKey().substring(18); Logger.logDebug("Adding new configuration severity value: " + severityString); int severityNumber = Integer.parseInt(severityString); createConfigurationItem(new ConfigurationModel(SystemConfigurationUtilities.TYPE_SEVERITY, severityString, props.getProperty("version"), severityNumber)); } catch (Exception e) { Logger.logError("Unable to load severity value: " + baseLanguage[i].getResourceKey(), e); } } if (baseLanguage[i].getResourceKey().startsWith(ITrackerResources.KEY_BASE_STATUS)) { try { String statusString = baseLanguage[i].getResourceKey().substring(16); Logger.logDebug("Adding new configuration status value: " + statusString); int statusNumber = Integer.parseInt(statusString); createConfigurationItem(new ConfigurationModel(SystemConfigurationUtilities.TYPE_STATUS, statusString, props.getProperty("version"), statusNumber)); } catch (Exception e) { Logger.logError("Unable to load status value: " + baseLanguage[i].getResourceKey(), e); } } } createConfigurationItem(new ConfigurationModel(SystemConfigurationUtilities.TYPE_INITIALIZED, "1", props.getProperty("version"))); } } catch (Exception e) { Logger.logError("Unable to initialize system configuration.", e); } } } \ No newline at end of file --- 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.Arrays; import java.util.Collection; import java.util.Date; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.Locale; import java.util.Properties; import java.util.Vector; import cowsultants.itracker.ejb.beans.entity.ConfigurationBean; import cowsultants.itracker.ejb.beans.entity.CustomFieldBean; import cowsultants.itracker.ejb.beans.entity.CustomFieldValueBean; import cowsultants.itracker.ejb.beans.entity.LanguageBean; import cowsultants.itracker.ejb.beans.entity.WorkflowScriptBean; import cowsultants.itracker.ejb.client.exceptions.SystemConfigurationException; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.models.ConfigurationModel; import cowsultants.itracker.ejb.client.models.CustomFieldModel; import cowsultants.itracker.ejb.client.models.CustomFieldValueModel; import cowsultants.itracker.ejb.client.models.LanguageModel; import cowsultants.itracker.ejb.client.models.NameValuePairModel; import cowsultants.itracker.ejb.client.models.SystemConfigurationModel; import cowsultants.itracker.ejb.client.models.WorkflowScriptModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.ejb.client.util.IssueUtilities; import cowsultants.itracker.ejb.client.util.Logger; import cowsultants.itracker.ejb.client.util.SystemConfigurationUtilities; import cowsultants.itracker.ejb.util.PropertiesFileHandler; /** * * Implimetation of the SystemConfiguration Interface. * * @see SystemConfiguration * */ public class SystemConfigurationBean implements SystemConfiguration { private static Properties props = null; ConfigurationFactory configurationFactory; private CustomFieldFactory cfHome; CustomFieldValueFactory cfvHome = null; LanguageFactory languageFactory; WorkflowScriptFactory wsHome = null; public SystemConfigurationBean() { if (props == null) { props = new Properties(); PropertiesFileHandler filePropertiesHandler = new PropertiesFileHandler(); filePropertiesHandler.addProperties("/itrackerApplication.properties"); filePropertiesHandler.addProperties("/itrackerVersion.properties"); Properties fileProps = filePropertiesHandler.getProperties(); for (Enumeration e = fileProps.propertyNames(); e.hasMoreElements();) { String propName = (String) e.nextElement(); Logger.logDebug("Setting property " + propName + " from file to value '" + fileProps.getProperty(propName) + "'"); props.setProperty(propName, fileProps.getProperty(propName)); } props.setProperty("start_time_millis", Long.toString(new java.util.Date().getTime())); } // initialize Factories... cfHome = SpringFactories.getCustomFieldFactory(); wsHome = SpringFactories.getWorkflowScriptFactory(); } public String getProperty(String name) { return props.getProperty(name); } public String getProperty(String name, String defaultValue) { return props.getProperty(name, defaultValue); } public boolean getBooleanProperty(String name, boolean defaultValue) { String value = props.getProperty(name); return (value == null ? defaultValue : new Boolean(value).booleanValue()); } public int getIntegerProperty(String name, int defaultValue) { String value = props.getProperty(name); try { return (value == null ? defaultValue : Integer.parseInt(value)); } catch (NumberFormatException nfe) { return defaultValue; } } public long getLongProperty(String name, long defaultValue) { String value = props.getProperty(name); try { return (value == null ? defaultValue : Long.parseLong(value)); } catch (NumberFormatException nfe) { return defaultValue; } } public Properties getProperties() { return props; } public ConfigurationModel getConfigurationItem(Integer id) { ConfigurationBean configItem = configurationFactory.findByPrimaryKey(id); return configItem.getModel(); } public ConfigurationModel[] getConfigurationItemsByType(int type) throws DataException { ConfigurationModel[] items = new ConfigurationModel[0]; Collection configItems = configurationFactory.findByType(type); items = new ConfigurationModel[configItems.size()]; int i = 0; for (Iterator iter = configItems.iterator(); iter.hasNext(); i++) { items[i] = ((ConfigurationBean) iter.next()).getModel(); } Arrays.sort(items, new ConfigurationModel()); return items; } public ConfigurationModel[] getConfigurationItemsByType(int type, Locale locale) throws DataException { ConfigurationModel[] items = getConfigurationItemsByType(type); for (int i = 0; i < items.length; i++) { if (items[i].getType() == SystemConfigurationUtilities.TYPE_STATUS) { items[i].setName(IssueUtilities.getStatusName(items[i].getValue(), locale)); } else if (items[i].getType() == SystemConfigurationUtilities.TYPE_SEVERITY) { items[i].setName(IssueUtilities.getSeverityName(items[i].getValue(), locale)); } else if (items[i].getType() == SystemConfigurationUtilities.TYPE_RESOLUTION) { items[i].setName(IssueUtilities.getResolutionName(items[i].getValue(), locale)); } } return items; } public ConfigurationModel createConfigurationItem(ConfigurationModel model) { ConfigurationBean configurationItem = new ConfigurationBean(); configurationItem.setModel(model); configurationItem.setCreateDate( new Timestamp( new Date().getTime())); configurationFactory.saveOrUpdate(configurationItem); return configurationItem.getModel(); } public ConfigurationModel updateConfigurationItem(ConfigurationModel model) { if (model != null) { ConfigurationBean configurationItem = configurationFactory.findByPrimaryKey(model.getId()); configurationItem.setModel(model); return configurationItem.getModel(); } return (null); } public ConfigurationModel[] updateConfigurationItems(ConfigurationModel[] models, int type) throws DataException { removeConfigurationItems(type); for (int i = 0; i < models.length; i++) { ConfigurationBean configurationItem = new ConfigurationBean(); configurationItem.setModel(models[i]); models[i] = configurationItem.getModel(); } Arrays.sort(models, new ConfigurationModel()); return models; // Logger.logDebug("Unable to create new language item."); // return new ConfigurationModel[0]; } public void removeConfigurationItem(Integer id) { // cHome.remove(id); // Logger.logDebug("Unable to remove configuration item " + id + "."); } public void removeConfigurationItems(int type) throws DataException { Collection currentItems = configurationFactory.findByType(type); for (Iterator iter = currentItems.iterator(); iter.hasNext();) { ConfigurationBean config = (ConfigurationBean) iter.next(); // config.remove(); } } public void removeConfigurationItems(ConfigurationModel model) throws DataException { Vector currentIds = new Vector(); Collection currentItems = configurationFactory.findByTypeAndValue(model.getType(), model.getValue()); for (Iterator iter = currentItems.iterator(); iter.hasNext();) { ConfigurationBean configItem = (ConfigurationBean) iter.next(); configurationFactory.delete(configItem); } } public boolean configurationItemExists(ConfigurationModel model) throws DataException { if (model != null && model.getVersion() != null) { Collection configItems = configurationFactory.findByTypeAndValue(model.getType(), model.getValue()); if (configItems != null && configItems.size() > 0) { return true; } } return false; } public boolean configurationItemUpToDate(ConfigurationModel model) throws DataException { long currentVersion = 0; if (model != null && model.getVersion() != null) { Collection configItems = configurationFactory.findByTypeAndValue(model.getType(), model.getValue()); for (Iterator iter = configItems.iterator(); iter.hasNext();) { ConfigurationBean configItem = (ConfigurationBean) iter.next(); if (configItem != null) { currentVersion = Math.max(SystemConfigurationUtilities.getVersionAsLong(configItem.getVersion()), currentVersion); } } if (currentVersion >= SystemConfigurationUtilities.getVersionAsLong(model.getVersion())) { return true; } } return false; } public void resetConfigurationCache() throws DataException { IssueUtilities.setResolutions(getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_RESOLUTION)); IssueUtilities.setSeverities(getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_SEVERITY)); IssueUtilities.setStatuses(getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_STATUS)); IssueUtilities.setCustomFields(getCustomFields()); } public void resetConfigurationCache(int type) throws DataException { if (type == SystemConfigurationUtilities.TYPE_RESOLUTION) { IssueUtilities.setResolutions(getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_RESOLUTION)); } else if (type == SystemConfigurationUtilities.TYPE_SEVERITY) { IssueUtilities.setSeverities(getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_SEVERITY)); } else if (type == SystemConfigurationUtilities.TYPE_STATUS) { IssueUtilities.setStatuses(getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_STATUS)); } else if (type == SystemConfigurationUtilities.TYPE_CUSTOMFIELD) { IssueUtilities.setCustomFields(getCustomFields()); } } public WorkflowScriptModel getWorkflowScript(Integer id) { WorkflowScriptBean workflowScript = wsHome.findByPrimaryKey(id); return workflowScript.getModel(); } public WorkflowScriptModel[] getWorkflowScripts() { WorkflowScriptModel[] scripts = new WorkflowScriptModel[0]; Collection workflowScripts = wsHome.findAll(); scripts = new WorkflowScriptModel[workflowScripts.size()]; int i = 0; for (Iterator iter = workflowScripts.iterator(); iter.hasNext(); i++) { scripts[i] = ((WorkflowScriptBean) iter.next()).getModel(); } return scripts; } public WorkflowScriptModel createWorkflowScript(WorkflowScriptModel model) { // try { WorkflowScriptBean workflowScript = new WorkflowScriptBean(); workflowScript.setModel(model); model.setId(workflowScript.getId()); return workflowScript.getModel(); // } catch(CreateException ce) { // Logger.logDebug("Unable to create new workflow script.", ce); // } // return null; } public WorkflowScriptModel updateWorkflowScript(WorkflowScriptModel model) { if (model != null) { WorkflowScriptBean workflowScript = wsHome.findByPrimaryKey(model.getId()); workflowScript.setModel(model); return workflowScript.getModel(); } return null; } public CustomFieldModel getCustomField(Integer id) throws DataException { CustomFieldBean customField = cfHome.findByPrimaryKey(id); return customField.getModel(); } public CustomFieldModel[] getCustomFields() throws DataException { CustomFieldModel[] fields = new CustomFieldModel[0]; Collection customFields = cfHome.findAll(); fields = new CustomFieldModel[customFields.size()]; int i = 0; for (Iterator iter = customFields.iterator(); iter.hasNext(); i++) { fields[i] = ((CustomFieldBean) iter.next()).getModel(); } return fields; } public CustomFieldModel[] getCustomFields(Locale locale) throws DataException { CustomFieldModel[] fields = getCustomFields(); for (int i = 0; i < fields.length; i++) { fields[i].setLabels(locale); } return fields; } public CustomFieldModel createCustomField(CustomFieldModel model) throws DataException { CustomFieldBean customField = new CustomFieldBean(); customField.setModel(model); model.setId(customField.getId()); if (model.getOptions().length > 0) { removeCustomFieldValues(customField.getId()); CustomFieldValueModel[] newOptions = model.getOptions(); for (int i = 0; i < newOptions.length; i++) { newOptions[i].setCustomFieldId(customField.getId()); createCustomFieldValue(newOptions[i]); } } return customField.getModel(); // Logger.logDebug("Unable to create new custom field.", ce); } public CustomFieldModel updateCustomField(CustomFieldModel model) throws DataException { if (model != null) { CustomFieldBean customField = cfHome.findByPrimaryKey(model.getId()); customField.setModel(model); if (model.getOptions().length > 0) { removeCustomFieldValues(customField.getId()); CustomFieldValueModel[] newOptions = model.getOptions(); for (int i = 0; i < newOptions.length; i++) { createCustomFieldValue(newOptions[i]); } } return customField.getModel(); } return null; } public void removeCustomField(Integer customFieldId) throws DataException { CustomFieldBean customField = cfHome.findByPrimaryKey(customFieldId); // customField.remove(); } public CustomFieldValueModel getCustomFieldValue(Integer id) { // CustomFieldValueBean customFieldValue = cfvHome.findByPrimaryKey(id); // return customFieldValue.getModel(); return (null); } public CustomFieldValueModel createCustomFieldValue(CustomFieldValueModel model) throws DataException { if (model == null || model.getCustomFieldId() == null) { return null; } CustomFieldBean customField = cfHome.findByPrimaryKey(model.getCustomFieldId()); CustomFieldValueBean customFieldValue = new CustomFieldValueBean(); customFieldValue.setModel(model); customFieldValue.setCustomField(customField); return customFieldValue.getModel(); // Logger.logDebug("Unable to create new custom field value: " + // ce.getMessage()); // Logger.logDebug("Unable to create new custom field value, custom // field not found: " + fe.getMessage()); } public CustomFieldValueModel updateCustomFieldValue(CustomFieldValueModel model) { // if(model != null) { // CustomFieldValueBean customFieldValue = // cfvHome.findByPrimaryKey(model.getId()); // customFieldValue.setModel(model); // return customFieldValue.getModel(); // } return null; } public CustomFieldValueModel[] updateCustomFieldValues(Integer customFieldId, CustomFieldValueModel[] models) throws DataException { CustomFieldValueModel[] values = new CustomFieldValueModel[0]; if (customFieldId != null) { CustomFieldBean customField = cfHome.findByPrimaryKey(customFieldId); Collection currValues = customField.getValues(); for (Iterator iter = currValues.iterator(); iter.hasNext();) { if (models == null || models.length == 0) { // ((CustomFieldValueBean) iter.next()).remove(); } else { CustomFieldValueBean value = (CustomFieldValueBean) iter.next(); for (int i = 0; i < models.length; i++) { if (value.getId().equals(models[i].getId())) { value.setModel(models[i]); models[i] = value.getModel(); break; } } } } } Arrays.sort(models, new CustomFieldValueModel()); return models; ... [truncated message content] |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:47:39
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/entity In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29538 Modified Files: Tag: itrackerhibernate UserBean.java Log Message: collections were not initialized when creating a new instance, this caused problems creating new users Index: UserBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/entity/UserBean.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 *** UserBean.java 21 Oct 2005 11:14:29 -0000 1.9.4.2 --- UserBean.java 30 Oct 2005 16:47:32 -0000 1.9.4.3 *************** *** 22,25 **** --- 22,26 ---- import java.util.Collection; import java.util.Date; + import java.util.LinkedList; import cowsultants.itracker.ejb.client.models.UserModel; *************** *** 28,46 **** private String login; private String password; private String firstName; private String lastName; public String email; public int status; public int superUser; public int registrationType; public UserPreferencesBean preferences; ! public Collection permissions; ! public Collection notifications; ! public Collection activities; ! public Collection history; ! public Collection projects; ! public Collection attachments; ! public Collection getActivities() { return activities; --- 29,61 ---- private String login; + private String password; + private String firstName; + private String lastName; + public String email; + public int status; + public int superUser; + public int registrationType; + public UserPreferencesBean preferences; ! ! public Collection permissions = new LinkedList(); ! ! public Collection notifications = new LinkedList(); ! ! public Collection activities = new LinkedList(); ! ! public Collection history = new LinkedList(); ! ! public Collection projects = new LinkedList(); ! ! public Collection attachments = new LinkedList(); ! public Collection getActivities() { return activities; *************** *** 134,138 **** return login; } ! public void setLogin(String value) { this.login = value; --- 149,153 ---- return login; } ! public void setLogin(String value) { this.login = value; *************** *** 142,146 **** return password; } ! public void setPassword(String value) { this.password = value; --- 157,161 ---- return password; } ! public void setPassword(String value) { this.password = value; *************** *** 150,154 **** return firstName; } ! public void setFirstName(String value) { firstName = value; --- 165,169 ---- return firstName; } ! public void setFirstName(String value) { firstName = value; *************** *** 158,162 **** return lastName; } ! public void setLastName(String value) { this.lastName = value; --- 173,177 ---- return lastName; } ! public void setLastName(String value) { this.lastName = value; *************** *** 191,195 **** // Only set the password if it is a new value... ! if(model.getPassword() != null && ! model.getPassword().equals("") && ! model.getPassword().equals(this.getPassword())) { this.setPassword(model.getPassword()); } --- 206,211 ---- // Only set the password if it is a new value... ! if (model.getPassword() != null && !model.getPassword().equals("") ! && !model.getPassword().equals(this.getPassword())) { this.setPassword(model.getPassword()); } |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:46:50
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29358/util Modified Files: Tag: itrackerhibernate EmailHandler.java Log Message: removed unused ejb code formatting Index: EmailHandler.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/util/EmailHandler.java,v retrieving revision 1.13.4.2 retrieving revision 1.13.4.3 diff -C2 -d -r1.13.4.2 -r1.13.4.3 *** EmailHandler.java 23 Oct 2005 12:45:47 -0000 1.13.4.2 --- EmailHandler.java 30 Oct 2005 16:46:42 -0000 1.13.4.3 *************** *** 25,29 **** import java.util.Properties; - import javax.ejb.EJBException; import javax.mail.Authenticator; import javax.mail.MessagingException; --- 25,28 ---- *************** *** 33,88 **** import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; - import javax.naming.InitialContext; - import javax.naming.NamingException; - import cowsultants.itracker.ejb.beans.session.SystemConfigurationBean; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; public class EmailHandler { public static final String DEFAULT_FROM_ADDRESS = "itracker@localhost"; public static final String DEFAULT_FROM_TEXT = "ITracker Notification System"; public static final String DEFAULT_REPLYTO_ADDRESS = "itracker@localhost"; public static final String DEFAULT_SMTP_HOST = "localhost"; public static final String DEFAULT_SMTP_USERID = null; public static final String DEFAULT_SMTP_PASSWORD = null; public static final String DEFAULT_SMTP_CHARSET = "ISO-8859-1"; private static String fromAddress = ""; private static String fromText = ""; private static String replyToAddress = ""; private static String smtpHost = ""; private static String smtpUserid = null; private static String smtpPassword = null; private static String smtpCharset = ""; static { - try { - InitialContext ic = new InitialContext(); - Object scRef = ic.lookup("java:comp/env/" + SystemConfiguration.JNDI_NAME); - SystemConfiguration sc = new SystemConfigurationBean(); ! fromAddress = sc.getProperty("notification_from_address", DEFAULT_FROM_ADDRESS); ! fromText = sc.getProperty("notification_from_text", DEFAULT_FROM_TEXT); ! replyToAddress = sc.getProperty("notification_replyto_address", DEFAULT_REPLYTO_ADDRESS); ! smtpHost = sc.getProperty("notification_smtp_host", DEFAULT_SMTP_HOST); ! smtpUserid = sc.getProperty("notification_smtp_userid", null); ! smtpPassword = sc.getProperty("notification_smtp_password", null); ! smtpCharset = sc.getProperty("notification_smtp_charset", DEFAULT_SMTP_CHARSET); ! if("".equals(smtpUserid) || "".equals(smtpPassword)) { ! smtpUserid = null; ! smtpPassword = null; ! } ! if(Logger.isLoggingDebug()) { ! Logger.logDebug("Notification Init: From Address set to: " + fromAddress); ! Logger.logDebug("Notification Init: From Text set to: " + fromText); ! Logger.logDebug("Notification Init: ReplyTo Address set to: " + replyToAddress); ! Logger.logDebug("Notification Init: SMTP server set to: " + smtpHost); ! Logger.logDebug("Notification Init: SMTP userid set to: " + smtpUserid); ! Logger.logDebug("Notification Init: SMTP password set to: " + smtpPassword); ! } ! } catch(NamingException ne) { ! throw new EJBException(ne); } } --- 32,91 ---- import javax.mail.internet.InternetAddress; import javax.mail.internet.MimeMessage; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; public class EmailHandler { public static final String DEFAULT_FROM_ADDRESS = "itracker@localhost"; + public static final String DEFAULT_FROM_TEXT = "ITracker Notification System"; + public static final String DEFAULT_REPLYTO_ADDRESS = "itracker@localhost"; + public static final String DEFAULT_SMTP_HOST = "localhost"; + public static final String DEFAULT_SMTP_USERID = null; + public static final String DEFAULT_SMTP_PASSWORD = null; + public static final String DEFAULT_SMTP_CHARSET = "ISO-8859-1"; private static String fromAddress = ""; + private static String fromText = ""; + private static String replyToAddress = ""; + private static String smtpHost = ""; + private static String smtpUserid = null; + private static String smtpPassword = null; + private static String smtpCharset = ""; static { ! SystemConfiguration sc = null; ! fromAddress = sc.getProperty("notification_from_address", DEFAULT_FROM_ADDRESS); ! fromText = sc.getProperty("notification_from_text", DEFAULT_FROM_TEXT); ! replyToAddress = sc.getProperty("notification_replyto_address", DEFAULT_REPLYTO_ADDRESS); ! smtpHost = sc.getProperty("notification_smtp_host", DEFAULT_SMTP_HOST); ! smtpUserid = sc.getProperty("notification_smtp_userid", null); ! smtpPassword = sc.getProperty("notification_smtp_password", null); ! smtpCharset = sc.getProperty("notification_smtp_charset", DEFAULT_SMTP_CHARSET); ! if ("".equals(smtpUserid) || "".equals(smtpPassword)) { ! smtpUserid = null; ! smtpPassword = null; ! } ! ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Notification Init: From Address set to: " + fromAddress); ! Logger.logDebug("Notification Init: From Text set to: " + fromText); ! Logger.logDebug("Notification Init: ReplyTo Address set to: " + replyToAddress); ! Logger.logDebug("Notification Init: SMTP server set to: " + smtpHost); ! Logger.logDebug("Notification Init: SMTP userid set to: " + smtpUserid); ! Logger.logDebug("Notification Init: SMTP password set to: " + smtpPassword); } } *************** *** 97,101 **** sendEmail(recipients, subject, msgText); ! } catch(AddressException ae) { Logger.logDebug("AddressException while sending email.", ae); } --- 100,104 ---- sendEmail(recipients, subject, msgText); ! } catch (AddressException ae) { Logger.logDebug("AddressException while sending email.", ae); } *************** *** 107,116 **** try { InternetAddress[] recipients = new InternetAddress[addresses.size()]; ! for(Iterator iterator = addresses.iterator(); iterator.hasNext(); i++) { recipients[i] = new InternetAddress((String) iterator.next()); } sendEmail(recipients, subject, msgText); ! } catch(AddressException ae) { Logger.logDebug("AddressException while sending email.", ae); } --- 110,119 ---- try { InternetAddress[] recipients = new InternetAddress[addresses.size()]; ! for (Iterator iterator = addresses.iterator(); iterator.hasNext(); i++) { recipients[i] = new InternetAddress((String) iterator.next()); } sendEmail(recipients, subject, msgText); ! } catch (AddressException ae) { Logger.logDebug("AddressException while sending email.", ae); } *************** *** 124,128 **** props.put("mail.mime.charset", smtpCharset); ! if(smtpUserid != null && smtpPassword != null) { smtpAuth = (Authenticator) new EmailAuthenticator(new PasswordAuthentication(smtpUserid, smtpPassword)); } --- 127,131 ---- props.put("mail.mime.charset", smtpCharset); ! if (smtpUserid != null && smtpPassword != null) { smtpAuth = (Authenticator) new EmailAuthenticator(new PasswordAuthentication(smtpUserid, smtpPassword)); } *************** *** 140,148 **** Transport.send(msg); ! } catch(AddressException ae) { Logger.logDebug("AddressException while sending email.", ae); ! } catch(MessagingException me) { Logger.logDebug("MessagingException while sending email.", me); ! } catch(UnsupportedEncodingException uee) { Logger.logDebug("UnsupportedEncodingException while sending email.", uee); } --- 143,151 ---- Transport.send(msg); ! } catch (AddressException ae) { Logger.logDebug("AddressException while sending email.", ae); ! } catch (MessagingException me) { Logger.logDebug("MessagingException while sending email.", me); ! } catch (UnsupportedEncodingException uee) { Logger.logDebug("UnsupportedEncodingException while sending email.", uee); } |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:45:29
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv29128/resources Modified Files: Tag: itrackerhibernate ITrackerResources.java Log Message: now initialized via spring Index: ITrackerResources.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/resources/ITrackerResources.java,v retrieving revision 1.33.4.1 retrieving revision 1.33.4.2 diff -C2 -d -r1.33.4.1 -r1.33.4.2 *** ITrackerResources.java 11 Oct 2005 01:21:04 -0000 1.33.4.1 --- ITrackerResources.java 30 Oct 2005 16:45:21 -0000 1.33.4.2 *************** *** 75,86 **** private static Object bundleLock = new Object(); ! private static SystemConfigurationBean sc = new SystemConfigurationBean();; ! ! public ITrackerResources() { ! } ! ! public HashMap getLanguages() { ! return languages; ! } public static Locale getLocale() { --- 75,79 ---- private static Object bundleLock = new Object(); ! private static SystemConfigurationBean sc; public static Locale getLocale() { *************** *** 357,359 **** --- 350,356 ---- } + public static void setSystemConfiguration(SystemConfigurationBean sc) { + ITrackerResources.sc = sc; + } + } |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:44:37
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28896 Modified Files: Tag: itrackerhibernate TestApplicationProperties.java TestProjectHandler.java Log Message: no message Index: TestProjectHandler.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/test/TestProjectHandler.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 *** TestProjectHandler.java 13 Oct 2005 14:26:13 -0000 1.6.4.2 --- TestProjectHandler.java 30 Oct 2005 16:44:30 -0000 1.6.4.3 *************** *** 20,24 **** import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import junit.framework.Test; --- 20,23 ---- *************** *** 26,30 **** import junit.framework.TestSuite; 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; --- 25,28 ---- *************** *** 33,37 **** private InitialContext ic; private Object phRef; - private ProjectHandlerHome phHome; private ProjectHandler ph; --- 31,34 ---- *************** *** 130,136 **** ic = new InitialContext(); ! phRef = ic.lookup(ProjectHandler.JNDI_NAME); ! phHome = (ProjectHandlerHome) PortableRemoteObject.narrow(phRef, ProjectHandlerHome.class); ! ph = phHome.create(); } catch(Exception e) { fail("Exception in setup caught: " + e.toString()); --- 127,132 ---- ic = new InitialContext(); ! phRef = ic.lookup(ProjectHandler.JNDI_NAME); ! ph = null; } catch(Exception e) { fail("Exception in setup caught: " + e.toString()); Index: TestApplicationProperties.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/test/TestApplicationProperties.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 *** TestApplicationProperties.java 18 Oct 2005 12:01:53 -0000 1.8.4.2 --- TestApplicationProperties.java 30 Oct 2005 16:44:29 -0000 1.8.4.3 *************** *** 36,40 **** public void testGetProperties() throws NamingException { ! SystemConfiguration sc = new SystemConfigurationBean(); Properties props = sc.getProperties(); --- 36,40 ---- public void testGetProperties() throws NamingException { ! SystemConfiguration sc = null; Properties props = sc.getProperties(); |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:42:32
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28531/client/interfaces Removed Files: Tag: itrackerhibernate ProjectHandlerHome.java Log Message: no longer used --- ProjectHandlerHome.java DELETED --- |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:42:17
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/test/spring In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28494/spring Modified Files: Tag: itrackerhibernate ITrackerSpringTest.java Log Message: no message Index: ITrackerSpringTest.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/test/spring/Attic/ITrackerSpringTest.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 *** ITrackerSpringTest.java 13 Oct 2005 12:23:37 -0000 1.1.2.1 --- ITrackerSpringTest.java 30 Oct 2005 16:42:09 -0000 1.1.2.2 *************** *** 124,132 **** lf = (LanguageFactory) bf.getBean("languageFactory"); cff = SpringFactories.getCustomFieldFactory(); ! uf = SpringFactories.getUserFactory(); ! pf = SpringFactories.getProjectFactory(); upf = SpringFactories.getUserPreferencesFactory(); permissionf = SpringFactories.getPermissionFactory(); ! issuef = SpringFactories.getIssueFactory(); issuehistoryf = SpringFactories.getIssueHistoryFactory(); } --- 124,132 ---- lf = (LanguageFactory) bf.getBean("languageFactory"); cff = SpringFactories.getCustomFieldFactory(); ! uf = null;//SpringFactories.getUserFactory(); ! pf = null;//SpringFactories.getProjectFactory(); upf = SpringFactories.getUserPreferencesFactory(); permissionf = SpringFactories.getPermissionFactory(); ! //issuef = SpringFactories.getIssueFactory(); issuehistoryf = SpringFactories.getIssueHistoryFactory(); } |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:38:34
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27914 Modified Files: Tag: itrackerhibernate ExportAttachmentsAction.java ExportLanguageAction.java ForgotPasswordAction.java ImportDataProcessAction.java ImportDataVerifyAction.java InitializeLanguagesAction.java Log Message: replaced static init for calling a method for finding out if saving the login is allowed Index: ExportAttachmentsAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/ExportAttachmentsAction.java,v retrieving revision 1.6.4.3 retrieving revision 1.6.4.4 diff -C2 -d -r1.6.4.3 -r1.6.4.4 *** ExportAttachmentsAction.java 23 Oct 2005 22:58:05 -0000 1.6.4.3 --- ExportAttachmentsAction.java 30 Oct 2005 16:38:23 -0000 1.6.4.4 *************** *** 57,61 **** try { ! IssueHandler ih = new IssueHandlerBean(); IssueAttachmentModel[] attachments = ih.getAllIssueAttachments(); --- 57,61 ---- try { ! IssueHandler ih = getITrackerServices().getIssueHandler(); IssueAttachmentModel[] attachments = ih.getAllIssueAttachments(); Index: ImportDataProcessAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/ImportDataProcessAction.java,v retrieving revision 1.11.4.3 retrieving revision 1.11.4.4 diff -C2 -d -r1.11.4.3 -r1.11.4.4 *** ImportDataProcessAction.java 29 Oct 2005 00:26:52 -0000 1.11.4.3 --- ImportDataProcessAction.java 30 Oct 2005 16:38:23 -0000 1.11.4.4 *************** *** 23,27 **** import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 23,26 ---- *************** *** 35,44 **** import org.apache.struts.action.ActionMapping; - import cowsultants.itracker.ejb.beans.session.SystemConfigurationBean; - import cowsultants.itracker.ejb.beans.session.UserHandlerBean; 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.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.interfaces.UserHandler; --- 34,39 ---- *************** *** 120,126 **** private boolean createConfig(ImportDataModel model, UserModel importer, InitialContext ic) { try { ! Object scRef = ic.lookup("java:comp/env/" + SystemConfiguration.JNDI_NAME); ! //SystemConfigurationHome scHome = (SystemConfigurationHome) PortableRemoteObject.narrow(scRef, SystemConfigurationHome.class); ! SystemConfiguration sc = new SystemConfigurationBean(); GenericModel[] importData = model.getData(); --- 115,119 ---- private boolean createConfig(ImportDataModel model, UserModel importer, InitialContext ic) { try { ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); GenericModel[] importData = model.getData(); *************** *** 164,168 **** private boolean createUsers(ImportDataModel model, UserModel importer, InitialContext ic) { try { ! UserHandler uh = new UserHandlerBean(); GenericModel[] importData = model.getData(); --- 157,161 ---- private boolean createUsers(ImportDataModel model, UserModel importer, InitialContext ic) { try { ! UserHandler uh = getITrackerServices().getUserHandler(); GenericModel[] importData = model.getData(); *************** *** 188,194 **** private boolean createProjects(ImportDataModel model, UserModel importer, InitialContext ic) { try { ! Object phRef = ic.lookup("java:comp/env/" + ProjectHandler.JNDI_NAME); ! ProjectHandlerHome phHome = (ProjectHandlerHome) PortableRemoteObject.narrow(phRef, ProjectHandlerHome.class); ! ProjectHandler ph = phHome.create(); GenericModel[] importData = model.getData(); --- 181,185 ---- private boolean createProjects(ImportDataModel model, UserModel importer, InitialContext ic) { try { ! ProjectHandler ph = getITrackerServices().getProjectHandler(); GenericModel[] importData = model.getData(); *************** *** 233,239 **** private boolean createIssues(ImportDataModel model, UserModel importer, InitialContext ic) { try { ! Object ihRef = ic.lookup("java:comp/env/" + IssueHandler.JNDI_NAME); ! IssueHandlerHome ihHome = (IssueHandlerHome) PortableRemoteObject.narrow(ihRef, IssueHandlerHome.class); ! IssueHandler ih = ihHome.create(); GenericModel[] importData = model.getData(); --- 224,228 ---- private boolean createIssues(ImportDataModel model, UserModel importer, InitialContext ic) { try { ! IssueHandler ih = getITrackerServices().getIssueHandler(); GenericModel[] importData = model.getData(); Index: ForgotPasswordAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/ForgotPasswordAction.java,v retrieving revision 1.9.4.3 retrieving revision 1.9.4.4 diff -C2 -d -r1.9.4.3 -r1.9.4.4 *** ForgotPasswordAction.java 29 Oct 2005 00:26:52 -0000 1.9.4.3 --- ForgotPasswordAction.java 30 Oct 2005 16:38:23 -0000 1.9.4.4 *************** *** 53,58 **** try { ! SystemConfiguration sc = new SystemConfigurationBean(); ! UserHandler uh = new UserHandlerBean(); if(! sc.getBooleanProperty("allow_forgot_password", true)) { --- 53,58 ---- try { ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); ! UserHandler uh = getITrackerServices().getUserHandler(); if(! sc.getBooleanProperty("allow_forgot_password", true)) { Index: ImportDataVerifyAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/ImportDataVerifyAction.java,v retrieving revision 1.9.4.3 retrieving revision 1.9.4.4 diff -C2 -d -r1.9.4.3 -r1.9.4.4 *** ImportDataVerifyAction.java 29 Oct 2005 00:26:52 -0000 1.9.4.3 --- ImportDataVerifyAction.java 30 Oct 2005 16:38:23 -0000 1.9.4.4 *************** *** 22,26 **** import javax.naming.InitialContext; - import javax.rmi.PortableRemoteObject; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 22,25 ---- *************** *** 36,44 **** import org.apache.struts.upload.FormFile; - import cowsultants.itracker.ejb.beans.session.SystemConfigurationBean; - import cowsultants.itracker.ejb.beans.session.UserHandlerBean; import cowsultants.itracker.ejb.client.exceptions.ImportExportException; import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; - import cowsultants.itracker.ejb.client.interfaces.ProjectHandlerHome; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.interfaces.UserHandler; --- 35,40 ---- *************** *** 145,149 **** int maxResolutionValue = 1; ! SystemConfiguration sc = new SystemConfigurationBean(); ConfigurationModel[] statuses = sc.getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_STATUS, ImportExportUtilities.EXPORT_LOCALE); --- 141,145 ---- int maxResolutionValue = 1; ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); ConfigurationModel[] statuses = sc.getConfigurationItemsByType(SystemConfigurationUtilities.TYPE_STATUS, ImportExportUtilities.EXPORT_LOCALE); *************** *** 258,262 **** try { ! UserHandler uh = new UserHandlerBean(); GenericModel[] importData = model.getData(); --- 254,258 ---- try { ! UserHandler uh = getITrackerServices().getUserHandler(); GenericModel[] importData = model.getData(); *************** *** 293,299 **** private void checkProjects(ImportDataModel model, InitialContext ic) throws ImportExportException { try { ! Object phRef = ic.lookup("java:comp/env/" + ProjectHandler.JNDI_NAME); ! ProjectHandlerHome phHome = (ProjectHandlerHome) PortableRemoteObject.narrow(phRef, ProjectHandlerHome.class); ! ProjectHandler ph = phHome.create(); ProjectModel[] existingProjects = ph.getAllProjects(); --- 289,293 ---- private void checkProjects(ImportDataModel model, InitialContext ic) throws ImportExportException { try { ! ProjectHandler ph = getITrackerServices().getProjectHandler(); ProjectModel[] existingProjects = ph.getAllProjects(); Index: ExportLanguageAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/ExportLanguageAction.java,v retrieving revision 1.9.4.3 retrieving revision 1.9.4.4 diff -C2 -d -r1.9.4.3 -r1.9.4.4 *** ExportLanguageAction.java 23 Oct 2005 22:58:05 -0000 1.9.4.3 --- ExportLanguageAction.java 30 Oct 2005 16:38:23 -0000 1.9.4.4 *************** *** 59,63 **** try { ! SystemConfiguration sc = new SystemConfigurationBean(); String locale = (String) PropertyUtils.getSimpleProperty(form, "locale"); --- 59,63 ---- try { ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); String locale = (String) PropertyUtils.getSimpleProperty(form, "locale"); Index: InitializeLanguagesAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/InitializeLanguagesAction.java,v retrieving revision 1.6.4.3 retrieving revision 1.6.4.4 diff -C2 -d -r1.6.4.3 -r1.6.4.4 *** InitializeLanguagesAction.java 18 Oct 2005 20:38:49 -0000 1.6.4.3 --- InitializeLanguagesAction.java 30 Oct 2005 16:38:23 -0000 1.6.4.4 *************** *** 55,59 **** try { ! SystemConfiguration sc = new SystemConfigurationBean(); SystemConfigurationUtilities.initializeAllLanguages(sc, true); --- 55,59 ---- try { ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); SystemConfigurationUtilities.initializeAllLanguages(sc, true); |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:38:02
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27812 Modified Files: Tag: itrackerhibernate ITrackerAction.java Log Message: replaced static init for calling a method for finding out if saving the login is allowed Index: ITrackerAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/ITrackerAction.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 *** ITrackerAction.java 24 Oct 2005 20:35:12 -0000 1.7.4.2 --- ITrackerAction.java 30 Oct 2005 16:37:50 -0000 1.7.4.3 *************** *** 22,26 **** import java.util.HashMap; - import javax.servlet.ServletContext; import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; --- 22,25 ---- *************** *** 29,55 **** 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; import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.util.UserUtilities; import cowsultants.itracker.web.util.Constants; import cowsultants.itracker.web.util.LoginUtilities; public abstract class ITrackerAction extends Action { ! protected static boolean allowSaveLogin = true; ! ! // TODO remove this - RJST ! static { ! SystemConfiguration sc = new SystemConfigurationBean(); ! allowSaveLogin = sc.getBooleanProperty("allow_save_login", true); ! } ! ! private ITrackerServices itrackerServices; ! protected boolean hasPermission(int[] permissionsNeeded, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { --- 28,41 ---- import org.apache.struts.action.Action; import cowsultants.itracker.ejb.beans.session.ITrackerServices; import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.util.UserUtilities; import cowsultants.itracker.web.util.Constants; import cowsultants.itracker.web.util.LoginUtilities; + import cowsultants.itracker.web.util.ServletContextUtils; public abstract class ITrackerAction extends Action { ! protected boolean hasPermission(int[] permissionsNeeded, HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { *************** *** 85,89 **** if (login == null || "".equals(login)) { ! LoginUtilities.checkAutoLogin(request, allowSaveLogin); return false; } --- 71,75 ---- if (login == null || "".equals(login)) { ! LoginUtilities.checkAutoLogin(request, getAllowSaveLogin()); return false; } *************** *** 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; } - } --- 81,91 ---- + request.getContextPath(); } protected ITrackerServices getITrackerServices() { ! return ServletContextUtils.getItrackerServices(getServlet().getServletContext()); ! } ! ! private boolean getAllowSaveLogin() { ! return(getITrackerServices().getSystemConfiguration().getBooleanProperty("allow_save_login", true)); } } |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:36:55
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27573 Modified Files: Tag: itrackerhibernate LoginAction.java Log Message: no longer instantiating service objects, but using the only instance of the service layer and data access objects created by spring formatting Index: LoginAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/LoginAction.java,v retrieving revision 1.20.4.3 retrieving revision 1.20.4.4 diff -C2 -d -r1.20.4.3 -r1.20.4.4 *** LoginAction.java 28 Oct 2005 14:05:19 -0000 1.20.4.3 --- LoginAction.java 30 Oct 2005 16:36:43 -0000 1.20.4.4 *************** *** 36,43 **** import cowsultants.itracker.ejb.beans.session.DataException; - import cowsultants.itracker.ejb.beans.session.SystemConfigurationBean; - import cowsultants.itracker.ejb.beans.session.UserHandlerBean; import cowsultants.itracker.ejb.client.exceptions.AuthenticatorException; - import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.interfaces.UserHandler; import cowsultants.itracker.ejb.client.models.UserModel; --- 36,40 ---- *************** *** 51,61 **** import cowsultants.itracker.web.util.SessionManager; import cowsultants.itracker.web.util.SessionTracker; public class LoginAction extends ITrackerAction { - private static int SESSION_TIMEOUT = 30; ! static { ! SystemConfiguration sc = new SystemConfigurationBean(); ! SESSION_TIMEOUT = sc.getIntegerProperty("web_session_timeout", SESSION_TIMEOUT); ! } public LoginAction() { --- 48,57 ---- import cowsultants.itracker.web.util.SessionManager; import cowsultants.itracker.web.util.SessionTracker; + + public class LoginAction extends ITrackerAction { ! // TODO: this should live in SystemConfiguration ! private int SESSION_TIMEOUT = 30; public LoginAction() { *************** *** 69,73 **** try { ! UserHandler uh = new UserHandlerBean(); try { --- 65,69 ---- try { ! UserHandler uh = getITrackerServices().getUserHandler(); try { *************** *** 201,222 **** public UserModel setupSession(String login, HttpServletRequest request, HttpServletResponse response) throws DataException { ! UserHandler uh = new UserHandlerBean(); ! UserModel user = uh.getUserByLogin(login); ! if (user != null) { ! String encPassword = null; ! Cookie[] cookies = request.getCookies(); ! if (cookies != null) { ! for (int i = 0; i < cookies.length; i++) { ! if (Constants.COOKIE_NAME.equals(cookies[i].getName())) { ! int seperator = cookies[i].getValue().indexOf('~'); ! if (seperator > 0) { ! encPassword = cookies[i].getValue().substring(seperator + 1); ! } } } } - - return setupSession(user, encPassword, request, response); } return null; } --- 197,218 ---- public UserModel setupSession(String login, HttpServletRequest request, HttpServletResponse response) throws DataException { ! UserHandler uh = getITrackerServices().getUserHandler(); ! UserModel user = uh.getUserByLogin(login); ! if (user != null) { ! String encPassword = null; ! Cookie[] cookies = request.getCookies(); ! if (cookies != null) { ! for (int i = 0; i < cookies.length; i++) { ! if (Constants.COOKIE_NAME.equals(cookies[i].getName())) { ! int seperator = cookies[i].getValue().indexOf('~'); ! if (seperator > 0) { ! encPassword = cookies[i].getValue().substring(seperator + 1); } } } } + + return setupSession(user, encPassword, request, response); + } return null; } *************** *** 228,302 **** } ! UserHandler uh = new UserHandlerBean(); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Creating new session"); ! } ! HttpSession session = request.getSession(true); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting session timeout to " + SESSION_TIMEOUT + " minutes"); ! } ! session.setMaxInactiveInterval(SESSION_TIMEOUT * 60); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting session tracker"); ! } ! session.setAttribute(Constants.SESSION_TRACKER_KEY, new SessionTracker(user.getLogin(), session.getId())); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting user information"); ! } ! session.setAttribute(Constants.USER_KEY, user); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting preferences for user " + user.getLogin()); ! } ! UserPreferencesModel userPrefs = uh.getUserPreferencesByUserId(user.getId()); ! session.setAttribute(Constants.PREFERENCES_KEY, userPrefs); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting user locale to " + ITrackerResources.getLocale(userPrefs.getUserLocale())); ! } ! session.setAttribute(Constants.LOCALE_KEY, ITrackerResources.getLocale(userPrefs.getUserLocale())); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting autologin cookie for user " + user.getLogin()); ! } ! Cookie cookie = new Cookie(Constants.COOKIE_NAME, ""); ! cookie.setPath(request.getContextPath()); ! if (userPrefs.getSaveLogin()) { ! if (encPassword != null) { ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("User allows autologin"); ! } ! cookie.setComment("ITracker autologin cookie"); ! cookie.setValue(user.getLogin() + "~" + encPassword); ! cookie.setMaxAge(30 * 24 * 60 * 60); ! } ! } else { if (Logger.isLoggingDebug()) { ! Logger.logDebug("User does not allow autologin"); } ! cookie.setValue(""); ! cookie.setMaxAge(0); } ! response.addCookie(cookie); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting permissions for user " + user.getLogin()); } ! HashMap permissions = uh.getUserPermissions(user, AuthenticationConstants.REQ_SOURCE_WEB); ! session.setAttribute(Constants.PERMISSIONS_KEY, permissions); ! // Reset some session forms ! session.setAttribute(Constants.SEARCH_QUERY_KEY, null); ! SessionManager.clearSessionNeedsReset(user.getLogin()); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("User session data updated."); ! } ! return user; } } --- 224,302 ---- } ! UserHandler uh = getITrackerServices().getUserHandler(); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Creating new session"); ! } ! HttpSession session = request.getSession(true); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting session timeout to " + getConfiguredSessionTimeout() + " minutes"); ! } ! session.setMaxInactiveInterval(getConfiguredSessionTimeout() * 60); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting session tracker"); ! } ! session.setAttribute(Constants.SESSION_TRACKER_KEY, new SessionTracker(user.getLogin(), session.getId())); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting user information"); ! } ! session.setAttribute(Constants.USER_KEY, user); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting preferences for user " + user.getLogin()); ! } ! UserPreferencesModel userPrefs = uh.getUserPreferencesByUserId(user.getId()); ! session.setAttribute(Constants.PREFERENCES_KEY, userPrefs); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting user locale to " + ITrackerResources.getLocale(userPrefs.getUserLocale())); ! } ! session.setAttribute(Constants.LOCALE_KEY, ITrackerResources.getLocale(userPrefs.getUserLocale())); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting autologin cookie for user " + user.getLogin()); ! } ! Cookie cookie = new Cookie(Constants.COOKIE_NAME, ""); ! cookie.setPath(request.getContextPath()); ! if (userPrefs.getSaveLogin()) { ! if (encPassword != null) { if (Logger.isLoggingDebug()) { ! Logger.logDebug("User allows autologin"); } ! cookie.setComment("ITracker autologin cookie"); ! cookie.setValue(user.getLogin() + "~" + encPassword); ! cookie.setMaxAge(30 * 24 * 60 * 60); } ! } else { if (Logger.isLoggingDebug()) { ! Logger.logDebug("User does not allow autologin"); } ! cookie.setValue(""); ! cookie.setMaxAge(0); ! } ! response.addCookie(cookie); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("Setting permissions for user " + user.getLogin()); ! } ! HashMap permissions = uh.getUserPermissions(user, AuthenticationConstants.REQ_SOURCE_WEB); ! session.setAttribute(Constants.PERMISSIONS_KEY, permissions); ! // Reset some session forms ! session.setAttribute(Constants.SEARCH_QUERY_KEY, null); ! ! SessionManager.clearSessionNeedsReset(user.getLogin()); ! if (Logger.isLoggingDebug()) { ! Logger.logDebug("User session data updated."); ! } ! return user; } + private int getConfiguredSessionTimeout() { + return (getITrackerServices().getSystemConfiguration().getIntegerProperty("web_session_timeout", + SESSION_TIMEOUT)); + } } |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:36:14
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27435 Modified Files: Tag: itrackerhibernate LockUserAction.java Log Message: no longer instantiating service objects, but using the only instance of the service layer and data access objects created by spring Index: LockUserAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/LockUserAction.java,v retrieving revision 1.5.4.3 retrieving revision 1.5.4.4 diff -C2 -d -r1.5.4.3 -r1.5.4.4 *** LockUserAction.java 23 Oct 2005 22:58:05 -0000 1.5.4.3 --- LockUserAction.java 30 Oct 2005 16:35:59 -0000 1.5.4.4 *************** *** 54,58 **** try { ! UserHandler uh = new UserHandlerBean(); Integer userId = new Integer((request.getParameter("id") == null ? "-1" : (request.getParameter("id")))); --- 54,58 ---- try { ! UserHandler uh = getITrackerServices().getUserHandler(); Integer userId = new Integer((request.getParameter("id") == null ? "-1" : (request.getParameter("id")))); |
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27374 Modified Files: Tag: itrackerhibernate MoveIssueFormAction.java OrderConfigurationItemAction.java OrderCustomFieldValueAction.java RemoveConfigurationItemAction.java RemoveCustomFieldAction.java RemoveCustomFieldValueAction.java RemoveHistoryEntryAction.java RemoveIssueAttachmentAction.java RemoveTaskAction.java SearchIssuesFormAction.java SelfRegisterAction.java Log Message: no longer instantiating service objects, but using the only instance of the service layer and data access objects created by spring Index: RemoveIssueAttachmentAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/RemoveIssueAttachmentAction.java,v retrieving revision 1.7.4.3 retrieving revision 1.7.4.4 diff -C2 -d -r1.7.4.3 -r1.7.4.4 *** RemoveIssueAttachmentAction.java 23 Oct 2005 22:58:05 -0000 1.7.4.3 --- RemoveIssueAttachmentAction.java 30 Oct 2005 16:35:45 -0000 1.7.4.4 *************** *** 56,60 **** try { ! IssueHandler ih = new IssueHandlerBean(); try { --- 56,60 ---- try { ! IssueHandler ih = getITrackerServices().getIssueHandler(); try { *************** *** 63,67 **** if(attachment != null) { ! SystemConfiguration sc = new SystemConfigurationBean(); File attachmentFile = new File( sc.getProperty("attachment_dir") + File.separator + attachment.getFileName()); --- 63,67 ---- if(attachment != null) { ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); File attachmentFile = new File( sc.getProperty("attachment_dir") + File.separator + attachment.getFileName()); Index: SearchIssuesFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/SearchIssuesFormAction.java,v retrieving revision 1.12.4.3 retrieving revision 1.12.4.4 diff -C2 -d -r1.12.4.3 -r1.12.4.4 *** SearchIssuesFormAction.java 23 Oct 2005 15:33:52 -0000 1.12.4.3 --- SearchIssuesFormAction.java 30 Oct 2005 16:35:45 -0000 1.12.4.4 *************** *** 37,41 **** 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.IssueSearchQueryModel; --- 37,40 ---- *************** *** 63,67 **** try { ! ProjectHandler ph = new ProjectHandlerBean(); UserPreferencesModel userPrefs = (UserPreferencesModel) session.getAttribute(Constants.PREFERENCES_KEY); --- 62,66 ---- try { ! ProjectHandler ph = getITrackerServices().getProjectHandler(); UserPreferencesModel userPrefs = (UserPreferencesModel) session.getAttribute(Constants.PREFERENCES_KEY); Index: SelfRegisterAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/SelfRegisterAction.java,v retrieving revision 1.8.4.3 retrieving revision 1.8.4.4 diff -C2 -d -r1.8.4.3 -r1.8.4.4 *** SelfRegisterAction.java 23 Oct 2005 22:58:05 -0000 1.8.4.3 --- SelfRegisterAction.java 30 Oct 2005 16:35:45 -0000 1.8.4.4 *************** *** 31,36 **** import org.apache.struts.action.ActionMapping; - import cowsultants.itracker.ejb.beans.session.SystemConfigurationBean; - import cowsultants.itracker.ejb.beans.session.UserHandlerBean; import cowsultants.itracker.ejb.client.exceptions.UserException; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; --- 31,34 ---- *************** *** 58,62 **** try { ! SystemConfiguration sc = new SystemConfigurationBean(); boolean allowSelfRegister = sc.getBooleanProperty("allow_self_register", false); --- 56,60 ---- try { ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); boolean allowSelfRegister = sc.getBooleanProperty("allow_self_register", false); *************** *** 74,78 **** errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("itracker.web.error.missingfields")); } else { ! UserHandler uh = new UserHandlerBean(); try { --- 72,76 ---- errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("itracker.web.error.missingfields")); } else { ! UserHandler uh = getITrackerServices().getUserHandler(); try { Index: RemoveCustomFieldAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/RemoveCustomFieldAction.java,v retrieving revision 1.4.4.4 retrieving revision 1.4.4.5 diff -C2 -d -r1.4.4.4 -r1.4.4.5 *** RemoveCustomFieldAction.java 28 Oct 2005 14:05:19 -0000 1.4.4.4 --- RemoveCustomFieldAction.java 30 Oct 2005 16:35:45 -0000 1.4.4.5 *************** *** 61,65 **** try { ! SystemConfiguration sc = new SystemConfigurationBean(); Integer valueId = (Integer) PropertyUtils.getSimpleProperty(form, "id"); --- 61,65 ---- try { ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); Integer valueId = (Integer) PropertyUtils.getSimpleProperty(form, "id"); Index: OrderCustomFieldValueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/OrderCustomFieldValueAction.java,v retrieving revision 1.6.4.4 retrieving revision 1.6.4.5 diff -C2 -d -r1.6.4.4 -r1.6.4.5 *** OrderCustomFieldValueAction.java 28 Oct 2005 14:05:19 -0000 1.6.4.4 --- OrderCustomFieldValueAction.java 30 Oct 2005 16:35:45 -0000 1.6.4.5 *************** *** 59,63 **** try { ! SystemConfiguration sc = new SystemConfigurationBean(); Integer valueId = (Integer) PropertyUtils.getSimpleProperty(form, "id"); --- 59,63 ---- try { ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); Integer valueId = (Integer) PropertyUtils.getSimpleProperty(form, "id"); Index: RemoveConfigurationItemAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/RemoveConfigurationItemAction.java,v retrieving revision 1.8.4.4 retrieving revision 1.8.4.5 diff -C2 -d -r1.8.4.4 -r1.8.4.5 *** RemoveConfigurationItemAction.java 23 Oct 2005 22:58:05 -0000 1.8.4.4 --- RemoveConfigurationItemAction.java 30 Oct 2005 16:35:45 -0000 1.8.4.5 *************** *** 66,70 **** try { ! SystemConfiguration sc = new SystemConfigurationBean(); Integer configId = (Integer) PropertyUtils.getSimpleProperty(form, "id"); --- 66,70 ---- try { ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); Integer configId = (Integer) PropertyUtils.getSimpleProperty(form, "id"); *************** *** 109,113 **** Integer currUserId = (currUser == null ? new Integer(-1) : currUser.getId()); ! IssueHandler ih = new IssueHandlerBean(); IssueModel[] issues = ih.getIssuesWithSeverity(currSeverity); for(int i = 0; i < issues.length; i++) { --- 109,113 ---- Integer currUserId = (currUser == null ? new Integer(-1) : currUser.getId()); ! IssueHandler ih = getITrackerServices().getIssueHandler(); IssueModel[] issues = ih.getIssuesWithSeverity(currSeverity); for(int i = 0; i < issues.length; i++) { *************** *** 158,162 **** 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++) { --- 158,162 ---- Integer currUserId = (currUser == null ? new Integer(-1) : currUser.getId()); ! IssueHandler ih = getITrackerServices().getIssueHandler(); IssueModel[] issues = ih.getIssuesWithStatus(currStatus); for(int i = 0; i < issues.length; i++) { Index: RemoveTaskAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/RemoveTaskAction.java,v retrieving revision 1.8.4.3 retrieving revision 1.8.4.4 diff -C2 -d -r1.8.4.3 -r1.8.4.4 *** RemoveTaskAction.java 23 Oct 2005 22:58:05 -0000 1.8.4.3 --- RemoveTaskAction.java 30 Oct 2005 16:35:45 -0000 1.8.4.4 *************** *** 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; --- 19,25 ---- package cowsultants.itracker.web.actions; import java.io.IOException; import java.util.HashMap; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 58,62 **** } ! SchedulerHandler sh = new SchedulerHandlerBean(); Integer taskId = new Integer((request.getParameter("id") == null ? "-1" : request.getParameter("id"))); --- 58,62 ---- } ! SchedulerHandler sh = getITrackerServices().getSchedulerHandler(); Integer taskId = new Integer((request.getParameter("id") == null ? "-1" : request.getParameter("id"))); Index: RemoveHistoryEntryAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/RemoveHistoryEntryAction.java,v retrieving revision 1.6.4.3 retrieving revision 1.6.4.4 diff -C2 -d -r1.6.4.3 -r1.6.4.4 *** RemoveHistoryEntryAction.java 23 Oct 2005 22:58:05 -0000 1.6.4.3 --- RemoveHistoryEntryAction.java 30 Oct 2005 16:35:45 -0000 1.6.4.4 *************** *** 51,55 **** try { ! IssueHandler ih = new IssueHandlerBean(); Integer historyId = (Integer) PropertyUtils.getSimpleProperty(form, "historyId"); --- 51,55 ---- try { ! IssueHandler ih = getITrackerServices().getIssueHandler(); Integer historyId = (Integer) PropertyUtils.getSimpleProperty(form, "historyId"); Index: MoveIssueFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/MoveIssueFormAction.java,v retrieving revision 1.8.4.3 retrieving revision 1.8.4.4 diff -C2 -d -r1.8.4.3 -r1.8.4.4 *** MoveIssueFormAction.java 28 Oct 2005 14:05:19 -0000 1.8.4.3 --- MoveIssueFormAction.java 30 Oct 2005 16:35:45 -0000 1.8.4.4 *************** *** 35,39 **** import org.apache.struts.validator.DynaValidatorForm; - import cowsultants.itracker.ejb.beans.session.ProjectHandlerBean; import cowsultants.itracker.ejb.client.interfaces.IssueHandler; import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; --- 35,38 ---- *************** *** 59,63 **** try { IssueHandler ih = getITrackerServices().getIssueHandler(); ! ProjectHandler ph = new ProjectHandlerBean(); Integer issueId = new Integer((request.getParameter("id") == null ? "-1" : (request.getParameter("id")))); --- 58,62 ---- try { IssueHandler ih = getITrackerServices().getIssueHandler(); ! ProjectHandler ph = getITrackerServices().getProjectHandler(); Integer issueId = new Integer((request.getParameter("id") == null ? "-1" : (request.getParameter("id")))); Index: OrderConfigurationItemAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/OrderConfigurationItemAction.java,v retrieving revision 1.7.4.3 retrieving revision 1.7.4.4 diff -C2 -d -r1.7.4.3 -r1.7.4.4 *** OrderConfigurationItemAction.java 23 Oct 2005 22:58:05 -0000 1.7.4.3 --- OrderConfigurationItemAction.java 30 Oct 2005 16:35:45 -0000 1.7.4.4 *************** *** 58,62 **** try { ! SystemConfiguration sc = new SystemConfigurationBean(); Integer configId = (Integer) PropertyUtils.getSimpleProperty(form, "id"); --- 58,62 ---- try { ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); Integer configId = (Integer) PropertyUtils.getSimpleProperty(form, "id"); Index: RemoveCustomFieldValueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/RemoveCustomFieldValueAction.java,v retrieving revision 1.5.4.3 retrieving revision 1.5.4.4 diff -C2 -d -r1.5.4.3 -r1.5.4.4 *** RemoveCustomFieldValueAction.java 23 Oct 2005 22:58:05 -0000 1.5.4.3 --- RemoveCustomFieldValueAction.java 30 Oct 2005 16:35:45 -0000 1.5.4.4 *************** *** 63,67 **** try { ! SystemConfiguration sc = new SystemConfigurationBean(); Integer valueId = (Integer) PropertyUtils.getSimpleProperty(form, "id"); --- 63,67 ---- try { ! SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); Integer valueId = (Integer) PropertyUtils.getSimpleProperty(form, "id"); |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:35:28
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv27312 Modified Files: Tag: itrackerhibernate UnlockUserAction.java Log Message: no longer instantiating service objects, but using the only instance of the service layer and data access objects created by spring Index: UnlockUserAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/UnlockUserAction.java,v retrieving revision 1.5.4.3 retrieving revision 1.5.4.4 diff -C2 -d -r1.5.4.3 -r1.5.4.4 *** UnlockUserAction.java 23 Oct 2005 22:58:05 -0000 1.5.4.3 --- UnlockUserAction.java 30 Oct 2005 16:35:16 -0000 1.5.4.4 *************** *** 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; --- 19,24 ---- package cowsultants.itracker.web.actions; import java.io.IOException; + import javax.servlet.ServletException; import javax.servlet.http.HttpServletRequest; *************** *** 51,55 **** try { ! UserHandler uh = new UserHandlerBean(); Integer userId = new Integer((request.getParameter("id") == null ? "-1" : (request.getParameter("id")))); --- 51,55 ---- try { ! UserHandler uh = getITrackerServices().getUserHandler(); Integer userId = new Integer((request.getParameter("id") == null ? "-1" : (request.getParameter("id")))); |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:32:25
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26578 Modified Files: Tag: itrackerhibernate ITrackerMessageResourcesFactory.java Log Message: removed unneeded serialID Index: ITrackerMessageResourcesFactory.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/resources/ITrackerMessageResourcesFactory.java,v retrieving revision 1.3.4.2 retrieving revision 1.3.4.3 diff -C2 -d -r1.3.4.2 -r1.3.4.3 *** ITrackerMessageResourcesFactory.java 16 Oct 2005 12:09:48 -0000 1.3.4.2 --- ITrackerMessageResourcesFactory.java 30 Oct 2005 16:32:17 -0000 1.3.4.3 *************** *** 24,32 **** public class ITrackerMessageResourcesFactory extends MessageResourcesFactory { - /** - * - */ - private static final long serialVersionUID = 1L; - public MessageResources createResources(String config) { return new ITrackerMessageResources(this, config, this.returnNull); --- 24,27 ---- |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:31:07
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/servlets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv26310 Modified Files: Tag: itrackerhibernate AttachmentDownloadController.java Log Message: small change from Marc's commit, instead of calling the utility method directly, called it from the superclass Index: AttachmentDownloadController.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/servlets/AttachmentDownloadController.java,v retrieving revision 1.13.4.4 retrieving revision 1.13.4.5 diff -C2 -d -r1.13.4.4 -r1.13.4.5 *** AttachmentDownloadController.java 29 Oct 2005 02:10:30 -0000 1.13.4.4 --- AttachmentDownloadController.java 30 Oct 2005 16:30:56 -0000 1.13.4.5 *************** *** 19,39 **** package cowsultants.itracker.web.servlets; ! import java.io.*; ! import javax.servlet.*; ! import javax.servlet.http.*; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; ! import cowsultants.itracker.ejb.client.interfaces.*; ! import cowsultants.itracker.ejb.client.models.*; ! import cowsultants.itracker.ejb.client.util.*; ! import cowsultants.itracker.web.util.ServletContextUtils; public class AttachmentDownloadController extends GenericController { - /** - * - */ - private static final long serialVersionUID = 1L; public AttachmentDownloadController() { --- 19,41 ---- package cowsultants.itracker.web.servlets; ! ! import java.io.IOException; ! ! import javax.servlet.ServletConfig; ! import javax.servlet.ServletException; ! import javax.servlet.ServletOutputStream; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! import javax.servlet.http.HttpSession; import org.apache.struts.action.ActionError; import org.apache.struts.action.ActionErrors; ! import cowsultants.itracker.ejb.client.interfaces.IssueHandler; ! import cowsultants.itracker.ejb.client.models.IssueAttachmentModel; ! import cowsultants.itracker.ejb.client.models.UserModel; ! import cowsultants.itracker.ejb.client.util.Logger; public class AttachmentDownloadController extends GenericController { public AttachmentDownloadController() { *************** *** 53,58 **** UserModel user = (UserModel) session.getAttribute("user"); try { ! IssueHandler ih = ServletContextUtils.getItrackerServices ! ( request.getSession().getServletContext() ).getIssueHandler(); Integer attachmentId = null; --- 55,59 ---- UserModel user = (UserModel) session.getAttribute("user"); try { ! IssueHandler ih = getITrackerServices().getIssueHandler(); Integer attachmentId = null; |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:12:18
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/servlets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22956 Modified Files: Tag: itrackerhibernate GenericController.java Log Message: arranged imports added utility method to make ITrackerServices available to subclasses Index: GenericController.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/servlets/GenericController.java,v retrieving revision 1.4 retrieving revision 1.4.4.1 diff -C2 -d -r1.4 -r1.4.4.1 *** GenericController.java 19 Apr 2004 12:26:17 -0000 1.4 --- GenericController.java 30 Oct 2005 16:12:06 -0000 1.4.4.1 *************** *** 19,33 **** package cowsultants.itracker.web.servlets; ! import java.io.*; ! import java.util.*; ! import javax.servlet.*; ! import javax.servlet.http.*; import org.apache.struts.Globals; import org.apache.struts.action.ActionErrors; ! import cowsultants.itracker.ejb.client.models.*; ! import cowsultants.itracker.ejb.client.util.*; ! import cowsultants.itracker.web.util.*; public abstract class GenericController extends HttpServlet { --- 19,40 ---- package cowsultants.itracker.web.servlets; ! import java.io.IOException; ! import java.util.HashMap; ! ! import javax.servlet.RequestDispatcher; ! import javax.servlet.ServletException; ! import javax.servlet.http.HttpServlet; ! import javax.servlet.http.HttpServletRequest; ! import javax.servlet.http.HttpServletResponse; ! import javax.servlet.http.HttpSession; import org.apache.struts.Globals; import org.apache.struts.action.ActionErrors; ! import cowsultants.itracker.ejb.beans.session.ITrackerServices; ! import cowsultants.itracker.ejb.client.models.UserModel; ! import cowsultants.itracker.ejb.client.util.UserUtilities; ! import cowsultants.itracker.web.util.Constants; ! import cowsultants.itracker.web.util.ServletContextUtils; public abstract class GenericController extends HttpServlet { *************** *** 108,111 **** --- 115,124 ---- response.sendRedirect(baseURL + url); } + + + protected ITrackerServices getITrackerServices() { + return ServletContextUtils.getItrackerServices(getServletContext()); + } + } |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:11:11
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/servlets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22716 Modified Files: Tag: itrackerhibernate SchedulerController.java Log Message: no longer a servlet (didn't need to be) Index: SchedulerController.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/servlets/SchedulerController.java,v retrieving revision 1.7.4.3 retrieving revision 1.7.4.4 diff -C2 -d -r1.7.4.3 -r1.7.4.4 *** SchedulerController.java 29 Oct 2005 00:28:27 -0000 1.7.4.3 --- SchedulerController.java 30 Oct 2005 16:11:00 -0000 1.7.4.4 *************** *** 19,46 **** package cowsultants.itracker.web.servlets; - import java.io.IOException; - - import javax.servlet.ServletConfig; - import javax.servlet.ServletException; - import javax.servlet.http.HttpServletRequest; - import javax.servlet.http.HttpServletResponse; - - import cowsultants.itracker.ejb.beans.session.SchedulerHandlerBean; import cowsultants.itracker.ejb.client.interfaces.SchedulerHandler; import cowsultants.itracker.ejb.client.models.ScheduledTaskModel; import cowsultants.itracker.web.scheduler.Scheduler; ! public class SchedulerController extends GenericController { ! Scheduler scheduler = null; ! ! public SchedulerController() { ! } ! public void init(ServletConfig config) { scheduler = new Scheduler(); scheduler.setPriority(4); ! scheduler.start(); ! ! SchedulerHandler sh = new SchedulerHandlerBean(); ScheduledTaskModel[] tasks = sh.getAllTasks(); --- 19,34 ---- package cowsultants.itracker.web.servlets; import cowsultants.itracker.ejb.client.interfaces.SchedulerHandler; import cowsultants.itracker.ejb.client.models.ScheduledTaskModel; import cowsultants.itracker.web.scheduler.Scheduler; ! public class SchedulerController { ! ! Scheduler scheduler; ! public SchedulerController(SchedulerHandler sh) { scheduler = new Scheduler(); scheduler.setPriority(4); ! scheduler.start(); ScheduledTaskModel[] tasks = sh.getAllTasks(); *************** *** 51,61 **** } } - - public void service(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException { - } - - public void destroy() { - scheduler.setStop(true); - scheduler = null; - } } --- 39,41 ---- |
From: Ricardo T. <rj...@us...> - 2005-10-30 16:10:07
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22489 Modified Files: Tag: itrackerhibernate SessionManager.java Log Message: arranged imports Index: SessionManager.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/util/SessionManager.java,v retrieving revision 1.5 retrieving revision 1.5.4.1 diff -C2 -d -r1.5 -r1.5.4.1 *** SessionManager.java 22 Dec 2004 18:31:00 -0000 1.5 --- SessionManager.java 30 Oct 2005 16:09:57 -0000 1.5.4.1 *************** *** 19,23 **** package cowsultants.itracker.web.util; ! import java.util.*; public class SessionManager { --- 19,25 ---- package cowsultants.itracker.web.util; ! import java.util.Date; ! import java.util.HashMap; ! import java.util.Iterator; public class SessionManager { |