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
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/taglib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/web/taglib Modified Files: Tag: itrackerhnodto CheckLoginTag.java FormatCustomFieldTag.java FormatImageActionTag.java FormatIssueOwnerTag.java Log Message: removal of value objects Index: FormatCustomFieldTag.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/taglib/FormatCustomFieldTag.java,v retrieving revision 1.18.4.2 retrieving revision 1.18.4.2.2.1 diff -C2 -d -r1.18.4.2 -r1.18.4.2.2.1 *** FormatCustomFieldTag.java 16 Oct 2005 12:09:48 -0000 1.18.4.2 --- FormatCustomFieldTag.java 6 Dec 2005 12:38:02 -0000 1.18.4.2.2.1 *************** *** 19,24 **** --- 19,28 ---- package cowsultants.itracker.web.taglib; + import cowsultants.itracker.ejb.beans.entity.CustomFieldBean; + import cowsultants.itracker.ejb.client.util.NameValuePair; import java.net.MalformedURLException; + import java.util.Collection; import java.util.HashMap; + import java.util.Iterator; import java.util.Locale; *************** *** 30,35 **** import org.apache.struts.util.ResponseUtils; - import cowsultants.itracker.ejb.client.models.CustomFieldModel; - import cowsultants.itracker.ejb.client.models.NameValuePairModel; import cowsultants.itracker.ejb.client.util.CustomFieldUtilities; import cowsultants.itracker.ejb.client.util.Logger; --- 34,37 ---- *************** *** 45,49 **** public static final String DISPLAY_TYPE_VIEW = "view"; ! private CustomFieldModel field; private String currentValue; private String displayType; --- 47,51 ---- public static final String DISPLAY_TYPE_VIEW = "view"; ! private CustomFieldBean field; private String currentValue; private String displayType; *************** *** 51,59 **** private HashMap listOptions; ! public CustomFieldModel getField() { return field; } ! public void setField(CustomFieldModel value) { field = value; } --- 53,61 ---- private HashMap listOptions; ! public CustomFieldBean getField() { return field; } ! public void setField(CustomFieldBean value) { field = value; } *************** *** 123,134 **** if(field.getFieldType() == CustomFieldUtilities.TYPE_LIST) { Logger.logDebug("Looking for options for field " + field.getId()); ! NameValuePairModel[] options = WorkflowUtilities.getListOptions(getListOptions(), field.getId()); ! Logger.logDebug("Found " + options.length + " options."); buf.append("<select name=\"customFields(" + field.getId() + ")\" class=\"editColumnText\">\n"); ! for(int i = 0; i < options.length; i++) { ! buf.append("<option value=\"" + options[i].getValue() + "\""); ! buf.append((currentValue != null && currentValue.equals(options[i].getValue()) ? " selected=\"selected\"" : "")); buf.append(" class=\"editColumnText\">"); ! buf.append(options[i].getName()); buf.append("</option>\n"); } --- 125,139 ---- if(field.getFieldType() == CustomFieldUtilities.TYPE_LIST) { Logger.logDebug("Looking for options for field " + field.getId()); ! Collection options = WorkflowUtilities.getListOptions(getListOptions(), field.getId()); ! Logger.logDebug("Found " + options.size() + " options."); buf.append("<select name=\"customFields(" + field.getId() + ")\" class=\"editColumnText\">\n"); ! ! Iterator optionsIter = options.iterator(); ! while(optionsIter.hasNext()) { ! NameValuePair option = (NameValuePair) optionsIter.next(); ! buf.append("<option value=\"" + option.getValue() + "\""); ! buf.append((currentValue != null && currentValue.equals(option.getValue()) ? " selected=\"selected\"" : "")); buf.append(" class=\"editColumnText\">"); ! buf.append(option.getName()); buf.append("</option>\n"); } Index: FormatImageActionTag.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/taglib/FormatImageActionTag.java,v retrieving revision 1.8.4.2 retrieving revision 1.8.4.2.2.1 diff -C2 -d -r1.8.4.2 -r1.8.4.2.2.1 *** FormatImageActionTag.java 16 Oct 2005 12:15:55 -0000 1.8.4.2 --- FormatImageActionTag.java 6 Dec 2005 12:38:02 -0000 1.8.4.2.2.1 *************** *** 19,22 **** --- 19,23 ---- package cowsultants.itracker.web.taglib; + import cowsultants.itracker.ejb.beans.entity.UserPreferencesBean; import java.net.MalformedURLException; import java.util.Locale; *************** *** 29,33 **** import org.apache.struts.util.ResponseUtils; - import cowsultants.itracker.ejb.client.models.UserPreferencesModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.web.util.Constants; --- 30,33 ---- *************** *** 160,164 **** if(session != null) { currLocale = (Locale) session.getAttribute(Constants.LOCALE_KEY); ! UserPreferencesModel currUserPrefs = (UserPreferencesModel) session.getAttribute(Constants.PREFERENCES_KEY); useTextActions = (currUserPrefs != null ? currUserPrefs.getUseTextActions() : false); } --- 160,164 ---- if(session != null) { currLocale = (Locale) session.getAttribute(Constants.LOCALE_KEY); ! UserPreferencesBean currUserPrefs = (UserPreferencesBean) session.getAttribute(Constants.PREFERENCES_KEY); useTextActions = (currUserPrefs != null ? currUserPrefs.getUseTextActions() : false); } Index: CheckLoginTag.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/taglib/CheckLoginTag.java,v retrieving revision 1.15.4.6 retrieving revision 1.15.4.6.2.1 diff -C2 -d -r1.15.4.6 -r1.15.4.6.2.1 *** CheckLoginTag.java 29 Oct 2005 12:53:58 -0000 1.15.4.6 --- CheckLoginTag.java 6 Dec 2005 12:38:02 -0000 1.15.4.6.2.1 *************** *** 19,22 **** --- 19,23 ---- package cowsultants.itracker.web.taglib; + import cowsultants.itracker.ejb.beans.entity.UserBean; import java.io.IOException; import java.util.HashMap; *************** *** 35,39 **** 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.Logger; import cowsultants.itracker.ejb.client.util.UserUtilities; --- 36,39 ---- *************** *** 90,94 **** (request.getQueryString() != null ? "?" + request.getQueryString() : ""); ! HttpSession session = pageContext.getSession(); try { --- 90,94 ---- (request.getQueryString() != null ? "?" + request.getQueryString() : ""); ! HttpSession session = pageContext.getSession(); try { *************** *** 100,104 **** } ! UserModel user = (UserModel) session.getAttribute(Constants.USER_KEY); String login = (user == null ? null : user.getLogin()); HashMap permissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); --- 100,104 ---- } ! UserBean user = (UserBean) session.getAttribute(Constants.USER_KEY); String login = (user == null ? null : user.getLogin()); HashMap permissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); Index: FormatIssueOwnerTag.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/taglib/FormatIssueOwnerTag.java,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.2.2.1 diff -C2 -d -r1.4.4.2 -r1.4.4.2.2.1 *** FormatIssueOwnerTag.java 16 Oct 2005 12:15:55 -0000 1.4.4.2 --- FormatIssueOwnerTag.java 6 Dec 2005 12:38:02 -0000 1.4.4.2.2.1 *************** *** 19,22 **** --- 19,23 ---- package cowsultants.itracker.web.taglib; + import cowsultants.itracker.ejb.beans.entity.IssueBean; import java.util.Locale; *************** *** 27,31 **** import org.apache.struts.util.ResponseUtils; - import cowsultants.itracker.ejb.client.models.IssueModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.web.util.Constants; --- 28,31 ---- *************** *** 35,42 **** * */ ! private static final long serialVersionUID = 1L; ! private String emptyKey = "itracker.web.generic.unassigned"; private String format; ! private IssueModel issue; public String getFormat() { --- 35,42 ---- * */ ! private static final long serialVersionUID = 1L; ! private String emptyKey = "itracker.web.generic.unassigned"; private String format; ! private IssueBean issue; public String getFormat() { *************** *** 48,56 **** } ! public IssueModel getIssue() { return issue; } ! public void setIssue(IssueModel value) { issue = value; } --- 48,56 ---- } ! public IssueBean getIssue() { return issue; } ! public void setIssue(IssueBean value) { issue = value; } *************** *** 77,89 **** } ! if(issue == null || issue.getOwnerId() == null || issue.getOwnerId().intValue() < 0) { value = ITrackerResources.getString(emptyKey, currLocale); } else { try { if("short".equalsIgnoreCase(format)) { ! value = (issue.getOwnerFirstName().length() > 0 ? issue.getOwnerFirstName().substring(0,1).toUpperCase() + "." : "") + ! " " + issue.getOwnerLastName(); } else { ! value = issue.getOwnerFirstName() + " " + issue.getOwnerLastName(); } } catch(Exception e) { --- 77,89 ---- } ! if(issue == null || issue.getOwner() == null || issue.getOwner().getId().intValue() < 0) { value = ITrackerResources.getString(emptyKey, currLocale); } else { try { if("short".equalsIgnoreCase(format)) { ! value = (issue.getOwner().getFirstName().length() > 0 ? issue.getOwner().getFirstName().substring(0,1).toUpperCase() + "." : "") + ! " " + issue.getOwner().getLastName(); } else { ! value = issue.getOwner().getFirstName() + " " + issue.getOwner().getLastName(); } } catch(Exception e) { |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:21
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/reports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/web/reports Modified Files: Tag: itrackerhnodto AbstractITrackerJFreeReport.java AbstractITrackerJasperReport.java AbstractITrackerReport.java ITrackerReport.java IssueTableModel.java ProjectTableModel.java ReportTableModel.java Log Message: removal of value objects Index: AbstractITrackerReport.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/reports/AbstractITrackerReport.java,v retrieving revision 1.6.4.2 retrieving revision 1.6.4.2.2.1 diff -C2 -d -r1.6.4.2 -r1.6.4.2.2.1 *** AbstractITrackerReport.java 15 Oct 2005 11:42:26 -0000 1.6.4.2 --- AbstractITrackerReport.java 6 Dec 2005 12:38:02 -0000 1.6.4.2.2.1 *************** *** 19,22 **** --- 19,24 ---- package cowsultants.itracker.web.reports; + import cowsultants.itracker.ejb.beans.entity.ReportBean; + import java.util.Collection; import java.util.Locale; *************** *** 28,33 **** import cowsultants.itracker.ejb.client.exceptions.ReportException; - import cowsultants.itracker.ejb.client.models.IssueModel; - import cowsultants.itracker.ejb.client.models.ReportModel; /** --- 30,33 ---- *************** *** 37,42 **** */ public abstract class AbstractITrackerReport implements ITrackerReport { ! protected IssueModel[] issues = null; ! protected ReportModel report = null; protected Locale locale = null; protected String reportOutput = null; --- 37,42 ---- */ public abstract class AbstractITrackerReport implements ITrackerReport { ! protected Collection issues = null; ! protected ReportBean report = null; protected Locale locale = null; protected String reportOutput = null; *************** *** 50,54 **** * it for later use. */ ! public void initializeReport(IssueModel[] issues, ReportModel report, Locale locale, String reportOutput, HttpSession session) throws ReportException { storeInputs(issues, report, locale, reportOutput, session); } --- 50,54 ---- * it for later use. */ ! public void initializeReport(Collection issues, ReportBean report, Locale locale, String reportOutput, HttpSession session) throws ReportException { storeInputs(issues, report, locale, reportOutput, session); } *************** *** 107,111 **** public abstract Object getReport() throws ReportException; ! protected void storeInputs(IssueModel[] issues, ReportModel report, Locale locale, String reportOutput, HttpSession session) { this.issues = issues; this.report = report; --- 107,111 ---- public abstract Object getReport() throws ReportException; ! protected void storeInputs(Collection issues, ReportBean report, Locale locale, String reportOutput, HttpSession session) { this.issues = issues; this.report = report; Index: IssueTableModel.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/reports/IssueTableModel.java,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.1.2.1 diff -C2 -d -r1.7.4.1 -r1.7.4.1.2.1 *** IssueTableModel.java 11 Oct 2005 01:21:05 -0000 1.7.4.1 --- IssueTableModel.java 6 Dec 2005 12:38:02 -0000 1.7.4.1.2.1 *************** *** 19,25 **** package cowsultants.itracker.web.reports; import java.util.*; - import cowsultants.itracker.ejb.client.models.*; import cowsultants.itracker.ejb.client.resources.*; import cowsultants.itracker.ejb.client.util.*; --- 19,29 ---- package cowsultants.itracker.web.reports; + import cowsultants.itracker.ejb.beans.entity.CustomFieldBean; + import cowsultants.itracker.ejb.beans.entity.CustomFieldValueBean; + import cowsultants.itracker.ejb.beans.entity.IssueBean; + import cowsultants.itracker.ejb.beans.entity.IssueFieldBean; + import cowsultants.itracker.ejb.beans.entity.IssueHistoryBean; import java.util.*; import cowsultants.itracker.ejb.client.resources.*; import cowsultants.itracker.ejb.client.util.*; *************** *** 27,31 **** public class IssueTableModel extends ReportTableModel { ! public IssueTableModel(IssueModel[] issues, Locale locale) { super(issues, locale); } --- 31,35 ---- public class IssueTableModel extends ReportTableModel { ! public IssueTableModel(Collection issues, Locale locale) { super(issues, locale); } *************** *** 51,55 **** } ! IssueModel issue = (IssueModel) issues.elementAt(row); if(issue == null) { return null; --- 55,59 ---- } ! IssueBean issue = (IssueBean) issues.elementAt(row); if(issue == null) { return null; *************** *** 59,65 **** return issue.getId(); } else if (column == COLUMN_PROJECTID) { ! return issue.getProjectId(); } else if (column == COLUMN_PROJECTNAME) { ! return issue.getProjectName(); } else if (column == COLUMN_DESCRIPTION) { return issue.getDescription(); --- 63,69 ---- return issue.getId(); } else if (column == COLUMN_PROJECTID) { ! return issue.getProject().getId(); } else if (column == COLUMN_PROJECTNAME) { ! return issue.getProject().getName(); } else if (column == COLUMN_DESCRIPTION) { return issue.getDescription(); *************** *** 101,106 **** return IssueUtilities.historyToString(issue, sdf); } else if (column == COLUMN_LASTHISTORY) { ! if(issue.getHistory().length > 0) { ! IssueHistoryModel history = issue.getHistory()[issue.getHistory().length - 1]; return history.getDescription(); } else { --- 105,112 ---- return IssueUtilities.historyToString(issue, sdf); } else if (column == COLUMN_LASTHISTORY) { ! if(issue.getHistory().size() > 0) { ! Collection historyCollection = issue.getHistory(); ! IssueHistoryBean history = ! (IssueHistoryBean) issue.getHistory().toArray()[historyCollection.size() - 1]; return history.getDescription(); } else { *************** *** 108,113 **** } } else if (column == COLUMN_LASTHISTORYDATE) { ! if(issue.getHistory().length > 0) { ! IssueHistoryModel history = issue.getHistory()[issue.getHistory().length - 1]; return sdf.format(history.getLastModifiedDate()); } else { --- 114,121 ---- } } else if (column == COLUMN_LASTHISTORYDATE) { ! if(issue.getHistory().size() > 0) { ! Collection historyCollection = issue.getHistory(); ! IssueHistoryBean history = ! (IssueHistoryBean) issue.getHistory().toArray()[historyCollection.size() - 1]; return sdf.format(history.getLastModifiedDate()); } else { *************** *** 115,135 **** } } else if (column == COLUMN_LASTHISTORYUSER) { ! if(issue.getHistory().length > 0) { ! IssueHistoryModel history = issue.getHistory()[issue.getHistory().length - 1]; ! return history.getUserFirstName() + " " + history.getUserLastName(); } else { return ""; } ! } else if (column >= TOTAL_STATIC_COLUMNS && column < (TOTAL_STATIC_COLUMNS + customFields.length)) { try { ! CustomFieldModel customField = customFields[column - TOTAL_STATIC_COLUMNS]; if(customField != null) { ! for(int i = 0; i < issue.getFields().length; i++) { ! if(issue.getFields()[i].getCustomFieldId().equals(customField.getId())) { ! String value = issue.getFields()[i].getValue(reportLocale); if(customField.getFieldType() == CustomFieldUtilities.TYPE_LIST) { ! for(int j = 0; j < customField.getOptions().length; j++) { ! if(customField.getOptions()[j].getValue().equals(value)) { ! value = customField.getOptions()[j].getName(); break; } --- 123,150 ---- } } else if (column == COLUMN_LASTHISTORYUSER) { ! if(issue.getHistory().size() > 0) { ! Collection historyCollection = issue.getHistory(); ! IssueHistoryBean history = ! (IssueHistoryBean) issue.getHistory().toArray()[historyCollection.size() - 1]; ! return history.getUser().getFirstName() + " " + history.getUser().getLastName(); } else { return ""; } ! } else if (column >= TOTAL_STATIC_COLUMNS && column < (TOTAL_STATIC_COLUMNS + customFields.size())) { try { ! CustomFieldBean customField = getCustomFieldAt(customFields, column - TOTAL_STATIC_COLUMNS); if(customField != null) { ! Collection fields = issue.getFields(); ! Iterator iter = fields.iterator(); ! while(iter.hasNext()) { ! IssueFieldBean bean = (IssueFieldBean) iter.next(); ! if(bean.getId().equals(customField.getId())) { ! String value = bean.getValue(reportLocale); if(customField.getFieldType() == CustomFieldUtilities.TYPE_LIST) { ! Iterator valuesIterator = customField.getValues().iterator(); ! while(valuesIterator.hasNext()) { ! CustomFieldValueBean valueBean = (CustomFieldValueBean) valuesIterator.next(); ! if(valueBean.getValue().equals(value)) { ! value = valueBean.getName(); break; } *************** *** 148,150 **** --- 163,184 ---- } } + + private CustomFieldBean getCustomFieldAt(Collection collection, int index) { + CustomFieldBean result = null; + int i = 0; + + Iterator iter = collection.iterator(); + while(iter.hasNext()) { + CustomFieldBean bean = (CustomFieldBean) iter.next(); + + if(i == index) { + result = bean; + break; + } + + i++; + } + + return result; + } } Index: AbstractITrackerJasperReport.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/reports/AbstractITrackerJasperReport.java,v retrieving revision 1.6.4.1 retrieving revision 1.6.4.1.2.1 diff -C2 -d -r1.6.4.1 -r1.6.4.1.2.1 *** AbstractITrackerJasperReport.java 11 Oct 2005 01:21:05 -0000 1.6.4.1 --- AbstractITrackerJasperReport.java 6 Dec 2005 12:38:02 -0000 1.6.4.1.2.1 *************** *** 19,24 **** --- 19,26 ---- package cowsultants.itracker.web.reports; + import cowsultants.itracker.ejb.beans.entity.ReportBean; import java.io.ByteArrayInputStream; import java.io.File; + import java.util.Collection; import java.util.HashMap; import java.util.Locale; *************** *** 47,52 **** import cowsultants.itracker.ejb.client.exceptions.ReportException; - import cowsultants.itracker.ejb.client.models.IssueModel; - import cowsultants.itracker.ejb.client.models.ReportModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.ejb.client.util.Logger; --- 49,52 ---- *************** *** 71,75 **** * for the report and sets up the report locale. */ ! public void initializeReport(IssueModel[] issues, ReportModel report, Locale locale, String reportOutput, HttpSession session) throws ReportException { super.initializeReport(issues, report, locale, reportOutput, session); --- 71,75 ---- * for the report and sets up the report locale. */ ! public void initializeReport(Collection issues, ReportBean report, Locale locale, String reportOutput, HttpSession session) throws ReportException { super.initializeReport(issues, report, locale, reportOutput, session); Index: ProjectTableModel.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/reports/ProjectTableModel.java,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.2.2.1 diff -C2 -d -r1.4.4.2 -r1.4.4.2.2.1 *** ProjectTableModel.java 23 Oct 2005 12:46:12 -0000 1.4.4.2 --- ProjectTableModel.java 6 Dec 2005 12:38:02 -0000 1.4.4.2.2.1 *************** *** 19,25 **** package cowsultants.itracker.web.reports; import java.util.*; - import cowsultants.itracker.ejb.client.models.*; import cowsultants.itracker.ejb.client.util.*; --- 19,25 ---- package cowsultants.itracker.web.reports; + import cowsultants.itracker.ejb.beans.entity.IssueBean; import java.util.*; import cowsultants.itracker.ejb.client.util.*; *************** *** 27,31 **** private Vector projects; ! public ProjectTableModel(IssueModel[] issues, Locale locale) { super(issues, locale); } --- 27,31 ---- private Vector projects; ! public ProjectTableModel(Collection issues, Locale locale) { super(issues, locale); } *************** *** 80,84 **** } ! public void addValueAt(IssueModel issue, int row) { if(issue != null) { if(row < issues.size() && row >= 0) { --- 80,84 ---- } ! public void addValueAt(IssueBean issue, int row) { if(issue != null) { if(row < issues.size() && row >= 0) { *************** *** 94,98 **** for(int i = 0; i < projects.size(); i++) { ProjectData project = (ProjectData) projects.elementAt(i); ! if(project.getProjectId().intValue() == issue.getProjectId().intValue()) { project.addIssue(issue); return; --- 94,98 ---- for(int i = 0; i < projects.size(); i++) { ProjectData project = (ProjectData) projects.elementAt(i); ! if(project.getProjectId().intValue() == issue.getProject().getId().intValue()) { project.addIssue(issue); return; *************** *** 101,105 **** // No existing project was found ! ProjectData project = new ProjectData(issue.getProjectId(), issue.getProjectName()); project.addIssue(issue); projects.addElement(project); --- 101,105 ---- // No existing project was found ! ProjectData project = new ProjectData(issue.getProject().getId(), issue.getProject().getName()); project.addIssue(issue); projects.addElement(project); *************** *** 171,175 **** } ! public void addIssue(IssueModel issue) { if(issue != null) { totalIssues++; --- 171,175 ---- } ! public void addIssue(IssueBean issue) { if(issue != null) { totalIssues++; Index: ITrackerReport.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/reports/ITrackerReport.java,v retrieving revision 1.7 retrieving revision 1.7.6.1 diff -C2 -d -r1.7 -r1.7.6.1 *** ITrackerReport.java 28 Apr 2004 16:59:48 -0000 1.7 --- ITrackerReport.java 6 Dec 2005 12:38:02 -0000 1.7.6.1 *************** *** 19,22 **** --- 19,23 ---- package cowsultants.itracker.web.reports; + import cowsultants.itracker.ejb.beans.entity.ReportBean; import java.util.*; import javax.servlet.http.HttpServletRequest; *************** *** 27,32 **** import cowsultants.itracker.ejb.client.exceptions.ReportException; - import cowsultants.itracker.ejb.client.models.IssueModel; - import cowsultants.itracker.ejb.client.models.ReportModel; public interface ITrackerReport { --- 28,31 ---- *************** *** 35,40 **** * Initializes the report. It will be called immediately after the ITrackerReport * object is created. ! * @param issues an array of issues that is supplied as the data ! * @param report the report as a ReportModel * @param locale the locale to be used for the report output * @param reportOutput the requested output method --- 34,39 ---- * Initializes the report. It will be called immediately after the ITrackerReport * object is created. ! * @param issues a collection of issues that is supplied as the data ! * @param report the report as a ReportBean * @param locale the locale to be used for the report output * @param reportOutput the requested output method *************** *** 42,46 **** * @exception ReportException thrown if the report has not been properly initialized */ ! public void initializeReport(IssueModel[] issues, ReportModel report, Locale locale, String reportOutput, HttpSession session) throws ReportException; /** --- 41,45 ---- * @exception ReportException thrown if the report has not been properly initialized */ ! public void initializeReport(Collection issues, ReportBean report, Locale locale, String reportOutput, HttpSession session) throws ReportException; /** Index: ReportTableModel.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/reports/ReportTableModel.java,v retrieving revision 1.6 retrieving revision 1.6.6.1 diff -C2 -d -r1.6 -r1.6.6.1 *** ReportTableModel.java 10 May 2004 23:32:26 -0000 1.6 --- ReportTableModel.java 6 Dec 2005 12:38:02 -0000 1.6.6.1 *************** *** 19,27 **** package cowsultants.itracker.web.reports; import java.text.SimpleDateFormat; import java.util.*; import javax.swing.table.AbstractTableModel; - import cowsultants.itracker.ejb.client.models.*; import cowsultants.itracker.ejb.client.resources.*; import cowsultants.itracker.ejb.client.util.IssueUtilities; --- 19,28 ---- package cowsultants.itracker.web.reports; + import cowsultants.itracker.ejb.beans.entity.CustomFieldBean; + import cowsultants.itracker.ejb.beans.entity.IssueBean; import java.text.SimpleDateFormat; import java.util.*; import javax.swing.table.AbstractTableModel; import cowsultants.itracker.ejb.client.resources.*; import cowsultants.itracker.ejb.client.util.IssueUtilities; *************** *** 62,66 **** protected Vector issues; ! protected CustomFieldModel[] customFields = new CustomFieldModel[0]; protected Locale reportLocale; protected SimpleDateFormat sdf; --- 63,67 ---- protected Vector issues; ! protected ArrayList customFields = new ArrayList(); protected Locale reportLocale; protected SimpleDateFormat sdf; *************** *** 70,82 **** this.reportLocale = ITrackerResources.getLocale(); this.sdf = new SimpleDateFormat(ITrackerResources.getString("itracker.dateformat.full")); ! this.customFields = IssueUtilities.getCustomFields(ITrackerResources.getLocale()); } ! public ReportTableModel(IssueModel[] issues, Locale locale) { this(); if(issues != null) { ! for(int i = 0; i < issues.length; i++) { ! if(issues[i] != null) { ! addValue(issues[i]); } } --- 71,91 ---- this.reportLocale = ITrackerResources.getLocale(); this.sdf = new SimpleDateFormat(ITrackerResources.getString("itracker.dateformat.full")); ! Collection col = IssueUtilities.getCustomFields(ITrackerResources.getLocale()); ! if(col instanceof ArrayList) { ! this.customFields = (ArrayList) col; ! } ! else { ! this.customFields.addAll(col); ! } } ! public ReportTableModel(Collection issues, Locale locale) { this(); if(issues != null) { ! Iterator iter = issues.iterator(); ! while(iter.hasNext()) { ! IssueBean bean = (IssueBean) iter.next(); ! if(bean != null) { ! addValue(bean); } } *************** *** 85,89 **** this.reportLocale = locale; this.sdf = new SimpleDateFormat(ITrackerResources.getString("itracker.dateformat.full", locale)); ! this.customFields = IssueUtilities.getCustomFields(locale); } } --- 94,104 ---- this.reportLocale = locale; this.sdf = new SimpleDateFormat(ITrackerResources.getString("itracker.dateformat.full", locale)); ! Collection col = IssueUtilities.getCustomFields(locale); ! if(col instanceof ArrayList) { ! this.customFields = (ArrayList) col; ! } ! else { ! this.customFields.addAll(col); ! } } } *************** *** 94,98 **** */ public int getColumnCount() { ! return TOTAL_STATIC_COLUMNS + customFields.length; } --- 109,113 ---- */ public int getColumnCount() { ! return TOTAL_STATIC_COLUMNS + customFields.size(); } *************** *** 103,109 **** */ public String getColumnName(final int column) { ! if(column >= TOTAL_STATIC_COLUMNS && column < (TOTAL_STATIC_COLUMNS + customFields.length)) { ! if(customFields[column - TOTAL_STATIC_COLUMNS] != null) { ! return "customfield" + customFields[column - TOTAL_STATIC_COLUMNS].getId(); } } --- 118,124 ---- */ public String getColumnName(final int column) { ! if(column >= TOTAL_STATIC_COLUMNS && column < (TOTAL_STATIC_COLUMNS + customFields.size())) { ! if(customFields.get(column - TOTAL_STATIC_COLUMNS) != null) { ! return "customfield" + ((CustomFieldBean) customFields.get(column - TOTAL_STATIC_COLUMNS)).getId(); } } *************** *** 236,241 **** try { Integer id = new Integer(columnName.substring(11)); ! for(int i = 0; i < customFields.length; i++) { ! if(customFields[i] != null && id.equals(customFields[i].getId())) { return TOTAL_STATIC_COLUMNS + i; } --- 251,257 ---- try { Integer id = new Integer(columnName.substring(11)); ! for(int i = 0; i < customFields.size(); i++) { ! if(customFields.get(i) != null && ! id.equals(((CustomFieldBean) customFields.get(i)).getId())) { return TOTAL_STATIC_COLUMNS + i; } *************** *** 252,260 **** } ! public void addValue(IssueModel issue) { addValueAt(issue, -1); } ! public void addValueAt(IssueModel issue, int row) { if(issue != null) { if(row < issues.size() && row >= 0) { --- 268,276 ---- } ! public void addValue(IssueBean issue) { addValueAt(issue, -1); } ! public void addValueAt(IssueBean issue, int row) { if(issue != null) { if(row < issues.size() && row >= 0) { Index: AbstractITrackerJFreeReport.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/reports/AbstractITrackerJFreeReport.java,v retrieving revision 1.6.4.2 retrieving revision 1.6.4.2.2.1 diff -C2 -d -r1.6.4.2 -r1.6.4.2.2.1 *** AbstractITrackerJFreeReport.java 15 Oct 2005 11:42:27 -0000 1.6.4.2 --- AbstractITrackerJFreeReport.java 6 Dec 2005 12:38:02 -0000 1.6.4.2.2.1 *************** *** 19,25 **** --- 19,27 ---- package cowsultants.itracker.web.reports; + import cowsultants.itracker.ejb.beans.entity.ReportBean; import java.io.ByteArrayInputStream; import java.io.File; import java.io.OutputStreamWriter; + import java.util.Collection; import java.util.Locale; *************** *** 42,47 **** import cowsultants.itracker.ejb.client.exceptions.ReportException; - import cowsultants.itracker.ejb.client.models.IssueModel; - import cowsultants.itracker.ejb.client.models.ReportModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.ejb.client.util.Logger; --- 44,47 ---- *************** *** 64,68 **** * for the report and setups up the report locale. */ ! public void initializeReport(IssueModel[] issues, ReportModel report, Locale locale, String reportOutput, HttpSession session) throws ReportException{ super.initializeReport(issues, report, locale, reportOutput, session); --- 64,68 ---- * for the report and setups up the report locale. */ ! public void initializeReport(Collection issues, ReportBean report, Locale locale, String reportOutput, HttpSession session) throws ReportException{ super.initializeReport(issues, report, locale, reportOutput, session); |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:21
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/servlets In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/web/servlets Modified Files: Tag: itrackerhnodto AttachmentDownloadController.java GenericController.java ReportDownloadController.java SchedulerController.java Log Message: removal of value objects Index: ReportDownloadController.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/servlets/ReportDownloadController.java,v retrieving revision 1.6.4.3 retrieving revision 1.6.4.3.2.1 diff -C2 -d -r1.6.4.3 -r1.6.4.3.2.1 *** ReportDownloadController.java 29 Oct 2005 01:44:25 -0000 1.6.4.3 --- ReportDownloadController.java 6 Dec 2005 12:38:02 -0000 1.6.4.3.2.1 *************** *** 19,22 **** --- 19,24 ---- package cowsultants.itracker.web.servlets; + import cowsultants.itracker.ejb.beans.entity.ReportBean; + import cowsultants.itracker.ejb.beans.entity.UserBean; import cowsultants.itracker.ejb.beans.session.ReportHandlerBean; import java.io.*; *************** *** 25,29 **** import cowsultants.itracker.ejb.client.interfaces.*; - import cowsultants.itracker.ejb.client.models.*; import cowsultants.itracker.ejb.client.util.*; public class ReportDownloadController extends GenericController { --- 27,30 ---- *************** *** 42,51 **** HttpSession session = request.getSession(); ! UserModel user = (UserModel) session.getAttribute("user"); try { ReportHandler rh = new ReportHandlerBean(); Integer reportId = null; ! ReportModel report = null; try { --- 43,52 ---- HttpSession session = request.getSession(); ! UserBean user = (UserBean) session.getAttribute("user"); try { ReportHandler rh = new ReportHandlerBean(); Integer reportId = null; ! ReportBean report = null; try { Index: GenericController.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/servlets/GenericController.java,v retrieving revision 1.4.4.1 retrieving revision 1.4.4.1.2.1 diff -C2 -d -r1.4.4.1 -r1.4.4.1.2.1 *** GenericController.java 30 Oct 2005 16:12:06 -0000 1.4.4.1 --- GenericController.java 6 Dec 2005 12:38:02 -0000 1.4.4.1.2.1 *************** *** 19,22 **** --- 19,23 ---- package cowsultants.itracker.web.servlets; + import cowsultants.itracker.ejb.beans.entity.UserBean; import java.io.IOException; import java.util.HashMap; *************** *** 33,37 **** 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; --- 34,37 ---- *************** *** 76,80 **** protected boolean isLoggedIn(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession session = request.getSession(false); ! UserModel user = (session == null ? null : (UserModel) session.getAttribute("user")); String login = (user == null ? null : user.getLogin()); --- 76,80 ---- protected boolean isLoggedIn(HttpServletRequest request, HttpServletResponse response) throws IOException, ServletException { HttpSession session = request.getSession(false); ! UserBean user = (session == null ? null : (UserBean) session.getAttribute("user")); String login = (user == null ? null : user.getLogin()); Index: AttachmentDownloadController.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/servlets/AttachmentDownloadController.java,v retrieving revision 1.13.4.5 retrieving revision 1.13.4.5.2.1 diff -C2 -d -r1.13.4.5 -r1.13.4.5.2.1 *** AttachmentDownloadController.java 30 Oct 2005 16:30:56 -0000 1.13.4.5 --- AttachmentDownloadController.java 6 Dec 2005 12:38:02 -0000 1.13.4.5.2.1 *************** *** 20,23 **** --- 20,25 ---- + import cowsultants.itracker.ejb.beans.entity.IssueAttachmentBean; + import cowsultants.itracker.ejb.beans.entity.UserBean; import java.io.IOException; *************** *** 33,38 **** 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; --- 35,38 ---- *************** *** 53,62 **** HttpSession session = request.getSession(); ! UserModel user = (UserModel) session.getAttribute("user"); try { IssueHandler ih = getITrackerServices().getIssueHandler(); Integer attachmentId = null; ! IssueAttachmentModel attachment = null; try { --- 53,62 ---- HttpSession session = request.getSession(); ! UserBean user = (UserBean) session.getAttribute("user"); try { IssueHandler ih = getITrackerServices().getIssueHandler(); Integer attachmentId = null; ! IssueAttachmentBean attachment = null; try { *************** *** 77,81 **** } ! if(! ih.canViewIssue(attachment.getIssueId(), user)) { forward("/unauthorized.jsp", request, response); return; --- 77,81 ---- } ! if(! ih.canViewIssue(attachment.getIssue().getId(), user)) { forward("/unauthorized.jsp", request, response); return; Index: SchedulerController.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/servlets/SchedulerController.java,v retrieving revision 1.7.4.4 retrieving revision 1.7.4.4.2.1 diff -C2 -d -r1.7.4.4 -r1.7.4.4.2.1 *** SchedulerController.java 30 Oct 2005 16:11:00 -0000 1.7.4.4 --- SchedulerController.java 6 Dec 2005 12:38:02 -0000 1.7.4.4.2.1 *************** *** 19,25 **** 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 { --- 19,27 ---- package cowsultants.itracker.web.servlets; + import cowsultants.itracker.ejb.beans.entity.ScheduledTaskBean; import cowsultants.itracker.ejb.client.interfaces.SchedulerHandler; import cowsultants.itracker.web.scheduler.Scheduler; + import java.util.Collection; + import java.util.Iterator; public class SchedulerController { *************** *** 32,39 **** scheduler.start(); ! ScheduledTaskModel[] tasks = sh.getAllTasks(); if (tasks != null) { ! for (int i = 0; i < tasks.length; i++) { ! scheduler.addTask(tasks[i]); } } --- 34,42 ---- scheduler.start(); ! Collection tasks = sh.getAllTasks(); if (tasks != null) { ! Iterator iter = tasks.iterator(); ! while(iter.hasNext()) { ! scheduler.addTask((ScheduledTaskBean) iter.next()); } } |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:20
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/forms In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/web/forms Modified Files: Tag: itrackerhnodto IssueForm.java Log Message: removal of value objects Index: IssueForm.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/forms/IssueForm.java,v retrieving revision 1.12.4.3 retrieving revision 1.12.4.3.2.1 diff -C2 -d -r1.12.4.3 -r1.12.4.3.2.1 *** IssueForm.java 30 Oct 2005 16:09:18 -0000 1.12.4.3 --- IssueForm.java 6 Dec 2005 12:38:02 -0000 1.12.4.3.2.1 *************** *** 19,22 **** --- 19,27 ---- package cowsultants.itracker.web.forms; + import cowsultants.itracker.ejb.beans.entity.CustomFieldBean; + import cowsultants.itracker.ejb.beans.entity.IssueFieldBean; + import cowsultants.itracker.ejb.beans.entity.ProjectBean; + import java.util.Collection; + import java.util.Iterator; import java.util.Locale; *************** *** 31,38 **** import cowsultants.itracker.ejb.client.exceptions.IssueException; import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; - import cowsultants.itracker.ejb.client.models.CustomFieldModel; - import cowsultants.itracker.ejb.client.models.IssueFieldModel; - import cowsultants.itracker.ejb.client.models.ProjectModel; - import cowsultants.itracker.ejb.client.models.ProjectScriptModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.ejb.client.util.CustomFieldUtilities; --- 36,39 ---- *************** *** 60,64 **** Logger.logDebug("Errors contains " + errors.size() + " errors."); try { ! ProjectModel project = null; Integer projectId = (Integer) PropertyUtils.getSimpleProperty(this, "projectId"); if(projectId == null) { --- 61,65 ---- Logger.logDebug("Errors contains " + errors.size() + " errors."); try { ! ProjectBean project = null; Integer projectId = (Integer) PropertyUtils.getSimpleProperty(this, "projectId"); if(projectId == null) { *************** *** 79,84 **** request.setAttribute(Constants.PROJECT_KEY, project); ! CustomFieldModel[] projectFields = project.getCustomFields(); ! if(projectFields.length > 0) { HttpSession session = request.getSession(); if(session != null) { --- 80,85 ---- request.setAttribute(Constants.PROJECT_KEY, project); ! Collection projectFields = project.getCustomFields(); ! if(projectFields.size() > 0) { HttpSession session = request.getSession(); if(session != null) { *************** *** 86,101 **** } ! for(int i = 0; i < projectFields.length; i++) { ! String fieldValue = request.getParameter("customFields(" + projectFields[i].getId() +")"); if(fieldValue != null && ! fieldValue.equals("")) { ! IssueFieldModel issueField = new IssueFieldModel(projectFields[i]); try { issueField.setValue(fieldValue, currLocale); } catch(IssueException ie) { ! String label = CustomFieldUtilities.getCustomFieldName(projectFields[i].getId(), currLocale); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(ie.getType(), label)); } ! } else if(projectFields[i].isRequired()) { ! String label = CustomFieldUtilities.getCustomFieldName(projectFields[i].getId(), currLocale); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(IssueException.TYPE_CF_REQ_FIELD, label)); } --- 87,106 ---- } ! Iterator iter = projectFields.iterator(); ! while(iter.hasNext()) { ! CustomFieldBean field = (CustomFieldBean) iter.next(); ! String fieldValue = request.getParameter("customFields(" + field.getId() +")"); if(fieldValue != null && ! fieldValue.equals("")) { ! IssueFieldBean issueField = new IssueFieldBean(); ! issueField.setCustomField(field); try { issueField.setValue(fieldValue, currLocale); } catch(IssueException ie) { ! String label = CustomFieldUtilities.getCustomFieldName(field.getId(), currLocale); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(ie.getType(), label)); } ! //@todo figure out why getRequired is an int ! } else if(field.getRequired() == 1) { ! String label = CustomFieldUtilities.getCustomFieldName(field.getId(), currLocale); errors.add(ActionErrors.GLOBAL_ERROR, new ActionError(IssueException.TYPE_CF_REQ_FIELD, label)); } *************** *** 103,107 **** } ! ProjectScriptModel[] scripts = project.getScripts(); WorkflowUtilities.ProcessFieldScripts(scripts, WorkflowUtilities.EVENT_FIELD_ONVALIDATE, null, errors, this); } --- 108,112 ---- } ! Collection scripts = project.getScripts(); WorkflowUtilities.ProcessFieldScripts(scripts, WorkflowUtilities.EVENT_FIELD_ONVALIDATE, null, errors, this); } |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:20
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/resources In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/ejb/client/resources Modified Files: Tag: itrackerhnodto ITrackerResourceBundle.java ITrackerResources.java Log Message: removal of value objects Index: ITrackerResources.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/resources/ITrackerResources.java,v retrieving revision 1.33.4.2 retrieving revision 1.33.4.2.2.1 diff -C2 -d -r1.33.4.2 -r1.33.4.2.2.1 *** ITrackerResources.java 30 Oct 2005 16:45:21 -0000 1.33.4.2 --- ITrackerResources.java 6 Dec 2005 12:38:01 -0000 1.33.4.2.2.1 *************** *** 19,22 **** --- 19,24 ---- package cowsultants.itracker.ejb.client.resources; + import cowsultants.itracker.ejb.beans.entity.LanguageBean; + import java.util.Collection; import java.util.HashMap; import java.util.Iterator; *************** *** 27,31 **** import cowsultants.itracker.ejb.beans.session.SystemConfigurationBean; import cowsultants.itracker.ejb.client.exceptions.ITrackerDirtyResourceException; - import cowsultants.itracker.ejb.client.models.LanguageModel; import cowsultants.itracker.ejb.client.util.Logger; --- 29,32 ---- *************** *** 143,147 **** if (bundle == null) { Logger.logDebug("Loading new resource bundle for locale " + locale + " from the database."); ! LanguageModel[] languageItems = sc.getLanguage(locale); bundle = new ITrackerResourceBundle(locale, languageItems); if (bundle != null) { --- 144,148 ---- if (bundle == null) { Logger.logDebug("Loading new resource bundle for locale " + locale + " from the database."); ! Collection languageItems = sc.getLanguage(locale); bundle = new ITrackerResourceBundle(locale, languageItems); if (bundle != null) { *************** *** 231,235 **** Logger.logDebug("Loading new key to replace dirty key " + key + " for resource bundle for locale " + locale); ! LanguageModel languageItem = sc.getLanguageItemByKey(key, locale); ((ITrackerResourceBundle) getBundle(locale)).updateValue(languageItem); } --- 232,236 ---- Logger.logDebug("Loading new key to replace dirty key " + key + " for resource bundle for locale " + locale); ! LanguageBean languageItem = sc.getLanguageItemByKey(key, locale); ((ITrackerResourceBundle) getBundle(locale)).updateValue(languageItem); } Index: ITrackerResourceBundle.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/resources/ITrackerResourceBundle.java,v retrieving revision 1.5 retrieving revision 1.5.6.1 diff -C2 -d -r1.5 -r1.5.6.1 *** ITrackerResourceBundle.java 22 Aug 2005 11:41:28 -0000 1.5 --- ITrackerResourceBundle.java 6 Dec 2005 12:38:01 -0000 1.5.6.1 *************** *** 19,26 **** package cowsultants.itracker.ejb.client.resources; import java.util.*; import cowsultants.itracker.ejb.client.exceptions.*; - import cowsultants.itracker.ejb.client.models.*; public class ITrackerResourceBundle extends ResourceBundle { --- 19,26 ---- package cowsultants.itracker.ejb.client.resources; + import cowsultants.itracker.ejb.beans.entity.LanguageBean; import java.util.*; import cowsultants.itracker.ejb.client.exceptions.*; public class ITrackerResourceBundle extends ResourceBundle { *************** *** 37,41 **** } ! public ITrackerResourceBundle(Locale locale, LanguageModel[] items) { setLocale(locale); setContents(items); --- 37,47 ---- } ! /** ! * Constructs a new resource bundle ! * ! * @param locale the locale to use ! * @param a collection of LanguageBean objects ! */ ! public ITrackerResourceBundle(Locale locale, Collection items) { setLocale(locale); setContents(items); *************** *** 55,64 **** } ! public void setContents(LanguageModel[] content) { if(content != null ) { synchronized (data) { data.clear(); ! for(int i = 0; i < content.length; i++) { ! data.put(content[i].getResourceKey(), content[i].getResourceValue()); } } --- 61,72 ---- } ! public void setContents(Collection content) { if(content != null ) { synchronized (data) { data.clear(); ! Iterator iter = content.iterator(); ! while(iter.hasNext()) { ! LanguageBean contentBean = (LanguageBean) iter.next(); ! data.put(contentBean.getResourceKey(), contentBean.getResourceValue()); } } *************** *** 99,106 **** } ! public void updateValue(LanguageModel model) { ! if(model != null) { synchronized (data) { ! data.put(model.getResourceKey(), model.getResourceValue()); } } --- 107,114 ---- } ! public void updateValue(LanguageBean lang) { ! if(lang != null) { synchronized (data) { ! data.put(lang.getResourceKey(), lang.getResourceValue()); } } |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:20
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/scheduler In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/web/scheduler Modified Files: Tag: itrackerhnodto Scheduler.java Log Message: removal of value objects Index: Scheduler.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/scheduler/Scheduler.java,v retrieving revision 1.4.4.2 retrieving revision 1.4.4.2.2.1 diff -C2 -d -r1.4.4.2 -r1.4.4.2.2.1 *** Scheduler.java 22 Oct 2005 16:37:28 -0000 1.4.4.2 --- Scheduler.java 6 Dec 2005 12:38:02 -0000 1.4.4.2.2.1 *************** *** 19,23 **** --- 19,25 ---- package cowsultants.itracker.web.scheduler; + import cowsultants.itracker.ejb.beans.entity.ScheduledTaskBean; import java.text.SimpleDateFormat; + import java.util.ArrayList; import java.util.Calendar; import java.util.Date; *************** *** 25,89 **** import java.util.Vector; - import cowsultants.itracker.ejb.client.models.ScheduledTaskModel; import cowsultants.itracker.ejb.client.util.Logger; /** ! * This class represents a currently running task in the scheduler. ! */ class WorkerThread extends Thread { ! private ScheduledTaskModel task = null; ! ! public WorkerThread(ScheduledTaskModel task) { this.task = task; } ! ! public void run() { ! try { if(task == null || task.getClassName() == null) { throw new Exception("Scheduled task, class, or method is null."); } ! Class taskClass = Class.forName(task.getClassName()); SchedulableTask workTask = (SchedulableTask) taskClass.newInstance(); ! workTask.performTask(task.getArgs()); ! } catch (Exception e) { Logger.logError("Unable to run scheduled task " + task.toString() + ". " + e.getMessage()); ! } ! } } /** ! * This class is used by the SchedulerEngine to process tasks at specific times. ! * It is spawned every minute and sent a copy of the current tasks list. This ! * thread then determines if any of the tasks need to be run. This prevents a single ! * run from stopping the scheduler altogether and preventing future tasks from being ! * spawned. ! */ class SchedulerThread extends Thread { ! private Scheduler engine = null; ! private GregorianCalendar startDate = null; ! private Vector tasks = null; private boolean stop = false; ! ! public SchedulerThread() { tasks = new Vector(); ! startDate = new GregorianCalendar(); ! } ! ! public SchedulerThread(Scheduler engine, ScheduledTaskModel[] tasks) { ! this(); ! ! int hour = startDate.get(Calendar.HOUR_OF_DAY); ! int min = startDate.get(Calendar.MINUTE); ! int mday = startDate.get(Calendar.DAY_OF_MONTH); ! int month = startDate.get(Calendar.MONTH) + 1; ! int wday = startDate.get(Calendar.DAY_OF_WEEK); ! if(engine != null && tasks != null) { ! this.engine = engine; ! for(int i = 0; i < tasks.length; i++) { ! if(tasks != null && tasks[i].getId() != null && tasks[i].getId().intValue() > 0) { ! ScheduledTaskModel task = (ScheduledTaskModel) tasks[i].clone(); // Now check to see if this is our task. if(processTask(task, hour, min, mday, month, wday)) { --- 27,100 ---- import java.util.Vector; import cowsultants.itracker.ejb.client.util.Logger; + import java.util.Collection; + import java.util.Iterator; /** ! * This class represents a currently running task in the scheduler. ! */ class WorkerThread extends Thread { ! private ScheduledTaskBean task = null; ! ! public WorkerThread(ScheduledTaskBean task) { this.task = task; } ! ! public void run() { ! try { if(task == null || task.getClassName() == null) { throw new Exception("Scheduled task, class, or method is null."); } ! Class taskClass = Class.forName(task.getClassName()); SchedulableTask workTask = (SchedulableTask) taskClass.newInstance(); ! //@todo check out what happened here... ! workTask.performTask(task.getArgs().split(" ")); ! } catch (Exception e) { Logger.logError("Unable to run scheduled task " + task.toString() + ". " + e.getMessage()); ! } ! } } /** ! * This class is used by the SchedulerEngine to process tasks at specific times. ! * It is spawned every minute and sent a copy of the current tasks list. This ! * thread then determines if any of the tasks need to be run. This prevents a single ! * run from stopping the scheduler altogether and preventing future tasks from being ! * spawned. ! */ class SchedulerThread extends Thread { ! private Scheduler engine = null; ! private GregorianCalendar startDate = null; ! private Vector tasks = null; private boolean stop = false; ! ! public SchedulerThread() { tasks = new Vector(); ! startDate = new GregorianCalendar(); ! } ! ! public SchedulerThread(Scheduler engine, Collection tasks) { ! this(); ! ! int hour = startDate.get(Calendar.HOUR_OF_DAY); ! int min = startDate.get(Calendar.MINUTE); ! int mday = startDate.get(Calendar.DAY_OF_MONTH); ! int month = startDate.get(Calendar.MONTH) + 1; ! int wday = startDate.get(Calendar.DAY_OF_WEEK); ! if(engine != null && tasks != null) { ! this.engine = engine; ! Iterator iter = tasks.iterator(); ! while(iter.hasNext()) { ! ScheduledTaskBean bean = (ScheduledTaskBean) iter.next(); ! if(bean.getId() != null && bean.getId().intValue() > 0) { ! ScheduledTaskBean task = null; ! try { ! task = (ScheduledTaskBean) bean.clone(); ! } catch (CloneNotSupportedException ex) { ! ex.printStackTrace(); ! } // Now check to see if this is our task. if(processTask(task, hour, min, mday, month, wday)) { *************** *** 94,130 **** } } ! ! public void run() { ! for(int i = 0; i < tasks.size(); i++) { if(stop) { break; } ! ScheduledTaskModel task = (ScheduledTaskModel) tasks.elementAt(i); ! try { ! if(task != null && task.getId() != null) { ! WorkerThread worker = new WorkerThread(task); ! worker.setPriority(5); ! worker.start(); ! engine.setTaskLastRun(task.getId().intValue()); ! } ! } catch(Exception e) { Logger.logError("Unable to run scheduled task " + task.toString()); ! } ! } ! } ! public void setStop(boolean value) { stop = value; } ! ! private boolean processTask(ScheduledTaskModel task, int hour, int min, int mday, int month, int wday) { ! if(hasInt(task.getHours(), hour) && hasInt(task.getMinutes(), min) && hasInt(task.getDaysOfMonth(), mday) && ! hasInt(task.getMonths(), month) && hasInt(task.getWeekdays(), wday)) { return true; ! } ! return false; } ! private boolean hasInt(int[] array, int value) { if(array != null) { --- 105,142 ---- } } ! ! public void run() { ! for(int i = 0; i < tasks.size(); i++) { if(stop) { break; } ! ScheduledTaskBean task = (ScheduledTaskBean) tasks.elementAt(i); ! try { ! if(task != null && task.getId() != null) { ! WorkerThread worker = new WorkerThread(task); ! worker.setPriority(5); ! worker.start(); ! engine.setTaskLastRun(task.getId().intValue()); ! } ! } catch(Exception e) { Logger.logError("Unable to run scheduled task " + task.toString()); ! } ! } ! } ! public void setStop(boolean value) { stop = value; } ! ! private boolean processTask(ScheduledTaskBean task, int hour, int min, int mday, int month, int wday) { ! //@todo what happened to hasInt? ! /*if(hasInt(task.getHours(), hour) && hasInt(task.getMinutes(), min) && hasInt(task.getDaysOfMonth(), mday) && ! hasInt(task.getMonths(), month) && hasInt(task.getWeekdays(), wday)) { return true; ! }*/ ! return false; } ! private boolean hasInt(int[] array, int value) { if(array != null) { *************** *** 142,233 **** public class Scheduler extends Thread { ! private GregorianCalendar currDate; ! private static GregorianCalendar lastDate; ! private static GregorianCalendar startDate; ! private static Vector threads; private static Vector tasks; private static boolean stop = false; ! ! public Scheduler() { Logger.logDebug("Scheduler starting."); ! ! lastDate = new GregorianCalendar(); ! currDate = new GregorianCalendar(); ! threads = new Vector(); tasks = new Vector(); ! } ! /** ! * Main processing method of the scheduler. Every minute it spans a new SchedulerThread ! * which looks for tasks that need to be run. ! */ ! public void run() { ! while(true) { if(stop) { break; } ! ! currDate = new GregorianCalendar(); ! if(currDate.get(Calendar.MINUTE) == lastDate.get(Calendar.MINUTE)) { ! // Not time yet..try again in 20 seconds ! try { ! sleep(20000); ! for(int i = 0; i < threads.size(); i++) { ! SchedulerThread minThread = (SchedulerThread) threads.elementAt(i); ! if(! minThread.isAlive()) { ! threads.removeElementAt(i); ! } ! } ! } catch(Exception e) { Logger.logError("Error checking on scheduler threads. " + e.getMessage()); ! } ! } else { ! lastDate.setTime(currDate.getTime()); ! if((currDate.get(Calendar.MINUTE) % 10) == 0) { Logger.logDebug("Scheduler currently running with " + threads.size() + " active threads."); ! } ! ! SchedulerThread sThread = null; ! try { ! ScheduledTaskModel[] tasksArray = new ScheduledTaskModel[tasks.size()]; ! tasks.copyInto(tasksArray); ! sThread = new SchedulerThread(this, tasksArray); ! sThread.setPriority(7); ! sThread.start(); ! threads.addElement(sThread); ! } catch(Exception e) { Logger.logError("Error while starting new scheduler thread. " + e.getMessage()); e.printStackTrace(); ! } ! } ! } currDate = null; ! } ! /** ! * Returns the current number of SchedulerThreads that are running. Usually there ! * is one scheduler thread produced each minute. A large number of these could ! * indecate problems processing tasks. ! */ ! public static int getNumThreads() { ! if(threads == null) { threads = new Vector(); ! } ! return(threads.size()); ! } ! /** ! * Returns the current number of tasks being checked by the scheduler. ! */ ! public static int getNumTasks() { ! if(tasks == null) { tasks = new Vector(); ! } ! return(tasks.size()); ! } ! /** ! * Returns the time the scheduler last looked for tasks to process ! */ public static Date getLastRun() { if(lastDate != null) { --- 154,243 ---- public class Scheduler extends Thread { ! private GregorianCalendar currDate; ! private static GregorianCalendar lastDate; ! private static GregorianCalendar startDate; ! private static Vector threads; private static Vector tasks; private static boolean stop = false; ! ! public Scheduler() { Logger.logDebug("Scheduler starting."); ! ! lastDate = new GregorianCalendar(); ! currDate = new GregorianCalendar(); ! threads = new Vector(); tasks = new Vector(); ! } ! /** ! * Main processing method of the scheduler. Every minute it spans a new SchedulerThread ! * which looks for tasks that need to be run. ! */ ! public void run() { ! while(true) { if(stop) { break; } ! ! currDate = new GregorianCalendar(); ! if(currDate.get(Calendar.MINUTE) == lastDate.get(Calendar.MINUTE)) { ! // Not time yet..try again in 20 seconds ! try { ! sleep(20000); ! for(int i = 0; i < threads.size(); i++) { ! SchedulerThread minThread = (SchedulerThread) threads.elementAt(i); ! if(! minThread.isAlive()) { ! threads.removeElementAt(i); ! } ! } ! } catch(Exception e) { Logger.logError("Error checking on scheduler threads. " + e.getMessage()); ! } ! } else { ! lastDate.setTime(currDate.getTime()); ! if((currDate.get(Calendar.MINUTE) % 10) == 0) { Logger.logDebug("Scheduler currently running with " + threads.size() + " active threads."); ! } ! ! SchedulerThread sThread = null; ! try { ! sThread = new SchedulerThread(this, tasks); ! sThread.setPriority(7); ! sThread.start(); ! threads.addElement(sThread); ! } catch(Exception e) { Logger.logError("Error while starting new scheduler thread. " + e.getMessage()); e.printStackTrace(); ! } ! } ! } currDate = null; ! } ! /** ! * Returns the current number of SchedulerThreads that are running. Usually there ! * is one scheduler thread produced each minute. A large number of these could ! * indecate problems processing tasks. ! */ ! public static int getNumThreads() { ! if(threads == null) { threads = new Vector(); ! } ! return(threads.size()); ! } ! /** ! * Returns the current number of tasks being checked by the scheduler. ! */ ! public static int getNumTasks() { ! if(tasks == null) { tasks = new Vector(); ! } ! return(tasks.size()); ! } ! /** ! * Returns the time the scheduler last looked for tasks to process ! */ public static Date getLastRun() { if(lastDate != null) { *************** *** 236,249 **** return null; } ! /** ! * Returns a currently defined scheduler task. ! * @param taskId the id of the task to return ! * @return a ScheduledTaskModel of the requested task ! */ ! public static ScheduledTaskModel getTask(int taskId) { if(tasks != null) { for(int i = 0; i < tasks.size(); i++) { ! ScheduledTaskModel task = (ScheduledTaskModel) tasks.elementAt(i); if(task.getId() != null && taskId == task.getId().intValue()) { return task; --- 246,259 ---- return null; } ! /** ! * Returns a currently defined scheduler task. ! * @param taskId the id of the task to return ! * @return a ScheduledTaskModel of the requested task ! */ ! public static ScheduledTaskBean getTask(int taskId) { if(tasks != null) { for(int i = 0; i < tasks.size(); i++) { ! ScheduledTaskBean task = (ScheduledTaskBean) tasks.elementAt(i); if(task.getId() != null && taskId == task.getId().intValue()) { return task; *************** *** 252,291 **** } return null; ! } ! /** ! * Returns all currently defined scheduler tasks. ! * @return an array of ScheduledTaskModels ! */ ! public static ScheduledTaskModel[] getTasks() { ! if(tasks == null) { ! return new ScheduledTaskModel[0]; ! } ! ! ScheduledTaskModel[] tasksArray = new ScheduledTaskModel[tasks.size()]; ! for(int i = 0; i < tasks.size(); i++) { ! tasksArray[i] = (ScheduledTaskModel) tasks.elementAt(i); ! } ! return tasksArray; ! } ! /** ! * Adds a new task into the list. ! * @param task the task to add ! */ ! public static void addTask(ScheduledTaskModel task) { if(task != null) { tasks.add(task); } } ! /** ! * Removes a task for the list of tasks to perform. ! * @param taskId the id of the task to remove ! */ public static void removeTask(int taskId) { if(tasks != null) { for(int i = 0; i < tasks.size(); i++) { ! ScheduledTaskModel task = (ScheduledTaskModel) tasks.elementAt(i); if(task.getId() != null && taskId == task.getId().intValue()) { tasks.removeElementAt(i); --- 262,293 ---- } return null; ! } ! /** ! * Returns all currently defined scheduler tasks. ! * @return an collection of ScheduledTaskBeans ! */ ! public static Collection getTasks() { ! return tasks; ! } ! /** ! * Adds a new task into the list. ! * @param task the task to add ! */ ! public static void addTask(ScheduledTaskBean task) { if(task != null) { tasks.add(task); } } ! /** ! * Removes a task for the list of tasks to perform. ! * @param taskId the id of the task to remove ! */ public static void removeTask(int taskId) { if(tasks != null) { for(int i = 0; i < tasks.size(); i++) { ! ScheduledTaskBean task = (ScheduledTaskBean) tasks.elementAt(i); if(task.getId() != null && taskId == task.getId().intValue()) { tasks.removeElementAt(i); *************** *** 295,320 **** } } ! /** ! * This will stop the current scheduler threads, but NOT the worker threads. ! * This means you might be able to stop new jobs from starting but not currently ! * running jobs. In general this should never be called. ! */ ! public static void stopAll() { ! for(int i = 0; i < threads.size(); i++) { ! SchedulerThread thread = (SchedulerThread) threads.elementAt(i); ! if(thread.isAlive()) { thread.setStop(true); ! } ! threads.removeElementAt(i); ! } ! } ! /** ! * Outputs a task description. ! * @param taskId the id of the task to print ! */ ! public static String printTask(int taskId) { ! ScheduledTaskModel task = getTask(taskId); if(task != null) { return task.toString(); --- 297,322 ---- } } ! /** ! * This will stop the current scheduler threads, but NOT the worker threads. ! * This means you might be able to stop new jobs from starting but not currently ! * running jobs. In general this should never be called. ! */ ! public static void stopAll() { ! for(int i = 0; i < threads.size(); i++) { ! SchedulerThread thread = (SchedulerThread) threads.elementAt(i); ! if(thread.isAlive()) { thread.setStop(true); ! } ! threads.removeElementAt(i); ! } ! } ! /** ! * Outputs a task description. ! * @param taskId the id of the task to print ! */ ! public static String printTask(int taskId) { ! ScheduledTaskBean task = getTask(taskId); if(task != null) { return task.toString(); *************** *** 322,353 **** return "Unknown task."; } ! /** ! * Outputs the full date of the last time the task was run. ! * @param taskId the id of the task to print ! */ ! public static String printTaskLastRun(int taskId) { ! ScheduledTaskModel task = getTask(taskId); if(task != null && task.getLastRun() != null) { SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); ! return sdf.format(task.getLastRun()); ! } return "Unknown task."; ! } ! /** ! * Sets the date a task was last run to the current date/time. ! * @param taskId the id of the task to set ! */ ! public static void setTaskLastRun(int taskId) { ! ScheduledTaskModel task = getTask(taskId); if(task != null) { task.setLastRun(new Date()); ! } ! } ! /** ! * Sets a flag to tell the scheduler whether to continue to process tasks. ! */ public static void setStop(boolean value) { stop = value; --- 324,357 ---- return "Unknown task."; } ! /** ! * Outputs the full date of the last time the task was run. ! * @param taskId the id of the task to print ! */ ! public static String printTaskLastRun(int taskId) { ! ScheduledTaskBean task = getTask(taskId); ! //@todo what happened to getLastRun? if(task != null && task.getLastRun() != null) { + //@todo shouldn't this be i18n'd? SimpleDateFormat sdf = new SimpleDateFormat("MM/dd/yyyy HH:mm:ss"); ! return sdf.format(task.getLastRun()); ! } return "Unknown task."; ! } ! /** ! * Sets the date a task was last run to the current date/time. ! * @param taskId the id of the task to set ! */ ! public static void setTaskLastRun(int taskId) { ! ScheduledTaskBean task = getTask(taskId); if(task != null) { task.setLastRun(new Date()); ! } ! } ! /** ! * Sets a flag to tell the scheduler whether to continue to process tasks. ! */ public static void setStop(boolean value) { stop = value; |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:19
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/test In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/ejb/test Modified Files: Tag: itrackerhnodto TestProjectHandler.java Log Message: removal of value objects Index: TestProjectHandler.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/test/TestProjectHandler.java,v retrieving revision 1.6.4.3 retrieving revision 1.6.4.3.2.1 diff -C2 -d -r1.6.4.3 -r1.6.4.3.2.1 *** TestProjectHandler.java 30 Oct 2005 16:44:30 -0000 1.6.4.3 --- TestProjectHandler.java 6 Dec 2005 12:38:01 -0000 1.6.4.3.2.1 *************** *** 19,22 **** --- 19,25 ---- package cowsultants.itracker.ejb.test; + import cowsultants.itracker.ejb.beans.entity.ComponentBean; + import cowsultants.itracker.ejb.beans.entity.ProjectBean; + import java.util.Collection; import javax.naming.InitialContext; *************** *** 25,30 **** import junit.framework.TestSuite; import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; - import cowsultants.itracker.ejb.client.models.ComponentModel; - import cowsultants.itracker.ejb.client.models.ProjectModel; public class TestProjectHandler extends TestCase { --- 28,31 ---- *************** *** 41,45 **** boolean status = false; ! ProjectModel pModel = new ProjectModel(); pModel.setName("Test Project"); pModel.setDescription("Test Project Description"); --- 42,46 ---- boolean status = false; ! ProjectBean pModel = new ProjectBean(); pModel.setName("Test Project"); pModel.setDescription("Test Project Description"); *************** *** 49,57 **** assertNotNull("Create project did not assign id", pModel.getId()); ! ProjectModel pModel2 = ph.createProject(pModel); ! ProjectModel[] projects = ph.getAllProjects(); ! assertNotNull("All projects lookup returned null array", projects); ! assertTrue("All projects lookup returned incorrect number or projects", projects.length == 2); status = ph.deleteProject(pModel); --- 50,58 ---- assertNotNull("Create project did not assign id", pModel.getId()); ! ProjectBean pModel2 = ph.createProject(pModel); ! Collection projects = ph.getAllProjects(); ! assertNotNull("All projects lookup returned null collection", projects); ! assertTrue("All projects lookup returned incorrect number or projects", projects.size() == 2); status = ph.deleteProject(pModel); *************** *** 62,66 **** projects = ph.getAllProjects(); assertNotNull("Projects list was null", projects); ! assertTrue("Project list did not contain 0 elements after removal", projects.length == 0); } catch(Exception e) { fail("Exception in test caught: " + e.toString()); --- 63,67 ---- projects = ph.getAllProjects(); assertNotNull("Projects list was null", projects); ! assertTrue("Project list did not contain 0 elements after removal", projects.size() == 0); } catch(Exception e) { fail("Exception in test caught: " + e.toString()); *************** *** 70,79 **** public void testProjectLookup() { try { ! ProjectModel pModel = new ProjectModel(); pModel.setName("Test Project"); pModel.setDescription("Test Project Description"); pModel = ph.createProject(pModel); ! ProjectModel testProjectModel = ph.getProject(pModel.getId()); assertNotNull("Project lookup returned null value", testProjectModel); assertTrue("Project lookup did not return correct test data", testProjectModel.getId().equals(pModel.getId())); --- 71,80 ---- public void testProjectLookup() { try { ! ProjectBean pModel = new ProjectBean(); pModel.setName("Test Project"); pModel.setDescription("Test Project Description"); pModel = ph.createProject(pModel); ! ProjectBean testProjectModel = ph.getProject(pModel.getId()); assertNotNull("Project lookup returned null value", testProjectModel); assertTrue("Project lookup did not return correct test data", testProjectModel.getId().equals(pModel.getId())); *************** *** 88,97 **** public void testManageComponents() { try { ! ProjectModel pModel = new ProjectModel(); pModel.setName("Test Project"); pModel.setDescription("Test Project Description"); pModel = ph.createProject(pModel); ! ComponentModel cModel = new ComponentModel(); cModel.setName("Test Component"); cModel.setDescription("Test Component Description"); --- 89,98 ---- public void testManageComponents() { try { ! ProjectBean pModel = new ProjectBean(); pModel.setName("Test Project"); pModel.setDescription("Test Project Description"); pModel = ph.createProject(pModel); ! ComponentBean cModel = new ComponentBean(); cModel.setName("Test Component"); cModel.setDescription("Test Component Description"); *************** *** 101,113 **** assertNotNull("Component not assigned id on addition to project", cModel.getId()); ! ProjectModel testProjectModel = ph.getProject(pModel.getId()); assertNotNull("Project lookup returned null value", testProjectModel); assertTrue("Project lookup did not return correct test data", testProjectModel.getId().equals(pModel.getId())); assertTrue("Project lookup did not return correct test data", testProjectModel.getName().equals(pModel.getName())); ! ComponentModel[] components = ph.getProjectComponents(testProjectModel.getId()); assertNotNull("Project component list was null", components); ! assertTrue("Project did not contain 1 component", components.length == 1); ! assertTrue("Component data did not match test data", cModel.getName().equals(components[0].getName())); boolean status = ph.removeProjectComponent(testProjectModel.getId(), cModel.getId()); --- 102,114 ---- assertNotNull("Component not assigned id on addition to project", cModel.getId()); ! ProjectBean testProjectModel = ph.getProject(pModel.getId()); assertNotNull("Project lookup returned null value", testProjectModel); assertTrue("Project lookup did not return correct test data", testProjectModel.getId().equals(pModel.getId())); assertTrue("Project lookup did not return correct test data", testProjectModel.getName().equals(pModel.getName())); ! Collection components = ph.getProjectComponents(testProjectModel.getId()); assertNotNull("Project component list was null", components); ! assertTrue("Project did not contain 1 component", components.size() == 1); ! assertTrue("Component data did not match test data", cModel.getName().equals(((ComponentBean) components.iterator().next()).getName())); boolean status = ph.removeProjectComponent(testProjectModel.getId(), cModel.getId()); *************** *** 115,119 **** components = ph.getProjectComponents(testProjectModel.getId()); assertNotNull("Project component list was null", components); ! assertTrue("Project did not contain 0 components after removal", components.length == 0); ph.deleteProject(pModel); --- 116,120 ---- components = ph.getProjectComponents(testProjectModel.getId()); assertNotNull("Project component list was null", components); ! assertTrue("Project did not contain 0 components after removal", components.size() == 0); ph.deleteProject(pModel); |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:19
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/interfaces In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/ejb/client/interfaces Modified Files: Tag: itrackerhnodto IssueHandler.java IssueSearch.java ProjectHandler.java ReportHandler.java SchedulerHandler.java SystemConfiguration.java UserHandler.java Log Message: removal of value objects Index: UserHandler.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/interfaces/UserHandler.java,v retrieving revision 1.22.4.3 retrieving revision 1.22.4.3.2.1 diff -C2 -d -r1.22.4.3 -r1.22.4.3.2.1 *** UserHandler.java 21 Oct 2005 11:14:29 -0000 1.22.4.3 --- UserHandler.java 6 Dec 2005 12:38:01 -0000 1.22.4.3.2.1 *************** *** 19,22 **** --- 19,27 ---- package cowsultants.itracker.ejb.client.interfaces; + import cowsultants.itracker.ejb.beans.entity.IssueBean; + import cowsultants.itracker.ejb.beans.entity.PermissionBean; + import cowsultants.itracker.ejb.beans.entity.UserBean; + import cowsultants.itracker.ejb.beans.entity.UserPreferencesBean; + import java.util.Collection; import java.util.HashMap; *************** *** 26,55 **** import cowsultants.itracker.ejb.client.exceptions.PasswordException; import cowsultants.itracker.ejb.client.exceptions.UserException; - import cowsultants.itracker.ejb.client.models.IssueModel; - import cowsultants.itracker.ejb.client.models.PermissionModel; - import cowsultants.itracker.ejb.client.models.UserModel; - import cowsultants.itracker.ejb.client.models.UserPreferencesModel; - import cowsultants.itracker.ejb.client.util.UserUtilities; public interface UserHandler { public static final String JNDI_NAME = "ejb/UserHandler"; ! public UserModel getUser(Integer userId) throws DataException; ! public UserModel getUserByLogin(String login)throws DataException, NoSuchEntityException; public String getUserPasswordByLogin(String login) throws DataException; ! public UserModel[] getAllUsers() throws DataException; public int getNumberUsers() throws DataException; ! public UserModel[] getActiveUsers(); ! public UserModel[] getSuperUsers(); ! public UserPreferencesModel getUserPreferencesByUserId(Integer userId) throws DataException; ! public UserModel[] getPossibleOwners(IssueModel issue, Integer projectId, Integer userId) throws DataException; ! public UserModel createUser(UserModel model) throws UserException; ! public UserModel updateUser(UserModel model) throws UserException; ! public String generateUserPassword(UserModel model) throws PasswordException, DataException; ! public boolean deleteUser(UserModel model) throws DataException; ! public UserPreferencesModel updateUserPreferences(UserPreferencesModel model) throws UserException; public boolean setUserStatus(Integer userId, int status) throws DataException; --- 31,55 ---- import cowsultants.itracker.ejb.client.exceptions.PasswordException; import cowsultants.itracker.ejb.client.exceptions.UserException; public interface UserHandler { public static final String JNDI_NAME = "ejb/UserHandler"; ! public UserBean getUser(Integer userId) throws DataException; ! public UserBean getUserByLogin(String login)throws DataException, NoSuchEntityException; public String getUserPasswordByLogin(String login) throws DataException; ! public Collection getAllUsers() throws DataException; public int getNumberUsers() throws DataException; ! public Collection getActiveUsers(); ! public Collection getSuperUsers(); ! public UserPreferencesBean getUserPreferencesByUserId(Integer userId) throws DataException; ! public Collection getPossibleOwners(IssueBean issue, Integer projectId, Integer userId) throws DataException; ! public UserBean createUser(UserBean model) throws UserException; ! public UserBean updateUser(UserBean model) throws UserException; ! public String generateUserPassword(UserBean model) throws PasswordException, DataException; ! public boolean deleteUser(UserBean model) throws DataException; ! public UserPreferencesBean updateUserPreferences(UserPreferencesBean model) throws UserException; public boolean setUserStatus(Integer userId, int status) throws DataException; *************** *** 62,68 **** * external system, calling this method may not have up to date information. * @param permission the permission to search for ! * @return an array of UserModels containing the users with the permission */ ! public UserModel[] getUsersWithPermissionLocal(PermissionModel permission) throws DataException; /** * This method will call local EJBs to find all permissions for a user. --- 62,68 ---- * external system, calling this method may not have up to date information. * @param permission the permission to search for ! * @return a collection of UserBeans representing the users with the permission */ ! public Collection getUsersWithPermissionLocal(PermissionBean permission) throws DataException; /** * This method will call local EJBs to find all permissions for a user. *************** *** 71,77 **** * external system, calling this method may not have up to date information. * @param user the user to find the permissions for ! * @return an array of PermissionModels containing the user's permissions */ ! public PermissionModel[] getUserPermissionsLocal(UserModel user) throws DataException; /** --- 71,77 ---- * external system, calling this method may not have up to date information. * @param user the user to find the permissions for ! * @return a collection of PermissionBeans containing the user's permissions */ ! public Collection getUserPermissionsLocal(UserBean user) throws DataException; /** *************** *** 81,88 **** * set of permissions will then be used for the actual update. * @param userId the userId, not login, of the user to add the permissions to ! * @param newPermissions an array of PermissionModels that represent the new permissions to add to the user * @return true if the operation was successful */ ! public boolean addUserPermissions(Integer userId, PermissionModel[] newPermissions); /** * Resets all of the permissions for a user in the database. The new permissions for the user are contained in a --- 81,89 ---- * set of permissions will then be used for the actual update. * @param userId the userId, not login, of the user to add the permissions to ! * @param newPermissions a collection of PermissionBeans that represent the new permissions to add to the user * @return true if the operation was successful */ ! public boolean addUserPermissions(Integer userId, Collection newPermissions); ! /** * Resets all of the permissions for a user in the database. The new permissions for the user are contained in a *************** *** 92,107 **** * set augmented. This augmented set of permissions will then be used for the actual update. * @param userId the userId, not login, of the user to add the permissions to ! * @param newPermissions a HashMap containing keys and PermissionModel values as described in the method description. * @return true if the operation was successful * @see UserUtilities */ ! public boolean setUserPermissions(Integer userId, PermissionModel[] newPermissions) throws DataException; /** ! * Returns an array of PermissionModel objects for the requested userId. * @param userId the userId, not the login, to find the permissions of ! * @returns an array of PermissionModels */ ! public PermissionModel[] getPermissionsByUserId(Integer userId) throws DataException; /** * Returns a HashMap of all permissions a user has. The HashMap uses the projectId as the key values, and then --- 93,108 ---- * set augmented. This augmented set of permissions will then be used for the actual update. * @param userId the userId, not login, of the user to add the permissions to ! * @param newPermissions a collection PermissionBeans values as described in the method description. * @return true if the operation was successful * @see UserUtilities */ ! public boolean setUserPermissions(Integer userId, Collection newPermissions) throws DataException; /** ! * Returns a collection of PermissionBeans objects for the requested userId. * @param userId the userId, not the login, to find the permissions of ! * @returns a collection of PermissionBeans */ ! public Collection getPermissionsByUserId(Integer userId) throws DataException; /** * Returns a HashMap of all permissions a user has. The HashMap uses the projectId as the key values, and then *************** *** 111,120 **** * if the user was a super user. This HashMap is usually not used directly, but in conjunction with the hasPermission * methods in UserUtilities to determine if a user ahs a particualr permission. ! * @param model a UserModel representing the user that the permissions should be obtained for * @param reqSource the source of the request * @return a HashMap of permissions as described in the method description * @see UserUtilities#hasPermission */ ! public HashMap getUserPermissions(UserModel model, int reqSource) throws DataException; /** * This method will return a list of users with a specific permission, either explicitly, or --- 112,121 ---- * if the user was a super user. This HashMap is usually not used directly, but in conjunction with the hasPermission * methods in UserUtilities to determine if a user ahs a particualr permission. ! * @param user a UserBean representing the user that the permissions should be obtained for * @param reqSource the source of the request * @return a HashMap of permissions as described in the method description * @see UserUtilities#hasPermission */ ! public HashMap getUserPermissions(UserBean user, int reqSource) throws DataException; /** * This method will return a list of users with a specific permission, either explicitly, or *************** *** 124,130 **** * @param projectId the project to find the permission for * @param permission the permission to check for ! * @return an array of UserModels that represent the users that have the permission */ ! public UserModel[] getUsersWithProjectPermission(Integer projectId, int permission); /** * This method will return a list of users with a specific permission, either explicitly, or --- 125,131 ---- * @param projectId the project to find the permission for * @param permission the permission to check for ! * @return a Collection of UserBeans that represent the users that have the permission */ ! public Collection getUsersWithProjectPermission(Integer projectId, int permission); /** * This method will return a list of users with a specific permission, either explicitly, or *************** *** 135,141 **** * @param permission the permission to check for * @param activeOnly only include users who are currently active ! * @return an array of UserModels that represent the users that have the permission */ ! public UserModel[] getUsersWithProjectPermission(Integer projectId, int permission, boolean activeOnly); /** * This method will return a list of users with the supplied permission, either explicitly, or --- 136,142 ---- * @param permission the permission to check for * @param activeOnly only include users who are currently active ! * @return a colleciton of UserBeans that represent the users that have the permission */ ! public Collection getUsersWithProjectPermission(Integer projectId, int permission, boolean activeOnly); /** * This method will return a list of users with the supplied permission, either explicitly, or *************** *** 146,152 **** * @param requireAll true if all the permissions in the array are required, false if only one is required * @param activeOnly only include users who are currently active ! * @return an array of UserModels that represent the users that have the permission */ ! public UserModel[] getUsersWithProjectPermission(Integer projectId, int[] permissions, boolean requireAll, boolean activeOnly); /** * This method will return a list of users with any of the supplied permission, either explicitly, or --- 147,153 ---- * @param requireAll true if all the permissions in the array are required, false if only one is required * @param activeOnly only include users who are currently active ! * @return a colleciton of UserBeans that represent the users that have the permission */ ! public Collection getUsersWithProjectPermission(Integer projectId, int[] permissions, boolean requireAll, boolean activeOnly); /** * This method will return a list of users with any of the supplied permission, either explicitly, or *************** *** 156,162 **** * @param projectId the project to find the permission for * @param permissions the permissions that are checked against ! * @return an array of UserModels that represent the users that have the permission */ ! public UserModel[] getUsersWithAnyProjectPermission(Integer projectId, int[] permissions); /** * This method will return a list of users with any of the supplied permission, either explicitly, or --- 157,163 ---- * @param projectId the project to find the permission for * @param permissions the permissions that are checked against ! * @return a colleciton of UserBeans that represent the users that have the permission */ ! public Collection getUsersWithAnyProjectPermission(Integer projectId, int[] permissions); /** * This method will return a list of users with any of the supplied permission, either explicitly, or *************** *** 167,173 **** * @param permissions the permissions that are checked against * @param activeOnly only include users who are currently active ! * @return an array of UserModels that represent the users that have the permission */ ! public UserModel[] getUsersWithAnyProjectPermission(Integer projectId, int[] permissions, boolean activeOnly); /** --- 168,174 ---- * @param permissions the permissions that are checked against * @param activeOnly only include users who are currently active ! * @return a colleciton of UserBeans that represent the users that have the permission */ ! public Collection getUsersWithAnyProjectPermission(Integer projectId, int[] permissions, boolean activeOnly); /** *************** *** 177,188 **** * @param authType the type of authentication information being provided * @param reqSource the source from which the request was made (eg web, api) ! * @return a UserModel if the login is successful * @throws AuthenticatorException an exception if the login is unsuccessful, or an error occurs */ ! public UserModel checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method checks to see if the given user is allowed to self register. ! * @param user a UserModel object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 178,189 ---- * @param authType the type of authentication information being provided * @param reqSource the source from which the request was made (eg web, api) ! * @return a UserBean if the login is successful * @throws AuthenticatorException an exception if the login is unsuccessful, or an error occurs */ ! public UserBean checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method checks to see if the given user is allowed to self register. ! * @param user a UserBean object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 191,199 **** * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowRegistration(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method checks to see if a new user profile can be created within ITracker ! * @param user a UserModel object that contains the data for the new user. If null, then the request is being made for an unknown future user. For example, the system may request this with an null user if it needs to know if the system --- 192,200 ---- * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowRegistration(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method checks to see if a new user profile can be created within ITracker ! * @param user a UserBean object that contains the data for the new user. If null, then the request is being made for an unknown future user. For example, the system may request this with an null user if it needs to know if the system *************** *** 205,214 **** * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowProfileCreation(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method checks to see if the given user's core user profile information * can be updated locally. ! * @param user a UserModel object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 206,215 ---- * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowProfileCreation(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method checks to see if the given user's core user profile information * can be updated locally. ! * @param user a UserBean object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 217,225 **** * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowProfileUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method checks to see if the given user's password can be updated locally. ! * @param user a UserModel object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 218,226 ---- * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowProfileUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method checks to see if the given user's password can be updated locally. ! * @param user a UserBean object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 228,237 **** * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowPasswordUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method checks to see if the given user's permission information * can be updated locally. ! * @param user a UserModel object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 229,238 ---- * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowPasswordUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method checks to see if the given user's permission information * can be updated locally. ! * @param user a UserBean object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 240,249 **** * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowPermissionUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method checks to see if the given user's preference information * can be updated locally. ! * @param user a UserModel object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 241,250 ---- * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowPermissionUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method checks to see if the given user's preference information * can be updated locally. ! * @param user a UserBean object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 252,256 **** * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowPreferenceUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; public void sendNotification(String login, String email, String baseURL); --- 253,257 ---- * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowPreferenceUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; public void sendNotification(String login, String email, String baseURL); Index: SchedulerHandler.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/interfaces/SchedulerHandler.java,v retrieving revision 1.8.4.2 retrieving revision 1.8.4.2.2.1 diff -C2 -d -r1.8.4.2 -r1.8.4.2.2.1 *** SchedulerHandler.java 13 Oct 2005 14:26:54 -0000 1.8.4.2 --- SchedulerHandler.java 6 Dec 2005 12:38:01 -0000 1.8.4.2.2.1 *************** *** 19,33 **** package cowsultants.itracker.ejb.client.interfaces; import cowsultants.itracker.ejb.beans.session.DataException; ! import cowsultants.itracker.ejb.client.models.ScheduledTaskModel; public interface SchedulerHandler { public static final String JNDI_NAME = "ejb/SchedulerHandler"; ! public ScheduledTaskModel getTask(Integer id) throws DataException; ! public ScheduledTaskModel[] getAllTasks() throws DataException; ! public ScheduledTaskModel createTask(ScheduledTaskModel model); ! public ScheduledTaskModel updateTask(ScheduledTaskModel model); public boolean removeTask(Integer taskId); } \ No newline at end of file --- 19,40 ---- package cowsultants.itracker.ejb.client.interfaces; + import cowsultants.itracker.ejb.beans.entity.ScheduledTaskBean; import cowsultants.itracker.ejb.beans.session.DataException; ! import java.util.Collection; public interface SchedulerHandler { public static final String JNDI_NAME = "ejb/SchedulerHandler"; ! public ScheduledTaskBean getTask(Integer id) throws DataException; ! ! /** ! * Gets all the tasks in the system ! * ! * @return a collection of ScheduledTaskBean objects ! */ ! public Collection getAllTasks() throws DataException; ! public ScheduledTaskBean createTask(ScheduledTaskBean task); ! public ScheduledTaskBean updateTask(ScheduledTaskBean task); public boolean removeTask(Integer taskId); } \ No newline at end of file Index: SystemConfiguration.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/interfaces/SystemConfiguration.java,v retrieving revision 1.22.4.1 retrieving revision 1.22.4.1.2.1 diff -C2 -d -r1.22.4.1 -r1.22.4.1.2.1 *** SystemConfiguration.java 11 Oct 2005 01:21:04 -0000 1.22.4.1 --- SystemConfiguration.java 6 Dec 2005 12:38:01 -0000 1.22.4.1.2.1 *************** *** 1,277 **** ! /* ! * 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.client.interfaces; ! ! import java.util.HashMap; ! import java.util.Locale; ! import java.util.Properties; ! ! import cowsultants.itracker.ejb.beans.session.DataException; ! 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; ! ! public interface SystemConfiguration { ! public static final String JNDI_NAME = "ejb/SystemConfiguration"; ! ! public Properties getProperties(); ! ! public String getProperty(String name); ! public String getProperty(String name, String defaultValue); ! public boolean getBooleanProperty(String name, boolean defaultValue); ! public int getIntegerProperty(String name, int defaultValue); ! public long getLongProperty(String name, long defaultValue); ! ! public ConfigurationModel getConfigurationItem(Integer id); ! /** ! * Returns all the configuration items of a particular type. The name values ! * for all the items will not be initialized. ! * @param type the type of configuration items to retrieve ! * @return an array of ConfigurationModels ! */ ! public ConfigurationModel[] getConfigurationItemsByType(int type) throws DataException; ! /** ! * Returns all the configuration items of a particular type. In addition, all ! * of the configuration items name values will be initialized to the values ! * for the supplied locale. ! * @param type the type of configuration items to retrieve ! * @param locale the locale to use when setting the configuration items name values ! * @return an array of ConfigurationModels ! */ ! public ConfigurationModel[] getConfigurationItemsByType(int type, Locale locale) throws DataException; ! /** ! * This method will create a new ConfigurationBean for persistance in the database. ! * @param model the model to create the bean from ! * @returns and updated model with the information from the newly created bean ! */ ! public ConfigurationModel createConfigurationItem(ConfigurationModel model); ! /** ! * This method updates a configuration item in the database. It does not include any updates ! * to language items that would be used to display the localized value of the item. ! * @param model a ConfigurationModel of the item to update ! * @return a ConfigurationModel with the updated item ! */ ! public ConfigurationModel updateConfigurationItem(ConfigurationModel model) throws DataException; ! public ConfigurationModel[] updateConfigurationItems(ConfigurationModel[] models, int type) throws DataException; ! ! public boolean configurationItemExists(ConfigurationModel model) throws DataException; ! public boolean configurationItemUpToDate(ConfigurationModel model) throws DataException; ! ! /** ! * This method will remove the configuration item with the supplied id. ! * @param id the id of the configuration information to remove ! */ ! public void removeConfigurationItem(Integer id) throws DataException; ! /** ! * This method will remove all configuration items that match the supplied type. This ! * will remove all items of that type such as all system status values. ! * @param type the type of configuration information to remove ! */ ! public void removeConfigurationItems(int type) throws DataException; ! /** ! * This method will remove all configuration items that match the supplied models ! * type and value. This effectively eliminates all previous versions of the item. ! * It is normally called prior to a create to remove any older copies of this item. ! * @param model the model to determine the type and value from ! */ ! public void removeConfigurationItems(ConfigurationModel model) throws DataException; ! ! /** ! * This method will reset any caches in the system of configuration items for all configuration ! * item types. ! */ ! public void resetConfigurationCache() throws DataException; ! /** ! * This method will reset any caches in the system of configuration items for the specified ! * configuration item type. ! * @param type the type of configuration item to reset in any caches ! */ ! public void resetConfigurationCache(int type) throws DataException; ! ! /** ! * This method will return the requested workflow script. ! * @param id the id of the requested script ! * @return a WorkflowScriptModel with the requested script, or null if not found ! */ ! public WorkflowScriptModel getWorkflowScript(Integer id); ! /** ! * This method will return all defined workflow scripts. ! * @return a WorkflowScriptModel array with all defined scripts ! */ ! public WorkflowScriptModel[] getWorkflowScripts(); ! /** ! * This method will create a new workflow script for persistance in the database. ! * @param model the model to create the script from ! * @returns and updated model with the information from the newly created script ! */ ! public WorkflowScriptModel createWorkflowScript(WorkflowScriptModel model); ! /** ! * This method updates a workflow script in the database. ! * @param model a WorkflowScriptModel of the item to update ! * @return a WorkflowScriptModel with the updated item ! */ ! public WorkflowScriptModel updateWorkflowScript(WorkflowScriptModel model); ! ! /** ! * This method will return the requested custom field. ! * @param id the id of the requested field ! * @return a CustomFieldModel with the requested field, or null if not found ! */ ! public CustomFieldModel getCustomField(Integer id) throws DataException; ! /** ! * This method will return all the custom fields defined in the system. ! * @return an array of CustomFieldModels ! */ ! public CustomFieldModel[] getCustomFields() throws DataException; ! /** ! * This method will return all the custom fields defined in the system. It will ! * also initialize all of the field labels using the supplied locale. ! * @param locale the locale to use to initialize the labels ! * @return an array of CustomFieldModels ! */ ! public CustomFieldModel[] getCustomFields(Locale locale) throws DataException; ! /** ! * This method will create a new CustomField for persistance in the database. If the ! * field includes a set of option values, those will be created also. ! * @param model the model to create the field from ! * @returns and updated model with the information from the newly created field ! */ ! public CustomFieldModel createCustomField(CustomFieldModel model) throws DataException; ! /** ! * This method updates a custom field in the database. It does not include any updates ! * to language items that would be used to display the localized label for the field. ! * If any options are included, the list will be used to replace any existing options. ! * @param model a CustomFieldModel of the item to update ! * @return a CustomFieldModel with the updated item ! */ ! public CustomFieldModel updateCustomField(CustomFieldModel model) throws DataException; ! /** ! * Removes a single custom field from the database. ! * @param customFieldValueId the id of the custom field to remove ! */ ! public void removeCustomField(Integer customFieldId) throws DataException; ! /** ! * This method will return the requested custom field value. ! * @param id the id of the requested field value ! * @return a CustomFieldModel with the requested field value, or null if not found ! */ ! public CustomFieldValueModel getCustomFieldValue(Integer id); ! /** ! * This method will create a new CustomFieldValue for persistance in the database. ! * @param model the model to create the field from ! * @returns and updated model with the information from the newly created field ! */ ! public CustomFieldValueModel createCustomFieldValue(CustomFieldValueModel model) throws DataException; ! /** ! * This method updates a custom field value in the database. It does not include any updates ! * to language items that would be used to display the localized label for the field value. ! * @param model a CustomFieldValueModel of the item to update ! * @return a CustomFieldValueModel with the updated item ! */ ! public CustomFieldValueModel updateCustomFieldValue(CustomFieldValueModel model) throws DataException; ! /** ! * This method updates a set of custom field values in the database. If the array of values ! * is null or zero length, it will remove all existing values from the custom field. Otherwise ! * it will update the value and sort order of all the values. If the array of models contains ! * more or less values than the current custom field, it will not remove theose values, or create ! * new values. ! * @param customFieldId the id of the custom field to update ! * @param models an array of CustomFieldValueModels to update ! * @return a array of CustomFieldValueModels with the updated items ! */ ! public CustomFieldValueModel[] updateCustomFieldValues(Integer customFieldId, CustomFieldValueModel[] models) throws DataException; ! /** ! * Removes a single custom field value from the database. ! * @param customFieldValueId the id of the custom field value to remove ! */ ! public void removeCustomFieldValue(Integer customFieldValueId); ! /** ! * Removes all custom field values from the database for a single custom field. ! * @param customFieldId the id of the custom field to remove the values for ! */ ! public void removeCustomFieldValues(Integer customFieldId); ! ! /** ! * This method will return the translation for a particular key in a locale. ! * @param key the key to look up ! * @param locale the localue to translate the key for ! * @return a LanguageModel with the translation ! */ ! public LanguageModel getLanguageItemByKey(String key, Locale locale) throws DataException; ! /** ! * This method will return all the translations for a particular key. ! * @param key the key to look up ! * @return an array of LanguageModels with the translations for the key ! */ ! public LanguageModel[] getLanguageItemsByKey(String key) throws DataException; ! /** ! * Updates a translations for a particular key and locale. ! * @param model A LanguageModel for the key to update ! * @return a LanguageModel with the updated translation ! */ ! public LanguageModel updateLanguageItem(LanguageModel model) throws DataException; ! /** ! * This method will remove all language items with the supplied key regardless ! * of locale. ! * @param key the key to remove ! */ ! public void removeLanguageKey(String key) throws DataException; ! public void removeLanguageItem(LanguageModel model) throws DataException; ! ! /** ! * This method will return the current configuration of the system. ! * @return a SystemConfigurationModel with the current configuration of the system ! */ ! public SystemConfigurationModel getSystemConfiguration(Locale locale) throws DataException; ! ! /** ! * Returns all of the keys currently defined in the base locale sorted and grouped in a ! * logical manner. ! */ ! public String[] getSortedKeys() throws DataException; ! ! public HashMap getDefinedKeys(String locale) throws DataException; ! public NameValuePairModel[] getDefinedKeysAsArray(String locale) throws DataException; ! public int getNumberDefinedKeys(String locale) throws DataException; ! public HashMap getAvailableLanguages() throws DataException; ! public int getNumberAvailableLanguages() throws DataException; ! public LanguageModel[] getLanguage(Locale locale) throws DataException; ! public void updateLanguage(Locale locale, LanguageModel[] models) throws DataException; ! public void updateLanguage(Locale locale, LanguageModel[] models, ConfigurationModel config) throws DataException; ! ! /** ! * This method will load the specified locale. It will look for the appropriate properties file, ! * and then load all of the resources into the database. ! * @param locale the locale to load ! * @param forceReload if true, it will reload the languages from the property file even if it is listed ! * as being up to date ! */ ! public boolean initializeLocale(String locale, boolean forceReload) throws DataException; ! ! /** ! * This method will load the some default system configuration data into the database. The values ! * it loads are determined from the base ITracker.properties file so the language intiialization ! * <b>must</b> be performed before this method is called. ! */ ! public void initializeConfiguration(); ! } --- 1,313 ---- ! /* ! * 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.client.interfaces; ! ! 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.beans.session.SystemConfigurationBean; ! import cowsultants.itracker.ejb.client.util.SystemConfigurationModel; ! import java.util.Collection; ! import java.util.HashMap; ! import java.util.Locale; ! import java.util.Properties; ! ! import cowsultants.itracker.ejb.beans.session.DataException; ! ! public interface SystemConfiguration { ! ! public static final String JNDI_NAME = "ejb/SystemConfiguration"; ! ! public Properties getProperties(); ! ! public String getProperty(String name); ! public String getProperty(String name, String defaultValue); ! public boolean getBooleanProperty(String name, boolean defaultValue); ! public int getIntegerProperty(String name, int defaultValue); ! public long getLongProperty(String name, long defaultValue); ! ! public ConfigurationBean getConfigurationItem(Integer id); ! ! /** ! * Returns all the configuration items of a particular type. The name values ! * for all the items will not be initialized. ! * @param type the type of configuration items to retrieve ! * @return a collection of ConfigurationBeans ! */ ! public Collection getConfigurationItemsByType(int type) throws DataException; ! ! /** ! * Returns all the configuration items of a particular type. In addition, all ! * of the configuration items name values will be initialized to the values ! * for the supplied locale. ! * @param type the type of configuration items to retrieve ! * @param locale the locale to use when setting the configuration items name values ! * @return a Collection of ConfigurationBeans ! */ ! ! public Collection getConfigurationItemsByType(int type, Locale locale) throws DataException; ! ! /** ! * This method will create a new ConfigurationBean for persistance in the database. ! * @param entity the entity to create the bean from ! * @returns an updated entity with the information from the newly created bean ! */ ! public ConfigurationBean createConfigurationItem(ConfigurationBean entity); ! ! /** ! * This method updates a configuration item in the database. It does not include any updates ! * to language items that would be used to display the localized value of the item. ! * @param entity a ConfigurationBean to update ! * @return a ConfigurationBean with the updated item ! */ ! public ConfigurationBean updateConfigurationItem(ConfigurationBean entity) throws DataException; ! ! public Collection updateConfigurationItems(Collection models, int type) throws DataException; ! ! public boolean configurationItemExists(ConfigurationBean entity) throws DataException; ! ! public boolean configurationItemUpToDate(ConfigurationBean entity) throws DataException; ! ! /** ! * This method will remove the configuration item with the supplied id. ! * @param id the id of the configuration information to remove ! */ ! public void removeConfigurationItem(Integer id) throws DataException; ! ! /** ! * This method will remove all configuration items that match the supplied type. This ! * will remove all items of that type such as all system status values. ! * @param type the type of configuration information to remove ! */ ! public void removeConfigurationItems(int type) throws DataException; ! ! /** ! * This method will remove all configuration items that match the supplied models ! * type and value. This effectively eliminates all previous versions of the item. ! * It is normally called prior to a create to remove any older copies of this item. ! * @param entity the entity to determine the type and value from ! */ ! public void removeConfigurationItems(ConfigurationBean entity) throws DataException; ! ! /** ! * This method will reset any caches in the system of configuration items for all configuration ! * item types. ! */ ! public void resetConfigurationCache() throws DataException; ! ! /** ! * This method will reset any caches in the system of configuration items for the specified ! * configuration item type. ! * @param type the type of configuration item to reset in any caches ! */ ! public void resetConfigurationCache(int type) throws DataException; ! ! /** ! * This method will return the requested workflow script. ! * @param id the id of the requested script ! * @return a WorkflowScriptBean with the requested script, or null if not found ! */ ! public WorkflowScriptBean getWorkflowScript(Integer id); ! ! /** ! * This method will return all defined workflow scripts. ! * @return a WorkflowScriptModel collection with all defined scripts ! */ ! public Collection getWorkflowScripts(); ! ! /** ! * This method will create a new workflow script for persistance in the database. ! * @param script the script to create ! * @returns and updated script with the information from the newly created script ! */ ! public WorkflowScriptBean createWorkflowScript(WorkflowScriptBean script); ! ! /** ! * This method updates a workflow script in the database. ! * @param script a WorkflowScriptBean of the item to update ! * @return a WorkflowScriptBean with the updated item ! */ ! public WorkflowScriptBean updateWorkflowScript(WorkflowScriptBean script); ! ! /** ! * This method will return the requested custom field. ! * @param id the id of the requested field ! * @return a CustomFieldBean representing the requested field, or null if not found ! */ ! public CustomFieldBean getCustomField(Integer id) throws DataException; ! ! /** ! * This method will return all the custom fields defined in the system. ! * @return an array of CustomFieldBeans ! */ ! public Collection getCustomFields() throws DataException; ! ! /** ! * This method will return all the custom fields defined in the system. It will ! * also initialize all of the field labels using the supplied locale. ! * @param locale the locale to use to initialize the labels ! * @return an array of CustomFieldBeans ! */ ! public Collection getCustomFields(Locale locale) throws DataException; ! ! /** ! * This method will create a new CustomField for persistance in the database. If the ! * field includes a set of option values, those will be created also. ! * @param field the field to create ! * @returns and updated field with the information from the newly created field ! */ ! public CustomFieldBean createCustomField(CustomFieldBean field) throws DataException; ! ! /** ! * This method updates a custom field in the database. It does not include any updates ! * to language items that would be used to display the localized label for the field. ! * If any options are included, the list will be used to replace any existing options. ! * @param model a CustomFieldModel of the item to update ! * @return a CustomFieldModel with the updated item ! */ ! public CustomFieldBean updateCustomField(CustomFieldBean model) throws DataException; ! ! /** ! * Removes a single custom field from the database. ! * @param customFieldValueId the id of the custom field to remove ! */ ! public void removeCustomField(Integer customFieldId) throws DataException; ! ! /** ! * This method will return the requested custom field value. ! * @param id the id of the requested field value ! * @return a CustomFieldModel with the requested field value, or null if not found ! */ ! public CustomFieldValueBean getCustomFieldValue(Integer id); ! ! /** ! * This method will create a new CustomFieldValue for persistance in the database. ! * @param field the field to create ! * @returns and updated field with the information from the newly created field ! */ ! public CustomFieldValueBean createCustomFieldValue(CustomFieldValueBean field) throws DataException; ! ! /** ! * This method updates a custom field value in the database. It does not include any updates ! * to language items that would be used to display the localized label for the field value. ! * @param field a CustomFieldValueBean of the item to update ! * @return a CustomFieldValueBean with the updated item ! */ ! public CustomFieldValueBean updateCustomFieldValue(CustomFieldValueBean field) throws DataException; ! ! /** ! * This method updates a set of custom field values in the database. If the collection of values ! * is null or zero length, it will remove all existing values from the custom field. Otherwise ! * it will update the value and sort order of all the values. If the collection contains ! * more or less values than the current custom field, it will not remove theose values, or create ! * new values. ! * @param customFieldId the id of the custom field to update ! * @param fields a collection of CustomFieldValueBeans to update ! * @return a collection of CustomFieldValueBeans with the updated items ! */ ! public Collection updateCustomFieldValues(Integer customFieldId, Collection fields) throws DataException; ! ! /** ! * Removes a single custom field value from the database. ! * @param customFieldValueId the id of the custom field value to remove ! */ ! public void removeCustomFieldValue(Integer customFieldValueId); ! ! /** ! * Removes all custom field values from the database for a single custom field. ! * @param customFieldId the id of the custom field to remove the values for ! */ ! public void removeCustomFieldValues(Integer customFieldId); ! ! /** ! * This method will return the translation for a particular key in a locale. ! * @param key the key to look up ! * @param locale the localue to translate the key for ! * @return a LanguageBean with the translation ! */ ! public LanguageBean getLanguageItemByKey(String key, Locale locale) throws DataException; ! ! /** ! * This method will return all the translations for a particular key. ! * @param key the key to look up ! * @return an array of LanguageModels with the translations for the key ! */ ! public Collection getLanguageItemsByKey(String key) throws DataException; ! ! /** ! * Updates a translations for a particular key and locale. ! * @param language A LanguageBean for the key to update ! * @return a LanguageBean with the updated translation ! */ ! public LanguageBean updateLanguageItem(LanguageBean language) throws DataException; ! ! /** ! * This method will remove all language items with the supplied key regardless ! * of locale. ! * @param key the key to remove ! */ ! public void removeLanguageKey(String key) throws DataException; ! ! public void removeLanguageItem(LanguageBean model) throws DataException; ! ! /** ! * This method will return the current configuration of the system. ! * @return a SystemConfigurationModel with the current configuration of the system ! */ ! public SystemConfigurationModel getSystemConfiguration(Locale locale) throws DataException; ! ! /** ! * Returns all of the keys currently defined in the base locale sorted and grouped in a ! * logical manner. ! */ ! public String[] getSortedKeys() throws DataException; ! ! public HashMap getDefinedKeys(String locale) throws DataException; ! ! /** ! * Gets a collection of NameValuePair objects for the specified locale ! * @todo create the NameValuePair object or replace it with an existing object ! */ ! public Collection getDefinedKeysAsArray(String locale) throws DataException; ! public int getNumberDefinedKeys(String locale) throws DataException; ! public HashMap getAvailableLanguages() throws DataException; ! public int getNumberAvailableLanguages() throws DataException; ! public Collection getLanguage(Locale locale) throws DataException; ! public void updateLanguage(Locale locale, Collection langs) throws DataException; ! public void updateLanguage(Locale locale, Collection langs, ConfigurationBean config) throws DataException; ! ! /** ! * This method will load the specified locale. It will look for the appropriate properties file, ! * and then load all of the resources into the database. ! * @param locale the locale to load ! * @param forceReload if true, it will reload the languages from the property file even if it is listed ! * as being up to date ! */ ! public boolean initializeLocale(String locale, boolean forceReload) throws DataException; ! ! /** ! * This method will load the some default system configuration data into the database. The values ! * it loads are determined from the base ITracker.properties file so the language intiialization ! * <b>must</b> be performed before this method is called. ! */ ! public void initializeConfiguration(); ! } ! Index: ReportHandler.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/interfaces/ReportHandler.java,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.1.2.1 diff -C2 -d -r1.7.4.1 -r1.7.4.1.2.1 *** ReportHandler.java 11 Oct 2005 01:21:04 -0000 1.7.4.1 --- ReportHandler.java 6 Dec 2005 12:38:01 -0000 1.7.4.1.2.1 *************** *** 19,34 **** package cowsultants.itracker.ejb.client.interfaces; ! import cowsultants.itracker.ejb.client.models.ReportModel; public interface ReportHandler { public static final String JNDI_NAME = "ejb/ReportHandler"; ! public ReportModel getReport(Integer id); public byte[] getReportFile(Integer reportId); ! public ReportModel[] getAllReports(); public int getNumberReports(); ! public ReportModel createReport(ReportModel model); ! public ReportModel updateReport(ReportModel model); public boolean removeReport(Integer reportId); } \ No newline at end of file --- 19,35 ---- package cowsultants.itracker.ejb.client.interfaces; ! import cowsultants.itracker.ejb.beans.entity.ReportBean; ! import java.util.Collection; public interface ReportHandler { public static final String JNDI_NAME = "ejb/ReportHandler"; ! public ReportBean getReport(Integer id); public byte[] getReportFile(Integer reportId); ! public Collection getAllReports(); public int getNumberReports(); ! public ReportBean createReport(ReportBean model); ! public ReportBean updateReport(ReportBean model); public boolean removeReport(Integer reportId); } \ No newline at end of file Index: IssueHandler.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/interfaces/IssueHandler.java,v retrieving revision 1.34.4.2 retrieving revision 1.34.4.2.2.1 diff -C2 -d -r1.34.4.2 -r1.34.4.2.2.1 *** IssueHandler.java 22 Oct 2005 16:37:28 -0000 1.34.4.2 --- IssueHandler.java 6 Dec 2005 12:38:01 -0000 1.34.4.2.2.1 *************** *** 1,179 **** ! /* ! * 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.client.interfaces; ! ! import java.util.Date; import java.util.HashSet; import cowsultants.itracker.ejb.beans.entity.IssueActivityBean; import cowsultants.itracker.ejb.beans.session.DataException; import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; import cowsultants.itracker.ejb.client.models.ComponentModel; import cowsultants.itracker.ejb.client.models.IssueAttachmentModel; import cowsultants.itracker.ejb.client.models.IssueFieldModel; import cowsultants.itracker.ejb.client.models.IssueHistoryModel; import cowsultants.itracker.ejb.client.models.IssueModel; import cowsultants.itracker.ejb.client.models.IssueRelationModel; import cowsultants.itracker.ejb.client.models.NotificationModel; import cowsultants.itracker.ejb.client.models.ProjectModel; import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.models.VersionModel; ! ! public interface IssueHandler { ! public static final String JNDI_NAME = "ejb/IssueHandler"; ! ! public IssueModel getIssue(Integer issueId) throws DataException; ! public IssueModel[] getAllIssues() throws DataException; ! public int getNumberIssues() throws DataException; ! /** ! * Returns an array of issues that are currently at the given status. ! * @param status the status to search for ! * @return an array of issues with the given status ! */ ! public IssueModel[] getIssuesWithStatus(int status); ! /** ! * Returns an array of issues that are currently at the given status or a status ! * less than the given status. ! * @param status the status to search for ! * @return an array of issues with the given status or lower ! */ ! public IssueModel[] getIssuesWithStatusLessThan(int status) throws DataException; ! /** ! * Returns an array of issues that are currently at the given severity. ! * @param severity the severity to search for ! * @return an array of issues with the given severity ! */ ! public IssueModel[] getIssuesWithSeverity(int severity); ! ... [truncated message content] |
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/authentication/adsson In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/ejb/authentication/adsson Modified Files: Tag: itrackerhnodto GetUserModelFromADPrivilegedAction.java WindowsSSONAuthenticator.java WindowsSSONAuthenticatorADInfo.java Log Message: removal of value objects Index: WindowsSSONAuthenticator.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/authentication/adsson/Attic/WindowsSSONAuthenticator.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -C2 -d -r1.1.2.1 -r1.1.2.1.2.1 *** WindowsSSONAuthenticator.java 21 Oct 2005 11:34:03 -0000 1.1.2.1 --- WindowsSSONAuthenticator.java 6 Dec 2005 12:38:00 -0000 1.1.2.1.2.1 *************** *** 4,8 **** --- 4,11 ---- package cowsultants.itracker.ejb.authentication.adsson; + import cowsultants.itracker.ejb.beans.entity.UserBean; + import cowsultants.itracker.ejb.beans.entity.UserPreferencesBean; import java.rmi.RemoteException; + import java.sql.Timestamp; import java.util.Date; *************** *** 13,18 **** import cowsultants.itracker.ejb.client.exceptions.UserException; import cowsultants.itracker.ejb.client.interfaces.UserHandler; - import cowsultants.itracker.ejb.client.models.UserModel; - import cowsultants.itracker.ejb.client.models.UserPreferencesModel; import cowsultants.itracker.ejb.client.util.Logger; import cowsultants.itracker.ejb.client.util.UserUtilities; --- 16,19 ---- *************** *** 34,40 **** * java.lang.Object, int, int) */ ! public UserModel checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException { ! UserModel userModel; try { // this authenticator only handles authType=AUTH_TYPE_REQUEST --- 35,41 ---- * java.lang.Object, int, int) */ ! public UserBean checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException { ! UserBean user; try { // this authenticator only handles authType=AUTH_TYPE_REQUEST *************** *** 64,69 **** } ! userModel = updateOrCreateUser(login, userHandler); ! return userModel; } catch (RemoteException e) { Logger.logError("pt_PT", e.getMessage()); --- 65,70 ---- } ! user = updateOrCreateUser(login, userHandler); ! return user; } catch (RemoteException e) { Logger.logError("pt_PT", e.getMessage()); *************** *** 87,112 **** * @throws UserException */ ! private UserModel updateOrCreateUser(String login, UserHandler userHandler) throws RemoteException, UserException, AuthenticatorException { ! UserModel userModel; // check if the user already exists in ITracker // if he already exists, and needs updating, update him // if not, create him ! userModel = userHandler.getUserByLogin(login); ! if (null == userModel) { ! userModel = createUser(login, userHandler); } else { // user exists, update if needed // get user info from authentication source ! if (needsUpdate(userModel, getExternalUserInfo(login))) { // update user here... // userHandler.updateUser(); // get updated version ! userModel = userHandler.getUserByLogin(login); ! userModel = updateUser(userModel, getExternalUserInfo(login)); ! userHandler.updateUser(userModel); } } ! return userModel; } --- 88,113 ---- * @throws UserException */ ! private UserBean updateOrCreateUser(String login, UserHandler userHandler) throws RemoteException, UserException, AuthenticatorException { ! UserBean user; // check if the user already exists in ITracker // if he already exists, and needs updating, update him // if not, create him ! user = userHandler.getUserByLogin(login); ! if (null == user) { ! user = createUser(login, userHandler); } else { // user exists, update if needed // get user info from authentication source ! if (needsUpdate(user, getExternalUserInfo(login))) { // update user here... // userHandler.updateUser(); // get updated version ! user = userHandler.getUserByLogin(login); ! user = updateUser(user, getExternalUserInfo(login)); ! userHandler.updateUser(user); } } ! return user; } *************** *** 117,127 **** * @return */ ! private UserModel updateUser(UserModel oldUserModel, UserModel newUserModel) { ! oldUserModel.setEmail(newUserModel.getEmail()); ! oldUserModel.setFirstName(newUserModel.getFirstName()); ! oldUserModel.setLastName(newUserModel.getLastName()); ! oldUserModel.setLastModifiedDate(new Date()); ! oldUserModel.setSuperUser(newUserModel.isSuperUser()); ! return (oldUserModel); } --- 118,128 ---- * @return */ ! private UserBean updateUser(UserBean oldUser, UserBean newUser) { ! oldUser.setEmail(newUser.getEmail()); ! oldUser.setFirstName(newUser.getFirstName()); ! oldUser.setLastName(newUser.getLastName()); ! oldUser.setLastModifiedDate(new Timestamp(new Date().getTime())); ! oldUser.setSuperUser(newUser.getSuperUser()); ! return (oldUser); } *************** *** 136,155 **** * @throws RemoteException */ ! private UserModel createUser(String login, UserHandler userHandler) throws RemoteException, UserException, AuthenticatorException { // doesn't exist, create ! UserModel userModel = getExternalUserInfo(login); ! userModel.setRegistrationType(UserUtilities.REGISTRATION_TYPE_ADMIN); ! userModel.setStatus(UserUtilities.STATUS_ACTIVE); ! userModel = userHandler.createUser(userModel); // if this user is a super user, there is no need to set default // permissions // if not, set default permissions ! if (!userModel.isSuperUser()) { ! setDefaultPermissions(userModel, userHandler); } ! return userModel; } --- 137,157 ---- * @throws RemoteException */ ! private UserBean createUser(String login, UserHandler userHandler) throws RemoteException, UserException, AuthenticatorException { // doesn't exist, create ! UserBean user = getExternalUserInfo(login); ! user.setRegistrationType(UserUtilities.REGISTRATION_TYPE_ADMIN); ! user.setStatus(UserUtilities.STATUS_ACTIVE); ! user = userHandler.createUser(user); // if this user is a super user, there is no need to set default // permissions // if not, set default permissions ! //@todo check why superuser is an int ! if (user.getSuperUser() != 1) { ! setDefaultPermissions(user, userHandler); } ! return user; } *************** *** 164,171 **** * @throws RemoteException */ ! private void setDefaultPermissions(UserModel userModel, UserHandler userHandler) throws RemoteException, AuthenticatorException, UserException { ! UserModel templateUser = userHandler.getUserByLogin(TEMPLATE_USER); if (templateUser == null) { String errorMessage = "TemplateUser not found. Create a user called template user, new permissions are copied from him to new users"; --- 166,173 ---- * @throws RemoteException */ ! private void setDefaultPermissions(UserBean user, UserHandler userHandler) throws RemoteException, AuthenticatorException, UserException { ! UserBean templateUser = userHandler.getUserByLogin(TEMPLATE_USER); if (templateUser == null) { String errorMessage = "TemplateUser not found. Create a user called template user, new permissions are copied from him to new users"; *************** *** 174,181 **** } // set permissions ! userHandler.setUserPermissions(userModel.getId(), userHandler.getPermissionsByUserId(templateUser.getId())); // set preferences ! UserPreferencesModel preferences = userHandler.getUserPreferencesByUserId(templateUser.getId()); ! preferences.setUserId(userModel.getId()); userHandler.updateUserPreferences(preferences); } --- 176,183 ---- } // set permissions ! userHandler.setUserPermissions(user.getId(), userHandler.getPermissionsByUserId(templateUser.getId())); // set preferences ! UserPreferencesBean preferences = userHandler.getUserPreferencesByUserId(templateUser.getId()); ! preferences.setUser(user); userHandler.updateUserPreferences(preferences); } *************** *** 186,195 **** * * @param localUser ! * The local UserModel * @param remoteUser ! * The remote UserModel * @return true if the user needs updating, false otherwise */ ! private boolean needsUpdate(UserModel localUser, UserModel remoteUser) { if (!(localUser.getEmail().equals(remoteUser.getEmail()))) return true; --- 188,197 ---- * * @param localUser ! * The local UserBean * @param remoteUser ! * The remote UserBean * @return true if the user needs updating, false otherwise */ ! private boolean needsUpdate(UserBean localUser, UserBean remoteUser) { if (!(localUser.getEmail().equals(remoteUser.getEmail()))) return true; *************** *** 198,207 **** if (!(localUser.getLastName().equals(remoteUser.getLastName()))) return true; ! if (localUser.isSuperUser() != remoteUser.isSuperUser()) return true; return (false); } ! protected abstract UserModel getExternalUserInfo(String login) throws AuthenticatorException; /* --- 200,209 ---- if (!(localUser.getLastName().equals(remoteUser.getLastName()))) return true; ! if (localUser.getSuperUser() != remoteUser.getSuperUser()) return true; return (false); } ! protected abstract UserBean getExternalUserInfo(String login) throws AuthenticatorException; /* *************** *** 211,215 **** * java.lang.Object, int, int) */ ! public boolean allowProfileUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return true; --- 213,217 ---- * java.lang.Object, int, int) */ ! public boolean allowProfileUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return true; *************** *** 222,226 **** * java.lang.Object, int, int) */ ! public boolean allowPasswordUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return false; --- 224,228 ---- * java.lang.Object, int, int) */ ! public boolean allowPasswordUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return false; Index: GetUserModelFromADPrivilegedAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/authentication/adsson/Attic/GetUserModelFromADPrivilegedAction.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -C2 -d -r1.1.2.1 -r1.1.2.1.2.1 *** GetUserModelFromADPrivilegedAction.java 21 Oct 2005 11:34:03 -0000 1.1.2.1 --- GetUserModelFromADPrivilegedAction.java 6 Dec 2005 12:38:00 -0000 1.1.2.1.2.1 *************** *** 4,7 **** --- 4,8 ---- package cowsultants.itracker.ejb.authentication.adsson; + import cowsultants.itracker.ejb.beans.entity.UserBean; import java.util.Enumeration; import java.util.Hashtable; *************** *** 17,21 **** import javax.naming.directory.SearchResult; - import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.util.Logger; --- 18,21 ---- *************** *** 49,53 **** } ! private UserModel getUserInfo(String login) throws NamingException { // Set up environment for creating initial context Hashtable env = new Hashtable(11); --- 49,53 ---- } ! private UserBean getUserInfo(String login) throws NamingException { // Set up environment for creating initial context Hashtable env = new Hashtable(11); *************** *** 104,118 **** // create user model ! UserModel userModel = new UserModel(); ! userModel.setEmail(mail); ! userModel.setFirstName(firstName); ! userModel.setLastName(lastName); ! userModel.setLogin(login); ! userModel.setPassword("notused="); // if user belongs to "ITracker Super Users" group // make him a super user ! userModel.setSuperUser(false); Logger.logInfo("About to check if user " + login + " is a super user"); --- 104,119 ---- // create user model ! UserBean user = new UserBean(); ! user.setEmail(mail); ! user.setFirstName(firstName); ! user.setLastName(lastName); ! user.setLogin(login); ! user.setPassword("notused="); // if user belongs to "ITracker Super Users" group // make him a super user ! //@todo check why this is an int ! user.setSuperUser(0); Logger.logInfo("About to check if user " + login + " is a super user"); *************** *** 123,128 **** Logger.logInfo(login + " belongs to NT Group " + group); if (group.indexOf(ITRACKER_SUPER_USERS_GROUP) > 0) { ! userModel.setSuperUser(true); ! Logger.logInfo("User " + userModel.getLogin() + " was made an administrator "); } } --- 124,129 ---- Logger.logInfo(login + " belongs to NT Group " + group); if (group.indexOf(ITRACKER_SUPER_USERS_GROUP) > 0) { ! user.setSuperUser(0); ! Logger.logInfo("User " + user.getLogin() + " was made an administrator "); } } *************** *** 131,135 **** } ! if (userModel.isSuperUser()) { Logger.logInfo(login + " is a super user"); } else { --- 132,137 ---- } ! //@todo check why super user is an int ! if (user.getSuperUser() == 1) { Logger.logInfo(login + " is a super user"); } else { *************** *** 139,143 **** ctx.close(); ! return userModel; } } \ No newline at end of file --- 141,145 ---- ctx.close(); ! return user; } } \ No newline at end of file Index: WindowsSSONAuthenticatorADInfo.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/authentication/adsson/Attic/WindowsSSONAuthenticatorADInfo.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -C2 -d -r1.1.2.1 -r1.1.2.1.2.1 *** WindowsSSONAuthenticatorADInfo.java 21 Oct 2005 11:34:03 -0000 1.1.2.1 --- WindowsSSONAuthenticatorADInfo.java 6 Dec 2005 12:38:00 -0000 1.1.2.1.2.1 *************** *** 4,7 **** --- 4,8 ---- package cowsultants.itracker.ejb.authentication.adsson; + import cowsultants.itracker.ejb.beans.entity.UserBean; import java.io.IOException; *************** *** 9,13 **** import cowsultants.itracker.ejb.client.exceptions.AuthenticatorException; - import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.util.Logger; --- 10,13 ---- *************** *** 24,28 **** * @see com.emation.itracker.authentication.WindowsSSONAuthenticator#getExternalUserInfo(java.lang.String) */ ! protected UserModel getExternalUserInfo(String login) throws AuthenticatorException { try { --- 24,28 ---- * @see com.emation.itracker.authentication.WindowsSSONAuthenticator#getExternalUserInfo(java.lang.String) */ ! protected UserBean getExternalUserInfo(String login) throws AuthenticatorException { try { *************** *** 31,36 **** ad.login(); // get external user info ! UserModel userModel = (UserModel)ad.getUserInfo( login ); ! return userModel; } catch (LoginException e) { Logger.logError(" Erro de autenticação no A.D. : " + e.getMessage() + AuthenticatorException.SYSTEM_ERROR ); --- 31,36 ---- ad.login(); // get external user info ! UserBean user = (UserBean)ad.getUserInfo( login ); ! return user; } catch (LoginException e) { Logger.logError(" Erro de autenticação no A.D. : " + e.getMessage() + AuthenticatorException.SYSTEM_ERROR ); |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:19
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/util In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/ejb/client/util Modified Files: Tag: itrackerhnodto Convert.java ImportExportUtilities.java ImportHandler.java IssueUtilities.java SystemConfigurationUtilities.java UserUtilities.java WorkflowUtilities.java Log Message: removal of value objects Index: IssueUtilities.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/util/IssueUtilities.java,v retrieving revision 1.47 retrieving revision 1.47.6.1 diff -C2 -d -r1.47 -r1.47.6.1 *** IssueUtilities.java 14 Sep 2004 18:12:13 -0000 1.47 --- IssueUtilities.java 6 Dec 2005 12:38:01 -0000 1.47.6.1 *************** *** 19,26 **** package cowsultants.itracker.ejb.client.util; import java.text.SimpleDateFormat; import java.util.*; - import cowsultants.itracker.ejb.client.models.*; import cowsultants.itracker.ejb.client.resources.*; --- 19,35 ---- package cowsultants.itracker.ejb.client.util; + import cowsultants.itracker.ejb.beans.entity.ComponentBean; + import cowsultants.itracker.ejb.beans.entity.ConfigurationBean; + import cowsultants.itracker.ejb.beans.entity.CustomFieldBean; + import cowsultants.itracker.ejb.beans.entity.IssueBean; + import cowsultants.itracker.ejb.beans.entity.IssueHistoryBean; + import cowsultants.itracker.ejb.beans.entity.IssueRelationBean; + import cowsultants.itracker.ejb.beans.entity.NotificationBean; + import cowsultants.itracker.ejb.beans.entity.ProjectBean; + import cowsultants.itracker.ejb.beans.entity.UserBean; + import cowsultants.itracker.ejb.beans.entity.VersionBean; import java.text.SimpleDateFormat; import java.util.*; import cowsultants.itracker.ejb.client.resources.*; *************** *** 108,115 **** public static final int NUM_RELATION_TYPES = 10; ! private static ConfigurationModel[] resolutions = new ConfigurationModel[0]; ! private static ConfigurationModel[] severities = new ConfigurationModel[0]; ! private static ConfigurationModel[] statuses = new ConfigurationModel[0]; ! private static CustomFieldModel[] customFields = new CustomFieldModel[0]; public IssueUtilities() { --- 117,124 ---- public static final int NUM_RELATION_TYPES = 10; ! private static Collection resolutions = new ArrayList(); ! private static Collection severities = new ArrayList(); ! private static Collection statuses = new ArrayList(); ! private static Collection customFields = new ArrayList(); public IssueUtilities() { *************** *** 181,190 **** } ! public static String getFieldName(Integer fieldId, CustomFieldModel[] customFields, Locale locale) { if(fieldId.intValue() < 0) { return ITrackerResources.getString(getStandardFieldKey(fieldId.intValue()), locale); } else { ! for(int i = 0; i < customFields.length; i++) { ! if(fieldId.equals(customFields[i].getId())) { return CustomFieldUtilities.getCustomFieldName(fieldId, locale); } --- 190,201 ---- } ! public static String getFieldName(Integer fieldId, Collection customFields, Locale locale) { if(fieldId.intValue() < 0) { return ITrackerResources.getString(getStandardFieldKey(fieldId.intValue()), locale); } else { ! Iterator iter = customFields.iterator(); ! while(iter.hasNext()) { ! CustomFieldBean bean = (CustomFieldBean) iter.next(); ! if(fieldId.equals(bean.getId())) { return CustomFieldUtilities.getCustomFieldName(fieldId, locale); } *************** *** 234,241 **** } ! public static NameValuePairModel[] getStandardFields(Locale locale) { ! NameValuePairModel[] fieldNames = new NameValuePairModel[STANDARD_FIELDS.length]; for(int i = 0; i < STANDARD_FIELDS.length; i++) { ! fieldNames[i] = new NameValuePairModel(ITrackerResources.getString(getStandardFieldKey(STANDARD_FIELDS[i]), locale), Integer.toString(STANDARD_FIELDS[i])); } return fieldNames; --- 245,262 ---- } ! /** ! * Retrieves a collection of standard fields ! * ! * @param locale the locale for which to get the fields ! * @return A collection of NameValuePair objects ! */ ! public static Collection getStandardFields(Locale locale) { ! Collection fieldNames = new ArrayList(); for(int i = 0; i < STANDARD_FIELDS.length; i++) { ! fieldNames.add( ! new NameValuePair( ! ITrackerResources.getString( ! getStandardFieldKey(STANDARD_FIELDS[i]), locale), ! Integer.toString(STANDARD_FIELDS[i]))); } return fieldNames; *************** *** 281,289 **** } ! public static String componentsToString(IssueModel issue) { String value = ""; ! if(issue != null && issue.getComponents().length > 0) { ! for(int i = 0; i < issue.getComponents().length; i++) { ! value += (i != 0 ? ", " : "") + issue.getComponents()[i].getName(); } } --- 302,314 ---- } ! public static String componentsToString(IssueBean issue) { String value = ""; ! if(issue != null && issue.getComponents().size() > 0) { ! Iterator iter = issue.getComponents().iterator(); ! boolean isFirst = true; ! while(iter.hasNext()) { ! ComponentBean bean = (ComponentBean) iter.next(); ! value += (!isFirst ? ", " : "") + bean.getName(); ! isFirst = false; } } *************** *** 291,299 **** } ! public static String versionsToString(IssueModel issue) { String value = ""; ! if(issue != null && issue.getVersions().length > 0) { ! for(int i = 0; i < issue.getVersions().length; i++) { ! value += (i != 0 ? ", " : "") + issue.getVersions()[i].getNumber(); } } --- 316,328 ---- } ! public static String versionsToString(IssueBean issue) { String value = ""; ! if(issue != null && issue.getVersions().size() > 0) { ! Iterator iter = issue.getVersions().iterator(); ! boolean isFirst = true; ! while(iter.hasNext()) { ! VersionBean bean = (VersionBean) iter.next(); ! value += (isFirst ? ", " : "") + bean.getNumber(); ! isFirst = false; } } *************** *** 301,310 **** } ! public static String historyToString(IssueModel issue, SimpleDateFormat sdf) { String value = ""; ! if(issue != null && issue.getHistory().length > 0 && sdf != null) { ! for(int i = 0; i < issue.getHistory().length; i++) { ! value += (i != 0 ? "," : "") + issue.getHistory()[i].getDescription() + "," + issue.getHistory()[i].getUserFirstName(); ! value += " " + issue.getHistory()[i].getUserLastName() + "," + sdf.format(issue.getHistory()[i].getLastModifiedDate()); } } --- 330,343 ---- } ! public static String historyToString(IssueBean issue, SimpleDateFormat sdf) { String value = ""; ! if(issue != null && issue.getHistory().size() > 0 && sdf != null) { ! Iterator iter = issue.getHistory().iterator(); ! boolean isFirst = true; ! while(iter.hasNext()) { ! IssueHistoryBean bean = (IssueHistoryBean) iter.next(); ! value += (isFirst ? "," : "") + bean.getDescription() + "," + bean.getUser().getFirstName(); ! value += " " + bean.getUser().getLastName() + "," + sdf.format(bean.getLastModifiedDate()); ! isFirst = false; } } *************** *** 324,345 **** } ! public static ConfigurationModel[] getStatuses() { return statuses; } ! public static NameValuePairModel[] getStatuses(Locale locale) { ! NameValuePairModel[] statusStrings = new NameValuePairModel[statuses.length]; ! for(int i = 0; i < statuses.length; i++) { ! statusStrings[i] = new NameValuePairModel(ITrackerResources.getString(ITrackerResources.KEY_BASE_STATUS + statuses[i].getValue(), locale), statuses[i].getValue()); } return statusStrings; } ! public static void setStatuses(ConfigurationModel[] value) { ! statuses = (value == null ? new ConfigurationModel[0] : value); } public static int getNumberStatuses() { ! return statuses.length; } --- 357,394 ---- } ! public static Collection getStatuses() { return statuses; } ! /** ! * Gets a list of statuses for the specified locale ! * ! * @param locale the locale for which to retrieve the statuses ! * @return A collection of NameValuePairs ! */ ! public static Collection getStatuses(Locale locale) { ! Collection statusStrings = new ArrayList(); ! ! int index = 0; ! Iterator iter = statuses.iterator(); ! while(iter.hasNext()) { ! ConfigurationBean statusBean = (ConfigurationBean) iter.next(); ! statusStrings.add( ! new NameValuePair( ! ITrackerResources.getString( ! ITrackerResources.KEY_BASE_STATUS + ! statusBean.getValue(), locale), ! statusBean.getValue())); ! index++; } return statusStrings; } ! public static void setStatuses(Collection value) { ! statuses = (value == null ? new ArrayList() : value); } public static int getNumberStatuses() { ! return statuses.size(); } *************** *** 361,380 **** * in the database and and can be obtained from the SystemConfiguration bean. * @param locale the locale to return the severities as ! * @returns array of translated strings from the cached severities list */ ! public static NameValuePairModel[] getSeverities(Locale locale) { ! NameValuePairModel[] severityStrings = new NameValuePairModel[severities.length]; ! for(int i = 0; i < severities.length; i++) { ! severityStrings[i] = new NameValuePairModel(ITrackerResources.getString(ITrackerResources.KEY_BASE_SEVERITY + severities[i].getValue(), locale), severities[i].getValue()); } return severityStrings; } ! public static void setSeverities(ConfigurationModel[] value) { ! severities = (value == null ? new ConfigurationModel[0] : value); } public static int getNumberSeverities() { ! return severities.length; } --- 410,440 ---- * in the database and and can be obtained from the SystemConfiguration bean. * @param locale the locale to return the severities as ! * @returns colleciton of translated strings from the cached severities list ! * stored as NameValuePair objects */ ! public static Collection getSeverities(Locale locale) { ! Collection severityStrings = new ArrayList(); ! ! int index = 0; ! Iterator iter = severities.iterator(); ! while(iter.hasNext()) { ! ConfigurationBean severityBean = (ConfigurationBean) iter.next(); ! severityStrings.add( ! new NameValuePair( ! ITrackerResources.getString( ! ITrackerResources.KEY_BASE_STATUS + ! severityBean.getValue(), locale), ! severityBean.getValue())); ! index++; } return severityStrings; } ! public static void setSeverities(Collection value) { ! severities = (value == null ? new ArrayList() : value); } public static int getNumberSeverities() { ! return severities.size(); } *************** *** 383,391 **** * the severity of issue A is less than the severity of issue B, positive if issue * A is a higher severity than issue B, or 0 if the two issues have the same severity. ! * @param ma IssueModel A ! * @param mb IssueModel B * @returns an int representing the compared severities */ ! public static int compareSeverity(IssueModel ma, IssueModel mb) { if(ma == null && mb == null) { return 0; --- 443,451 ---- * the severity of issue A is less than the severity of issue B, positive if issue * A is a higher severity than issue B, or 0 if the two issues have the same severity. ! * @param ma IssueBean A ! * @param mb IssueBean B * @returns an int representing the compared severities */ ! public static int compareSeverity(IssueBean ma, IssueBean mb) { if(ma == null && mb == null) { return 0; *************** *** 397,409 **** int maIndex = Integer.MAX_VALUE; int mbIndex = Integer.MAX_VALUE; ! for(int i = 0; i < severities.length; i++) { ! if(severities[i] != null) { ! if(severities[i].getValue().equalsIgnoreCase(Integer.toString(ma.getSeverity()))) { ! maIndex = i; } ! if(severities[i].getValue().equalsIgnoreCase(Integer.toString(mb.getSeverity()))) { ! mbIndex = i; } } } if(maIndex > mbIndex) { --- 457,475 ---- int maIndex = Integer.MAX_VALUE; int mbIndex = Integer.MAX_VALUE; ! ! int index = 0; ! Iterator iter = severities.iterator(); ! while(iter.hasNext()) { ! ConfigurationBean severityBean = (ConfigurationBean) iter.next(); ! if(severityBean!= null) { ! if(severityBean.getValue().equalsIgnoreCase(Integer.toString(ma.getSeverity()))) { ! maIndex = index; } ! if(severityBean.getValue().equalsIgnoreCase(Integer.toString(mb.getSeverity()))) { ! mbIndex = index; } } + + index ++; } if(maIndex > mbIndex) { *************** *** 438,448 **** * in the database and and can be obtained from the SystemConfiguration bean. * @param locale the locale to return the resolutions as ! * @returns array of translated strings from the cached resolution list */ ! public static NameValuePairModel[] getResolutions(Locale locale) { ! NameValuePairModel[] resolutionStrings = new NameValuePairModel[resolutions.length]; ! for(int i = 0; i < resolutions.length; i++) { ! resolutionStrings[i] = new NameValuePairModel(ITrackerResources.getString(ITrackerResources.KEY_BASE_RESOLUTION + resolutions[i].getValue(), locale), resolutions[i].getValue()); } return resolutionStrings; } --- 504,526 ---- * in the database and and can be obtained from the SystemConfiguration bean. * @param locale the locale to return the resolutions as ! * @returns collection of translated strings from the cached resolution list ! * stored as NameValuePair objects */ ! public static Collection getResolutions(Locale locale) { ! Collection resolutionStrings = new ArrayList(); ! ! int index = 0; ! Iterator iter = resolutions.iterator(); ! while(iter.hasNext()) { ! ConfigurationBean resolutionBean = (ConfigurationBean) iter.next(); ! resolutionStrings.add( ! new NameValuePair( ! ITrackerResources.getString( ! ITrackerResources.KEY_BASE_STATUS + ! resolutionBean.getValue(), locale), ! resolutionBean.getValue())); ! index++; } + return resolutionStrings; } *************** *** 451,456 **** * Sets the cached list of predefined resolutions. */ ! public static void setResolutions(ConfigurationModel[] value) { ! resolutions = (value == null ? new ConfigurationModel[0] : value); } --- 529,534 ---- * Sets the cached list of predefined resolutions. */ ! public static void setResolutions(Collection value) { ! resolutions = (value == null ? new ArrayList() : value); } *************** *** 464,496 **** /** ! * Returns the cached array of CustomFieldModels. ! * @return an array of CustomFieldModels */ ! public static CustomFieldModel[] getCustomFields() { ! return (customFields == null ? new CustomFieldModel[0] : customFields); } /** ! * Sets the cached array of CustomFieldModels. ! * @return an array of CustomFieldModels */ ! public static void setCustomFields(CustomFieldModel[] value) { ! customFields = (value == null ? new CustomFieldModel[0] : value); } /** ! * Returns an array of the cached custom fields. The fields labels will be initialized * based on the Locale given. If no locale is given, the default locale of the * system will be used. * @param locale the locale to use to populate the field labels ! * @return the cached array of CustomFieldModels */ ! public static CustomFieldModel[] getCustomFields(Locale locale) { ! CustomFieldModel[] localizedFields = new CustomFieldModel[customFields.length]; ! for(int i = 0; i < customFields.length; i++) { try { ! localizedFields[i] = (CustomFieldModel) customFields[i].clone(); ! if(localizedFields[i] != null) { ! localizedFields[i].setLabels(locale); } } catch(CloneNotSupportedException cnse) { --- 542,578 ---- /** ! * Returns the cached collection of CustomFieldBeans. ! * @return an collection of CustomFieldBeans */ ! public static Collection getCustomFields() { ! return (customFields == null ? new ArrayList() : customFields); } /** ! * Sets the cached collection of CustomFieldBeans. ! * @return an collection of CustomFieldBeans */ ! public static void setCustomFields(Collection value) { ! customFields = (value == null ? new ArrayList() : value); } /** ! * Returns a Collection of the cached custom fields. The fields labels will be initialized * based on the Locale given. If no locale is given, the default locale of the * system will be used. * @param locale the locale to use to populate the field labels ! * @return the cached Collection of CustomFieldBeans */ ! public static Collection getCustomFields(Locale locale) { ! Collection localizedFields = new ArrayList(); ! ! Iterator iter = customFields.iterator(); ! while(iter.hasNext()) { ! CustomFieldBean bean = (CustomFieldBean) iter.next(); try { ! CustomFieldBean clonedBean = (CustomFieldBean) bean.clone(); ! localizedFields.add(clonedBean); ! if(clonedBean != null) { ! clonedBean.setLabels(locale); } } catch(CloneNotSupportedException cnse) { *************** *** 507,511 **** * @return the requested CustomField object, or a new field if not found */ ! public static CustomFieldModel getCustomField(Integer id) { return getCustomField(id, ITrackerResources.getLocale()); } --- 589,593 ---- * @return the requested CustomField object, or a new field if not found */ ! public static CustomFieldBean getCustomField(Integer id) { return getCustomField(id, ITrackerResources.getLocale()); } *************** *** 518,528 **** * @return the requested CustomField object, or a new field if not found */ ! public static CustomFieldModel getCustomField(Integer id, Locale locale) { ! CustomFieldModel retField = null; try { ! for(int i = 0; i < customFields.length; i++) { ! if(customFields[i] != null && customFields[i].getId() != null && customFields[i].getId().equals(id)) { ! retField = (CustomFieldModel) customFields[i].clone(); break; } --- 600,612 ---- * @return the requested CustomField object, or a new field if not found */ ! public static CustomFieldBean getCustomField(Integer id, Locale locale) { ! CustomFieldBean retField = null; try { ! Iterator iter = customFields.iterator(); ! while(iter.hasNext()) { ! CustomFieldBean bean = (CustomFieldBean) iter.next(); ! if(bean != null && bean.getId() != null && bean.getId().equals(id)) { ! retField = (CustomFieldBean) bean.clone(); break; } *************** *** 534,538 **** retField.setLabels(locale); } else { ! retField = new CustomFieldModel(); } --- 618,622 ---- retField.setLabels(locale); } else { ! retField = new CustomFieldBean(); } *************** *** 544,557 **** */ public static int getNumberCustomFields() { ! return customFields.length; } /** * Returns true if the user has permission to view the requested issue. ! * @param issue an IssueModel of the issue to check view permission for ! * @param user a UserModel for the user to check permission for * @param permissions a HashMap of the users permissions */ ! public static boolean canViewIssue(IssueModel issue, UserModel user, HashMap permissions) { if(user == null) { return false; --- 628,641 ---- */ public static int getNumberCustomFields() { ! return customFields.size(); } /** * Returns true if the user has permission to view the requested issue. ! * @param issue an IssueBean of the issue to check view permission for ! * @param user a UserBean for the user to check permission for * @param permissions a HashMap of the users permissions */ ! public static boolean canViewIssue(IssueBean issue, UserBean user, HashMap permissions) { if(user == null) { return false; *************** *** 562,586 **** /** * Returns true if the user has permission to view the requested issue. ! * @param issue an IssueModel of the issue to check view permission for * @param userId the userId of the user to check permission for * @param permissions a HashMap of the users permissions */ ! public static boolean canViewIssue(IssueModel issue, Integer userId, HashMap permissions) { if(issue == null || userId == null || permissions == null) { return false; } ! if(UserUtilities.hasPermission(permissions, issue.getProjectId(), UserUtilities.PERMISSION_VIEW_ALL)) { return true; } ! if(! UserUtilities.hasPermission(permissions, issue.getProjectId(), UserUtilities.PERMISSION_VIEW_USERS)) { return false; } ! if(issue.getCreatorId().equals(userId)) { return true; } ! if(issue.getOwnerId().equals(userId)) { return true; } --- 646,670 ---- /** * Returns true if the user has permission to view the requested issue. ! * @param issue an IssueBean of the issue to check view permission for * @param userId the userId of the user to check permission for * @param permissions a HashMap of the users permissions */ ! public static boolean canViewIssue(IssueBean issue, Integer userId, HashMap permissions) { if(issue == null || userId == null || permissions == null) { return false; } ! if(UserUtilities.hasPermission(permissions, issue.getProject().getId(), UserUtilities.PERMISSION_VIEW_ALL)) { return true; } ! if(! UserUtilities.hasPermission(permissions, issue.getProject().getId(), UserUtilities.PERMISSION_VIEW_USERS)) { return false; } ! if(issue.getCreator().getId().equals(userId)) { return true; } ! if(issue.getOwner().getId().equals(userId)) { return true; } *************** *** 591,615 **** /** * Returns true if the user has permission to edit the requested issue. ! * @param issue an IssueModel of the issue to check edit permission for * @param userId the userId of the user to check permission for * @param permissions a HashMap of the users permissions */ ! public static boolean canEditIssue(IssueModel issue, Integer userId, HashMap permissions) { if(issue == null || userId == null || permissions == null) { return false; } ! if(UserUtilities.hasPermission(permissions, issue.getProjectId(), UserUtilities.PERMISSION_EDIT)) { return true; } ! if(! UserUtilities.hasPermission(permissions, issue.getProjectId(), UserUtilities.PERMISSION_EDIT_USERS)) { return false; } ! if(issue.getCreatorId().equals(userId)) { return true; } ! if(issue.getOwnerId().equals(userId)) { return true; } --- 675,699 ---- /** * Returns true if the user has permission to edit the requested issue. ! * @param issue an IssueBean of the issue to check edit permission for * @param userId the userId of the user to check permission for * @param permissions a HashMap of the users permissions */ ! public static boolean canEditIssue(IssueBean issue, Integer userId, HashMap permissions) { if(issue == null || userId == null || permissions == null) { return false; } ! if(UserUtilities.hasPermission(permissions, issue.getProject().getId(), UserUtilities.PERMISSION_EDIT)) { return true; } ! if(! UserUtilities.hasPermission(permissions, issue.getProject().getId(), UserUtilities.PERMISSION_EDIT_USERS)) { return false; } ! if(issue.getCreator().getId().equals(userId)) { return true; } ! if(issue.getOwner().getId().equals(userId)) { return true; } *************** *** 620,641 **** /** * Returns true if the user can be assigned to this issue. ! * @param issue an IssueModel of the issue to check assign permission for * @param userId the userId of the user to check permission for * @param permissions a HashMap of the users permissions */ ! public static boolean canBeAssignedIssue(IssueModel issue, Integer userId, HashMap permissions) { if(issue == null || userId == null || permissions == null) { return false; } ! if(UserUtilities.hasPermission(permissions, issue.getProjectId(), UserUtilities.PERMISSION_EDIT)) { return true; } ! if(UserUtilities.hasPermission(permissions, issue.getProjectId(), UserUtilities.PERMISSION_EDIT_USERS)) { ! if(issue.getCreatorId().equals(userId)) { return true; ! } else if(UserUtilities.hasPermission(permissions, issue.getProjectId(), UserUtilities.PERMISSION_ASSIGNABLE)) { return true; ! } else if(issue.getOwnerId() != null && issue.getOwnerId().equals(userId)) { return true; } --- 704,725 ---- /** * Returns true if the user can be assigned to this issue. ! * @param issue an IssueBean of the issue to check assign permission for * @param userId the userId of the user to check permission for * @param permissions a HashMap of the users permissions */ ! public static boolean canBeAssignedIssue(IssueBean issue, Integer userId, HashMap permissions) { if(issue == null || userId == null || permissions == null) { return false; } ! if(UserUtilities.hasPermission(permissions, issue.getProject().getId(), UserUtilities.PERMISSION_EDIT)) { return true; } ! if(UserUtilities.hasPermission(permissions, issue.getProject().getId(), UserUtilities.PERMISSION_EDIT_USERS)) { ! if(issue.getCreator().getId().equals(userId)) { return true; ! } else if(UserUtilities.hasPermission(permissions, issue.getProject().getId(), UserUtilities.PERMISSION_ASSIGNABLE)) { return true; ! } else if(issue.getOwner().getId() != null && issue.getOwner().getId().equals(userId)) { return true; } *************** *** 647,664 **** /** * Returns true if the user can unassign themselves from the issue. ! * @param issue an IssueModel of the issue to check assign permission for * @param userId the userId of the user to check permission for * @param permissions a HashMap of the users permissions */ ! public static boolean canUnassignIssue(IssueModel issue, Integer userId, HashMap permissions) { if(issue == null || userId == null || permissions == null) { return false; } ! if(UserUtilities.hasPermission(permissions, issue.getProjectId(), UserUtilities.PERMISSION_ASSIGN_OTHERS)) { return true; } if(issue.getOwner() != null && userId.equals(issue.getOwner().getId()) && ! UserUtilities.hasPermission(permissions, issue.getProjectId(), UserUtilities.PERMISSION_UNASSIGN_SELF)) { return true; } --- 731,748 ---- /** * Returns true if the user can unassign themselves from the issue. ! * @param issue an IssueBean of the issue to check assign permission for * @param userId the userId of the user to check permission for * @param permissions a HashMap of the users permissions */ ! public static boolean canUnassignIssue(IssueBean issue, Integer userId, HashMap permissions) { if(issue == null || userId == null || permissions == null) { return false; } ! if(UserUtilities.hasPermission(permissions, issue.getProject().getId(), UserUtilities.PERMISSION_ASSIGN_OTHERS)) { return true; } if(issue.getOwner() != null && userId.equals(issue.getOwner().getId()) && ! UserUtilities.hasPermission(permissions, issue.getProject().getId(), UserUtilities.PERMISSION_UNASSIGN_SELF)) { return true; } *************** *** 667,675 **** } ! public static boolean hasIssueRelation(IssueModel issue, Integer relatedIssueId) { if(issue != null) { ! IssueRelationModel[] relations = issue.getRelations(); ! for(int i = 0; i < relations.length; i++) { ! if(relations[i].getRelatedIssueId().equals(relatedIssueId)) { return true; } --- 751,761 ---- } ! public static boolean hasIssueRelation(IssueBean issue, Integer relatedIssueId) { if(issue != null) { ! Collection relations = issue.getRelations(); ! Iterator iter = relations.iterator(); ! while(iter.hasNext()) { ! IssueRelationBean bean = (IssueRelationBean) iter.next(); ! if(bean.getId().equals(relatedIssueId)) { return true; } *************** *** 679,698 **** } ! public static boolean hasIssueNotification(IssueModel issue, Integer userId) { return hasIssueNotification(issue, issue.getProject(), userId); } ! public static boolean hasIssueNotification(IssueModel issue, ProjectModel project, Integer userId) { if(issue == null || userId == null) { return false; } ! if(issue.getOwnerId().equals(userId) || issue.getCreatorId().equals(userId)) { return true; } if(project != null && project.getOwners() != null) { ! UserModel[] owners = project.getOwners(); ! for(int i = 0; i < owners.length; i++) { ! if(owners[i] != null && owners[i].getId().equals(userId)) { return true; } --- 765,786 ---- } ! public static boolean hasIssueNotification(IssueBean issue, Integer userId) { return hasIssueNotification(issue, issue.getProject(), userId); } ! public static boolean hasIssueNotification(IssueBean issue, ProjectBean project, Integer userId) { if(issue == null || userId == null) { return false; } ! if(issue.getOwner().getId().equals(userId) || issue.getCreator().getId().equals(userId)) { return true; } if(project != null && project.getOwners() != null) { ! Collection owners = project.getOwners(); ! Iterator iter = owners.iterator(); ! while(iter.hasNext()) { ! UserBean bean = (UserBean) iter.next(); ! if(bean != null && bean.getId().equals(userId)) { return true; } *************** *** 700,706 **** } ! NotificationModel [] notifications = issue.getNotifications(); ! for(int i = 0; i < notifications.length; i++) { ! if(notifications[i].getUserId().equals(userId)) { return true; } --- 788,796 ---- } ! Collection notifications = issue.getNotifications(); ! Iterator notificationIter = notifications.iterator(); ! while(notificationIter.hasNext()) { ! NotificationBean bean = (NotificationBean) notificationIter.next(); ! if(bean.getUser().getId().equals(userId)) { return true; } Index: Convert.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/util/Convert.java,v retrieving revision 1.5.4.2 retrieving revision 1.5.4.2.2.1 diff -C2 -d -r1.5.4.2 -r1.5.4.2.2.1 *** Convert.java 13 Oct 2005 14:26:54 -0000 1.5.4.2 --- Convert.java 6 Dec 2005 12:38:01 -0000 1.5.4.2.2.1 *************** *** 19,45 **** package cowsultants.itracker.ejb.client.util; import java.util.NoSuchElementException; import java.util.StringTokenizer; import java.util.Vector; - import cowsultants.itracker.ejb.client.models.ComponentModel; - import cowsultants.itracker.ejb.client.models.CustomFieldValueModel; - import cowsultants.itracker.ejb.client.models.NameValuePairModel; - import cowsultants.itracker.ejb.client.models.UserModel; - import cowsultants.itracker.ejb.client.models.VersionModel; - public class Convert { /** ! * Converts an array of CustomFieldValueModels to NameValuePairModels ! * @param options the array of CustomFieldValueModels to convert ! * @return the new NameValuePairModel array */ ! public static NameValuePairModel[] CustomFieldOptionsToNVP(CustomFieldValueModel[] options) { ! NameValuePairModel[] returnValues = new NameValuePairModel[0]; if(options != null) { ! returnValues = new NameValuePairModel[options.length]; ! for(int i = 0; i < options.length; i++) { ! returnValues[i] = new NameValuePairModel(options[i].getName(), options[i].getValue()); } } --- 19,47 ---- package cowsultants.itracker.ejb.client.util; + import cowsultants.itracker.ejb.beans.entity.ComponentBean; + import cowsultants.itracker.ejb.beans.entity.CustomFieldValueBean; + import cowsultants.itracker.ejb.beans.entity.UserBean; + import cowsultants.itracker.ejb.beans.entity.VersionBean; + import java.util.ArrayList; + import java.util.Collection; + import java.util.Iterator; import java.util.NoSuchElementException; import java.util.StringTokenizer; import java.util.Vector; public class Convert { /** ! * Converts an collection of CustomFieldValueBeans to NameValuePairs ! * @param options the array of CustomFieldValueBeans to convert ! * @return the new NameValuePair collection */ ! public static Collection CustomFieldOptionsToNVP(Collection options) { ! Collection returnValues = new ArrayList(); if(options != null) { ! Iterator iter = options.iterator(); ! while(iter.hasNext()) { ! CustomFieldValueBean option = (CustomFieldValueBean) iter.next(); ! returnValues.add(new NameValuePair(option.getName(), option.getValue())); } } *************** *** 49,63 **** /** ! * Converts an array of UserModels to NameValuePairModels ! * @param options the array of UserModels to convert ! * @return the new NameValuePairModel array */ ! public static NameValuePairModel[] UsersToNVP(UserModel[] users) { ! NameValuePairModel[] returnValues = new NameValuePairModel[0]; if(users != null) { ! returnValues = new NameValuePairModel[users.length]; ! for(int i = 0; i < users.length; i++) { ! returnValues[i] = new NameValuePairModel(users[i].getFirstName() + " " + users[i].getLastName(), users[i].getId().toString()); } } --- 51,66 ---- /** ! * Converts a collection of UserBeans to NameValuePairs ! * @param options the array of UserBeans to convert ! * @return the new NameValuePair collection */ ! public static Collection UsersToNVP(Collection users) { ! Collection returnValues = new ArrayList(); if(users != null) { ! Iterator iter = users.iterator(); ! while(iter.hasNext()) { ! UserBean user = (UserBean) iter.next(); ! returnValues.add(new NameValuePair(user.getFirstName() + " " + user.getLastName(), user.getId().toString())); } } *************** *** 67,81 **** /** ! * Converts an array of ComponentModels to NameValuePairModels * @param options the array of ComponentModels to convert ! * @return the new NameValuePairModel array */ ! public static NameValuePairModel[] ComponentsToNVP(ComponentModel[] components) { ! NameValuePairModel[] returnValues = new NameValuePairModel[0]; if(components != null) { ! returnValues = new NameValuePairModel[components.length]; ! for(int i = 0; i < components.length; i++) { ! returnValues[i] = new NameValuePairModel(components[i].getName(), components[i].getId().toString()); } } --- 70,85 ---- /** ! * Converts a collection of ComponentBeans to NameValuePairs * @param options the array of ComponentModels to convert ! * @return the new NameValuePair collection */ ! public static Collection ComponentsToNVP(Collection components) { ! Collection returnValues = new ArrayList(); if(components != null) { ! Iterator iter = components.iterator(); ! while(iter.hasNext()) { ! ComponentBean component = (ComponentBean) iter.next(); ! returnValues.add(new NameValuePair(component.getName(), component.getId().toString())); } } *************** *** 85,99 **** /** ! * Converts an array of VersionModels to NameValuePairModels * @param options the array of VersionModels to convert ! * @return the new NameValuePairModel array */ ! public static NameValuePairModel[] VersionsToNVP(VersionModel[] versions) { ! NameValuePairModel[] returnValues = new NameValuePairModel[0]; if(versions != null) { ! returnValues = new NameValuePairModel[versions.length]; ! for(int i = 0; i < versions.length; i++) { ! returnValues[i] = new NameValuePairModel(versions[i].getNumber(), versions[i].getId().toString()); } } --- 89,104 ---- /** ! * Converts a collection of VersionBeans to NameValuePairs * @param options the array of VersionModels to convert ! * @return the new NameValuePair collection */ ! public static Collection VersionsToNVP(Collection versions) { ! Collection returnValues = new ArrayList(); if(versions != null) { ! Iterator iter = versions.iterator(); ! while(iter.hasNext()) { ! VersionBean version = (VersionBean) iter.next(); ! returnValues.add(new NameValuePair(version.getNumber(), version.getId().toString())); } } Index: ImportExportUtilities.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/client/util/ImportExportUtilities.java,v retrieving revision 1.20.4.2 retrieving revision 1.20.4.2.2.1 diff -C2 -d -r1.20.4.2 -r1.20.4.2.2.1 *** ImportExportUtilities.java 23 Oct 2005 12:45:47 -0000 1.20.4.2 --- ImportExportUtilities.java 6 Dec 2005 12:38:01 -0000 1.20.4.2.2.1 *************** *** 19,22 **** --- 19,35 ---- package cowsultants.itracker.ejb.client.util; + import cowsultants.itracker.ejb.beans.entity.ComponentBean; + 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.GenericBean; + import cowsultants.itracker.ejb.beans.entity.IssueAttachmentBean; + import cowsultants.itracker.ejb.beans.entity.IssueBean; + import cowsultants.itracker.ejb.beans.entity.IssueFieldBean; + import cowsultants.itracker.ejb.beans.entity.IssueHistoryBean; + import cowsultants.itracker.ejb.beans.entity.ProjectBean; + import cowsultants.itracker.ejb.beans.entity.UserBean; + import cowsultants.itracker.ejb.beans.entity.VersionBean; + import cowsultants.itracker.ejb.beans.session.SystemConfigurationBean; import java.io.StringReader; import java.util.*; *************** *** 27,31 **** import cowsultants.itracker.ejb.client.exceptions.*; - import cowsultants.itracker.ejb.client.models.*; import cowsultants.itracker.ejb.client.resources.ITrackerResources; --- 40,43 ---- *************** *** 53,63 **** /** * Takes an XML file matching the ITracker import/export DTD and returns an array ! * of GenericModel objects. The array will contain all of the projects, components * versions, users, custom fields, and issues contained in the XML. * @param xml an xml string to import * @exception ImportExportException thrown if the xml can not be parsed into the appropriate objects */ ! public static GenericModel[] importIssues(String xml) throws ImportExportException { ! GenericModel[] models = new GenericModel[0]; try { --- 65,75 ---- /** * Takes an XML file matching the ITracker import/export DTD and returns an array ! * of GenericBean objects. The array will contain all of the projects, components * versions, users, custom fields, and issues contained in the XML. * @param xml an xml string to import * @exception ImportExportException thrown if the xml can not be parsed into the appropriate objects */ ! public static Collection importIssues(String xml) throws ImportExportException { ! Collection entities = new ArrayList(); try { *************** *** 69,75 **** reader.setErrorHandler(handler); reader.parse(new InputSource(new StringReader(xml))); ! models = handler.getModels(); ! Logger.logDebug("Imported a total of " + models.length + " models."); } catch(Exception e) { Logger.logDebug("Exception.", e); --- 81,87 ---- reader.setErrorHandler(handler); reader.parse(new InputSource(new StringReader(xml))); ! entities = handler.getEntities(); ! Logger.logDebug("Imported a total of " + entities.size() + " models."); } catch(Exception e) { Logger.logDebug("Exception.", e); *************** *** 77,91 **** } ! return models; } /** ! * Takes an array of IssueModels and exports them as XML suitable for import into another * instance of ITracker, or another issue tracking tool. ! * @param issues an array of IssueModel objects to export * @exception ImportExportException thrown if the array of issues can not be exported */ ! public static String exportIssues(IssueModel[] issues, SystemConfigurationModel config) throws ImportExportException { StringBuffer buf = new StringBuffer(); HashMap projects = new HashMap(); --- 89,104 ---- } ! return entities; } /** ! * Takes a collection of IssueBeans and exports them as XML suitable for import into another * instance of ITracker, or another issue tracking tool. ! * @param issues a collection of IssueBeans objects to export ! * @param config a collection of ConfigurationBean's representing the system's current configuration * @exception ImportExportException thrown if the array of issues can not be exported */ ! public static String exportIssues(Collection issues, SystemConfigurationModel config) throws ImportExportException { StringBuffer buf = new StringBuffer(); HashMap projects = new HashMap(); *************** *** 93,132 **** HashSet customFields = new HashSet(); ! if(issues == null || issues.length == 0) { throw new ImportExportException("The issue list was null or zero length."); } buf.append("<" + TAG_ISSUES + ">\n"); ! for(int i = 0; i < issues.length; i++) { ! if(! projects.containsKey(issues[i].getProject().getId().toString())) { ! Logger.logDebug("Adding new project " + issues[i].getProject().getId() + " to export."); ! projects.put(issues[i].getProject().getId().toString(), issues[i].getProject()); } ! if(issues[i].getCreator() != null && ! users.containsKey(issues[i].getCreator().getId().toString())) { ! Logger.logDebug("Adding new user " + issues[i].getCreator().getId() + " to export."); ! users.put(issues[i].getCreator().getId().toString(), issues[i].getCreator()); } ! if(issues[i].getOwner() != null && ! users.containsKey(issues[i].getOwner().getId().toString())) { ! Logger.logDebug("Adding new user " + issues[i].getOwner().getId() + " to export."); ! users.put(issues[i].getOwner().getId().toString(), issues[i].getOwner()); } ! IssueHistoryModel[] history = issues[i].getHistory(); ! for(int j = 0; j < history.length; j++) { ! if(history[j] != null && history[j].getUser() != null && ! users.containsKey(history[j].getUser().getId().toString())) { ! Logger.logDebug("Adding new user " + history[j].getUser().getId() + " to export."); ! users.put(history[j].getUser().getId().toString(), history[j].getUser()); } } ! IssueAttachmentModel[] attachments = issues[i].getAttachments(); ! for(int j = 0; j < attachments.length; j++) { ! if(attachments[j] != null && attachments[j].getUser() != null && ! users.containsKey(attachments[j].getUser().getId().toString())) { ! Logger.logDebug("Adding new user " + attachments[j].getUser().getId() + " to export."); ! users.put(attachments[j].getUser().getId().toString(), attachments[j].getUser()); } } ! buf.append(exportModel((GenericModel) issues[i])); } buf.append("</" + TAG_ISSUES + ">\n"); --- 106,151 ---- HashSet customFields = new HashSet(); ! if(issues == null || issues.size() == 0) { throw new ImportExportException("The issue list was null or zero length."); } buf.append("<" + TAG_ISSUES + ">\n"); ! Iterator iter = issues.iterator(); ! while(iter.hasNext()) { ! IssueBean issue = (IssueBean) iter.next(); ! if(! projects.containsKey(issue.getProject().getId().toString())) { ! Logger.logDebug("Adding new project " + issue.getProject().getId() + " to export."); ! projects.put(issue.getProject().getId().toString(), issue.getProject()); } ! if(issue.getCreator() != null && ! users.containsKey(issue.getCreator().getId().toString())) { ! Logger.logDebug("Adding new user " + issue.getCreator().getId() + " to export."); ! users.put(issue.getCreator().getId().toString(), issue.getCreator()); } ! if(issue.getOwner() != null && ! users.containsKey(issue.getOwner().getId().toString())) { ! Logger.logDebug("Adding new user " + issue.getOwner().getId() + " to export."); ! users.put(issue.getOwner().getId().toString(), issue.getOwner()); } ! Collection history = issue.getHistory(); ! Iterator histIter = history.iterator(); ! while(histIter.hasNext()) { ! IssueHistoryBean historyBean = (IssueHistoryBean) histIter.next(); ! if(historyBean != null && historyBean.getUser() != null && ! users.containsKey(historyBean.getUser().getId().toString())) { ! Logger.logDebug("Adding new user " + historyBean.getUser().getId() + " to export."); ! users.put(historyBean.getUser().getId().toString(), historyBean.getUser()); } } ! Collection attachments = issue.getAttachments(); ! Iterator attachmentIter = attachments.iterator(); ! while(attachmentIter.hasNext()) { ! IssueAttachmentBean attachment = (IssueAttachmentBean) attachmentIter.next(); ! if(attachment != null && attachment.getUser() != null && ! users.containsKey(attachment.getUser().getId().toString())) { ! Logger.logDebug("Adding new user " + attachment.getUser().getId() + " to export."); ! users.put(attachment.getUser().getId().toString(), attachment.getUser()); } } ! buf.append(exportModel(issue)); } buf.append("</" + TAG_ISSUES + ">\n"); *************** *** 135,150 **** buf.insert(0, "</" + TAG_PROJECTS +">\n"); ! for(Iterator iter = projects.keySet().iterator(); iter.hasNext(); ) { ! ProjectModel project = (ProjectModel) projects.get((String) iter.next()); ! for(int i = 0; i < project.getOwners().length; i++) { ! users.put(project.getOwners()[i].getId().toString(), project.getOwners()[i]); } ! buf.insert(0, exportModel((GenericModel) project)); } buf.insert(0, "<" + TAG_PROJECTS + ">\n"); buf.insert(0, "</" + TAG_USERS + ">\n"); ! for(Iterator iter = users.keySet().iterator(); iter.hasNext(); ) { ! buf.insert(0, exportModel((GenericModel) users.get((String) iter.next()))); } buf.insert(0, "<" + TAG_USERS + ">\n"); --- 154,173 ---- buf.insert(0, "</" + TAG_PROJECTS +">\n"); ! for(Iterator projIter = projects.keySet().iterator(); projIter.hasNext(); ) { ! ProjectBean project = (ProjectBean) projects.get((String) projIter.next()); ! ! Collection projOwners = project.getOwners(); ! Iterator projectOwnersIter = projOwners.iterator(); ! while(projectOwnersIter.hasNext()) { ! UserBean owner = (UserBean) projectOwnersIter.next(); ! users.put(owner.getId().toString(), owner); } ! buf.insert(0, exportModel(project)); } buf.insert(0, "<" + TAG_PROJECTS + ">\n"); buf.insert(0, "</" + TAG_USERS + ">\n"); ! for(Iterator userIter = users.keySet().iterator(); userIter.hasNext(); ) { ! buf.insert(0, exportModel((GenericBean) users.get((String) userIter.next()))); } buf.insert(0, "<" + TAG_USERS + ">\n"); *************** *** 163,178 **** /** * Returns the appropriate XML block for a given model. ! * @param model a modle that extends GenericModel * @exception ImportExportException thrown if the given model can not be exported */ ! public static String exportModel(GenericModel model) throws ImportExportException { ! if(model == null) { ! throw new ImportExportException("The model to export was null."); ! } else if(model instanceof IssueModel) { ! return getIssueXML((IssueModel) model); ! } else if(model instanceof ProjectModel) { ! return getProjectXML((ProjectModel) model); ! } else if(model instanceof UserModel) { ! return getUserXML((UserModel) model); } else { throw new ImportExportException("This model type can not be exported."); --- 186,201 ---- /** * Returns the appropriate XML block for a given model. ! * @param model a modle that extends GenericBean * @exception ImportExportException thrown if the given model can not be exported */ ! public static String exportModel(GenericBean bean) throws ImportExportException { ! if(bean == null) { ! throw new ImportExportException("The bean to export was null."); ! } else if(bean instanceof IssueBean) { ! return getIssueXML((IssueBean) bean); ! } else if(bean instanceof ProjectBean) { ! return getProjectXML((ProjectBean) bean); ! } else if(bean instanceof UserBean) { ! return getUserXML((UserBean) bean); } else { throw new ImportExportException("This model type can not be exported."); *************** *** 187,191 **** * @return a String containing the XML for the issue */ ! public static String getIssueXML(IssueModel issue) { if(issue == null) { return ""; --- 210,214 ---- * @return a String containing the XML for the issue */ ! public static String getIssueXML(IssueBean issue) { if(issue == null) { return ""; *************** *** 195,199 **** buf.append("<" + TAG_ISSUE + " " + ATTR_ID + "=\"" + TAG_ISSUE + issue.getId() + "\" " + ATTR_SYSTEMID + "=\"" + issue.getId() + "\">\n"); ! buf.append(" <" + TAG_ISSUE_PROJECT + "><![CDATA[" + TAG_PROJECT + issue.getProjectId() + "]]></" + TAG_ISSUE_PROJECT + ">\n"); buf.append(" <" + TAG_ISSUE_DESCRIPTION + "><![CDATA[" + ITrackerResources.escapeUnicodeString(issue.getDescription(), false) + "]]></" + TAG_ISSUE_DESCRIPTION + ">\n"); buf.append(" <" + TAG_ISSUE_SEVERITY + ">" + issue.getSeverity() + "</" + TAG_ISSUE_SEVERITY + ">\n"); --- 218,222 ---- buf.append("<" + TAG_ISSUE + " " + ATTR_ID + "=\"" + TAG_ISSUE + issue.getId() + "\" " + ATTR_SYSTEMID + "=\"" + issue.getId() + "\">\n"); ! buf.append(" <" + TAG_ISSUE_PROJECT + "><![CDATA[" + TAG_PROJECT + issue.getProject().getId() + "]]></" + TAG_ISSUE_PROJECT + ">\n"); buf.append(" <" + TAG_ISSUE_DESCRIPTION + "><![CDATA[" + ITrackerResources.escapeUnicodeString(issue.getDescription(), false) + "]]></" + TAG_ISSUE_DESCRIPTION + ">\n"); buf.append(" <" + TAG_ISSUE_SEVERITY + ">" + issue.getSeverity() + "</" + TAG_ISSUE_SEVERITY + ">\n"); *************** *** 201,250 **** buf.append(" <" + TAG_ISSUE_RESOLUTION + "><![CDATA[" + ITrackerResources.escapeUnicodeString(issue.getResolution(), false) + "]]></" + TAG_ISSUE_RESOLUTION + ">\n"); if(issue.getTargetVersion() != null) { ! buf.append(" <" + TAG_TARGET_VERSION_ID + ">" + TAG_VERSION + issue.getTargetVersionId() + "</" + TAG_TARGET_VERSION_ID + ">\n"); } buf.append(" <" + TAG_CREATE_DATE + ">" + DATE_FORMATTER.format(issue.getCreateDate()) + "</" + TAG_CREATE_DATE + ">\n"); buf.append(" <" + TAG_LAST_MODIFIED + ">" + DATE_FORMATTER.format(issue.getLastModifiedDate()) + "</" + TAG_LAST_MODIFIED + ">\n"); ! buf.append(" <" + TAG_CREATOR + ">" + TAG_USER + issue.getCreatorId() + "</" + TAG_CREATOR + ">\n"); if(issue.getOwner() != null) { ! buf.append(" <" + TAG_OWNER + ">" + TAG_USER + issue.getOwnerId() + "</" + TAG_OWNER + ">\n"); } ! if(issue.getComponents().length > 0) { buf.append(" <" + TAG_ISSUE_COMPONENTS + ">\n"); ! for(int i = 0; i < issue.getComponents().length; i++) { ! if(issue.getComponents()[i] != null) { ! buf.append(" <" + TAG_COMPONENT_ID + ">" + TAG_COMPONENT + issue.getComponents()[i].getId() + "</" + TAG_COMPONENT_ID + ">\n"); } } buf.append(" </" + TAG_ISSUE_COMPONENTS + ">\n"); } ! if(issue.getVersions().length > 0) { buf.append(" <" + TAG_ISSUE_VERSIONS + ">\n"); ! for(int i = 0; i < issue.getVersions().length; i++) { ! if(issue.getVersions()[i] != null) { ! buf.append(" <" + TAG_VERSION_ID + ">" + TAG_VERSION + issue.getVersions()[i].getId() + "</" + TAG_VERSION_ID + ">\n"); } } buf.append(" </" + TAG_ISSUE_VERSIONS + ">\n"); } ! if(issue.getFields().length > 0) { buf.append(" <" + TAG_ISSUE_FIELDS + ">\n"); ! for(int i = 0; i < issue.getFields().length; i++) { ! if(issue.getFields()[i] != null) { ! buf.append(" <" + TAG_ISSUE_FIELD + " " + ATTR_ID + "=\"" + TAG_CUSTOM_FIELD + issue.getFields()[i].getCustomFieldId() + "\"><![CDATA[" + issue.getFields()[i].getValue(EXPORT_LOCALE) + "]]></" + TAG_ISSUE_FIELD + ">\n"); } } buf.append(" </" + TAG_ISSUE_FIELDS + ">\n"); } ! if(issue.getAttachments().length > 0) { buf.append(" <" + TAG_ISSUE_ATTACHMENTS + ">\n"); ! for(int i = 0; i < issue.getAttachments().length; i++) { ! if(issue.getAttachments()[i] != null) { buf.append(" <" + TAG_ISSUE_ATTACHMENT + ">"); ! buf.append(" <" + TAG_ISSUE_ATTACHMENT_DESCRIPTION + "><![CDATA[" + ITrackerResources.escapeUnicodeStr... [truncated message content] |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:19
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/ejb/beans/session Modified Files: Tag: itrackerhnodto IssueHandlerBean.java IssueSearchBean.java ProjectHandlerBean.java ReportHandlerBean.java SchedulerHandlerBean.java SystemConfigurationBean.java UserFactory.java UserFactoryImpl.java UserHandlerBean.java Log Message: removal of value objects Index: SystemConfigurationBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/session/SystemConfigurationBean.java,v retrieving revision 1.31.4.6 retrieving revision 1.31.4.6.2.1 diff -C2 -d -r1.31.4.6 -r1.31.4.6.2.1 *** SystemConfigurationBean.java 30 Oct 2005 16:52:11 -0000 1.31.4.6 --- SystemConfigurationBean.java 6 Dec 2005 12:38:01 -0000 1.31.4.6.2.1 *************** *** 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; } 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 = languageFactory.findByKeyAndLocale(key, ITrackerResources.BASE_LOCALE); model = languageItem.getModel(); if (locale != null && !"".equals(locale.getLanguage())) { languageItem = languageFactory.findByKeyAndLocale(key, locale.getLanguage()); model = languageItem.getModel(); if (!"".equals(locale.getCountry())) { languageItem = languageFactory.findByKeyAndLocale(key, locale.toString()); model = languageItem.getModel(); } } } return model; } public LanguageModel[] getLanguageItemsByKey(String key) throws DataException { LanguageModel[] items = new LanguageModel[0]; Collection languageItems = languageFactory.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 = languageFactory.findByKeyAndLocale(model.getResourceKey(), model.getLocale()); languageItem.setModel(model); } catch (NoSuchEntityException fe) { languageItem = new LanguageBean(); languageItem.setCreateDate(new Timestamp(new Date().getTime())); languageItem.setModel(model); languageFactory.saveOrUpdate(languageItem); } return languageItem.getModel(); } public void removeLanguageKey(String key) throws DataException { Vector currentIds = new Vector(); Collection languageItems = languageFactory.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 = languageFactory.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 = languageFactory.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 = languageFactory.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 = languageFactory.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 = languageFactory.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 = languageFactory.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 = languageFactory.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); } } public LanguageFactory getLanguageFactory() { return languageFactory; } public void setLanguageFactory(LanguageFactory home) { languageFactory = home; } public ConfigurationFactory getConfigurationFactory() { return configurationFactory; } public void setConfigurationFactory(ConfigurationFactory configurationFactory) { this.configurationFactory = configurationFactory; } } \ 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 cowsultants.itracker.ejb.client.util.SystemConfigurationModel; import cowsultants.itracker.ejb.client.util.NameValuePair; import java.sql.Timestamp; import java.util.ArrayList; import java.util.Arrays; import java.util.Collection; import java.util.Collections; import java.util.Date; import java.util.Enumeration; import java.util.HashMap; import java.util.Iterator; import java.util.List; 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.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 ConfigurationBean getConfigurationItem(Integer id) { ConfigurationBean configItem = configurationFactory.findByPrimaryKey(id); return configItem; } public Collection getConfigurationItemsByType(int type) throws DataException { Collection configItems = configurationFactory.findByType(type); return configItems; } public Collection getConfigurationItemsByType(int type, Locale locale) throws DataException { Collection items = getConfigurationItemsByType(type); Iterator iter = items.iterator(); while(iter.hasNext()) { ConfigurationBean bean = (ConfigurationBean) iter.next(); //@todo investigate what this is for /*if (bean.getType() == SystemConfigurationUtilities.TYPE_STATUS) { bean.setName(IssueUtilities.getStatusName(bean.getValue(), locale)); } else if (bean.getType() == SystemConfigurationUtilities.TYPE_SEVERITY) { bean.setName(IssueUtilities.getSeverityName(bean.getValue(), locale)); } else if (items[i].getType() == SystemConfigurationUtilities.TYPE_RESOLUTION) { bean.setName(IssueUtilities.getResolutionName(bean.getValue(), locale)); }*/ } return items; } public ConfigurationBean createConfigurationItem(ConfigurationBean entity) { entity.setCreateDate(new Timestamp( new Date().getTime())); configurationFactory.saveOrUpdate(entity); return entity; } public ConfigurationBean updateConfigurationItem(ConfigurationBean entity) { if (entity != null) { ConfigurationBean configurationItem = configurationFactory.findByPrimaryKey(entity.getId()); return configurationItem; } return (null); } /** * Returns a collection of the ConfigurationBean's that were passed in, * ordered by ConfigurationBean.getOrder */ public Collection updateConfigurationItems(Collection entities, int type) throws DataException { removeConfigurationItems(type); ConfigurationBean[] beanArray = new ConfigurationBean[0]; if(entities != null) { beanArray = new ConfigurationBean[entities.size()]; } int i = 0; Iterator iter = entities.iterator(); while(iter.hasNext()) { ConfigurationBean configurationItem = (ConfigurationBean) iter.next(); beanArray[i] = configurationItem; i++; } Arrays.sort(beanArray, new ConfigurationBean()); List result = Arrays.asList(beanArray); return result; } 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(ConfigurationBean entity) throws DataException { Vector currentIds = new Vector(); Collection currentItems = configurationFactory.findByTypeAndValue(entity.getType(), entity.getValue()); for (Iterator iter = currentItems.iterator(); iter.hasNext();) { ConfigurationBean configItem = (ConfigurationBean) iter.next(); configurationFactory.delete(configItem); } } public boolean configurationItemExists(ConfigurationBean entity) throws DataException { if (entity != null && entity.getVersion() != null) { Collection configItems = configurationFactory.findByTypeAndValue( entity.getType(), entity.getValue()); if (configItems != null && configItems.size() > 0) { return true; } } return false; } public boolean configurationItemUpToDate(ConfigurationBean entity) throws DataException { long currentVersion = 0; if (entity != null && entity.getVersion() != null) { Collection configItems = configurationFactory.findByTypeAndValue(entity.getType(), entity.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(entity.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 WorkflowScriptBean getWorkflowScript(Integer id) { WorkflowScriptBean workflowScript = wsHome.findByPrimaryKey(id); return workflowScript; } public Collection getWorkflowScripts() { Collection workflowScripts = wsHome.findAll(); return workflowScripts; } public WorkflowScriptBean createWorkflowScript(WorkflowScriptBean script) { // try { //@todo do the creation in here? return script; // } catch(CreateException ce) { // Logger.logDebug("Unable to create new workflow script.", ce); // } // return null; } public WorkflowScriptBean updateWorkflowScript(WorkflowScriptBean script) { if (script != null) { //@todo update here? return script; } return null; } public CustomFieldBean getCustomField(Integer id) throws DataException { CustomFieldBean customField = cfHome.findByPrimaryKey(id); return customField; } public Collection getCustomFields() throws DataException { Collection customFields = cfHome.findAll(); return customFields; } public Collection getCustomFields(Locale locale) throws DataException { Collection fields = getCustomFields(); Iterator iter = fields.iterator(); while(iter.hasNext()) { CustomFieldBean field = (CustomFieldBean) iter.next(); field.setLabels(locale); } return fields; } public CustomFieldBean createCustomField(CustomFieldBean field) throws DataException { //@todo this is probably too fat, just a call to saveOrUpdate(field) should do it. //actual field is never saved here... if (field.getValues().size() > 0) { removeCustomFieldValues(field.getId()); Collection newOptions = field.getValues(); Iterator iter = newOptions.iterator(); while(iter.hasNext()) { CustomFieldValueBean fieldValue = (CustomFieldValueBean) iter.next(); createCustomFieldValue(fieldValue); } } return field; // Logger.logDebug("Unable to create new custom field.", ce); } public CustomFieldBean updateCustomField(CustomFieldBean field) throws DataException { if (field != null) { CustomFieldBean customField = cfHome.findByPrimaryKey(field.getId()); //@todo this is probably too fat, just a call to saveOrUpdate(field) should do it. //actual field is never saved here... if (field.getValues().size() > 0) { removeCustomFieldValues(field.getId()); Collection newOptions = field.getValues(); Iterator iter = newOptions.iterator(); while(iter.hasNext()) { CustomFieldValueBean fieldValue = (CustomFieldValueBean) iter.next(); createCustomFieldValue(fieldValue); } } return field; } return null; } public void removeCustomField(Integer customFieldId) throws DataException { CustomFieldBean customField = cfHome.findByPrimaryKey(customFieldId); //@todo remove? // customField.remove(); } public CustomFieldValueBean getCustomFieldValue(Integer id) { // CustomFieldValueBean customFieldValue = cfvHome.findByPrimaryKey(id); // return customFieldValue.getModel(); //@todo do something here? return (null); } public CustomFieldValueBean createCustomFieldValue(CustomFieldValueBean value) throws DataException { if (value == null || value.getCustomField() == null) { return null; } //@todo do something here to save it? return value; // 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 CustomFieldValueBean updateCustomFieldValue(CustomFieldValueBean value) { // if(model != null) { // CustomFieldValueBean customFieldValue = // cfvHome.findByPrimaryKey(model.getId()); // customFieldValue.setModel(model); // return customFieldValue.getModel(); // } //@todo do something here rather than just returning null? return null; } public Collection updateCustomFieldValues(Integer customFieldId, Collection values) throws DataException { //@todo what does this method do? // if (customFieldId != null) { // CustomFieldBean customField = cfHome.findByPrimaryKey(customFieldId); // Collection currValues = customField.getValues(); // // for (Iterator iter = currValues.iterator(); iter.hasNext();) { // if (values == null || values.size() == 0) { // //@todo remove? // // ((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 values; } public void removeCustomFieldValue(Integer customFieldValueId) { // CustomFieldValueBean customFieldValue = // cfvHome.findByPrimaryKey(customFieldValueId); // customFieldValue.remove(); //@todo do something? } public void removeCustomFieldValues(Integer customFieldId) { // Collection currentValues = cfvHome.findByCustomField(customFieldId); // for(Iterator iter = currentValues.iterator(); iter.hasNext(); ) { // // //((CustomFieldValueBean) iter.next()).remove(); // } //@todo do something? } public LanguageBean getLanguageItemByKey(String key, Locale locale) throws DataException { LanguageBean result = null; if (key != null) { LanguageBean languageItem = languageFactory.findByKeyAndLocale(key, ITrackerResources.BASE_LOCALE); if (locale != null && !"".equals(locale.getLanguage())) { languageItem = languageFactory.findByKeyAndLocale(key, locale.getLanguage()); if (!"".equals(locale.getCountry())) { languageItem = languageFactory.findByKeyAndLocale(key, locale.toString()); result = languageItem; } } } return result; } public Collection getLanguageItemsByKey(String key) throws DataException { Collection languageItems = languageFactory.findByKey(key); return languageItems; } public LanguageBean updateLanguageItem(LanguageBean lang) throws DataException { LanguageBean languageItem; //@todo shouldn't this do an update as well rather than just a create? try { languageItem = languageFactory.findByKeyAndLocale(lang.getResourceKey(), lang.getLocale()); } catch (NoSuchEntityException fe) { languageItem = new LanguageBean(); lang.setCreateDate(new Timestamp(new Date().getTime())); languageFactory.saveOrUpdate(lang); } return languageItem; } public void removeLanguageKey(String key) throws DataException { //@todo shouldn't this do a delete? Vector currentIds = new Vector(); Collection languageItems = languageFactory.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(LanguageBean lang) throws DataException { //@todo shouldn't this do a delete? LanguageBean languageItem = languageFactory.findByKeyAndLocale(lang.getResourceKey(), lang.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 = languageFactory.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 = languageFactory.findByLocale(locale); for (Iterator iter = items.iterator(); iter.hasNext();) { LanguageBean item = (LanguageBean) iter.next(); keys.put(item.getResourceKey(), item.getResourceValue()); } return keys; } /** * Gets as defined keys as an array of NameValuePair objects */ public Collection getDefinedKeysAsArray(String locale) throws DataException { ArrayList keys = new ArrayList(); if (locale == null || locale.equals("")) { locale = ITrackerResources.BASE_LOCALE; } int i = 0; Collection items = languageFactory.findByLocale(locale); for (Iterator iter = items.iterator(); iter.hasNext(); i++) { LanguageBean item = (LanguageBean) iter.next(); keys.add(new NameValuePair(item.getResourceKey(), item.getResourceValue())); } Collections.sort(keys, new NameValuePair()); return keys; } public int getNumberDefinedKeys(String locale) throws DataException { return getDefinedKeys(locale).size(); } public Collection getLanguage(Locale locale) throws DataException { HashMap language = new HashMap(); Collection baseItems = languageFactory.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 = languageFactory.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 = languageFactory.findByLocale(locale.toString()); for (Iterator iterator = countryItems.iterator(); iterator.hasNext();) { LanguageBean item = (LanguageBean) iterator.next(); language.put(item.getResourceKey(), item.getResourceValue()); } } } ArrayList languages = new ArrayList(); String localeStri... [truncated message content] |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:18
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/scheduler/tasks In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/web/scheduler/tasks Modified Files: Tag: itrackerhnodto MailNotification.java ReminderNotification.java Log Message: removal of value objects Index: ReminderNotification.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/scheduler/tasks/ReminderNotification.java,v retrieving revision 1.6.4.3 retrieving revision 1.6.4.3.2.1 diff -C2 -d -r1.6.4.3 -r1.6.4.3.2.1 *** ReminderNotification.java 30 Oct 2005 01:32:56 -0000 1.6.4.3 --- ReminderNotification.java 6 Dec 2005 12:38:02 -0000 1.6.4.3.2.1 *************** *** 19,24 **** --- 19,27 ---- package cowsultants.itracker.web.scheduler.tasks; + import cowsultants.itracker.ejb.beans.entity.IssueBean; + import cowsultants.itracker.ejb.beans.entity.NotificationBean; import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; import java.util.Calendar; + import java.util.Collection; import java.util.Date; import java.util.GregorianCalendar; *************** *** 26,35 **** import cowsultants.itracker.ejb.client.interfaces.IssueHandler; - import cowsultants.itracker.ejb.client.models.IssueModel; - import cowsultants.itracker.ejb.client.models.NotificationModel; import cowsultants.itracker.ejb.client.util.IssueUtilities; import cowsultants.itracker.ejb.client.util.Logger; import cowsultants.itracker.ejb.client.util.NotificationUtilities; import cowsultants.itracker.web.scheduler.SchedulableTask; /** * This class can be used to send reminder emails to owners/admins --- 29,37 ---- import cowsultants.itracker.ejb.client.interfaces.IssueHandler; import cowsultants.itracker.ejb.client.util.IssueUtilities; import cowsultants.itracker.ejb.client.util.Logger; import cowsultants.itracker.ejb.client.util.NotificationUtilities; import cowsultants.itracker.web.scheduler.SchedulableTask; + import java.util.Iterator; /** * This class can be used to send reminder emails to owners/admins *************** *** 64,68 **** */ public void performTask(String[] args) { ! IssueModel[] issues; String baseURL = DEFAULT_BASE_URL; int issueAge = DEFAULT_ISSUE_AGE; --- 66,70 ---- */ public void performTask(String[] args) { ! Collection issues; String baseURL = DEFAULT_BASE_URL; int issueAge = DEFAULT_ISSUE_AGE; *************** *** 112,133 **** issues = ih.getIssuesWithStatusLessThan(IssueUtilities.STATUS_RESOLVED); } ! if(issues != null && issues.length > 0) { ! for(int i = 0; i < issues.length; i++) { ! if(severity >= 0 && issues[i].getSeverity() != severity) { continue; } ! if(issues[i].getLastModifiedDate() != null && issues[i].getLastModifiedDate().before(oldDate)) { HashSet addresses = new HashSet(); ! long numMillis = currentDate.getTime() - issues[i].getLastModifiedDate().getTime(); int numDays = (int) (numMillis / (24 * 60 * 60 * 1000)); ! NotificationModel[] notifications = ih.getPrimaryIssueNotifications(issues[i].getId()); ! for(int j = 0; j < notifications.length; j++) { ! if(notifications[j].getUserEmail() != null && notifications[j].getUserEmail().indexOf('@') >= 0) { ! addresses.add(notifications[j].getUserEmail()); } } ! Logger.logDebug("Sending reminder notification for issue " + issues[i].getId() + " to " + addresses.size() + " users."); ! ih.sendNotification(issues[i].getId(), NotificationUtilities.TYPE_ISSUE_REMINDER, baseURL, addresses, new Integer(numDays)); } } --- 114,141 ---- issues = ih.getIssuesWithStatusLessThan(IssueUtilities.STATUS_RESOLVED); } ! if(issues != null && issues.size() > 0) { ! Iterator iter = issues.iterator(); ! while(iter.hasNext()) { ! IssueBean issue = (IssueBean) iter.next(); ! if(severity >= 0 && issue.getSeverity() != severity) { continue; } ! if(issue.getLastModifiedDate() != null && issue.getLastModifiedDate().before(oldDate)) { HashSet addresses = new HashSet(); ! long numMillis = currentDate.getTime() - issue.getLastModifiedDate().getTime(); int numDays = (int) (numMillis / (24 * 60 * 60 * 1000)); ! Collection notifications = ih.getPrimaryIssueNotifications(issue.getId()); ! Iterator notificationIter = notifications.iterator(); ! while(notificationIter.hasNext()) { ! NotificationBean notification = (NotificationBean) notificationIter.next(); ! if(notification.getUser() != null && ! notification.getUser().getEmail() != null && ! notification.getUser().getEmail().indexOf('@') >= 0) { ! addresses.add(notification.getUser().getEmail()); } } ! Logger.logDebug("Sending reminder notification for issue " + issue.getId() + " to " + addresses.size() + " users."); ! ih.sendNotification(issue.getId(), NotificationUtilities.TYPE_ISSUE_REMINDER, baseURL, addresses, new Integer(numDays)); } } Index: MailNotification.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/scheduler/tasks/Attic/MailNotification.java,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.4.2.1 diff -C2 -d -r1.1.2.4 -r1.1.2.4.2.1 *** MailNotification.java 30 Oct 2005 18:41:46 -0000 1.1.2.4 --- MailNotification.java 6 Dec 2005 12:38:02 -0000 1.1.2.4.2.1 *************** *** 1,4 **** --- 1,7 ---- package cowsultants.itracker.web.scheduler.tasks; + import cowsultants.itracker.ejb.beans.entity.IssueBean; + import cowsultants.itracker.ejb.beans.entity.IssueHistoryBean; + import cowsultants.itracker.ejb.beans.entity.UserBean; import cowsultants.itracker.ejb.beans.session.IssueHandlerBean; import cowsultants.itracker.ejb.beans.session.ProjectHandlerBean; *************** *** 26,31 **** import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; import cowsultants.itracker.ejb.client.interfaces.UserHandler; - import cowsultants.itracker.ejb.client.models.IssueHistoryModel; - import cowsultants.itracker.ejb.client.models.IssueModel; import cowsultants.itracker.ejb.client.util.IssueUtilities; import cowsultants.itracker.ejb.client.util.Logger; --- 29,32 ---- *************** *** 169,173 **** //UserHandler uh = new UserHandlerBean(); ! IssueModel issue = new IssueModel(); issue.setDescription(subject); issue.setSeverity(3); // prioridade m�dia --- 170,174 ---- //UserHandler uh = new UserHandlerBean(); ! IssueBean issue = new IssueBean(); issue.setDescription(subject); issue.setSeverity(3); // prioridade m�dia *************** *** 182,185 **** --- 183,187 ---- Connection dbConnection = ds.getConnection(); + //@todo is this SQL really necessary? Statement statement = dbConnection.createStatement(); statement.execute("SELECT id FROM userbean WHERE email='" + address + "'"); *************** *** 198,203 **** issue = ih.createIssue(issue, new Integer(projectId), userid, userid); ! IssueHistoryModel issueHistory = new IssueHistoryModel(content, IssueUtilities.HISTORY_STATUS_AVAILABLE, issue ! .getId(), new Integer(1)); ih.addIssueHistory(issueHistory); } --- 200,208 ---- issue = ih.createIssue(issue, new Integer(projectId), userid, userid); ! IssueHistoryBean issueHistory = new IssueHistoryBean(); ! issueHistory.setDescription(content); ! issueHistory.setStatus(IssueUtilities.HISTORY_STATUS_AVAILABLE); ! issueHistory.setIssue(issue); ! issueHistory.setUser(new UserBean()); ih.addIssueHistory(issueHistory); } |
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/web/actions Modified Files: Tag: itrackerhnodto AddIssueRelationAction.java AssignIssueAction.java CreateIssueAction.java CreateIssueFormAction.java CreateLanguageKeyAction.java DisplayReportAction.java EditComponentAction.java EditComponentFormAction.java EditConfigurationAction.java EditConfigurationFormAction.java EditCustomFieldAction.java EditCustomFieldFormAction.java EditCustomFieldValueAction.java EditCustomFieldValueFormAction.java EditIssueAction.java EditIssueFormAction.java EditLanguageAction.java EditPreferencesAction.java EditPreferencesFormAction.java EditProjectAction.java EditProjectFormAction.java EditReportAction.java EditReportFormAction.java EditTaskAction.java EditTaskFormAction.java EditUserAction.java EditUserFormAction.java EditVersionAction.java EditVersionFormAction.java EditWorkflowScriptAction.java EditWorkflowScriptFormAction.java ExportAttachmentsAction.java ExportLanguageAction.java ExportReportAction.java ForgotPasswordAction.java ITrackerAction.java ImportDataProcessAction.java ImportDataVerifyAction.java LockUserAction.java LoginAction.java LogoffAction.java MoveIssueAction.java MoveIssueFormAction.java OrderConfigurationItemAction.java OrderCustomFieldValueAction.java RemoveConfigurationItemAction.java RemoveCustomFieldAction.java RemoveCustomFieldValueAction.java RemoveHistoryEntryAction.java RemoveIssueAttachmentAction.java SearchIssuesAction.java SearchIssuesFormAction.java SelfRegisterAction.java WatchIssueAction.java Log Message: removal of value objects Index: EditVersionAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditVersionAction.java,v retrieving revision 1.10.4.4 retrieving revision 1.10.4.4.2.1 diff -C2 -d -r1.10.4.4 -r1.10.4.4.2.1 *** EditVersionAction.java 29 Oct 2005 18:10:24 -0000 1.10.4.4 --- EditVersionAction.java 6 Dec 2005 12:38:02 -0000 1.10.4.4.2.1 *************** *** 19,22 **** --- 19,24 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.entity.ProjectBean; + import cowsultants.itracker.ejb.beans.entity.VersionBean; import java.io.IOException; import java.util.HashMap; *************** *** 35,40 **** import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; - import cowsultants.itracker.ejb.client.models.ProjectModel; - import cowsultants.itracker.ejb.client.models.VersionModel; import cowsultants.itracker.ejb.client.util.Logger; import cowsultants.itracker.ejb.client.util.UserUtilities; --- 37,40 ---- *************** *** 58,63 **** resetToken(request); ! VersionModel version = null; ! ProjectModel project = null; try { ProjectHandler ph = getITrackerServices().getProjectHandler(); --- 58,63 ---- resetToken(request); ! VersionBean version = null; ! ProjectBean project = null; try { ProjectHandler ph = getITrackerServices().getProjectHandler(); *************** *** 65,72 **** HttpSession session = request.getSession(true); HashMap userPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); ! version = new VersionModel(); version.setId((Integer) PropertyUtils.getSimpleProperty(form, "id")); version.setDescription((String) PropertyUtils.getSimpleProperty(form, "description")); ! version.setVersionInfo((String) PropertyUtils.getSimpleProperty(form, "number")); Integer projectId = (Integer) PropertyUtils.getSimpleProperty(form, "pid"); --- 65,72 ---- HttpSession session = request.getSession(true); HashMap userPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); ! version = new VersionBean(); version.setId((Integer) PropertyUtils.getSimpleProperty(form, "id")); version.setDescription((String) PropertyUtils.getSimpleProperty(form, "description")); ! version.setNumber((String) PropertyUtils.getSimpleProperty(form, "number")); Integer projectId = (Integer) PropertyUtils.getSimpleProperty(form, "pid"); *************** *** 84,88 **** version = ph.addProjectVersion(project.getId(), version); } else if ("update".equals(action)) { ! version.setProjectId(project.getId()); version = ph.updateProjectVersion(version); } --- 84,88 ---- version = ph.addProjectVersion(project.getId(), version); } else if ("update".equals(action)) { ! version.setProject(project); version = ph.updateProjectVersion(version); } Index: CreateIssueFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/CreateIssueFormAction.java,v retrieving revision 1.16.4.3 retrieving revision 1.16.4.3.2.1 diff -C2 -d -r1.16.4.3 -r1.16.4.3.2.1 *** CreateIssueFormAction.java 30 Oct 2005 21:31:33 -0000 1.16.4.3 --- CreateIssueFormAction.java 6 Dec 2005 12:38:02 -0000 1.16.4.3.2.1 *************** *** 19,25 **** --- 19,36 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.entity.ComponentBean; + import cowsultants.itracker.ejb.beans.entity.ConfigurationBean; + import cowsultants.itracker.ejb.beans.entity.CustomFieldBean; + import cowsultants.itracker.ejb.beans.entity.ProjectBean; + import cowsultants.itracker.ejb.beans.entity.UserBean; + import cowsultants.itracker.ejb.beans.entity.VersionBean; + import cowsultants.itracker.ejb.client.util.NameValuePair; import java.io.IOException; import java.util.Arrays; + import java.util.Collection; + import java.util.Collections; import java.util.HashMap; + import java.util.Iterator; + import java.util.List; import java.util.Locale; *************** *** 38,48 **** import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; import cowsultants.itracker.ejb.client.interfaces.UserHandler; - import cowsultants.itracker.ejb.client.models.ComponentModel; - import cowsultants.itracker.ejb.client.models.CustomFieldModel; - import cowsultants.itracker.ejb.client.models.NameValuePairModel; - import cowsultants.itracker.ejb.client.models.ProjectModel; - import cowsultants.itracker.ejb.client.models.ProjectScriptModel; - import cowsultants.itracker.ejb.client.models.UserModel; - import cowsultants.itracker.ejb.client.models.VersionModel; import cowsultants.itracker.ejb.client.util.Convert; import cowsultants.itracker.ejb.client.util.CustomFieldUtilities; --- 49,52 ---- *************** *** 76,80 **** HttpSession session = request.getSession(true); ! UserModel currUser = (UserModel) session.getAttribute(Constants.USER_KEY); HashMap currPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); Locale currLocale = LoginUtilities.getCurrentLocale(request); --- 80,84 ---- HttpSession session = request.getSession(true); ! UserBean currUser = (UserBean) session.getAttribute(Constants.USER_KEY); HashMap currPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); Locale currLocale = LoginUtilities.getCurrentLocale(request); *************** *** 85,89 **** } ! ProjectModel project = ph.getProject(projectId); Logger.logDebug("Received request for project " + projectId + "(" + project.getName() + ")"); --- 89,93 ---- } ! ProjectBean project = ph.getProject(projectId); Logger.logDebug("Received request for project " + projectId + "(" + project.getName() + ")"); *************** *** 97,129 **** HashMap listOptions = new HashMap(); if(UserUtilities.hasPermission(currPermissions, project.getId(), UserUtilities.PERMISSION_ASSIGN_OTHERS)) { ! UserModel[] possibleOwners = uh.getPossibleOwners(null, project.getId(), currUser.getId()); ! Arrays.sort(possibleOwners, new UserModel.CompareByFirstName()); listOptions.put(new Integer(IssueUtilities.FIELD_OWNER), Convert.UsersToNVP(possibleOwners)); } else if(UserUtilities.hasPermission(currPermissions, project.getId(), UserUtilities.PERMISSION_ASSIGN_SELF)) { ! listOptions.put(new Integer(IssueUtilities.FIELD_OWNER), new NameValuePairModel[] { new NameValuePairModel(currUser.getFirstName() + " " + currUser.getLastName(), currUser.getId().toString()) }); } if(UserUtilities.hasPermission(currPermissions, project.getId(), UserUtilities.PERMISSION_CREATE_OTHERS)) { ! UserModel[] possibleCreators = uh.getUsersWithAnyProjectPermission(project.getId(), new int[] {UserUtilities.PERMISSION_VIEW_ALL, UserUtilities.PERMISSION_VIEW_USERS}); ! Arrays.sort(possibleCreators, new UserModel.CompareByFirstName()); listOptions.put(new Integer(IssueUtilities.FIELD_CREATOR), Convert.UsersToNVP(possibleCreators)); } ! NameValuePairModel[] severities = IssueUtilities.getSeverities(currLocale); listOptions.put(new Integer(IssueUtilities.FIELD_SEVERITY), severities); ! ComponentModel[] components = project.getComponents(); ! Arrays.sort(components, new ComponentModel()); listOptions.put(new Integer(IssueUtilities.FIELD_COMPONENTS), Convert.ComponentsToNVP(components)); ! VersionModel[] versions = project.getVersions(); ! Arrays.sort(versions, new VersionModel()); listOptions.put(new Integer(IssueUtilities.FIELD_VERSIONS), Convert.VersionsToNVP(versions)); ! CustomFieldModel[] projectFields = project.getCustomFields(); ! for(int i = 0; i < projectFields.length; i++) { ! if(projectFields[i].getFieldType() == CustomFieldUtilities.TYPE_LIST) { ! projectFields[i].setLabels(currLocale); ! listOptions.put(projectFields[i].getId(), Convert.CustomFieldOptionsToNVP(projectFields[i].getOptions())); } } --- 101,144 ---- HashMap listOptions = new HashMap(); if(UserUtilities.hasPermission(currPermissions, project.getId(), UserUtilities.PERMISSION_ASSIGN_OTHERS)) { ! Collection possibleOwners = uh.getPossibleOwners(null, project.getId(), currUser.getId()); ! if(possibleOwners instanceof List) { ! Collections.sort((List) possibleOwners, new UserBean.CompareByFirstName()); ! } listOptions.put(new Integer(IssueUtilities.FIELD_OWNER), Convert.UsersToNVP(possibleOwners)); } else if(UserUtilities.hasPermission(currPermissions, project.getId(), UserUtilities.PERMISSION_ASSIGN_SELF)) { ! listOptions.put(new Integer(IssueUtilities.FIELD_OWNER), new NameValuePair[] { new NameValuePair(currUser.getFirstName() + " " + currUser.getLastName(), currUser.getId().toString()) }); } if(UserUtilities.hasPermission(currPermissions, project.getId(), UserUtilities.PERMISSION_CREATE_OTHERS)) { ! Collection possibleCreators = uh.getUsersWithAnyProjectPermission(project.getId(), new int[] {UserUtilities.PERMISSION_VIEW_ALL, UserUtilities.PERMISSION_VIEW_USERS}); ! if(possibleCreators instanceof List) { ! Collections.sort((List) possibleCreators, new UserBean.CompareByFirstName()); ! } listOptions.put(new Integer(IssueUtilities.FIELD_CREATOR), Convert.UsersToNVP(possibleCreators)); } ! Collection severities = IssueUtilities.getSeverities(currLocale); listOptions.put(new Integer(IssueUtilities.FIELD_SEVERITY), severities); ! Collection components = project.getComponents(); ! if(components instanceof List) { ! Collections.sort((List) components, new ComponentBean.CompareByName()); ! } listOptions.put(new Integer(IssueUtilities.FIELD_COMPONENTS), Convert.ComponentsToNVP(components)); ! Collection versions = project.getVersions(); ! if(versions instanceof List) { ! Collections.sort((List) components, new VersionBean.CompareByMajorMinor(false)); ! } listOptions.put(new Integer(IssueUtilities.FIELD_VERSIONS), Convert.VersionsToNVP(versions)); ! Collection projectFields = project.getCustomFields(); ! Iterator iter = projectFields.iterator(); ! while(iter.hasNext()) { ! CustomFieldBean bean = (CustomFieldBean) iter.next(); ! if(bean.getFieldType() == CustomFieldUtilities.TYPE_LIST) { ! //find out why there is no set labels... ! bean.setLabels(currLocale); ! listOptions.put(bean.getId(), Convert.CustomFieldOptionsToNVP(bean.getValues())); } } *************** *** 134,141 **** } issueForm.set("creatorId", currUser.getId()); ! if(severities.length > 0) { try { ! int midPoint = (severities.length / 2); ! issueForm.set("severity", new Integer(severities[midPoint].getValue())); } catch(NumberFormatException nfe) { Logger.logDebug("Invalid status number found while preparing create issue form."); --- 149,157 ---- } issueForm.set("creatorId", currUser.getId()); ! if(severities.size() > 0) { try { ! int midPoint = (severities.size() / 2); ! ConfigurationBean midSeverity = getConfigurationBeanAt(severities, midPoint); ! issueForm.set("severity", new Integer(midSeverity.getValue())); } catch(NumberFormatException nfe) { Logger.logDebug("Invalid status number found while preparing create issue form."); *************** *** 143,151 **** } ! if(versions.length > 0) { ! issueForm.set("versions", new Integer[] {versions[0].getId()}); } ! ProjectScriptModel[] scripts = project.getScripts(); WorkflowUtilities.ProcessFieldScripts(scripts, WorkflowUtilities.EVENT_FIELD_ONPOPULATE, listOptions, errors, issueForm); WorkflowUtilities.ProcessFieldScripts(scripts, WorkflowUtilities.EVENT_FIELD_ONSETDEFAULT, null, errors, issueForm); --- 159,168 ---- } ! if(versions.size() > 0) { ! VersionBean bean = (VersionBean) versions.iterator().next(); ! issueForm.set("versions", new Integer[] {bean.getId()}); } ! Collection scripts = project.getScripts(); WorkflowUtilities.ProcessFieldScripts(scripts, WorkflowUtilities.EVENT_FIELD_ONPOPULATE, listOptions, errors, issueForm); WorkflowUtilities.ProcessFieldScripts(scripts, WorkflowUtilities.EVENT_FIELD_ONSETDEFAULT, null, errors, issueForm); *************** *** 170,173 **** --- 187,208 ---- return mapping.findForward("error"); } + + private ConfigurationBean getConfigurationBeanAt(Collection severities, int index) { + ConfigurationBean result = null; + + Iterator iter = severities.iterator(); + int i = 0; + while(iter.hasNext()) { + ConfigurationBean bean = (ConfigurationBean) iter.next(); + if(i == index) { + result = bean; + break; + } + + i++; + } + + return result; + } } \ No newline at end of file Index: SearchIssuesFormAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/SearchIssuesFormAction.java,v retrieving revision 1.12.4.4 retrieving revision 1.12.4.4.2.1 diff -C2 -d -r1.12.4.4 -r1.12.4.4.2.1 *** SearchIssuesFormAction.java 30 Oct 2005 16:35:45 -0000 1.12.4.4 --- SearchIssuesFormAction.java 6 Dec 2005 12:38:02 -0000 1.12.4.4.2.1 *************** *** 19,25 **** --- 19,35 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.entity.ConfigurationBean; + import cowsultants.itracker.ejb.beans.entity.ProjectBean; + import cowsultants.itracker.ejb.beans.entity.ProjectBean.CompareByName; + import cowsultants.itracker.ejb.beans.entity.UserPreferencesBean; + import cowsultants.itracker.ejb.client.util.IssueSearchQuery; import java.io.IOException; import java.util.Arrays; + import java.util.Collection; + import java.util.Collections; + import java.util.Comparator; import java.util.HashMap; + import java.util.Iterator; + import java.util.List; import java.util.Vector; *************** *** 38,44 **** import cowsultants.itracker.ejb.client.interfaces.ProjectHandler; - import cowsultants.itracker.ejb.client.models.IssueSearchQueryModel; - import cowsultants.itracker.ejb.client.models.ProjectModel; - import cowsultants.itracker.ejb.client.models.UserPreferencesModel; import cowsultants.itracker.ejb.client.util.IssueUtilities; import cowsultants.itracker.ejb.client.util.Logger; --- 48,51 ---- *************** *** 64,68 **** ProjectHandler ph = getITrackerServices().getProjectHandler(); ! UserPreferencesModel userPrefs = (UserPreferencesModel) session.getAttribute(Constants.PREFERENCES_KEY); HashMap userPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); --- 71,75 ---- ProjectHandler ph = getITrackerServices().getProjectHandler(); ! UserPreferencesBean userPrefs = (UserPreferencesBean) session.getAttribute(Constants.PREFERENCES_KEY); HashMap userPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); *************** *** 76,80 **** boolean newQuery = false; ! IssueSearchQueryModel query = (IssueSearchQueryModel) session.getAttribute(Constants.SEARCH_QUERY_KEY); Logger.logDebug("projectid = " + projectId); --- 83,87 ---- boolean newQuery = false; ! IssueSearchQuery query = (IssueSearchQuery) session.getAttribute(Constants.SEARCH_QUERY_KEY); Logger.logDebug("projectid = " + projectId); *************** *** 84,105 **** if(query == null || query.getType() == null || "reset".equalsIgnoreCase(action) || (userPrefs != null && ! userPrefs.getRememberLastSearch())) { Logger.logDebug("New search query. No existing query, reset forced, or saved querys not allowed."); ! query = new IssueSearchQueryModel(); ! query.setType(IssueSearchQueryModel.TYPE_FULL); newQuery = true; ! } else if(query.getType().intValue() == IssueSearchQueryModel.TYPE_FULL.intValue() && projectId != null) { Logger.logDebug("New search query. Previous query FULL, new query PROJECT."); ! query = new IssueSearchQueryModel(); ! query.setType(IssueSearchQueryModel.TYPE_PROJECT); newQuery = true; ! } else if(query.getType().intValue() == IssueSearchQueryModel.TYPE_PROJECT.intValue()) { if(projectId == null || projectId.equals("")) { Logger.logDebug("New search query. Previous query PROJECT, new query FULL."); ! query = new IssueSearchQueryModel(); ! query.setType(IssueSearchQueryModel.TYPE_FULL); newQuery = true; } else if(! projectId.equals(query.getProjectId().toString())) { Logger.logDebug("New search query. Requested project (" + projectId + ") different from previous query (" + query.getProjectId().toString() + ")"); ! query = new IssueSearchQueryModel(); ! query.setType(IssueSearchQueryModel.TYPE_PROJECT); newQuery = true; } --- 91,112 ---- if(query == null || query.getType() == null || "reset".equalsIgnoreCase(action) || (userPrefs != null && ! userPrefs.getRememberLastSearch())) { Logger.logDebug("New search query. No existing query, reset forced, or saved querys not allowed."); ! query = new IssueSearchQuery(); ! query.setType(IssueSearchQuery.TYPE_FULL); newQuery = true; ! } else if(query.getType().intValue() == IssueSearchQuery.TYPE_FULL.intValue() && projectId != null) { Logger.logDebug("New search query. Previous query FULL, new query PROJECT."); ! query = new IssueSearchQuery(); ! query.setType(IssueSearchQuery.TYPE_PROJECT); newQuery = true; ! } else if(query.getType().intValue() == IssueSearchQuery.TYPE_PROJECT.intValue()) { if(projectId == null || projectId.equals("")) { Logger.logDebug("New search query. Previous query PROJECT, new query FULL."); ! query = new IssueSearchQuery(); ! query.setType(IssueSearchQuery.TYPE_FULL); newQuery = true; } else if(! projectId.equals(query.getProjectId().toString())) { Logger.logDebug("New search query. Requested project (" + projectId + ") different from previous query (" + query.getProjectId().toString() + ")"); ! query = new IssueSearchQuery(); ! query.setType(IssueSearchQuery.TYPE_PROJECT); newQuery = true; } *************** *** 108,132 **** query.setAvailableProjects(null); ! ProjectModel[] projects = ph.getAllAvailableProjects(); ! Arrays.sort(projects, new ProjectModel()); Vector availableProjectsVector = new Vector(); Vector selectedProjectsVector = new Vector(); ! for(int i = 0; i < projects.length; i++) { ! if(! UserUtilities.hasPermission(userPermissions, projects[i].getId(), UserUtilities.PERMISSION_VIEW_ALL) && ! ! UserUtilities.hasPermission(userPermissions, projects[i].getId(), UserUtilities.PERMISSION_VIEW_USERS)) { continue; } ! Logger.logDebug("Adding project " + projects[i].getId() + " to list of available projects."); ! availableProjectsVector.add(projects[i]); ! if(projectId != null && projects[i].getId().toString().equals(projectId)) { ! query.setType(IssueSearchQueryModel.TYPE_PROJECT); ! query.setProject(projects[i]); break; } else { for(int j = 0; j < query.getProjects().length; j++) { ! if(query.getProjects()[j].equals(projects[i].getId())) { ! selectedProjectsVector.add(projects[i].getId()); break; } --- 115,143 ---- query.setAvailableProjects(null); ! Collection projects = ph.getAllAvailableProjects(); ! if(projects instanceof List) { ! Collections.sort((List) projects, new ProjectBean.CompareByName()); ! } Vector availableProjectsVector = new Vector(); Vector selectedProjectsVector = new Vector(); ! Iterator projectsIter = projects.iterator(); ! while(projectsIter.hasNext()) { ! ProjectBean project = (ProjectBean) projectsIter.next(); ! if(! UserUtilities.hasPermission(userPermissions, project.getId(), UserUtilities.PERMISSION_VIEW_ALL) && ! ! UserUtilities.hasPermission(userPermissions, project.getId(), UserUtilities.PERMISSION_VIEW_USERS)) { continue; } ! Logger.logDebug("Adding project " + project.getId() + " to list of available projects."); ! availableProjectsVector.add(project); ! if(projectId != null && project.getId().toString().equals(projectId)) { ! query.setType(IssueSearchQuery.TYPE_PROJECT); ! query.setProject(project); break; } else { for(int j = 0; j < query.getProjects().length; j++) { ! if(query.getProjects()[j].equals(project.getId())) { ! selectedProjectsVector.add(project.getId()); break; } *************** *** 134,144 **** } } ! ProjectModel[] availableProjects = new ProjectModel[availableProjectsVector.size()]; ! availableProjectsVector.copyInto(availableProjects); ! Logger.logDebug("Issue Search has " + availableProjects.length + " available projects."); ! if(availableProjects.length != 0) { ! query.setAvailableProjects(availableProjects); ! if(query.getType().equals(IssueSearchQueryModel.TYPE_PROJECT)) { searchForm.set("project", query.getProjectId()); } --- 145,153 ---- } } ! Logger.logDebug("Issue Search has " + selectedProjectsVector.size() + " available projects."); ! if(selectedProjectsVector.size() != 0) { ! query.setAvailableProjects(selectedProjectsVector); ! if(query.getType().equals(IssueSearchQuery.TYPE_PROJECT)) { searchForm.set("project", query.getProjectId()); } *************** *** 148,159 **** query.setResults(null); Vector selectedStatusesVector = new Vector(); ! for(int i = 0; i < IssueUtilities.getStatuses().length; i++) { try { ! int statusNumber = Integer.parseInt(IssueUtilities.getStatuses()[i].getValue()); if(statusNumber < IssueUtilities.STATUS_CLOSED) { selectedStatusesVector.add(new Integer(statusNumber)); } } catch(Exception e) { ! Logger.logDebug("Invalid status entry: " + IssueUtilities.getStatuses()[i]); } } --- 157,172 ---- query.setResults(null); Vector selectedStatusesVector = new Vector(); ! Collection statuses = IssueUtilities.getStatuses(); ! Iterator iter = statuses.iterator(); ! ! while(iter.hasNext()) { ! ConfigurationBean bean = (ConfigurationBean) iter.next(); try { ! int statusNumber = Integer.parseInt(bean.getValue()); if(statusNumber < IssueUtilities.STATUS_CLOSED) { selectedStatusesVector.add(new Integer(statusNumber)); } } catch(Exception e) { ! Logger.logDebug("Invalid status entry: " + bean); } } Index: RemoveCustomFieldAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/RemoveCustomFieldAction.java,v retrieving revision 1.4.4.5 retrieving revision 1.4.4.5.2.1 diff -C2 -d -r1.4.4.5 -r1.4.4.5.2.1 *** RemoveCustomFieldAction.java 30 Oct 2005 16:35:45 -0000 1.4.4.5 --- RemoveCustomFieldAction.java 6 Dec 2005 12:38:02 -0000 1.4.4.5.2.1 *************** *** 19,23 **** --- 19,27 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.entity.CustomFieldBean; + import cowsultants.itracker.ejb.beans.entity.CustomFieldValueBean; import java.io.IOException; + import java.util.Collection; + import java.util.Iterator; import javax.servlet.ServletException; *************** *** 35,40 **** import cowsultants.itracker.ejb.client.exceptions.SystemConfigurationException; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; - import cowsultants.itracker.ejb.client.models.CustomFieldModel; - import cowsultants.itracker.ejb.client.models.CustomFieldValueModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.ejb.client.util.CustomFieldUtilities; --- 39,42 ---- *************** *** 68,72 **** } ! CustomFieldModel customField = sc.getCustomField(valueId); if(customField == null) { throw new SystemConfigurationException("Invalid custom field id."); --- 70,74 ---- } ! CustomFieldBean customField = sc.getCustomField(valueId); if(customField == null) { throw new SystemConfigurationException("Invalid custom field id."); *************** *** 74,81 **** if(customField.getFieldType() == CustomFieldUtilities.TYPE_LIST) { ! CustomFieldValueModel[] options = customField.getOptions(); ! for(int i = 0; i < options.length; i++) { ! String key = CustomFieldUtilities.getCustomFieldOptionLabelKey(customField.getId(), options[i].getId()); ! sc.removeCustomFieldValue(options[i].getId()); if(key != null) { sc.removeLanguageKey(key); --- 76,85 ---- if(customField.getFieldType() == CustomFieldUtilities.TYPE_LIST) { ! Collection options = customField.getValues(); ! Iterator iter = options.iterator(); ! while(iter.hasNext()) { ! CustomFieldValueBean bean = (CustomFieldValueBean) iter.next(); ! String key = CustomFieldUtilities.getCustomFieldOptionLabelKey(customField.getId(), bean.getId()); ! sc.removeCustomFieldValue(bean.getId()); if(key != null) { sc.removeLanguageKey(key); Index: EditIssueAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/EditIssueAction.java,v retrieving revision 1.21.4.5 retrieving revision 1.21.4.5.2.1 diff -C2 -d -r1.21.4.5 -r1.21.4.5.2.1 *** EditIssueAction.java 29 Oct 2005 00:26:52 -0000 1.21.4.5 --- EditIssueAction.java 6 Dec 2005 12:38:02 -0000 1.21.4.5.2.1 *************** *** 19,23 **** --- 19,32 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.entity.CustomFieldBean; + import cowsultants.itracker.ejb.beans.entity.IssueAttachmentBean; + import cowsultants.itracker.ejb.beans.entity.IssueBean; + import cowsultants.itracker.ejb.beans.entity.IssueFieldBean; + import cowsultants.itracker.ejb.beans.entity.IssueHistoryBean; + import cowsultants.itracker.ejb.beans.entity.ProjectBean; + import cowsultants.itracker.ejb.beans.entity.UserBean; + import cowsultants.itracker.ejb.beans.entity.VersionBean; import java.io.IOException; + import java.util.ArrayList; import java.util.HashMap; import java.util.HashSet; *************** *** 41,53 **** import cowsultants.itracker.ejb.client.interfaces.IssueHandler; - import cowsultants.itracker.ejb.client.models.CustomFieldModel; - import cowsultants.itracker.ejb.client.models.IssueAttachmentModel; - import cowsultants.itracker.ejb.client.models.IssueFieldModel; - import cowsultants.itracker.ejb.client.models.IssueHistoryModel; - import cowsultants.itracker.ejb.client.models.IssueModel; - import cowsultants.itracker.ejb.client.models.ProjectModel; - import cowsultants.itracker.ejb.client.models.ProjectScriptModel; - import cowsultants.itracker.ejb.client.models.UserModel; - import cowsultants.itracker.ejb.client.models.VersionModel; import cowsultants.itracker.ejb.client.util.IssueUtilities; import cowsultants.itracker.ejb.client.util.Logger; --- 50,53 ---- *************** *** 58,61 **** --- 58,62 ---- import cowsultants.itracker.web.util.AttachmentUtilities; import cowsultants.itracker.web.util.Constants; + import java.util.Collection; *************** *** 83,87 **** HttpSession session = request.getSession(true); ! UserModel currUser = (UserModel) session.getAttribute(Constants.USER_KEY); HashMap currPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); Locale currLocale = (Locale) session.getAttribute(Constants.LOCALE_KEY); --- 84,88 ---- HttpSession session = request.getSession(true); ! UserBean currUser = (UserBean) session.getAttribute(Constants.USER_KEY); HashMap currPermissions = (HashMap) session.getAttribute(Constants.PERMISSIONS_KEY); Locale currLocale = (Locale) session.getAttribute(Constants.LOCALE_KEY); *************** *** 95,99 **** int previousStatus = -1; ! IssueModel issue = ih.getIssue(issueId); if(issue == null || issue.getId() == null || issue.getId().intValue() < 0) { --- 96,100 ---- int previousStatus = -1; ! IssueBean issue = ih.getIssue(issueId); if(issue == null || issue.getId() == null || issue.getId().intValue() < 0) { *************** *** 102,106 **** } ! ProjectModel project = issue.getProject(); if(project == null) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("itracker.web.error.invalidproject")); --- 103,107 ---- } ! ProjectBean project = issue.getProject(); if(project == null) { errors.add(ActionErrors.GLOBAL_ERROR, new ActionError("itracker.web.error.invalidproject")); *************** *** 113,117 **** } ! ProjectScriptModel[] scripts = project.getScripts(); WorkflowUtilities.ProcessFieldScripts(scripts, WorkflowUtilities.EVENT_FIELD_ONPRESUBMIT, null, errors, (DynaValidatorForm) form); --- 114,118 ---- } ! Collection scripts = project.getScripts(); WorkflowUtilities.ProcessFieldScripts(scripts, WorkflowUtilities.EVENT_FIELD_ONPRESUBMIT, null, errors, (DynaValidatorForm) form); *************** *** 144,148 **** } ! private void processFullEdit(IssueModel issue, ProjectModel project, UserModel user, HashMap userPermissions, Locale locale, ActionForm form, IssueHandler ih) throws Exception { int previousStatus = issue.getStatus(); --- 145,149 ---- } ! private void processFullEdit(IssueBean issue, ProjectBean project, UserBean user, HashMap userPermissions, Locale locale, ActionForm form, IssueHandler ih) throws Exception { int previousStatus = issue.getStatus(); *************** *** 153,157 **** Integer targetVersionId = (Integer) PropertyUtils.getSimpleProperty(form, "targetVersion"); if(targetVersionId != null && targetVersionId.intValue() != -1) { ! issue.setTargetVersion(new VersionModel(targetVersionId)); } --- 154,160 ---- Integer targetVersionId = (Integer) PropertyUtils.getSimpleProperty(form, "targetVersion"); if(targetVersionId != null && targetVersionId.intValue() != -1) { ! VersionBean version = new VersionBean(); ! version.setId(targetVersionId); ! issue.setTargetVersion(version); } *************** *** 220,224 **** } ! private void processLimitedEdit(IssueModel issue, ProjectModel project, UserModel user, HashMap userPermissions, Locale locale, ActionForm form, IssueHandler ih) throws Exception { issue.setDescription((String) PropertyUtils.getSimpleProperty(form, "description")); --- 223,227 ---- } ! private void processLimitedEdit(IssueBean issue, ProjectBean project, UserBean user, HashMap userPermissions, Locale locale, ActionForm form, IssueHandler ih) throws Exception { issue.setDescription((String) PropertyUtils.getSimpleProperty(form, "description")); *************** *** 240,245 **** } ! private void setOwner(IssueModel issue, UserModel user, HashMap userPermissions, ActionForm form, IssueHandler ih) throws Exception { ! Integer currentOwner = issue.getOwnerId(); Integer ownerId = (Integer) PropertyUtils.getSimpleProperty(form, "ownerId"); if(ownerId != null && ! ownerId.equals(currentOwner)) { --- 243,248 ---- } ! private void setOwner(IssueBean issue, UserBean user, HashMap userPermissions, ActionForm form, IssueHandler ih) throws Exception { ! Integer currentOwner = issue.getOwner().getId(); Integer ownerId = (Integer) PropertyUtils.getSimpleProperty(form, "ownerId"); if(ownerId != null && ! ownerId.equals(currentOwner)) { *************** *** 253,258 **** } ! private void setIssueFields(IssueModel issue, UserModel user, Locale locale, ActionForm form, IssueHandler ih) throws Exception { ! IssueFieldModel[] issueFields = new IssueFieldModel[0]; HashMap customFields = (HashMap) PropertyUtils.getSimpleProperty(form, "customFields"); if(customFields != null && customFields.size() > 0) { --- 256,261 ---- } ! private void setIssueFields(IssueBean issue, UserBean user, Locale locale, ActionForm form, IssueHandler ih) throws Exception { ! ArrayList issueFields = new ArrayList(); HashMap customFields = (HashMap) PropertyUtils.getSimpleProperty(form, "customFields"); if(customFields != null && customFields.size() > 0) { *************** *** 261,289 **** try { Integer fieldId = new Integer((String) iter.next()); ! CustomFieldModel field = IssueUtilities.getCustomField(fieldId); String fieldValue = (String) PropertyUtils.getMappedProperty(form, "customFields(" + fieldId + ")"); if(fieldValue != null && ! fieldValue.equals("")) { ! IssueFieldModel issueField = new IssueFieldModel(field, issue.getId()); issueField.setValue(fieldValue, locale); ! issueFieldsVector.add(issueField); } } catch(Exception e) { } } - issueFields = new IssueFieldModel[issueFieldsVector.size()]; - issueFieldsVector.copyInto(issueFields); } ih.setIssueFields(issue.getId(), issueFields); } ! private void addHistoryEntry(IssueModel issue, UserModel user, ActionForm form, IssueHandler ih) throws Exception { String history = (String) PropertyUtils.getSimpleProperty(form, "history"); if(history != null && ! history.equals("")) { ! IssueHistoryModel issueHistory = new IssueHistoryModel(history, IssueUtilities.HISTORY_STATUS_AVAILABLE, issue.getId(), user.getId()); ih.addIssueHistory(issueHistory); } } ! private void addAttachment(IssueModel issue, ProjectModel project, UserModel user, ActionForm form, IssueHandler ih) throws Exception { if(! ProjectUtilities.hasOption(ProjectUtilities.OPTION_NO_ATTACHMENTS, project.getOptions())) { FormFile file = (FormFile) PropertyUtils.getSimpleProperty(form, "attachment"); --- 264,296 ---- try { Integer fieldId = new Integer((String) iter.next()); ! CustomFieldBean field = IssueUtilities.getCustomField(fieldId); String fieldValue = (String) PropertyUtils.getMappedProperty(form, "customFields(" + fieldId + ")"); if(fieldValue != null && ! fieldValue.equals("")) { ! IssueFieldBean issueField = new IssueFieldBean(); ! issueField.setCustomField(field); ! issueField.setIssue(issue); issueField.setValue(fieldValue, locale); ! issueFields.add(issueField); } } catch(Exception e) { } } } ih.setIssueFields(issue.getId(), issueFields); } ! private void addHistoryEntry(IssueBean issue, UserBean user, ActionForm form, IssueHandler ih) throws Exception { String history = (String) PropertyUtils.getSimpleProperty(form, "history"); if(history != null && ! history.equals("")) { ! IssueHistoryBean issueHistory = new IssueHistoryBean(); ! issueHistory.setDescription(history); ! issueHistory.setStatus(IssueUtilities.HISTORY_STATUS_AVAILABLE); ! issueHistory.setIssue(issue); ! issueHistory.setUser(user); ih.addIssueHistory(issueHistory); } } ! private void addAttachment(IssueBean issue, ProjectBean project, UserBean user, ActionForm form, IssueHandler ih) throws Exception { if(! ProjectUtilities.hasOption(ProjectUtilities.OPTION_NO_ATTACHMENTS, project.getOptions())) { FormFile file = (FormFile) PropertyUtils.getSimpleProperty(form, "attachment"); *************** *** 297,305 **** origFileName = origFileName.substring(lastSlash + 1); } ! IssueAttachmentModel attachmentModel = new IssueAttachmentModel(origFileName, ! file.getContentType(), ! (String) PropertyUtils.getSimpleProperty(form, "attachmentDescription"), ! file.getFileSize(), ! issue.getId(), user.getId()); ih.addIssueAttachment(attachmentModel, file.getFileData()); } --- 304,314 ---- origFileName = origFileName.substring(lastSlash + 1); } ! IssueAttachmentBean attachmentModel = new IssueAttachmentBean(); ! attachmentModel.setOriginalFileName(origFileName); ! attachmentModel.setType(file.getContentType()); ! attachmentModel.setDescription((String) PropertyUtils.getSimpleProperty(form, "attachmentDescription")); ! attachmentModel.setSize(file.getFileSize()); ! attachmentModel.setIssue(issue); ! attachmentModel.setUser(user); ih.addIssueAttachment(attachmentModel, file.getFileData()); } *************** *** 308,312 **** } ! private void sendNotification(IssueModel issue, int previousStatus, String baseURL, IssueHandler ih) { int notificationType = NotificationUtilities.TYPE_UPDATED; if(previousStatus >= IssueUtilities.STATUS_CLOSED && issue.getStatus() >= IssueUtilities.STATUS_CLOSED) { --- 317,321 ---- } ! private void sendNotification(IssueBean issue, int previousStatus, String baseURL, IssueHandler ih) { int notificationType = NotificationUtilities.TYPE_UPDATED; if(previousStatus >= IssueUtilities.STATUS_CLOSED && issue.getStatus() >= IssueUtilities.STATUS_CLOSED) { *************** *** 316,320 **** } ! private ActionForward getReturnForward(IssueModel issue, ProjectModel project, ActionForm form, ActionMapping mapping) throws Exception { if("index".equals((String) PropertyUtils.getSimpleProperty(form, "caller"))) { return mapping.findForward("index"); --- 325,329 ---- } ! private ActionForward getReturnForward(IssueBean issue, ProjectBean project, ActionForm form, ActionMapping mapping) throws Exception { if("index".equals((String) PropertyUtils.getSimpleProperty(form, "caller"))) { return mapping.findForward("index"); Index: ImportDataProcessAction.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/web/actions/ImportDataProcessAction.java,v retrieving revision 1.11.4.4 retrieving revision 1.11.4.4.2.1 diff -C2 -d -r1.11.4.4 -r1.11.4.4.2.1 *** ImportDataProcessAction.java 30 Oct 2005 16:38:23 -0000 1.11.4.4 --- ImportDataProcessAction.java 6 Dec 2005 12:38:02 -0000 1.11.4.4.2.1 *************** *** 19,24 **** --- 19,40 ---- package cowsultants.itracker.web.actions; + import cowsultants.itracker.ejb.beans.entity.ComponentBean; + 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.GenericBean; + import cowsultants.itracker.ejb.beans.entity.IssueAttachmentBean; + import cowsultants.itracker.ejb.beans.entity.IssueBean; + import cowsultants.itracker.ejb.beans.entity.IssueFieldBean; + import cowsultants.itracker.ejb.beans.entity.IssueHistoryBean; + import cowsultants.itracker.ejb.beans.entity.LanguageBean; + import cowsultants.itracker.ejb.beans.entity.ProjectBean; + import cowsultants.itracker.ejb.beans.entity.UserBean; + import cowsultants.itracker.ejb.beans.entity.VersionBean; + import cowsultants.itracker.ejb.client.util.ImportDataModel; import java.io.IOException; + import java.util.Collection; import java.util.HashSet; + import java.util.Iterator; import javax.naming.InitialContext; *************** *** 38,54 **** import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.interfaces.UserHandler; - import cowsultants.itracker.ejb.client.models.ComponentModel; - import cowsultants.itracker.ejb.client.models.ConfigurationModel; - import cowsultants.itracker.ejb.client.models.CustomFieldModel; - import cowsultants.itracker.ejb.client.models.GenericModel; - import cowsultants.itracker.ejb.client.models.ImportDataModel; - import cowsultants.itracker.ejb.client.models.IssueAttachmentModel; - import cowsultants.itracker.ejb.client.models.IssueFieldModel; - import cowsultants.itracker.ejb.client.models.IssueHistoryModel; - import cowsultants.itracker.ejb.client.models.IssueModel; - import cowsultants.itracker.ejb.client.models.LanguageModel; - import cowsultants.itracker.ejb.client.models.ProjectModel; - import cowsultants.itracker.ejb.client.models.UserModel; - import cowsultants.itracker.ejb.client.models.VersionModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.ejb.client.util.CustomFieldUtilities; --- 54,57 ---- *************** *** 80,84 **** HttpSession session = request.getSession(true); ! UserModel importer = (UserModel) session.getAttribute(Constants.USER_KEY); if(importer == null) { return mapping.findForward("unauthorized"); --- 83,87 ---- HttpSession session = request.getSession(true); ! UserBean importer = (UserBean) session.getAttribute(Constants.USER_KEY); if(importer == null) { return mapping.findForward("unauthorized"); *************** *** 86,90 **** ImportDataModel model = (ImportDataModel) session.getAttribute(Constants.IMPORT_DATA_KEY); ! GenericModel[] importData = model.getData(); Logger.logDebug("Importing configuration data."); createConfig(model, importer, ic); --- 89,93 ---- ImportDataModel model = (ImportDataModel) session.getAttribute(Constants.IMPORT_DATA_KEY); ! GenericBean[] importData = model.getData(); Logger.logDebug("Importing configuration data."); createConfig(model, importer, ic); *************** *** 113,134 **** } ! private boolean createConfig(ImportDataModel model, UserModel importer, InitialContext ic) { try { SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); ! GenericModel[] importData = model.getData(); for(int i = 0; i < importData.length; i++) { ! if(importData[i] instanceof ConfigurationModel && ! model.getExistingModel(i)) { ! ConfigurationModel configItem = (ConfigurationModel) importData[i]; ! ConfigurationModel newConfigItem = sc.createConfigurationItem(configItem); configItem.setId(newConfigItem.getId()); // Now add a new language key String key = SystemConfigurationUtilities.getLanguageKey(configItem); ! sc.updateLanguageItem(new LanguageModel(ImportExportUtilities.EXPORT_LOCALE_STRING, key, configItem.getName())); ITrackerResources.clearKeyFromBundles(key, true); ! } else if(importData[i] instanceof CustomFieldModel && ! model.getExistingModel(i)) { ! CustomFieldModel customField = (CustomFieldModel) importData[i]; ! CustomFieldModel newCustomField = sc.createCustomField(customField); customField.setId(newCustomField.getId()); --- 116,141 ---- } ! private boolean createConfig(ImportDataModel model, UserBean importer, InitialContext ic) { try { SystemConfiguration sc = getITrackerServices().getSystemConfiguration(); ! GenericBean[] importData = model.getData(); for(int i = 0; i < importData.length; i++) { ! if(importData[i] instanceof ConfigurationBean && ! model.getExistingModel(i)) { ! ConfigurationBean configItem = (ConfigurationBean) importData[i]; ! ConfigurationBean newConfigItem = sc.createConfigurationItem(configItem); configItem.setId(newConfigItem.getId()); // Now add a new language key String key = SystemConfigurationUtilities.getLanguageKey(configItem); ! LanguageBean langBean = new LanguageBean(); ! langBean.setLocale(ImportExportUtilities.EXPORT_LOCALE_STRING); ! langBean.setResourceKey(key); ! langBean.setResourceValue(configItem.getName()); ! sc.updateLanguageItem(langBean); ITrackerResources.clearKeyFromBundles(key, true); ! } else if(importData[i] instanceof CustomFieldBean && ! model.getExistingModel(i)) { ! CustomFieldBean customField = (CustomFieldBean) importData[i]; ! CustomFieldBean newCustomField = sc.createCustomField(customField); customField.setId(newCustomField.getId()); *************** *** 136,145 **** // each option that exists. String key = CustomFieldUtilities.getCustomFieldLabelKey(customField.getId()); ! sc.updateLanguageItem(new LanguageModel(ImportExportUtilities.EXPORT_LOCALE_STRING, key, customField.getName())); ITrackerResources.clearKeyFromBundles(key, true); if(customField.getFieldType() == CustomFieldUtilities.TYPE_LIST) { ! for(int j = 0; j < customField.getOptions().length; j++) { ! String optionKey = CustomFieldUtilities.getCustomFieldOptionLabelKey(customField.getId(), customField.getOptions()[j].getId()); ! sc.updateLanguageItem(new LanguageModel(ImportExportUtilities.EXPORT_LOCALE_STRING, optionKey, customField.getOptions()[j].getName())); ITrackerResources.clearKeyFromBundles(optionKey, true); } --- 143,163 ---- // each option that exists. String key = CustomFieldUtilities.getCustomFieldLabelKey(customField.getId()); ! LanguageBean langBean = new LanguageBean(); ! langBean.setLocale(ImportExportUtilities.EXPORT_LOCALE_STRING); ! langBean.setResourceKey(key); ! langBean.setResourceValue(customField.getName()); ! sc.updateLanguageItem(langBean); ITrackerResources.clearKeyFromBundles(key, true); if(customField.getFieldType() == CustomFieldUtilities.TYPE_LIST) { ! Collection values = customField.getValues(); ! Iterator iter = values.iterator(); ! while(iter.hasNext()) { ! CustomFieldValueBean bean = (CustomFieldValueBean) iter.next(); ! String optionKey = CustomFieldUtilities.getCustomFieldOptionLabelKey(customField.getId(), bean.getId()); ! LanguageBean langValueBean = new LanguageBean(); ! langValueBean.setLocale(ImportExportUtilities.EXPORT_LOCALE_STRING); ! langValueBean.setResourceKey(key); ! langValueBean.setResourceValue(bean.getName()); ! sc.updateLanguageItem(langValueBean); ITrackerResources.clearKeyFromBundles(optionKey, true); } *************** *** 155,166 **** } ! private boolean createUsers(ImportDataModel model, UserModel importer, InitialContext ic) { try { UserHandler uh = getITrackerServices().getUserHandler(); ! GenericModel[] importData = model.getData(); for(int i = 0; i < importData.length; i++) { ! if(importData[i] instanceof UserModel && ! model.getExistingModel(i)) { ! UserModel user = (UserModel) importData[i]; user.setRegistrationType(UserUtilities.REGISTRATION_TYPE_IMPORT); if(model.getCreatePasswords()) { --- 173,184 ---- } ! private boolean createUsers(ImportDataModel model, UserBean importer, InitialContext ic) { try { UserHandler uh = getITrackerServices().getUserHandler(); ! GenericBean[] importData = model.getData(); for(int i = 0; i < importData.length; i++) { ! if(importData[i] instanceof UserBean && ! model.getExistingModel(i)) { ! UserBean user = (UserBean) importData[i]; user.setRegistrationType(UserUtilities.REGISTRATION_TYPE_IMPORT); if(model.getCreatePasswords()) { *************** *** 168,172 **** } user.setLogin(user.getLogin()); ! UserModel newUser = uh.createUser(user); user.setId(newUser.getId()); } --- 186,190 ---- } user.setLogin(user.getLogin()); ! UserBean newUser = uh.createUser(user); user.setId(newUser.getId()); } *************** *** 179,215 **** } ! private boolean createProjects(ImportDataModel model, UserModel importer, InitialContext ic) { try { ProjectHandler ph = getITrackerServices().getProjectHandler(); ! GenericModel[] importData = model.getData(); for(int i = 0; i < importData.length; i++) { ! if(importData[i] instanceof ProjectModel && ! model.getExistingModel(i)) { ! ProjectModel project = (ProjectModel) importData[i]; ! ProjectModel newProject = ph.createProject(project); project.setId(newProject.getId()); HashSet owners = new HashSet(); ! for(int j = 0; j < project.getOwners().length; j++) { ! owners.add(project.getOwners()[j].getId()); ! } ph.setProjectOwners(project, owners); HashSet fields = new HashSet(); ! for(int j = 0; j < project.getCustomFields().length; j++) { ! fields.add(project.getCustomFields()[j].getId()); ! } ph.setProjectFields(project, fields); ! ComponentModel[] components = project.getComponents(); ! for(int j = 0; j < components.length; j++) { ! ComponentModel newComponent = ph.addProjectComponent(project.getId(), components[j]); ! components[j].setId(newComponent.getId()); } ! VersionModel[] versions = project.getVersions(); ! for(int j = 0; j < versions.length; j++) { ! VersionModel newVersion = ph.addProjectVersion(project.getId(), versions[j]); ! versions[j].setId(newVersion.getId()); } } --- 197,231 ---- } ! private boolean createProjects(ImportDataModel model, UserBean importer, InitialContext ic) { try { ProjectHandler ph = getITrackerServices().getProjectHandler(); ! GenericBean[] importData = model.getData(); for(int i = 0; i < importData.length; i++) { ! if(importData[i] instanceof ProjectBean && ! model.getExistingModel(i)) { ! ProjectBean project = (ProjectBean) importData[i]; ! ProjectBean newProject = ph.createProject(project); project.setId(newProject.getId()); HashSet owners = new HashSet(); ! owners.addAll(project.getOwners()); ph.setProjectOwners(project, owners); HashSet fields = new HashSet(); ! fields.addAll(project.getCustomFields()); ph.setProjectFields(project, fields); ! Iterator componentIter = project.getComponents().iterator(); ! while(componentIter.hasNext()) { ! ComponentBean component = (ComponentBean) componentIter.next(); ! ComponentBean newComponent = ph.addProjectComponent(project.getId(), component); ! component.setId(newComponent.getId()); } ! Iterator versionIter = project.getVersions().iterator(); ! while(versionIter.hasNext()) { ! VersionBean version = (VersionBean) versio... [truncated message content] |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:17
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/core In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/core Modified Files: Tag: itrackerhnodto ApplicationInitialization.java Log Message: removal of value objects Index: ApplicationInitialization.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/core/Attic/ApplicationInitialization.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.2.2.1 diff -C2 -d -r1.1.2.2 -r1.1.2.2.2.1 *** ApplicationInitialization.java 29 Oct 2005 16:47:04 -0000 1.1.2.2 --- ApplicationInitialization.java 6 Dec 2005 12:38:00 -0000 1.1.2.2.2.1 *************** *** 19,22 **** --- 19,24 ---- package cowsultants.itracker.core; + import cowsultants.itracker.ejb.beans.entity.ReportBean; + import cowsultants.itracker.ejb.beans.entity.UserBean; import java.io.BufferedReader; import java.io.File; *************** *** 25,28 **** --- 27,32 ---- import java.io.InputStream; import java.io.InputStreamReader; + import java.util.Collection; + import java.util.Iterator; import net.sf.hibernate.HibernateException; *************** *** 44,49 **** import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.interfaces.UserHandler; - import cowsultants.itracker.ejb.client.models.ReportModel; - import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.ejb.client.util.Base64; --- 48,51 ---- *************** *** 137,142 **** } catch (NoSuchEntityException e) { Logger.logDebug("Attempting to create admin user."); ! UserModel adminUser = new UserModel("admin", UserUtilities.encryptPassword("admin"), "Super", "User", ! "", true); uh.createUser(adminUser); } --- 139,151 ---- } catch (NoSuchEntityException e) { Logger.logDebug("Attempting to create admin user."); ! UserBean adminUser = new UserBean(); ! adminUser.setLogin("admin"); ! adminUser.setPassword(UserUtilities.encryptPassword("admin")); ! adminUser.setFirstName("Super"); ! adminUser.setLastName("User"); ! adminUser.setEmail(""); ! //@todo why is this an int? ! adminUser.setSuperUser(1); ! uh.createUser(adminUser); } *************** *** 188,192 **** try { ReportHandler rh = new ReportHandlerBean(); ! ReportModel[] reports = rh.getAllReports(); String line; --- 197,201 ---- try { ReportHandler rh = new ReportHandlerBean(); ! Collection reports = rh.getAllReports(); String line; *************** *** 209,213 **** try { String repLine; ! ReportModel report = new ReportModel(); InputStream reportStream = getClass().getResourceAsStream( --- 218,222 ---- try { String repLine; ! ReportBean report = new ReportBean(); InputStream reportStream = getClass().getResourceAsStream( *************** *** 253,260 **** } Logger.logDebug("Loading " + report.toString()); ! for (int i = 0; i < reports.length; i++) { ! if (reports[i].equals(report)) { Logger.logDebug("Found existing report, updating."); ! report.setId(reports[i].getId()); rh.updateReport(report); continue LINE; --- 262,272 ---- } Logger.logDebug("Loading " + report.toString()); ! ! Iterator repIter = reports.iterator(); ! while(repIter.hasNext()) { ! ReportBean bean = (ReportBean) repIter.next(); ! if (bean.equals(report)) { Logger.logDebug("Found existing report, updating."); ! report.setId(bean.getId()); rh.updateReport(report); continue LINE; |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:17
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/authentication In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/ejb/authentication Modified Files: Tag: itrackerhnodto AbstractPluggableAuthenticator.java DefaultAuthenticator.java PluggableAuthenticator.java TestAuthenticator.java Log Message: removal of value objects Index: PluggableAuthenticator.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/authentication/PluggableAuthenticator.java,v retrieving revision 1.17.4.2 retrieving revision 1.17.4.2.2.1 diff -C2 -d -r1.17.4.2 -r1.17.4.2.2.1 *** PluggableAuthenticator.java 13 Oct 2005 14:26:54 -0000 1.17.4.2 --- PluggableAuthenticator.java 6 Dec 2005 12:38:00 -0000 1.17.4.2.2.1 *************** *** 19,27 **** package cowsultants.itracker.ejb.authentication; import java.util.HashMap; import cowsultants.itracker.ejb.client.exceptions.AuthenticatorException; - import cowsultants.itracker.ejb.client.models.PermissionModel; - import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.util.AuthenticationConstants; --- 19,27 ---- package cowsultants.itracker.ejb.authentication; + import cowsultants.itracker.ejb.beans.entity.UserBean; + import java.util.Collection; import java.util.HashMap; import cowsultants.itracker.ejb.client.exceptions.AuthenticatorException; import cowsultants.itracker.ejb.client.util.AuthenticationConstants; *************** *** 42,59 **** * @param authType the type of authentication information being provided * @param reqSource the source of the request (eg web, api) ! * @return a UserModel if the login is successful * @throws AuthenticatorException an exception if the login is unsuccessful, or an error occurs */ ! public UserModel checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method should return all the permissions a user has in the authentication system. This * list may then be augmented based on other attributes of the user, or project level options. ! * @param user a UserModel object that contains the user to retrieve permissions for * @param reqSource the source of the request (eg web, api) ! * @return an array of PermissionModels * @throws AuthenticatorException an error occurs */ ! public PermissionModel[] getUserPermissions(UserModel user, int reqSource) throws AuthenticatorException; /** --- 42,59 ---- * @param authType the type of authentication information being provided * @param reqSource the source of the request (eg web, api) ! * @return a UserBean if the login is successful * @throws AuthenticatorException an exception if the login is unsuccessful, or an error occurs */ ! public UserBean checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** * This method should return all the permissions a user has in the authentication system. This * list may then be augmented based on other attributes of the user, or project level options. ! * @param user a UserBean object that contains the user to retrieve permissions for * @param reqSource the source of the request (eg web, api) ! * @return an collection of PermissionBeans * @throws AuthenticatorException an error occurs */ ! public Collection getUserPermissions(UserBean user, int reqSource) throws AuthenticatorException; /** *************** *** 61,77 **** * authentication system. This list must always include all super users, even if they * do not explicitly have the required permission. ! * @param permissions an array of PermissionModels that define which permissions in which projects are required. * @param requireAll true is the user must possess any of the permissions, false if only one is required * @param activeOnly true if only users listed as active should be returned * @param reqSource the source of the request (eg web, api) ! * @return an array of UserModels * @throws AuthenticatorException an error occurs */ ! public UserModel[] getUsersWithProjectPermission(PermissionModel[] permissions, boolean requireAll, boolean activeOnly, int reqSource) throws AuthenticatorException; /** * This method should be implemented to determine if a user is authorized to self register. ! * @param user a UserModel object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 61,77 ---- * authentication system. This list must always include all super users, even if they * do not explicitly have the required permission. ! * @param permissions an array of PermissionBeans that define which permissions in which projects are required. * @param requireAll true is the user must possess any of the permissions, false if only one is required * @param activeOnly true if only users listed as active should be returned * @param reqSource the source of the request (eg web, api) ! * @return an collection of UserBeans * @throws AuthenticatorException an error occurs */ ! public Collection getUsersWithProjectPermission(Collection permissions, boolean requireAll, boolean activeOnly, int reqSource) throws AuthenticatorException; /** * This method should be implemented to determine if a user is authorized to self register. ! * @param user a UserBean object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 80,84 **** * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowRegistration(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** --- 80,84 ---- * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowRegistration(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** *************** *** 87,91 **** * a super user on the system. If this method would always return false, then some other * mechanism must be provided for new users to be created in the system. ! * @param user a UserModel object that contains the data for the new user. If null, then the request is being made for an unknown future user. For example, the system may request this with an null user if it needs to know if the system --- 87,91 ---- * a super user on the system. If this method would always return false, then some other * mechanism must be provided for new users to be created in the system. ! * @param user a UserBean object that contains the data for the new user. If null, then the request is being made for an unknown future user. For example, the system may request this with an null user if it needs to know if the system *************** *** 97,101 **** * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowProfileCreation(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** --- 97,101 ---- * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowProfileCreation(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** *************** *** 104,108 **** * allowPreferenceUpdates, and allowPermissionUpdates to determine what parts of the user's * information is allowed to be updated through ITracker. ! * @param user a UserModel object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 104,108 ---- * allowPreferenceUpdates, and allowPermissionUpdates to determine what parts of the user's * information is allowed to be updated through ITracker. ! * @param user a UserBean object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 114,118 **** * @see PluggableAuthentication#allowPreferenceUpdates */ ! public boolean allowProfileUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** --- 114,118 ---- * @see PluggableAuthentication#allowPreferenceUpdates */ ! public boolean allowProfileUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** *************** *** 121,125 **** * allowPermissionUpdates, and allowPreferenceUpdates to determine what parts of the user's * information is allowed to be updated through ITracker. ! * @param user a UserModel object that contains the current user data * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 121,125 ---- * allowPermissionUpdates, and allowPreferenceUpdates to determine what parts of the user's * information is allowed to be updated through ITracker. ! * @param user a UserBean object that contains the current user data * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 131,135 **** * @see PluggableAuthentication#allowPreferenceUpdates */ ! public boolean allowPasswordUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** --- 131,135 ---- * @see PluggableAuthentication#allowPreferenceUpdates */ ! public boolean allowPasswordUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** *************** *** 140,144 **** * request is being made for multiple users, for example on the edit project page, and is being applied * on a generic basis, that is are permission updates allowed at all on the system. ! * @param user a UserModel object that contains the current user data, or null if multiple users * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 140,144 ---- * request is being made for multiple users, for example on the edit project page, and is being applied * on a generic basis, that is are permission updates allowed at all on the system. ! * @param user a UserBean object that contains the current user data, or null if multiple users * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 150,154 **** * @see PluggableAuthentication#allowPreferenceUpdates */ ! public boolean allowPermissionUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** --- 150,154 ---- * @see PluggableAuthentication#allowPreferenceUpdates */ ! public boolean allowPermissionUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** *************** *** 157,161 **** * allowPasswordUpdates, and allowPermissionUpdate to determine what parts of the user's * information is allowed to be updated through ITracker. ! * @param user a UserModel object that contains the current user data * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 157,161 ---- * allowPasswordUpdates, and allowPermissionUpdate to determine what parts of the user's * information is allowed to be updated through ITracker. ! * @param user a UserBean object that contains the current user data * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 167,171 **** * @see PluggableAuthentication#allowPermissionUpdates */ ! public boolean allowPreferenceUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** --- 167,171 ---- * @see PluggableAuthentication#allowPermissionUpdates */ ! public boolean allowPreferenceUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** *************** *** 175,179 **** * core profile information and password are made here. Any permission information for the new user * whould be done through an updateProfile call. ! * @param user a UserModel object that contains the newly created profile * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 175,179 ---- * core profile information and password are made here. Any permission information for the new user * whould be done through an updateProfile call. ! * @param user a UserBean object that contains the newly created profile * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 183,187 **** * @see PluggableAuthenticator#updateProfile */ ! public boolean createProfile(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** --- 183,187 ---- * @see PluggableAuthenticator#updateProfile */ ! public boolean createProfile(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** *************** *** 190,194 **** * updates to a user including core profile information, password information, permission information * or preference changes. Any changes should be made directly to user model supplied to the method. ! * @param user a UserModel object that contains the updated profile * @param updateType the type of information that is being updated * @param authentication the user's authentication information, if known --- 190,194 ---- * updates to a user including core profile information, password information, permission information * or preference changes. Any changes should be made directly to user model supplied to the method. ! * @param user a UserBean object that contains the updated profile * @param updateType the type of information that is being updated * @param authentication the user's authentication information, if known *************** *** 198,202 **** * @throws AuthenticatorException an exception if the login is unsuccessful, or an error occurs */ ! public boolean updateProfile(UserModel user, int updateType, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** --- 198,202 ---- * @throws AuthenticatorException an exception if the login is unsuccessful, or an error occurs */ ! public boolean updateProfile(UserBean user, int updateType, Object authentication, int authType, int reqSource) throws AuthenticatorException; /** Index: TestAuthenticator.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/authentication/Attic/TestAuthenticator.java,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.1.2.1 diff -C2 -d -r1.1.2.1 -r1.1.2.1.2.1 *** TestAuthenticator.java 21 Oct 2005 17:11:17 -0000 1.1.2.1 --- TestAuthenticator.java 6 Dec 2005 12:38:00 -0000 1.1.2.1.2.1 *************** *** 1,7 **** package cowsultants.itracker.ejb.authentication; import cowsultants.itracker.ejb.client.exceptions.AuthenticatorException; import cowsultants.itracker.ejb.client.interfaces.UserHandler; - import cowsultants.itracker.ejb.client.models.UserModel; /** --- 1,7 ---- package cowsultants.itracker.ejb.authentication; + import cowsultants.itracker.ejb.beans.entity.UserBean; import cowsultants.itracker.ejb.client.exceptions.AuthenticatorException; import cowsultants.itracker.ejb.client.interfaces.UserHandler; /** *************** *** 18,22 **** * java.lang.Object, int, int) */ ! public UserModel checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException { --- 18,22 ---- * java.lang.Object, int, int) */ ! public UserBean checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException { *************** *** 32,36 **** * java.lang.Object, int, int) */ ! public boolean allowProfileUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return true; --- 32,36 ---- * java.lang.Object, int, int) */ ! public boolean allowProfileUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return true; *************** *** 43,47 **** * java.lang.Object, int, int) */ ! public boolean allowPasswordUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return false; --- 43,47 ---- * java.lang.Object, int, int) */ ! public boolean allowPasswordUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return false; Index: AbstractPluggableAuthenticator.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/authentication/AbstractPluggableAuthenticator.java,v retrieving revision 1.12.4.2 retrieving revision 1.12.4.2.2.1 diff -C2 -d -r1.12.4.2 -r1.12.4.2.2.1 *** AbstractPluggableAuthenticator.java 13 Oct 2005 14:26:54 -0000 1.12.4.2 --- AbstractPluggableAuthenticator.java 6 Dec 2005 12:38:00 -0000 1.12.4.2.2.1 *************** *** 19,22 **** --- 19,23 ---- package cowsultants.itracker.ejb.authentication; + import cowsultants.itracker.ejb.beans.entity.UserBean; import java.util.HashMap; *************** *** 24,207 **** import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.interfaces.UserHandler; - import cowsultants.itracker.ejb.client.models.PermissionModel; - import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.util.AuthenticationConstants; /** ! * This class provides a skeleton implementation of the PluggableAuthenticator interface. ! * It can be extended to provide a new authentication module for ITracker reducing the amount ! * of effort to implement the PluggableAuthenticator interface. ! */ public abstract class AbstractPluggableAuthenticator implements PluggableAuthenticator, AuthenticationConstants { private UserHandler userHandler = null; private SystemConfiguration systemConfiguration = null; ! public AbstractPluggableAuthenticator() { } ! /** ! * This method should be overridden to determine if a user login is successful. The method ! * should return a valid UserModel object. ! * @param login the login the user/client provided ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a UserModel if the login is successful ! * @throws AuthenticatorException an exception if the login is unsuccessful, or an error occurs ! */ ! public abstract UserModel checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to return all the permissions a user has in the ! * authentication system. This list may then be augmented based on other attributes of ! * the user, or project level options. ! * @param user a UserModel object that contains the user to retrieve permissions for ! * @param reqSource the source of the request (eg web, api) ! * @return an array of PermissionModels ! * @throws AuthenticatorException an error occurs ! */ ! public abstract PermissionModel[] getUserPermissions(UserModel user, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to return an array of users that have certian permissions ! * in the authentication system. This list must always include all super users, even if they ! * do not explicitly have the required permission. ! * @param permissions an array of PermissionModels that define which permissions in which ! projects are required. ! * @param requireAll true if the user must possess any of the permissions, false if only one is required ! * @param activeOnly true if only users listed as active should be returned ! * @param reqSource the source of the request (eg web, api) ! * @return an array of UserModels ! * @throws AuthenticatorException an error occurs ! */ ! public abstract UserModel[] getUsersWithProjectPermission(PermissionModel[] permissions, boolean requireAll, boolean activeOnly, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to determine if a user is authorized to self register. ! * @param user a UserModel object that contains the data the user submitted ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a boolean whether the user should be allowed to register ! * @throws AuthenticatorException an exception if an error occurs ! */ ! public abstract boolean allowRegistration(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overwritten to return if any new user profile should be allowed ! * to be created. ! * @param user a UserModel object that contains the data for the new user. If null, ! then the request is being made for an unknown future user. For example, ! the system may request this with an null user if it needs to know if the system ! should even present the option to create a new user ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a boolean whether the new profile creation is allowed ! * @throws AuthenticatorException an exception if an error occurs ! */ ! public abstract boolean allowProfileCreation(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to return if the particular user can have ! * core profile information updates on the system. ! * @param user a UserModel object that contains the current user data ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a boolean whether the user's core profile information can be updated ! * @throws AuthenticatorException an exception if an error occurs ! * @see PluggableAuthentication#allowPasswordUpdates ! * @see PluggableAuthentication#allowPermissionUpdates ! * @see PluggableAuthentication#allowPreferenceUpdates ! */ ! public abstract boolean allowProfileUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to return if the particular user profile can have ! * password updates on the system. ! * @param user a UserModel object that contains the current user data ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a boolean whether the user's core profile information can be updated ! * @throws AuthenticatorException an exception if an error occurs ! * @see PluggableAuthentication#allowProfileUpdates ! * @see PluggableAuthentication#allowPermissionUpdates ! * @see PluggableAuthentication#allowPreferenceUpdates ! */ ! public abstract boolean allowPasswordUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to return if the particular user profile can have ! * permission updates on the system. ! * information is allowed to be updated through ITracker. ! * @param user a UserModel object that contains the current user data, or null if multiple users ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a boolean whether the user's core profile information can be updated ! * @throws AuthenticatorException an exception if an error occurs ! * @see PluggableAuthentication#allowProfileUpdates ! * @see PluggableAuthentication#allowPasswordUpdates ! * @see PluggableAuthentication#allowPreferenceUpdates ! */ ! public abstract boolean allowPermissionUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be implemented to determine if the particular user can have ! * preferences updates on the system. ! * @param user a UserModel object that contains the current user data ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a boolean whether the user's core profile information can be updated ! * @throws AuthenticatorException an exception if an error occurs ! * @see PluggableAuthentication#allowProfileUpdates ! * @see PluggableAuthentication#allowPasswordUpdates ! * @see PluggableAuthentication#allowPermissionUpdates ! */ ! public abstract boolean allowPreferenceUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to perform any updates that are necessary in the authentication ! * system to support a new user. Any changes should be made directly to user model supplied to the ! * method. The system will then update the information in the ITracker datastore. Only changes to the ! * core profile information and password are made here. Any permission information for the new user ! * whould be done through an updateProfile call. ! * @param user a UserModel object that contains the profile information to be created ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return true if changes were made ! * @throws AuthenticatorException an error occurs ! * @see PluggableAuthenticator#updateProfile ! */ ! public abstract boolean createProfile(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to perform any updates that are necessary in the authentication ! * system to support the updated user information. This action will be called any time there are any ! * updates to a user includeing core profile information, password information, permission information ! * or preference changes. Any changes should be made directly to user model supplied to the method. ! * @param user a UserModel object that contains the updated profile ! * @param updateType the type of information that is being updated ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return true if changes were made ! * @throws AuthenticatorException an exception if the login is unsuccessful, or an error occurs ! */ ! public abstract boolean updateProfile(UserModel user, int updateType, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method is called after creating a new instance of the Authenticator. It supplies ! * some default EJB objects that the authenticator can use. ! */ public void initialize(HashMap values) { if(values != null) { Object userHandler = values.get("userHandler"); Object systemConfiguration = values.get("systemConfiguration"); ! if(userHandler instanceof UserHandler) { this.userHandler = (UserHandler) userHandler; --- 25,207 ---- import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; import cowsultants.itracker.ejb.client.interfaces.UserHandler; import cowsultants.itracker.ejb.client.util.AuthenticationConstants; + import java.util.Collection; /** ! * This class provides a skeleton implementation of the PluggableAuthenticator interface. ! * It can be extended to provide a new authentication module for ITracker reducing the amount ! * of effort to implement the PluggableAuthenticator interface. ! */ public abstract class AbstractPluggableAuthenticator implements PluggableAuthenticator, AuthenticationConstants { private UserHandler userHandler = null; private SystemConfiguration systemConfiguration = null; ! public AbstractPluggableAuthenticator() { } ! /** ! * This method should be overridden to determine if a user login is successful. The method ! * should return a valid UserModel object. ! * @param login the login the user/client provided ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a UserBean if the login is successful ! * @throws AuthenticatorException an exception if the login is unsuccessful, or an error occurs ! */ ! public abstract UserBean checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to return all the permissions a user has in the ! * authentication system. This list may then be augmented based on other attributes of ! * the user, or project level options. ! * @param user a UserBean object that contains the user to retrieve permissions for ! * @param reqSource the source of the request (eg web, api) ! * @return an collection of PermissionBeans ! * @throws AuthenticatorException an error occurs ! */ ! public abstract Collection getUserPermissions(UserBean user, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to return an array of users that have certian permissions ! * in the authentication system. This list must always include all super users, even if they ! * do not explicitly have the required permission. ! * @param permissions a collection of PermissionBeans that define which permissions in which ! * projects are required. ! * @param requireAll true if the user must possess any of the permissions, false if only one is required ! * @param activeOnly true if only users listed as active should be returned ! * @param reqSource the source of the request (eg web, api) ! * @return an array of UserBeans ! * @throws AuthenticatorException an error occurs ! */ ! public abstract Collection getUsersWithProjectPermission(Collection permissions, boolean requireAll, boolean activeOnly, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to determine if a user is authorized to self register. ! * @param user a UserModel object that contains the data the user submitted ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a boolean whether the user should be allowed to register ! * @throws AuthenticatorException an exception if an error occurs ! */ ! public abstract boolean allowRegistration(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overwritten to return if any new user profile should be allowed ! * to be created. ! * @param user a UserBean object that contains the data for the new user. If null, ! * then the request is being made for an unknown future user. For example, ! * the system may request this with an null user if it needs to know if the system ! * should even present the option to create a new user ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a boolean whether the new profile creation is allowed ! * @throws AuthenticatorException an exception if an error occurs ! */ ! public abstract boolean allowProfileCreation(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to return if the particular user can have ! * core profile information updates on the system. ! * @param user a UserBean object that contains the current user data ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a boolean whether the user's core profile information can be updated ! * @throws AuthenticatorException an exception if an error occurs ! * @see PluggableAuthentication#allowPasswordUpdates ! * @see PluggableAuthentication#allowPermissionUpdates ! * @see PluggableAuthentication#allowPreferenceUpdates ! */ ! public abstract boolean allowProfileUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to return if the particular user profile can have ! * password updates on the system. ! * @param user a UserBean object that contains the current user data ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a boolean whether the user's core profile information can be updated ! * @throws AuthenticatorException an exception if an error occurs ! * @see PluggableAuthentication#allowProfileUpdates ! * @see PluggableAuthentication#allowPermissionUpdates ! * @see PluggableAuthentication#allowPreferenceUpdates ! */ ! public abstract boolean allowPasswordUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to return if the particular user profile can have ! * permission updates on the system. ! * information is allowed to be updated through ITracker. ! * @param user a UserBean object that contains the current user data, or null if multiple users ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a boolean whether the user's core profile information can be updated ! * @throws AuthenticatorException an exception if an error occurs ! * @see PluggableAuthentication#allowProfileUpdates ! * @see PluggableAuthentication#allowPasswordUpdates ! * @see PluggableAuthentication#allowPreferenceUpdates ! */ ! public abstract boolean allowPermissionUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be implemented to determine if the particular user can have ! * preferences updates on the system. ! * @param user a UserBean object that contains the current user data ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return a boolean whether the user's core profile information can be updated ! * @throws AuthenticatorException an exception if an error occurs ! * @see PluggableAuthentication#allowProfileUpdates ! * @see PluggableAuthentication#allowPasswordUpdates ! * @see PluggableAuthentication#allowPermissionUpdates ! */ ! public abstract boolean allowPreferenceUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to perform any updates that are necessary in the authentication ! * system to support a new user. Any changes should be made directly to user model supplied to the ! * method. The system will then update the information in the ITracker datastore. Only changes to the ! * core profile information and password are made here. Any permission information for the new user ! * whould be done through an updateProfile call. ! * @param user a UserBean object that contains the profile information to be created ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return true if changes were made ! * @throws AuthenticatorException an error occurs ! * @see PluggableAuthenticator#updateProfile ! */ ! public abstract boolean createProfile(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method should be overridden to perform any updates that are necessary in the authentication ! * system to support the updated user information. This action will be called any time there are any ! * updates to a user includeing core profile information, password information, permission information ! * or preference changes. Any changes should be made directly to user model supplied to the method. ! * @param user a UserBean object that contains the updated profile ! * @param updateType the type of information that is being updated ! * @param authentication the user's authentication information, if known ! * @param authType the type of authentication information being provided ! * @param reqSource the source of the request (eg web, api) ! * @return true if changes were made ! * @throws AuthenticatorException an exception if the login is unsuccessful, or an error occurs ! */ ! public abstract boolean updateProfile(UserBean user, int updateType, Object authentication, int authType, int reqSource) throws AuthenticatorException; ! /** ! * This method is called after creating a new instance of the Authenticator. It supplies ! * some default objects that the authenticator can use. ! */ public void initialize(HashMap values) { if(values != null) { Object userHandler = values.get("userHandler"); Object systemConfiguration = values.get("systemConfiguration"); ! if(userHandler instanceof UserHandler) { this.userHandler = (UserHandler) userHandler; *************** *** 212,238 **** } } ! /** ! * Returns a UserHandler session bean that can be used to call needed methods such ! * as retrieving a user. ! */ public UserHandler getUserHandler() throws AuthenticatorException { if(userHandler == null || ! (userHandler instanceof UserHandler)) { throw new AuthenticatorException(AuthenticatorException.SYSTEM_ERROR); } ! return userHandler; } ! /** ! * Returns an SystemConfiguration session bean that can be used to retreive properties ! * that have been set in the system. These properties can be used to provide any ! * needed configuration for the authenticator. ! */ public SystemConfiguration getSystemConfiguration() throws AuthenticatorException { if(systemConfiguration == null || ! (systemConfiguration instanceof SystemConfiguration)) { throw new AuthenticatorException(AuthenticatorException.SYSTEM_ERROR); } ! return systemConfiguration; } --- 212,238 ---- } } ! /** ! * Returns a UserHandler session bean that can be used to call needed methods such ! * as retrieving a user. ! */ public UserHandler getUserHandler() throws AuthenticatorException { if(userHandler == null || ! (userHandler instanceof UserHandler)) { throw new AuthenticatorException(AuthenticatorException.SYSTEM_ERROR); } ! return userHandler; } ! /** ! * Returns an SystemConfiguration session bean that can be used to retreive properties ! * that have been set in the system. These properties can be used to provide any ! * needed configuration for the authenticator. ! */ public SystemConfiguration getSystemConfiguration() throws AuthenticatorException { if(systemConfiguration == null || ! (systemConfiguration instanceof SystemConfiguration)) { throw new AuthenticatorException(AuthenticatorException.SYSTEM_ERROR); } ! return systemConfiguration; } Index: DefaultAuthenticator.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/authentication/DefaultAuthenticator.java,v retrieving revision 1.18.4.2 retrieving revision 1.18.4.2.2.1 diff -C2 -d -r1.18.4.2 -r1.18.4.2.2.1 *** DefaultAuthenticator.java 13 Oct 2005 14:26:54 -0000 1.18.4.2 --- DefaultAuthenticator.java 6 Dec 2005 12:38:00 -0000 1.18.4.2.2.1 *************** *** 19,22 **** --- 19,26 ---- package cowsultants.itracker.ejb.authentication; + import cowsultants.itracker.ejb.beans.entity.PermissionBean; + import cowsultants.itracker.ejb.beans.entity.UserBean; + import java.util.ArrayList; + import java.util.Collection; import java.util.HashMap; import java.util.Iterator; *************** *** 26,31 **** import cowsultants.itracker.ejb.client.exceptions.PasswordException; import cowsultants.itracker.ejb.client.exceptions.UserException; - import cowsultants.itracker.ejb.client.models.PermissionModel; - import cowsultants.itracker.ejb.client.models.UserModel; import cowsultants.itracker.ejb.client.util.Logger; import cowsultants.itracker.ejb.client.util.UserUtilities; --- 30,33 ---- *************** *** 48,59 **** * @param authType the type of authentication information being provided * @param reqSource the source of the request (eg web, api) ! * @return a UserModel if the login is successful * @throws AuthenticatorException an exception if the login is unsuccessful, or an error occurs */ ! public UserModel checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException { Logger.logDebug("Checking login for " + login + " using DefaultAuthenticator"); if(login != null && authentication != null && ! login.equals("")) { ! UserModel user = null; try { user = getUserHandler().getUserByLogin(login); --- 50,61 ---- * @param authType the type of authentication information being provided * @param reqSource the source of the request (eg web, api) ! * @return a UserBean if the login is successful * @throws AuthenticatorException an exception if the login is unsuccessful, or an error occurs */ ! public UserBean checkLogin(String login, Object authentication, int authType, int reqSource) throws AuthenticatorException { Logger.logDebug("Checking login for " + login + " using DefaultAuthenticator"); if(login != null && authentication != null && ! login.equals("")) { ! UserBean user = null; try { user = getUserHandler().getUserByLogin(login); *************** *** 116,162 **** /** * The DefaultAuthenticator returns a list of user permissions from the database. ! * @param user a UserModel object that contains the user to retrieve permissions for * @param reqSource the source of the request (eg web, api) * @return an array of PermissionModels * @throws AuthenticatorException an error occurs */ ! public PermissionModel[] getUserPermissions(UserModel user, int reqSource) throws AuthenticatorException { if(user == null || user.getId() == null) { throw new AuthenticatorException(AuthenticatorException.INVALID_DATA); } ! PermissionModel[] permissionArray = new PermissionModel[0]; try { ! permissionArray = getUserHandler().getUserPermissionsLocal(user); } catch (DataException e) { throw new AuthenticatorException(e.getMessage(), reqSource); } ! if(user.isSuperUser()) { ! PermissionModel[] augmentedPermissions = new PermissionModel[permissionArray.length + 1]; ! augmentedPermissions[0] = new PermissionModel(new Integer(-1), -1, user.getLogin(), user.getId()); ! System.arraycopy(permissionArray, 0, augmentedPermissions, 1, permissionArray.length); ! permissionArray = augmentedPermissions; } ! return permissionArray; } ! public UserModel[] getUsersWithProjectPermission(PermissionModel[] permissions, boolean requireAll, boolean activeOnly, int reqSource) throws AuthenticatorException { ! UserModel[] userArray = new UserModel[0]; try { HashMap userMap = new HashMap(); ! for(int i = 0; i < permissions.length; i++) { ! UserModel[] explicitUsers = getUserHandler().getUsersWithPermissionLocal(permissions[i]); ! if(! requireAll || permissions.length == 1) { ! for(int j = 0; j < explicitUsers.length; j++) { ! userMap.put(explicitUsers[j].getId(), explicitUsers[j]); } } else { ! if(i == 0) { ! for(int j = 0; j < explicitUsers.length; j++) { ! userMap.put(explicitUsers[j].getId(), explicitUsers[j]); } } else { --- 118,178 ---- /** * The DefaultAuthenticator returns a list of user permissions from the database. ! * @param user a UserBean object that contains the user to retrieve permissions for * @param reqSource the source of the request (eg web, api) * @return an array of PermissionModels * @throws AuthenticatorException an error occurs */ ! public Collection getUserPermissions(UserBean user, int reqSource) throws AuthenticatorException { if(user == null || user.getId() == null) { throw new AuthenticatorException(AuthenticatorException.INVALID_DATA); } ! Collection permissions = null; try { ! permissions = getUserHandler().getUserPermissionsLocal(user); } catch (DataException e) { throw new AuthenticatorException(e.getMessage(), reqSource); } ! //@todo why is super user an int now and what to compare to? ! if(user.getSuperUser() == 1) { ! PermissionBean adminPermission = new PermissionBean(); ! adminPermission.setId(new Integer(-1)); ! adminPermission.setPermissionType(-1); ! adminPermission.setUser(user); ! ArrayList augmentedPermissions = new ArrayList(); ! augmentedPermissions.add(adminPermission); ! augmentedPermissions.addAll(permissions); ! ! permissions = augmentedPermissions; } ! return permissions; } ! public Collection getUsersWithProjectPermission(Collection permissions, boolean requireAll, boolean activeOnly, int reqSource) throws AuthenticatorException { ! ArrayList userArray = new ArrayList(); try { HashMap userMap = new HashMap(); ! Iterator permissionIter = permissions.iterator(); ! boolean isFirstIteration = true; ! while(permissionIter.hasNext()) { ! PermissionBean currentPermission = (PermissionBean) permissionIter.next(); ! ! Collection explicitUsers = getUserHandler().getUsersWithPermissionLocal(currentPermission); ! if(! requireAll || permissions.size() == 1) { ! Iterator userIter = explicitUsers.iterator(); ! while(userIter.hasNext()) { ! UserBean currentUser = (UserBean) userIter.next(); ! userMap.put(currentUser.getId(), currentUser); } } else { ! if(isFirstIteration) { ! Iterator userIter = explicitUsers.iterator(); ! while(userIter.hasNext()) { ! UserBean currentUser = (UserBean) userIter.next(); ! userMap.put(currentUser.getId(), currentUser); } } else { *************** *** 164,169 **** boolean found = false; Integer userId = (Integer) iter.next(); ! for(int j = 0; j < explicitUsers.length; j++) { ! if(userId.equals(explicitUsers[j].getId())) { found = true; break; --- 180,187 ---- boolean found = false; Integer userId = (Integer) iter.next(); ! Iterator userIter = explicitUsers.iterator(); ! while(userIter.hasNext()) { ! UserBean currentUser = (UserBean) userIter.next(); ! if(userId.equals(currentUser.getId())) { found = true; break; *************** *** 176,193 **** } } } ! UserModel[] superUsers = getUserHandler().getSuperUsers(); ! for(int i = 0; i < superUsers.length; i++) { ! if(! activeOnly || superUsers[i].getStatus() == UserUtilities.STATUS_ACTIVE) { ! userMap.put(superUsers[i].getId(), superUsers[i]); } } ! int i = 0; ! userArray = new UserModel[userMap.size()]; ! for(Iterator iter = userMap.values().iterator(); iter.hasNext(); i++) { ! userArray[i] = (UserModel) iter.next(); ! } } catch(Exception e) { Logger.logDebug("Error retreiving users with permissions.", e); --- 194,211 ---- } } + + isFirstIteration = false; } ! Collection superUsers = getUserHandler().getSuperUsers(); ! Iterator superUsersIter = superUsers.iterator(); ! while(superUsersIter.hasNext()) { ! UserBean superUser = (UserBean) superUsersIter.next(); ! if(! activeOnly || superUser.getStatus() == UserUtilities.STATUS_ACTIVE) { ! userMap.put(superUser.getId(), superUser); } } ! userArray.addAll(userMap.values()); } catch(Exception e) { Logger.logDebug("Error retreiving users with permissions.", e); *************** *** 200,204 **** /** * The DefaultAuthenticator always allows self registered users. ! * @param user a UserModel object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 218,222 ---- /** * The DefaultAuthenticator always allows self registered users. ! * @param user a UserBean object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 206,210 **** * @return true */ ! public boolean allowRegistration(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return true; } --- 224,228 ---- * @return true */ ! public boolean allowRegistration(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return true; } *************** *** 213,217 **** /** * The DefaultAuthenticator always allows new user profiles. ! * @param user a UserModel object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 231,235 ---- /** * The DefaultAuthenticator always allows new user profiles. ! * @param user a UserBean object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 219,223 **** * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowProfileCreation(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return true; } --- 237,241 ---- * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowProfileCreation(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return true; } *************** *** 225,229 **** /** * The DefaultAuthenticator always allows profile updates. ! * @param user a UserModel object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 243,247 ---- /** * The DefaultAuthenticator always allows profile updates. ! * @param user a UserBean object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 232,236 **** * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowProfileUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return true; } --- 250,254 ---- * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowProfileUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return true; } *************** *** 238,242 **** /** * The DefaultAuthenticator always allows password updates. ! * @param user a UserModel object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided --- 256,260 ---- /** * The DefaultAuthenticator always allows password updates. ! * @param user a UserBean object that contains the data the user submitted * @param authentication the user's authentication information, if known * @param authType the type of authentication information being provided *************** *** 245,249 **** * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowPasswordUpdates(UserModel user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return true; } --- 263,267 ---- * @throws AuthenticatorException an exception if an error occurs */ ! public boolean allowPasswordUpdates(UserBean user, Object authentication, int authType, int reqSource) throws AuthenticatorException { return true; } *************** *** 251,255 **** /** * The ... [truncated message content] |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:17
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/message In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/ejb/beans/message Modified Files: Tag: itrackerhnodto NotificationMessageBean.java Log Message: removal of value objects Index: NotificationMessageBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/message/NotificationMessageBean.java,v retrieving revision 1.24.4.3 retrieving revision 1.24.4.3.2.1 diff -C2 -d -r1.24.4.3 -r1.24.4.3.2.1 *** NotificationMessageBean.java 30 Oct 2005 18:46:36 -0000 1.24.4.3 --- NotificationMessageBean.java 6 Dec 2005 12:38:01 -0000 1.24.4.3.2.1 *************** *** 19,25 **** --- 19,32 ---- package cowsultants.itracker.ejb.beans.message; + import cowsultants.itracker.ejb.beans.entity.ComponentBean; + import cowsultants.itracker.ejb.beans.entity.IssueBean; + import cowsultants.itracker.ejb.beans.entity.IssueHistoryBean; + import cowsultants.itracker.ejb.beans.entity.NotificationBean; + import cowsultants.itracker.ejb.beans.entity.VersionBean; import java.io.ByteArrayInputStream; import java.io.ObjectInputStream; + import java.util.Collection; import java.util.HashSet; + import java.util.Iterator; import javax.ejb.EJBException; *************** *** 37,45 **** import cowsultants.itracker.ejb.client.interfaces.IssueHandler; import cowsultants.itracker.ejb.client.interfaces.SystemConfiguration; - import cowsultants.itracker.ejb.client.models.ComponentModel; - import cowsultants.itracker.ejb.client.models.IssueHistoryModel; - import cowsultants.itracker.ejb.client.models.IssueModel; - import cowsultants.itracker.ejb.client.models.NotificationModel; - import cowsultants.itracker.ejb.client.models.VersionModel; import cowsultants.itracker.ejb.client.resources.ITrackerResources; import cowsultants.itracker.ejb.client.util.EmailHandler; --- 44,47 ---- *************** *** 71,75 **** jndiContext = new InitialContext(); - SystemConfiguration sc = new SystemConfigurationBean(); --- 73,76 ---- *************** *** 122,126 **** try { HashSet addresses = null; ! NotificationModel[] notifications; Integer issueId = (Integer) notificationMsg.getObject("issueId"); --- 123,127 ---- try { HashSet addresses = null; ! Collection notifications; Integer issueId = (Integer) notificationMsg.getObject("issueId"); *************** *** 145,177 **** addresses = new HashSet(); notifications = ih.getIssueNotifications(issueId); ! for(int i = 0; i < notifications.length; i++) { ! if(notifications[i].getUserEmail() != null && notifications[i].getUserEmail().indexOf('@') >= 0) { ! addresses.add(notifications[i].getUserEmail()); } } } ! IssueModel issue = ih.getIssue(issueId); ! IssueActivityBean[] activity = ih.getIssueActivity(issueId, false); ! IssueHistoryModel history = ih.getLastIssueHistory(issueId); ! ComponentModel[] components = ih.getIssueComponents(issueId); ! VersionModel[] versions = ih.getIssueVersions(issueId); if(addresses.size() > 0) { String subject = ""; if(type == NotificationUtilities.TYPE_CREATED) { subject = ITrackerResources.getString("itracker.email.issue.subject.created", ! new Object[] {issue.getId(), issue.getProjectName(), lastModifiedDays}); } else if(type == NotificationUtilities.TYPE_ASSIGNED) { subject = ITrackerResources.getString("itracker.email.issue.subject.assigned", ! new Object[] {issue.getId(), issue.getProjectName(), lastModifiedDays}); } else if(type == NotificationUtilities.TYPE_CLOSED) { subject = ITrackerResources.getString("itracker.email.issue.subject.closed", ! new Object[] {issue.getId(), issue.getProjectName(), lastModifiedDays}); } else if(type == NotificationUtilities.TYPE_ISSUE_REMINDER) { subject = ITrackerResources.getString("itracker.email.issue.subject.reminder", ! new Object[] {issue.getId(), issue.getProjectName(), lastModifiedDays}); } else { subject = ITrackerResources.getString("itracker.email.issue.subject.updated", ! new Object[] {issue.getId(), issue.getProjectName(), lastModifiedDays}); } --- 146,182 ---- addresses = new HashSet(); notifications = ih.getIssueNotifications(issueId); ! Iterator iter = notifications.iterator(); ! while(iter.hasNext()) { ! NotificationBean notification = (NotificationBean) iter.next(); ! if(notification.getUser() != null && ! notification.getUser().getEmail() != null && ! notification.getUser().getEmail().indexOf('@') >= 0) { ! addresses.add(notification.getUser().getEmail()); } } } ! IssueBean issue = ih.getIssue(issueId); ! Collection activity = ih.getIssueActivity(issueId, false); ! IssueHistoryBean history = ih.getLastIssueHistory(issueId); ! Collection components = ih.getIssueComponents(issueId); ! Collection versions = ih.getIssueVersions(issueId); if(addresses.size() > 0) { String subject = ""; if(type == NotificationUtilities.TYPE_CREATED) { subject = ITrackerResources.getString("itracker.email.issue.subject.created", ! new Object[] {issue.getId(), issue.getProject().getName(), lastModifiedDays}); } else if(type == NotificationUtilities.TYPE_ASSIGNED) { subject = ITrackerResources.getString("itracker.email.issue.subject.assigned", ! new Object[] {issue.getId(), issue.getProject().getName(), lastModifiedDays}); } else if(type == NotificationUtilities.TYPE_CLOSED) { subject = ITrackerResources.getString("itracker.email.issue.subject.closed", ! new Object[] {issue.getId(), issue.getProject().getName(), lastModifiedDays}); } else if(type == NotificationUtilities.TYPE_ISSUE_REMINDER) { subject = ITrackerResources.getString("itracker.email.issue.subject.reminder", ! new Object[] {issue.getId(), issue.getProject().getName(), lastModifiedDays}); } else { subject = ITrackerResources.getString("itracker.email.issue.subject.updated", ! new Object[] {issue.getId(), issue.getProject().getName(), lastModifiedDays}); } *************** *** 180,191 **** String componentString = ""; String versionString = ""; ! for(int i = 0; i < activity.length; i++) { ! activityString += IssueUtilities.getActivityName(activity[i].getType()) + ": " + activity[i].getDescription() + "\n"; } ! for(int i = 0; i < components.length; i++) { ! componentString += (i != 0 ? ", " : "") + components[i].getName(); } ! for(int i = 0; i < versions.length; i++) { ! versionString += (i != 0 ? ", " : "") + versions[i].getNumber(); } --- 185,212 ---- String componentString = ""; String versionString = ""; ! ! Iterator activityIter = activity.iterator(); ! while(activityIter.hasNext()) { ! IssueActivityBean bean = (IssueActivityBean) activityIter.next(); ! activityString += IssueUtilities.getActivityName(bean.getType()) + ": " + bean.getDescription() + "\n"; } ! ! Iterator iter = components.iterator(); ! boolean isFirst = true; ! while(iter.hasNext()) { ! ComponentBean cb = (ComponentBean) iter.next(); ! componentString += (!isFirst ? ", " : "") + cb.getName(); ! ! if(isFirst) { ! isFirst = false; ! } } ! ! Iterator versionIter = versions.iterator(); ! isFirst = true; ! while(versionIter.hasNext()) { ! VersionBean bean = (VersionBean) versionIter.next(); ! versionString += (isFirst ? ", " : "") + bean.getNumber(); ! isFirst = false; } *************** *** 194,204 **** msgText = ITrackerResources.getString("itracker.email.issue.body.reminder", new Object[] {url + "/view_issue.jsp?id=" + issue.getId(), ! issue.getProjectName(), issue.getDescription(), IssueUtilities.getStatusName(issue.getStatus()), IssueUtilities.getSeverityName(issue.getSeverity()), ! (issue.getOwnerFirstName() != null ? issue.getOwnerFirstName() : "") + " " + (issue.getOwnerLastName() != null ? issue.getOwnerLastName() : ""), componentString, ! (history == null ? "" : history.getUserFirstName() + " " + history.getUserLastName()), (history == null ? "" : HTMLUtilities.removeMarkup(history.getDescription())), lastModifiedDays, --- 215,225 ---- msgText = ITrackerResources.getString("itracker.email.issue.body.reminder", new Object[] {url + "/view_issue.jsp?id=" + issue.getId(), ! issue.getProject().getName(), issue.getDescription(), IssueUtilities.getStatusName(issue.getStatus()), IssueUtilities.getSeverityName(issue.getSeverity()), ! (issue.getOwner().getFirstName() != null ? issue.getOwner().getFirstName() : "") + " " + (issue.getOwner().getLastName() != null ? issue.getOwner().getLastName() : ""), componentString, ! (history == null ? "" : history.getUser().getFirstName() + " " + history.getUser().getLastName()), (history == null ? "" : HTMLUtilities.removeMarkup(history.getDescription())), lastModifiedDays, *************** *** 213,224 **** msgText = ITrackerResources.getString("itracker.email.issue.body.standard", new Object[] {url + "/view_issue.jsp?id=" + issue.getId() + "&authtype=5", ! issue.getProjectName(), issue.getDescription(), IssueUtilities.getStatusName(issue.getStatus()), resolution, IssueUtilities.getSeverityName(issue.getSeverity()), ! (issue.getOwnerFirstName() != null ? issue.getOwnerFirstName() : "") + " " + (issue.getOwnerLastName() != null ? issue.getOwnerLastName() : ""), componentString, ! (history == null ? "" : history.getUserFirstName() + " " + history.getUserLastName()), (history == null ? "" : HTMLUtilities.removeMarkup(history.getDescription())), activityString --- 234,245 ---- msgText = ITrackerResources.getString("itracker.email.issue.body.standard", new Object[] {url + "/view_issue.jsp?id=" + issue.getId() + "&authtype=5", ! issue.getProject().getName(), issue.getDescription(), IssueUtilities.getStatusName(issue.getStatus()), resolution, IssueUtilities.getSeverityName(issue.getSeverity()), ! (issue.getOwner().getFirstName() != null ? issue.getOwner().getFirstName() : "") + " " + (issue.getOwner().getLastName() != null ? issue.getOwner().getLastName() : ""), componentString, ! (history == null ? "" : history.getUser().getFirstName() + " " + history.getUser().getLastName()), (history == null ? "" : HTMLUtilities.removeMarkup(history.getDescription())), activityString |
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/entity In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/ejb/beans/entity Modified Files: Tag: itrackerhnodto ComponentBean.java ConfigurationBean.java CustomFieldBean.java CustomFieldValueBean.java GenericBean.java IssueAttachmentBean.java IssueBean.java IssueFieldBean.java IssueHistoryBean.java IssueRelationBean.java LanguageBean.java NotificationBean.java PermissionBean.java ProjectBean.java ProjectScriptBean.java ReportBean.java ScheduledTaskBean.java UserBean.java UserPreferencesBean.java VersionBean.java WorkflowScriptBean.java Log Message: removal of value objects Index: PermissionBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/entity/PermissionBean.java,v retrieving revision 1.6.4.1 retrieving revision 1.6.4.1.2.1 diff -C2 -d -r1.6.4.1 -r1.6.4.1.2.1 *** PermissionBean.java 11 Oct 2005 01:21:04 -0000 1.6.4.1 --- PermissionBean.java 6 Dec 2005 12:38:01 -0000 1.6.4.1.2.1 *************** *** 1,73 **** ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Date; ! ! import cowsultants.itracker.ejb.client.models.PermissionModel; ! ! public class PermissionBean extends GenericBean { ! ! public int permissionType; ! public UserBean user; ! public ProjectBean project; ! ! public int getPermissionType() { ! return permissionType; ! } ! ! public void setPermissionType(int permissionType) { ! this.permissionType = permissionType; ! } ! ! public ProjectBean getProject() { ! return project; ! } ! ! public void setProject(ProjectBean project) { ! this.project = project; ! } ! ! public UserBean getUser() { ! return user; ! } ! ! public void setUser(UserBean user) { ! this.user = user; ! } ! ! public PermissionModel getModel() { ! PermissionModel model = new PermissionModel(); ! model.setId(this.getId()); ! model.setPermissionType(this.getPermissionType()); ! model.setUserLogin(this.getUser().getLogin()); ! model.setUserId(this.getUser().getId()); ! model.setProjectId(this.getProject().getId()); ! model.setLastModifiedDate(this.getLastModifiedDate()); ! model.setCreateDate(this.getCreateDate()); ! return model; ! } ! ! public void setModel(PermissionModel model) { ! this.setPermissionType(model.getPermissionType()); ! this.setLastModifiedDate(new Timestamp(new Date().getTime())); ! } ! ! } --- 1,54 ---- ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Date; ! ! public class PermissionBean extends GenericBean { ! ! public int permissionType; ! public UserBean user; ! public ProjectBean project; ! ! public int getPermissionType() { ! return permissionType; ! } ! ! public void setPermissionType(int permissionType) { ! this.permissionType = permissionType; ! } ! ! public ProjectBean getProject() { ! return project; ! } ! ! public void setProject(ProjectBean project) { ! this.project = project; ! } ! ! public UserBean getUser() { ! return user; ! } ! ! public void setUser(UserBean user) { ! this.user = user; ! } ! } ! Index: IssueHistoryBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/entity/IssueHistoryBean.java,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.1.2.1 diff -C2 -d -r1.7.4.1 -r1.7.4.1.2.1 *** IssueHistoryBean.java 11 Oct 2005 01:21:04 -0000 1.7.4.1 --- IssueHistoryBean.java 6 Dec 2005 12:38:01 -0000 1.7.4.1.2.1 *************** *** 1,88 **** ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Date; ! ! import cowsultants.itracker.ejb.client.models.IssueHistoryModel; ! ! public class IssueHistoryBean extends GenericBean { ! ! public String description; ! public int status; ! public IssueBean issue; ! public UserBean user; ! ! public String getDescription() { ! return description; ! } ! ! public void setDescription(String description) { ! this.description = description; ! } ! ! public IssueBean getIssue() { ! return issue; ! } ! ! public void setIssue(IssueBean issue) { ! this.issue = issue; ! } ! ! public int getStatus() { ! return status; ! } ! ! public void setStatus(int status) { ! this.status = status; ! } ! ! public UserBean getUser() { ! return user; ! } ! ! public void setUser(UserBean user) { ! this.user = user; ! } ! ! public IssueHistoryModel getModel() { ! IssueHistoryModel model = new IssueHistoryModel(); ! model.setId(this.getId()); ! model.setDescription(this.getDescription()); ! model.setStatus(this.getStatus()); ! model.setLastModifiedDate(this.getLastModifiedDate()); ! model.setCreateDate(this.getCreateDate()); ! ! model.setIssueId(this.getIssue().getId()); ! ! if(this.getUser() != null) { ! model.setUser(this.getUser().getModel()); ! } ! ! return model; ! } ! ! public void setModel(IssueHistoryModel model) { ! this.setDescription(model.getDescription()); ! this.setStatus(model.getStatus()); ! this.setLastModifiedDate(new Timestamp(new Date().getTime())); ! } ! ! } --- 1,63 ---- ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Date; ! ! public class IssueHistoryBean extends GenericBean { ! ! public String description; ! public int status; ! public IssueBean issue; ! public UserBean user; ! ! public String getDescription() { ! return description; ! } ! ! public void setDescription(String description) { ! this.description = description; ! } ! ! public IssueBean getIssue() { ! return issue; ! } ! ! public void setIssue(IssueBean issue) { ! this.issue = issue; ! } ! ! public int getStatus() { ! return status; ! } ! ! public void setStatus(int status) { ! this.status = status; ! } ! ! public UserBean getUser() { ! return user; ! } ! ! public void setUser(UserBean user) { ! this.user = user; ! } ! } ! Index: VersionBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/entity/VersionBean.java,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.1.2.1 diff -C2 -d -r1.7.4.1 -r1.7.4.1.2.1 *** VersionBean.java 11 Oct 2005 01:21:04 -0000 1.7.4.1 --- VersionBean.java 6 Dec 2005 12:38:01 -0000 1.7.4.1.2.1 *************** *** 1,115 **** ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Collection; ! import java.util.Date; ! ! import cowsultants.itracker.ejb.client.models.VersionModel; ! ! public class VersionBean extends GenericBean { ! ! private String number; ! ! private int major; ! ! private int minor; ! ! private String description; ! ! private ProjectBean project; ! ! private Collection issues; ! ! public String getDescription() { ! return description; ! } ! ! public void setDescription(String getDescription) { ! this.description = getDescription; ! } ! ! public Collection getIssues() { ! return issues; ! } ! ! public void setIssues(Collection getIssues) { ! this.issues = getIssues; ! } ! ! public int getMajor() { ! return major; ! } ! ! public void setMajor(int getMajor) { ! this.major = getMajor; ! } ! ! public int getMinor() { ! return minor; ! } ! ! public void setMinor(int getMinor) { ! this.minor = getMinor; ! } ! ! public String getNumber() { ! return number; ! } ! ! public void setNumber(String getNumber) { ! this.number = getNumber; ! } ! ! public ProjectBean getProject() { ! return project; ! } ! ! public void setProject(ProjectBean getProject) { ! this.project = getProject; ! } ! ! public int getTotalNumberIssues() { ! return getIssues().size(); ! } ! ! public VersionModel getModel() { ! VersionModel model = new VersionModel(); ! model.setId(this.getId()); ! model.setNumber(this.getNumber()); ! model.setMajor(this.getMajor()); ! model.setMinor(this.getMinor()); ! model.setDescription(this.getDescription()); ! model.setLastModifiedDate(this.getLastModifiedDate()); ! model.setCreateDate(this.getCreateDate()); ! ! model.setProjectId(this.getProject().getId()); ! ! return model; ! } ! ! public void setModel(VersionModel model) { ! this.setNumber(model.getNumber()); ! this.setMajor(model.getMajor()); ! this.setMinor(model.getMinor()); ! this.setDescription(model.getDescription()); ! this.setLastModifiedDate(new Timestamp(new Date().getTime())); ! } } \ No newline at end of file --- 1,135 ---- ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Collection; ! import java.util.Comparator; ! import java.util.Date; ! ! ! public class VersionBean extends GenericBean { ! ! private String number; ! private int major; ! private int minor; ! private String description; ! private ProjectBean project; ! private Collection issues; ! ! public String getDescription() { ! return description; ! } ! ! public void setDescription(String getDescription) { ! this.description = getDescription; ! } ! ! public Collection getIssues() { ! return issues; ! } ! ! public void setIssues(Collection getIssues) { ! this.issues = getIssues; ! } ! ! public int getMajor() { ! return major; ! } ! ! public void setMajor(int getMajor) { ! this.major = getMajor; ! } ! ! public int getMinor() { ! return minor; ! } ! ! public void setMinor(int getMinor) { ! this.minor = getMinor; ! } ! ! public String getNumber() { ! return number; ! } ! ! public void setNumber(String getNumber) { ! this.number = getNumber; ! } ! ! public ProjectBean getProject() { ! return project; ! } ! ! public void setProject(ProjectBean getProject) { ! this.project = getProject; ! } ! ! public int getTotalNumberIssues() { ! return getIssues().size(); ! } ! ! public static class CompareByMajorMinor implements Comparator { ! private boolean isAscending = true; ! ! public CompareByMajorMinor() { ! } ! ! public CompareByMajorMinor(boolean isAscending) { ! setAscending(isAscending); ! } ! ! public void setAscending(boolean value) { ! this.isAscending = value; ! } ! ! public int compare(Object a, Object b) { ! int result = 0; ! ! if(! (a instanceof VersionBean) || ! (b instanceof VersionBean)) { ! throw new ClassCastException(); ! } ! ! VersionBean ma = (VersionBean) a; ! VersionBean mb = (VersionBean) b; ! ! if(ma.getMajor() == mb.getMajor()) { ! if(ma.getMinor() == mb.getMinor()) { ! if(ma.getNumber() == null) { ! result = -1; ! } else if(mb.getNumber() == null) { ! result = 1; ! } else { ! result = ma.getNumber().compareTo(mb.getNumber()); ! } ! } else if(ma.getMinor() > mb.getMinor()) { ! result = 1; ! } else { ! result = -1; ! } ! } else if(ma.getMajor() > mb.getMajor()) { ! result = 1; ! } else { ! result = -1; ! } ! ! return (isAscending ? result : result * -1); ! } ! } } \ No newline at end of file Index: IssueRelationBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/entity/IssueRelationBean.java,v retrieving revision 1.7.4.1 retrieving revision 1.7.4.1.2.1 diff -C2 -d -r1.7.4.1 -r1.7.4.1.2.1 *** IssueRelationBean.java 11 Oct 2005 01:21:04 -0000 1.7.4.1 --- IssueRelationBean.java 6 Dec 2005 12:38:01 -0000 1.7.4.1.2.1 *************** *** 1,118 **** ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Date; ! ! import cowsultants.itracker.ejb.client.models.IssueRelationModel; ! ! public class IssueRelationBean { ! ! public Integer id; ! public Integer matchingRelationId; ! public int relationType; ! public IssueBean issue; ! public IssueBean relatedIssue; ! public Timestamp createDate; ! public Timestamp lastModifiedDate; ! ! public Timestamp getCreateDate() { ! return createDate; ! } ! ! public void setCreateDate(Timestamp createDate) { ! this.createDate = createDate; ! } ! ! public Integer getId() { ! return id; ! } ! ! public void setId(Integer id) { ! this.id = id; ! } ! ! public IssueBean getIssue() { ! return issue; ! } ! ! public void setIssue(IssueBean issue) { ! this.issue = issue; ! } ! ! public Timestamp getLastModifiedDate() { ! return lastModifiedDate; ! } ! ! public void setLastModifiedDate(Timestamp lastModifiedDate) { ! this.lastModifiedDate = lastModifiedDate; ! } ! ! public Integer getMatchingRelationId() { ! return matchingRelationId; ! } ! ! public void setMatchingRelationId(Integer matchingRelationId) { ! this.matchingRelationId = matchingRelationId; ! } ! ! public IssueBean getRelatedIssue() { ! return relatedIssue; ! } ! ! public void setRelatedIssue(IssueBean relatedIssue) { ! this.relatedIssue = relatedIssue; ! } ! ! public int getRelationType() { ! return relationType; ! } ! ! public void setRelationType(int relationType) { ! this.relationType = relationType; ! } ! ! public IssueRelationModel getModel() { ! IssueRelationModel model = new IssueRelationModel(); ! model.setId(this.getId()); ! model.setRelationType(this.getRelationType()); ! model.setMatchingRelationId(this.getMatchingRelationId()); ! model.setLastModifiedDate(this.getLastModifiedDate()); ! model.setCreateDate(this.getCreateDate()); ! ! if(this.getIssue() != null) { ! model.setIssueId(this.getIssue().getId()); ! } ! ! IssueBean relatedIssue = getRelatedIssue(); ! if(relatedIssue != null) { ! model.setRelatedIssueId(relatedIssue.getId()); ! model.setRelatedIssueDescription(relatedIssue.getDescription()); ! model.setRelatedIssueStatus(relatedIssue.getStatus()); ! model.setRelatedIssueSeverity(relatedIssue.getSeverity()); ! } ! return model; ! } ! ! public void setModel(IssueRelationModel model) { ! this.setRelationType(model.getRelationType()); ! this.setLastModifiedDate(new Timestamp(new Date().getTime())); ! } ! } --- 1,91 ---- ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Date; ! ! ! public class IssueRelationBean { ! ! public Integer id; ! public Integer matchingRelationId; ! public int relationType; ! public IssueBean issue; ! public IssueBean relatedIssue; ! public Timestamp createDate; ! public Timestamp lastModifiedDate; ! ! public Timestamp getCreateDate() { ! return createDate; ! } ! ! public void setCreateDate(Timestamp createDate) { ! this.createDate = createDate; ! } ! ! public Integer getId() { ! return id; ! } ! ! public void setId(Integer id) { ! this.id = id; ! } ! ! public IssueBean getIssue() { ! return issue; ! } ! ! public void setIssue(IssueBean issue) { ! this.issue = issue; ! } ! ! public Timestamp getLastModifiedDate() { ! return lastModifiedDate; ! } ! ! public void setLastModifiedDate(Timestamp lastModifiedDate) { ! this.lastModifiedDate = lastModifiedDate; ! } ! ! public Integer getMatchingRelationId() { ! return matchingRelationId; ! } ! ! public void setMatchingRelationId(Integer matchingRelationId) { ! this.matchingRelationId = matchingRelationId; ! } ! ! public IssueBean getRelatedIssue() { ! return relatedIssue; ! } ! ! public void setRelatedIssue(IssueBean relatedIssue) { ! this.relatedIssue = relatedIssue; ! } ! ! public int getRelationType() { ! return relationType; ! } ! ! public void setRelationType(int relationType) { ! this.relationType = relationType; ! } ! } ! Index: UserBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/entity/UserBean.java,v retrieving revision 1.9.4.3 retrieving revision 1.9.4.3.2.1 diff -C2 -d -r1.9.4.3 -r1.9.4.3.2.1 *** UserBean.java 30 Oct 2005 16:47:32 -0000 1.9.4.3 --- UserBean.java 6 Dec 2005 12:38:01 -0000 1.9.4.3.2.1 *************** *** 21,29 **** import java.sql.Timestamp; import java.util.Collection; import java.util.Date; import java.util.LinkedList; - import cowsultants.itracker.ejb.client.models.UserModel; - public class UserBean extends GenericBean { --- 21,28 ---- import java.sql.Timestamp; import java.util.Collection; + import java.util.Comparator; import java.util.Date; import java.util.LinkedList; public class UserBean extends GenericBean { *************** *** 177,214 **** this.lastName = value; } ! public UserModel getModel() { ! UserModel model = new UserModel(); ! model.setId(this.getId()); ! model.setLogin(this.getLogin()); ! model.setFirstName(this.getFirstName()); ! model.setLastName(this.getLastName()); ! model.setEmail(this.getEmail()); ! model.setStatus(this.getStatus()); ! model.setSuperUser((this.getSuperUser() == 1 ? true : false)); ! model.setRegistrationType(this.getRegistrationType()); ! model.setLastModifiedDate(this.getLastModifiedDate()); ! model.setCreateDate(this.getCreateDate()); ! // Set password in the model to empty so it isn't available to others ! model.setPassword(""); ! return model; } ! public void setModel(UserModel model) { ! this.setLogin(model.getLogin()); ! this.setFirstName(model.getFirstName()); ! this.setLastName(model.getLastName()); ! this.setEmail(model.getEmail()); ! this.setSuperUser((model.isSuperUser() ? 1 : 0)); ! this.setLastModifiedDate(new Timestamp(new Date().getTime())); ! // 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()); } } } --- 176,321 ---- this.lastName = value; } + + /** + * Checks whether all the required fields have been populated, assuming + * that a password is required. + */ + public boolean hasRequiredData() { + return hasRequiredData(true); + } ! /** ! * Checks whether all the required fields have been populated, but allows ! * caller to specify whether a password is mandatory or not ! */ ! public boolean hasRequiredData(boolean passwordRequired) { ! if(this.getLogin() == null || this.getLogin().equals("") || ! this.getFirstName() == null || this.getFirstName().equals("") || ! this.getLastName() == null || this.getLastName().equals("") || ! this.getEmail() == null || this.getEmail().equals("")) { ! return false; ! } ! if(passwordRequired && (this.getPassword() == null || this.getPassword().equals(""))) { ! return false; ! } ! return true; ! } ! public static abstract class UserBeanComparator implements Comparator { ! protected boolean isAscending = true; ! public UserBeanComparator() { ! } ! ! public UserBeanComparator(boolean isAscending) { ! setAscending(isAscending); ! } ! ! public void setAscending(boolean value) { ! this.isAscending = value; ! } ! ! protected abstract int doComparison(UserBean ma, UserBean mb); ! ! public final int compare(Object a, Object b) { ! if(! (a instanceof UserBean) || ! (b instanceof UserBean)) { ! throw new ClassCastException(); ! } ! ! UserBean ma = (UserBean) a; ! UserBean mb = (UserBean) b; ! ! int result = doComparison(ma, mb); ! if(! isAscending) { ! result = result * -1; ! } ! return result; ! } } ! public static class CompareByLogin extends UserBeanComparator { ! public CompareByLogin(){ ! super(); ! } ! public CompareByLogin(boolean isAscending) { ! super(isAscending); ! } ! ! protected int doComparison(UserBean ma, UserBean mb) { ! if(ma.getLogin() == null && mb.getLogin() == null) { ! return 0; ! } else if(ma.getLogin() == null) { ! return 1; ! } else if(mb.getLogin() == null) { ! return -1; ! } ! ! return ma.getLogin().compareTo(mb.getLogin()); } } + public static class CompareByName extends UserBeanComparator { + public CompareByName(){ + super(); + } + + public CompareByName(boolean isAscending) { + super(isAscending); + } + + protected int doComparison(UserBean ma, UserBean mb) { + if(ma.getLastName() == null && mb.getLastName() == null) { + return 0; + } else if(ma.getLastName() == null) { + return 1; + } else if(mb.getLastName() == null) { + return -1; + } + + if(ma.getLastName().equals(mb.getLastName())) { + if(ma.getFirstName() == null && mb.getFirstName() == null) { + return 0; + } else if(ma.getFirstName() == null) { + return 1; + } else if(mb.getFirstName() == null) { + return -1; + } + return ma.getFirstName().compareTo(mb.getFirstName()); + } + return ma.getLastName().compareTo(mb.getLastName()); + } + } + + public static class CompareByFirstName extends UserBeanComparator { + public CompareByFirstName(){ + super(); + } + + public CompareByFirstName(boolean isAscending) { + super(isAscending); + } + + protected int doComparison(UserBean ma, UserBean mb) { + if(ma.getFirstName() == null && mb.getFirstName() == null) { + return 0; + } else if(ma.getFirstName() == null) { + return 1; + } else if(mb.getFirstName() == null) { + return -1; + } + + if(ma.getFirstName().equals(mb.getFirstName())) { + if(ma.getLastName() == null && mb.getLastName() == null) { + return 0; + } else if(ma.getLastName() == null) { + return 1; + } else if(mb.getLastName() == null) { + return -1; + } + return ma.getLastName().compareTo(mb.getLastName()); + } + return ma.getFirstName().compareTo(mb.getFirstName()); + } + } } Index: CustomFieldBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/entity/CustomFieldBean.java,v retrieving revision 1.9.4.1 retrieving revision 1.9.4.1.2.1 diff -C2 -d -r1.9.4.1 -r1.9.4.1.2.1 *** CustomFieldBean.java 11 Oct 2005 01:21:04 -0000 1.9.4.1 --- CustomFieldBean.java 6 Dec 2005 12:38:00 -0000 1.9.4.1.2.1 *************** *** 1,126 **** ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Arrays; ! import java.util.Collection; ! import java.util.Date; ! import java.util.Iterator; ! ! import cowsultants.itracker.ejb.client.models.CustomFieldModel; ! import cowsultants.itracker.ejb.client.models.CustomFieldValueModel; ! ! public class CustomFieldBean extends GenericBean { ! ! public int fieldType; ! public String dateFormat; ! public int required; ! public int sortOptionsByName; ! public Collection values; ! public Collection projects; ! public Collection fields; ! ! public String getDateFormat() { ! return dateFormat; ! } ! ! public void setDateFormat(String dateFormat) { ! this.dateFormat = dateFormat; ! } ! ! public Collection getFields() { ! return fields; ! } ! ! public void setFields(Collection fields) { ! this.fields = fields; ! } ! ! public int getFieldType() { ! return fieldType; ! } ! ! public void setFieldType(int fieldType) { ! this.fieldType = fieldType; ! } ! ! public Collection getProjects() { ! return projects; ! } ! ! public void setProjects(Collection projects) { ! this.projects = projects; ! } ! ! public int getRequired() { ! return required; ! } ! ! public void setRequired(int required) { ! this.required = required; ! } ! ! public int getSortOptionsByName() { ! return sortOptionsByName; ! } ! ! public void setSortOptionsByName(int sortOptionsByName) { ! this.sortOptionsByName = sortOptionsByName; ! } ! ! public Collection getValues() { ! return values; ! } ! ! public void setValues(Collection values) { ! this.values = values; ! } ! ! public CustomFieldModel getModel() { ! CustomFieldModel model = new CustomFieldModel(); ! model.setId(this.getId()); ! model.setFieldType(this.getFieldType()); ! model.setDateFormat(this.getDateFormat()); ! model.setRequired((this.getRequired() == 1 ? true : false)); ! model.setSortOptionsByName((this.getSortOptionsByName() == 1 ? true : false)); ! model.setLastModifiedDate(this.getLastModifiedDate()); ! model.setCreateDate(this.getCreateDate()); ! ! int i = 0; ! Collection values = this.getValues(); ! CustomFieldValueModel[] options = new CustomFieldValueModel[values.size()]; ! for(Iterator iterator = values.iterator(); iterator.hasNext(); i++) { ! options[i] = ((CustomFieldValueBean) iterator.next()).getModel(); ! } ! Arrays.sort(options, new CustomFieldValueModel.CompareBySortOrder()); ! model.setOptions(options); ! ! return model; ! } ! ! public void setModel(CustomFieldModel model) { ! this.setFieldType(model.getFieldType()); ! this.setDateFormat(model.getDateFormat()); ! this.setRequired((model.isRequired() ? 1 : 0)); ! this.setSortOptionsByName((model.getSortOptionsByName() ? 1 : 0)); ! this.setLastModifiedDate(new Timestamp(new Date().getTime())); ! } ! ! } --- 1,191 ---- ! /* ! * 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.entity; ! ! import cowsultants.itracker.ejb.client.resources.ITrackerResources; ! import cowsultants.itracker.ejb.client.util.CustomFieldUtilities; ! import java.util.Collection; ! import java.util.Collections; ! import java.util.HashSet; ! import java.util.Iterator; ! import java.util.List; ! import java.util.Locale; ! ! public class CustomFieldBean extends GenericBean { ! ! public int fieldType; ! public String dateFormat; ! public int required; ! public int sortOptionsByName; ! public Collection values; ! public Collection projects; ! public Collection fields; ! ! private String locale; ! private String name; ! ! public String getDateFormat() { ! return dateFormat; ! } ! ! public void setDateFormat(String dateFormat) { ! this.dateFormat = dateFormat; ! } ! ! public Collection getFields() { ! return fields; ! } ! ! public void setFields(Collection fields) { ! this.fields = fields; ! } ! ! public int getFieldType() { ! return fieldType; ! } ! ! public void setFieldType(int fieldType) { ! this.fieldType = fieldType; ! } ! ! public Collection getProjects() { ! return projects; ! } ! ! public void setProjects(Collection projects) { ! this.projects = projects; ! } ! ! public int getRequired() { ! return required; ! } ! ! public void setRequired(int required) { ! this.required = required; ! } ! ! public int getSortOptionsByName() { ! return sortOptionsByName; ! } ! ! public void setSortOptionsByName(int sortOptionsByName) { ! this.sortOptionsByName = sortOptionsByName; ! } ! ! public Collection getValues() { ! return values; ! } ! ! public void setValues(Collection values) { ! this.values = values; ! } ! ! /** ! * Sets this custom fields names based on the supplied local string. ! * @param locale the name of the locale to use for the names ! */ ! public void setLabels(String locale) { ! Locale loc = ITrackerResources.getLocale(locale); ! setLabels(loc); ! } ! ! /** ! * Sets this custom fields names based on the supplied locale. ! * @param locale the locale to use for the names ! */ ! public void setLabels(Locale locale) { ! this.locale = locale.toString(); ! this.name = CustomFieldUtilities.getCustomFieldName(getId(), locale); ! ! Iterator iter = values.iterator(); ! while(iter.hasNext()) { ! CustomFieldValueBean value = (CustomFieldValueBean) iter.next(); ! if(value != null) { ! value.setName(CustomFieldUtilities.getCustomFieldOptionName(getId(), value.getId(), locale)); ! } ! } ! ! //@todo check this? ! if(getSortOptionsByName() == 1) { ! try { ! if(values instanceof List) { ! List valuesList = (List) values; ! Collections.sort(valuesList, new CustomFieldValueBean.CompareByName()); ! } ! } catch(Exception e) { ! } ! } ! } ! ! /** ! * Returns the configuration item's name or "" if null ! */ ! public String getName() { ! return (name == null ? "" : name); ! } ! ! /** ! * Sets the configuration item's name ! * ! * Note the name field is not persisted to the database and is used ! * to allow internationalisation ! */ ! public void setName(String value) { ! this.name = value; ! } ! ! /** ! * Returns the name for a particular option value. ! * @param optionValue the value to lookup the name for ! * @return the localized name for the supplied value ! */ ! public String getOptionNameByValue(String optionValue) { ! if(optionValue != null && ! optionValue.equals("")) { ! Iterator iter = values.iterator(); ! while(iter.hasNext()) { ! CustomFieldValueBean bean = (CustomFieldValueBean) iter.next(); ! if(bean != null && bean.getValue().equalsIgnoreCase(optionValue)) { ! return bean.getName(); ! } ! } ! } ! return ""; ! } ! ! ! /** ! * Adds a new option value/name to the custom field. New options are put ! * at the end of the list even if they should be sorted. This method is ! * mainly used to build a new custom field so it can be saved later. ! * @param value the option value ! * @param label the label/name for the new option ! */ ! public void addOption(String value, String label) { ! CustomFieldValueBean bean = new CustomFieldValueBean(); ! bean.setName(label); ! bean.setValue(value); ! bean.setCustomField(this); ! ! if(this.values == null) { ! this.values = new HashSet(); ! } ! this.values.add(bean); ! } ! } ! Index: UserPreferencesBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/entity/UserPreferencesBean.java,v retrieving revision 1.9.4.1 retrieving revision 1.9.4.1.2.1 diff -C2 -d -r1.9.4.1 -r1.9.4.1.2.1 *** UserPreferencesBean.java 11 Oct 2005 01:21:04 -0000 1.9.4.1 --- UserPreferencesBean.java 6 Dec 2005 12:38:01 -0000 1.9.4.1.2.1 *************** *** 1,157 **** ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Date; ! ! import cowsultants.itracker.ejb.client.models.UserPreferencesModel; ! ! public class UserPreferencesBean extends GenericBean { ! ! public boolean saveLogin; ! public String userLocale; ! public int numItemsOnIndex; ! public int numItemsOnIssueList; ! public boolean showClosedOnIssueList; ! public String sortColumnOnIssueList; ! public int hiddenIndexSections; ! public boolean rememberLastSearch; ! public boolean useTextActions; ! public UserBean user; ! ! public int getHiddenIndexSections() { ! return hiddenIndexSections; ! } ! ! public void setHiddenIndexSections(int hiddenIndexSections) { ! this.hiddenIndexSections = hiddenIndexSections; ! } ! ! public int getNumItemsOnIndex() { ! return numItemsOnIndex; ! } ! ! public void setNumItemsOnIndex(int numItemsOnIndex) { ! this.numItemsOnIndex = numItemsOnIndex; ! } ! ! public int getNumItemsOnIssueList() { ! return numItemsOnIssueList; ! } ! ! public void setNumItemsOnIssueList(int numItemsOnIssueList) { ! this.numItemsOnIssueList = numItemsOnIssueList; ! } ! ! public boolean getRememberLastSearch() { ! return rememberLastSearch; ! } ! ! public void setRememberLastSearch(boolean rememberLastSearch) { ! this.rememberLastSearch = rememberLastSearch; ! } ! ! public boolean getSaveLogin() { ! return saveLogin; ! } ! ! public void setSaveLogin(boolean saveLogin) { ! this.saveLogin = saveLogin; ! } ! ! public boolean getShowClosedOnIssueList() { ! return showClosedOnIssueList; ! } ! ! public void setShowClosedOnIssueList(boolean showClosedOnIssueList) { ! this.showClosedOnIssueList = showClosedOnIssueList; ! } ! ! public String getSortColumnOnIssueList() { ! return sortColumnOnIssueList; ! } ! ! public void setSortColumnOnIssueList(String sortColumnOnIssueList) { ! this.sortColumnOnIssueList = sortColumnOnIssueList; ! } ! ! public UserBean getUser() { ! return user; ! } ! ! public void setUser(UserBean user) { ! this.user = user; ! } ! ! public String getUserLocale() { ! return userLocale; ! } ! ! public void setUserLocale(String userLocale) { ! this.userLocale = userLocale; ! } ! ! public boolean getUseTextActions() { ! return useTextActions; ! } ! ! public void setUseTextActions(boolean useTextActions) { ! this.useTextActions = useTextActions; ! } ! ! public UserPreferencesModel getModel() { ! UserPreferencesModel model = new UserPreferencesModel(); ! model.setId(this.getId()); ! ! model.setSaveLogin(this.getSaveLogin()); ! model.setUserLocale(this.getUserLocale()); ! model.setNumItemsOnIndex(this.getNumItemsOnIndex()); ! model.setNumItemsOnIssueList(this.getNumItemsOnIssueList()); ! model.setShowClosedOnIssueList(this.getShowClosedOnIssueList()); ! model.setSortColumnOnIssueList(this.getSortColumnOnIssueList()); ! model.setHiddenIndexSections(this.getHiddenIndexSections()); ! ! model.setRememberLastSearch(this.getRememberLastSearch()); ! model.setUseTextActions(this.getUseTextActions()); ! ! model.setUserId(this.getUser().getId()); ! model.setUserLogin(this.getUser().getLogin()); ! ! model.setLastModifiedDate(this.getLastModifiedDate()); ! model.setCreateDate(this.getCreateDate()); ! return model; ! } ! ! public void setModel(UserPreferencesModel model) { ! this.setSaveLogin(model.getSaveLogin()); ! this.setUserLocale(model.getUserLocale()); ! this.setNumItemsOnIndex(model.getNumItemsOnIndex()); ! this.setNumItemsOnIssueList(model.getNumItemsOnIssueList()); ! this.setShowClosedOnIssueList(model.getShowClosedOnIssueList()); ! this.setSortColumnOnIssueList(model.getSortColumnOnIssueList()); ! this.setHiddenIndexSections(model.getHiddenIndexSections()); ! ! this.setRememberLastSearch(model.getRememberLastSearch()); ! this.setUseTextActions(model.getUseTextActions()); ! ! this.setLastModifiedDate(new Timestamp(new Date().getTime())); ! } ! ! } --- 1,131 ---- ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Date; ! ! ! public class UserPreferencesBean extends GenericBean { ! ! ! ! public boolean saveLogin; ! ! public String userLocale; ! ! public int numItemsOnIndex; ! ! public int numItemsOnIssueList; ! ! public boolean showClosedOnIssueList; ! ! public String sortColumnOnIssueList; ! ! public int hiddenIndexSections; ! ! public boolean rememberLastSearch; ! ! public boolean useTextActions; ! ! public UserBean user; ! ! ! ! public int getHiddenIndexSections() { ! return hiddenIndexSections; ! } ! ! public void setHiddenIndexSections(int hiddenIndexSections) { ! this.hiddenIndexSections = hiddenIndexSections; ! } ! ! public int getNumItemsOnIndex() { ! return numItemsOnIndex; ! } ! ! public void setNumItemsOnIndex(int numItemsOnIndex) { ! this.numItemsOnIndex = numItemsOnIndex; ! } ! ! public int getNumItemsOnIssueList() { ! return numItemsOnIssueList; ! } ! ! public void setNumItemsOnIssueList(int numItemsOnIssueList) { ! this.numItemsOnIssueList = numItemsOnIssueList; ! } ! ! public boolean getRememberLastSearch() { ! return rememberLastSearch; ! } ! ! public void setRememberLastSearch(boolean rememberLastSearch) { ! this.rememberLastSearch = rememberLastSearch; ! } ! ! public boolean getSaveLogin() { ! return saveLogin; ! } ! ! public void setSaveLogin(boolean saveLogin) { ! this.saveLogin = saveLogin; ! } ! ! public boolean getShowClosedOnIssueList() { ! return showClosedOnIssueList; ! } ! ! public void setShowClosedOnIssueList(boolean showClosedOnIssueList) { ! this.showClosedOnIssueList = showClosedOnIssueList; ! } ! ! public String getSortColumnOnIssueList() { ! return sortColumnOnIssueList; ! } ! ! public void setSortColumnOnIssueList(String sortColumnOnIssueList) { ! this.sortColumnOnIssueList = sortColumnOnIssueList; ! } ! ! public UserBean getUser() { ! return user; ! } ! ! public void setUser(UserBean user) { ! this.user = user; ! } ! ! public String getUserLocale() { ! return userLocale; ! } ! ! public void setUserLocale(String userLocale) { ! this.userLocale = userLocale; ! } ! ! public boolean getUseTextActions() { ! return useTextActions; ! } ! ! public void setUseTextActions(boolean useTextActions) { ! this.useTextActions = useTextActions; ! } ! } ! Index: LanguageBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/entity/LanguageBean.java,v retrieving revision 1.5.4.1 retrieving revision 1.5.4.1.2.1 diff -C2 -d -r1.5.4.1 -r1.5.4.1.2.1 *** LanguageBean.java 11 Oct 2005 01:21:04 -0000 1.5.4.1 --- LanguageBean.java 6 Dec 2005 12:38:01 -0000 1.5.4.1.2.1 *************** *** 1,75 **** ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Date; ! ! import cowsultants.itracker.ejb.client.models.LanguageModel; ! ! public class LanguageBean extends GenericBean { ! ! public String locale; ! public String resourceKey; ! public String resourceValue; ! ! public String getLocale() { ! return locale; ! } ! ! public void setLocale(String locale) { ! this.locale = locale; ! } ! ! public String getResourceKey() { ! return resourceKey; ! } ! ! public void setResourceKey(String resourceKey) { ! this.resourceKey = resourceKey; ! } ! ! public String getResourceValue() { ! return resourceValue; ! } ! ! public void setResourceValue(String resourceValue) { ! this.resourceValue = resourceValue; ! } ! ! public LanguageModel getModel() { ! LanguageModel model = new LanguageModel(); ! model.setId(this.getId()); ! model.setLocale(this.getLocale()); ! model.setResourceKey(this.getResourceKey()); ! model.setResourceValue(this.getResourceValue()); ! model.setLastModifiedDate(this.getLastModifiedDate()); ! model.setCreateDate(this.getCreateDate()); ! ! return model; ! } ! ! public void setModel(LanguageModel model) { ! this.setLocale(model.getLocale()); ! this.setResourceKey(model.getResourceKey()); ! this.setResourceValue(model.getResourceValue()); ! this.setLastModifiedDate(new Timestamp(new Date().getTime())); ! } ! } \ No newline at end of file --- 1,54 ---- ! /* ! * 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.entity; ! ! import java.sql.Timestamp; ! import java.util.Date; ! ! ! public class LanguageBean extends GenericBean { ! ! public String locale; ! public String resourceKey; ! public String resourceValue; ! ! public String getLocale() { ! return locale; ! } ! ! public void setLocale(String locale) { ! this.locale = locale; ! } ! ! public String getResourceKey() { ! return resourceKey; ! } ! ! public void setResourceKey(String resourceKey) { ! this.resourceKey = resourceKey; ! } ! ! public String getResourceValue() { ! return resourceValue; ! } ! ! public void setResourceValue(String resourceValue) { ! this.resourceValue = resourceValue; ! } } \ No newline at end of file Index: ComponentBean.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/ejb/beans/entity/ComponentBean.java,v retrieving revision 1.6.4.1 retrieving revision 1.6.4.1.2.1 diff -C2 -d -r1.6.4.1 -r1.6.4.1.2.1 *** ComponentBean.java 11 Oct 2005 01:21:04 -0000 1.6.4.1 --- ComponentBean.java 6 Dec 2005 12:38:00 -0000 1.6.4.1.2.1 *************** *** 1,81 **** ! /* ! * 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.entity; ! ! import java.util.*; ! import java.sql.Timestamp; ! ! import cowsultants.itracker.ejb.client.models.ComponentModel; ! ! public class ComponentBean extends GenericBean { ! ! private ProjectBean project; ! private String name; ! private String description; ! private Collection issues; ! ! public String getDescription() { ! return description; ! } ! public void setDescription(String description) { ! this.description = description; ! } ! public Collection getIssues() { ! return issues; ! } ! public void setIssues(Collection issues) { ! this.issues = issues; ! } ! public String getName() { ! return name; ! } ! public void setName(String name) { ! this.name = name; ! } ! public ProjectBean getProject() { ! return(project); ! } ! public void setProject(ProjectBean value) { ! this.project = value; ! } ! ! public int getTotalNumberIssues() { ! return getIssues().size(); ! } ! ! public ComponentModel getModel() { ! ComponentModel model = new ComponentModel(); ! model.setId(this.getId()); ! model.setName(this.getName()); ! model.setDescription(this.getDescription()); ! model.setLastModifiedDate(this.getLastModifiedDate()); ! model.setCreateDate(this.getCreateDate()); ! ! model.setProjectId(this.getProject().getId()); ! ! return model; ! } ! ! public void setModel(ComponentModel model) { ! this.setName(model.getName()); ! this.setDescription(model.getDescription()); ! this.setLastModifiedDate(new Timestamp(new Date().getTime())); ! } ! } \ No newline at end of file --- 1,137 ---- ! /* ! * 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.entity; ! ! import java.util.*; ! import java.sql.Timestamp; ! ! /** ! * Represents a system component against which an issue may be raised. ! */ ! public class ComponentBean extends GenericBean { ! ! private ProjectBean project; ! private String name; ! private String description; ! private Collection issues; ! ! /** ! * Gets the component's description ! * ! * @return the description ! */ ! public String... [truncated message content] |
|
From: Ricardo T. <rj...@us...> - 2005-12-06 12:38:16
|
Update of /cvsroot/itracker/itracker/src/cowsultants/itracker/test/spring In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv6833/cowsultants/itracker/test/spring Modified Files: Tag: itrackerhnodto ITrackerSpringTest.java Log Message: removal of value objects Index: ITrackerSpringTest.java =================================================================== RCS file: /cvsroot/itracker/itracker/src/cowsultants/itracker/test/spring/Attic/ITrackerSpringTest.java,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.2.2.1 diff -C2 -d -r1.1.2.2 -r1.1.2.2.2.1 *** ITrackerSpringTest.java 30 Oct 2005 16:42:09 -0000 1.1.2.2 --- ITrackerSpringTest.java 6 Dec 2005 12:38:01 -0000 1.1.2.2.2.1 *************** *** 88,92 **** // System.out.println("Issues : " + issuef.findAll()); System.out.println("Project custom fields : " + pf.findByPrimaryKey(new Integer(1)).getCustomFields()); ! System.out.println("Project model : " + pf.findByPrimaryKey(new Integer(1)).getModel()); System.out.println("History : " + issuehistoryf.findByIssueId(new Integer(401))); --- 88,92 ---- // System.out.println("Issues : " + issuef.findAll()); System.out.println("Project custom fields : " + pf.findByPrimaryKey(new Integer(1)).getCustomFields()); ! System.out.println("Project : " + pf.findByPrimaryKey(new Integer(1))); System.out.println("History : " + issuehistoryf.findByIssueId(new Integer(401))); *************** *** 101,105 **** System.out.println("Issues by status : " + issuef.findByStatusLessThan(500)); ! System.out.println("Issue model : " + issuef.findByPrimaryKey(new Integer(702)).getModel()); System.out.println("Target version : " + issuef.findByPrimaryKey(new Integer(702)).getNotifications()); --- 101,105 ---- System.out.println("Issues by status : " + issuef.findByStatusLessThan(500)); ! System.out.println("Issue : " + issuef.findByPrimaryKey(new Integer(702))); System.out.println("Target version : " + issuef.findByPrimaryKey(new Integer(702)).getNotifications()); |
|
From: Marky G. <mar...@us...> - 2005-12-01 18:20:44
|
Update of /cvsroot/itracker/itracker/lib In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv32308/lib Removed Files: Tag: itrackerhibernate commons-collections-2.1.1.jar Log Message: jstl --- commons-collections-2.1.1.jar DELETED --- |
|
From: Marky G. <mar...@us...> - 2005-12-01 10:18:14
|
Update of /cvsroot/itracker/itracker/web/WEB-INF In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5198/web/WEB-INF Modified Files: Tag: itrackerhibernate web.xml Log Message: IMPORTANT UPDATE OF WEB.XML. GET IT. Index: web.xml =================================================================== RCS file: /cvsroot/itracker/itracker/web/WEB-INF/Attic/web.xml,v retrieving revision 1.1.2.5 retrieving revision 1.1.2.6 diff -C2 -d -r1.1.2.5 -r1.1.2.6 *** web.xml 1 Dec 2005 07:33:17 -0000 1.1.2.5 --- web.xml 1 Dec 2005 10:18:07 -0000 1.1.2.6 *************** *** 1,9 **** <?xml version="1.0" encoding="ISO-8859-1"?> ! <!DOCTYPE web-app ! PUBLIC "-//Sun Microsystems, Inc.//DTD Web Application 2.3//EN" ! "" rel="nofollow">http://java.sun.com/dtd/web-app_2_3.dtd"> ! ! <web-app> <display-name>Issue Tracker</display-name> <description> --- 1,9 ---- <?xml version="1.0" encoding="ISO-8859-1"?> ! <web-app xmlns="http://java.sun.com/xml/ns/j2ee" ! xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" ! xsi:schemaLocation="http://java.sun.com/xml/ns/j2ee/web-app_2_4.xsd" ! version="2.4"> ! <display-name>Issue Tracker</display-name> <description> *************** *** 20,25 **** <filter-name>NTLM HTTP Authentication Filter</filter-name> <filter-class>jcifs.http.NtlmHttpFilter</filter-class> ! <!-- For development, any SMB server is suitable for validating ! password hashes. --> <init-param> <param-name>jcifs.http.domainController</param-name> --- 20,24 ---- <filter-name>NTLM HTTP Authentication Filter</filter-name> <filter-class>jcifs.http.NtlmHttpFilter</filter-class> ! <!-- For development, any SMB server is suitable for validating password hashes. --> <init-param> <param-name>jcifs.http.domainController</param-name> *************** *** 118,121 **** --- 117,122 ---- <welcome-file>index.jsp</welcome-file> </welcome-file-list> + + <jsp-config> <taglib> <taglib-uri>/itracker.tld</taglib-uri> *************** *** 162,164 **** --- 163,166 ---- <taglib-location>/WEB-INF/tld/struts-nested.tld</taglib-location> </taglib> + </jsp-config> </web-app> |
|
From: Marky G. <mar...@us...> - 2005-12-01 10:17:48
|
Update of /cvsroot/itracker/itracker/web/themes/standardtheme/includes In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv5091/web/themes/standardtheme/includes Modified Files: Tag: itrackerhibernate header.jsp page_init.jsp Log Message: new header, now using JSTL. new page_init, that put's variable in pageContext. Index: page_init.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/themes/standardtheme/includes/Attic/page_init.jsp,v retrieving revision 1.1.2.2 retrieving revision 1.1.2.3 diff -C2 -d -r1.1.2.2 -r1.1.2.3 *** page_init.jsp 1 Nov 2005 17:22:02 -0000 1.1.2.2 --- page_init.jsp 1 Dec 2005 10:17:40 -0000 1.1.2.3 *************** *** 12,16 **** Locale currLocale = LoginUtilities.getCurrentLocale(request); String currLogin = (currUser == null ? null : currUser.getLogin()); ! if(Logger.isLoggingDebug()) { Logger.logDebug("Request: " + request.getRequestURI() + "?" + request.getQueryString() + " " + --- 12,17 ---- Locale currLocale = LoginUtilities.getCurrentLocale(request); String currLogin = (currUser == null ? null : currUser.getLogin()); ! pageContext.setAttribute("currLogin",currLogin); ! if(Logger.isLoggingDebug()) { Logger.logDebug("Request: " + request.getRequestURI() + "?" + request.getQueryString() + " " + Index: header.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/themes/standardtheme/includes/Attic/header.jsp,v retrieving revision 1.1.2.4 retrieving revision 1.1.2.5 diff -C2 -d -r1.1.2.4 -r1.1.2.5 *** header.jsp 1 Dec 2005 07:47:19 -0000 1.1.2.4 --- header.jsp 1 Dec 2005 10:17:40 -0000 1.1.2.5 *************** *** 19,31 **** boolean allowSaveLogin = true; String alternateLogo = null; ! ! SystemConfiguration headerSC = ServletContextUtils.getItrackerServices(getServletContext()).getSystemConfiguration(); ! ! allowForgotPassword = headerSC.getBooleanProperty("allow_forgot_password", true); ! allowSelfRegister = headerSC.getBooleanProperty("allow_self_register", false); ! allowSaveLogin = headerSC.getBooleanProperty("allow_save_login", true); ! alternateLogo = headerSC.getProperty("alternate_logo", null); ! ! %> --- 19,28 ---- boolean allowSaveLogin = true; String alternateLogo = null; ! ! SystemConfiguration headerSC = ServletContextUtils.getItrackerServices(getServletContext()).getSystemConfiguration(); ! allowForgotPassword = headerSC.getBooleanProperty("allow_forgot_password", true); ! allowSelfRegister = headerSC.getBooleanProperty("allow_self_register", false); ! allowSaveLogin = headerSC.getBooleanProperty("allow_save_login", true); ! alternateLogo = headerSC.getProperty("alternate_logo", null); %> *************** *** 42,45 **** --- 39,43 ---- <body> <form name="lookupForm" action="<html:rewrite forward="viewissue"/>"> + <table border="0" cellspacing="1" cellspacing="0" width="100%"> <tr> *************** *** 62,67 **** <tr> <td class="headerLinks" align="left"> ! <c:if test="(currLogin != null)"> ! <a title="<%= ITrackerResources.getString("itracker.web.header.quickview.alt", currLocale) %>" class="headerLinks"> <it:message key="itracker.web.header.quickview"/> </a> --- 60,64 ---- <tr> <td class="headerLinks" align="left"> ! <c:if test="${currLogin != null}"> <a title="<%= ITrackerResources.getString("itracker.web.header.quickview.alt", currLocale) %>" class="headerLinks"> <it:message key="itracker.web.header.quickview"/> </a> *************** *** 72,94 **** <html:link forward="index" styleClass="headerLinks" titleKey="itracker.web.header.menu.home.alt"> <it:message key="itracker.web.header.menu.home"/></html:link> ! <c:if test="(currLogin != null)"> ! ! | ! <html:link forward="listprojects" styleClass="headerLinks" titleKey="itracker.web.header.menu.projectlist.alt"> ! <it:message key="itracker.web.header.menu.projectlist"/></html:link> ! | ! <html:link forward="searchissues" styleClass="headerLinks" titleKey="itracker.web.header.menu.search.alt"> <it:message key="itracker.web.header.menu.search"/></html:link> ! <c:if test="UserUtilities.hasPermission(currPermissions, UserUtilities.PERMISSION_VIEW_ALL)"> | <html:link forward="listreports" styleClass="headerLinks" titleKey="itracker.web.header.menu.reports.alt"> <it:message key="itracker.web.header.menu.reports"/></html:link> </c:if> ! <c:if test="UserUtilities.hasPermission(currPermissions, UserUtilities.PERMISSION_USER_ADMIN)"> | <html:link page="/themes/standardtheme/admin/" styleClass="headerLinks" titleKey="itracker.web.header.menu.admin.alt"> <it:message key="itracker.web.header.menu.admin"/></html:link> </c:if> ! <c:if test="UserUtilities.hasPermission(currPermissions, UserUtilities.PERMISSION_PRODUCT_ADMIN)"> | <html:link page="/adminlistprojects.do" styleClass="headerLinks" titleKey="itracker.web.header.menu.projectadmin.alt"> --- 69,88 ---- <html:link forward="index" styleClass="headerLinks" titleKey="itracker.web.header.menu.home.alt"> <it:message key="itracker.web.header.menu.home"/></html:link> ! ! <c:if test="${currLogin != null}"> | <html:link forward="listprojects" styleClass="headerLinks" titleKey="itracker.web.header.menu.projectlist.alt"> ! <it:message key="itracker.web.header.menu.projectlist"/></html:link> | <html:link forward="searchissues" styleClass="headerLinks" titleKey="itracker.web.header.menu.search.alt"> <it:message key="itracker.web.header.menu.search"/></html:link> ! ! <c:if test="<%=UserUtilities.hasPermission(currPermissions, UserUtilities.PERMISSION_VIEW_ALL)%>"> | <html:link forward="listreports" styleClass="headerLinks" titleKey="itracker.web.header.menu.reports.alt"> <it:message key="itracker.web.header.menu.reports"/></html:link> </c:if> ! <c:if test="<%=UserUtilities.hasPermission(currPermissions, UserUtilities.PERMISSION_USER_ADMIN)%>"> | <html:link page="/themes/standardtheme/admin/" styleClass="headerLinks" titleKey="itracker.web.header.menu.admin.alt"> <it:message key="itracker.web.header.menu.admin"/></html:link> </c:if> ! <c:if test="<%=UserUtilities.hasPermission(currPermissions, UserUtilities.PERMISSION_PRODUCT_ADMIN)%>"> | <html:link page="/adminlistprojects.do" styleClass="headerLinks" titleKey="itracker.web.header.menu.projectadmin.alt"> *************** *** 106,112 **** <html:link action="/logoff" styleClass="headerLinks" titleKey="itracker.web.header.menu.logout.alt"> <it:message key="itracker.web.header.menu.logout"/></html:link> ! </c:if> <c:if test="(currLogin == null)"> ! ! <c:if test="(allowForgotPassword)"> | --- 100,107 ---- <html:link action="/logoff" styleClass="headerLinks" titleKey="itracker.web.header.menu.logout.alt"> <it:message key="itracker.web.header.menu.logout"/></html:link> ! </c:if> ! ! <c:if test="{currLogin == null}"> ! <c:if test="${allowForgotPassword}"> | *************** *** 114,118 **** <it:message key="itracker.web.header.menu.forgotpass"/></html:link> </c:if> ! <c:if test="(allowSelfRegister)"> | <html:link forward="selfregistration" styleClass="headerLinks" titleKey="itracker.web.header.menu.selfreg.alt"> --- 109,113 ---- <it:message key="itracker.web.header.menu.forgotpass"/></html:link> </c:if> ! <c:if test="${allowSelfRegister}"> | <html:link forward="selfregistration" styleClass="headerLinks" titleKey="itracker.web.header.menu.selfreg.alt"> |
|
From: Marky G. <mar...@us...> - 2005-12-01 07:47:29
|
Update of /cvsroot/itracker/itracker/web/themes/standardtheme/module-portalhome In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4803/web/themes/standardtheme/module-portalhome Modified Files: Tag: itrackerhibernate portalhome.jsp Log Message: JSTL import and first usage in header. Index: portalhome.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/themes/standardtheme/module-portalhome/Attic/portalhome.jsp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** portalhome.jsp 30 Nov 2005 19:08:58 -0000 1.1.2.1 --- portalhome.jsp 1 Dec 2005 07:47:20 -0000 1.1.2.2 *************** *** 1,7 **** <%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/itracker.tld" prefix="it" %> ! <%@ taglib uri="/struts-bean.tld" prefix="bean" %> ! <%@ taglib uri="/struts-html.tld" prefix="html" %> ! <%@ taglib uri="/struts-logic.tld" prefix="logic" %> <%@ page import="java.util.Arrays" %> --- 1,10 ---- <%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/itracker.tld" prefix="it" %> ! <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %> ! <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %> ! <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %> ! <%@ taglib uri="/tags/fmt" prefix="fmt" %> ! <%@ taglib uri="/tags/c" prefix="c" %> ! <%@ page import="java.util.Arrays" %> *************** *** 17,21 **** <bean:define id="pageTitleArg" value=""/> <%@ include file="/themes/standardtheme/includes/header.jsp" %> ! <% IssueHandler ih = ServletContextUtils.getItrackerServices(getServletContext()).getIssueHandler(); --- 20,24 ---- <bean:define id="pageTitleArg" value=""/> <%@ include file="/themes/standardtheme/includes/header.jsp" %> ! <% IssueHandler ih = ServletContextUtils.getItrackerServices(getServletContext()).getIssueHandler(); *************** *** 98,101 **** --- 101,105 ---- <table border="0" cellspacing="0" cellpadding="1" width="100%" align="left"> <% if(! UserUtilities.hideIndexSection(UserUtilities.PREF_HIDE_ASSIGNED, hiddenSections)) { %> + <tr> <td class="editColumnTitle" colspan="15"><it:message key="itracker.web.index.assigned"/>:</td> *************** *** 112,120 **** <td><it:message key="itracker.web.attr.severity"/></td> <td><html:img page="/themes/standardtheme/images/blank.gif" width="3"/></td> ! <td><it:message key="itracker.web.attr.description"/></td> <td><html:img page="/themes/standardtheme/images/blank.gif" width="3"/></td> <td><it:message key="itracker.web.attr.owner"/></td> <td><html:img page="/themes/standardtheme/images/blank.gif" width="3"/></td> ! <td><it:message key="itracker.web.attr.lastmodified"/></td> </tr> <% --- 116,124 ---- <td><it:message key="itracker.web.attr.severity"/></td> <td><html:img page="/themes/standardtheme/images/blank.gif" width="3"/></td> ! <td width="100%"><it:message key="itracker.web.attr.description"/></td> <td><html:img page="/themes/standardtheme/images/blank.gif" width="3"/></td> <td><it:message key="itracker.web.attr.owner"/></td> <td><html:img page="/themes/standardtheme/images/blank.gif" width="3"/></td> ! <td align="right"><it:message key="itracker.web.attr.lastmodified"/></td> </tr> <% *************** *** 149,153 **** <td><it:formatIssueOwner issue="<%= ownedIssues[i] %>" format="short"/></td> <td></td> ! <td><it:formatDate date="<%= ownedIssues[i].getLastModifiedDate() %>"/></td> </tr> <% } %> --- 153,157 ---- <td><it:formatIssueOwner issue="<%= ownedIssues[i] %>" format="short"/></td> <td></td> ! <td align="right"><it:formatDate date="<%= ownedIssues[i].getLastModifiedDate() %>"/></td> </tr> <% } %> *************** *** 175,179 **** <td><it:message key="itracker.web.attr.owner"/></td> <td></td> ! <td><it:message key="itracker.web.attr.lastmodified"/></td> </tr> --- 179,183 ---- <td><it:message key="itracker.web.attr.owner"/></td> <td></td> ! <td align="right"><it:message key="itracker.web.attr.lastmodified"/></td> </tr> *************** *** 295,299 **** <% } %> <td></td> ! <td><it:formatDate date="<%= unassignedIssues[i].getLastModifiedDate() %>"/></td> </tr> <% } %> --- 299,303 ---- <% } %> <td></td> ! <td align="right"><it:formatDate date="<%= unassignedIssues[i].getLastModifiedDate() %>"/></td> </tr> <% } %> *************** *** 321,325 **** <td><it:message key="itracker.web.attr.owner"/></td> <td></td> ! <td><it:message key="itracker.web.attr.lastmodified"/></td> </tr> --- 325,329 ---- <td><it:message key="itracker.web.attr.owner"/></td> <td></td> ! <td align="right"><it:message key="itracker.web.attr.lastmodified"/></td> </tr> *************** *** 355,359 **** <td><it:formatIssueOwner issue="<%= createdIssues[i] %>" format="short"/></td> <td></td> ! <td><it:formatDate date="<%= createdIssues[i].getLastModifiedDate() %>"/></td> </tr> <% } %> --- 359,363 ---- <td><it:formatIssueOwner issue="<%= createdIssues[i] %>" format="short"/></td> <td></td> ! <td align="right"><it:formatDate date="<%= createdIssues[i].getLastModifiedDate() %>"/></td> </tr> <% } %> *************** *** 386,390 **** <td><it:message key="itracker.web.attr.owner"/></td> <td></td> ! <td><it:message key="itracker.web.attr.lastmodified"/></td> </tr> <% --- 390,394 ---- <td><it:message key="itracker.web.attr.owner"/></td> <td></td> ! <td align="right"><it:message key="itracker.web.attr.lastmodified"/></td> </tr> <% *************** *** 419,423 **** <td><it:formatIssueOwner issue="<%= watchedIssues[i] %>" format="short"/></td> <td></td> ! <td><it:formatDate date="<%= watchedIssues[i].getLastModifiedDate() %>"/></td> </tr> <% } %> --- 423,427 ---- <td><it:formatIssueOwner issue="<%= watchedIssues[i] %>" format="short"/></td> <td></td> ! <td align="right"><it:formatDate date="<%= watchedIssues[i].getLastModifiedDate() %>"/></td> </tr> <% } %> |
|
From: Marky G. <mar...@us...> - 2005-12-01 07:47:29
|
Update of /cvsroot/itracker/itracker/web/themes/standardtheme/module-portalhome-unauthenticated In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4803/web/themes/standardtheme/module-portalhome-unauthenticated Modified Files: Tag: itrackerhibernate forgot_password.jsp login.jsp self_register.jsp Log Message: JSTL import and first usage in header. Index: self_register.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/themes/standardtheme/module-portalhome-unauthenticated/Attic/self_register.jsp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** self_register.jsp 30 Nov 2005 19:08:57 -0000 1.1.2.1 --- self_register.jsp 1 Dec 2005 07:47:19 -0000 1.1.2.2 *************** *** 1,7 **** <%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/itracker.tld" prefix="it" %> ! <%@ taglib uri="/struts-bean.tld" prefix="bean" %> ! <%@ taglib uri="/struts-html.tld" prefix="html" %> ! <%@ taglib uri="/struts-logic.tld" prefix="logic" %> <%@ include file="/themes/standardtheme/includes/page_init.jsp" %> --- 1,9 ---- <%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/itracker.tld" prefix="it" %> ! <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %> ! <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %> ! <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %> ! <%@ taglib uri="/tags/fmt" prefix="fmt" %> ! <%@ taglib uri="/tags/c" prefix="c" %> <%@ include file="/themes/standardtheme/includes/page_init.jsp" %> Index: forgot_password.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/themes/standardtheme/module-portalhome-unauthenticated/Attic/forgot_password.jsp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** forgot_password.jsp 30 Nov 2005 19:08:57 -0000 1.1.2.1 --- forgot_password.jsp 1 Dec 2005 07:47:19 -0000 1.1.2.2 *************** *** 1,8 **** <%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/itracker.tld" prefix="it" %> ! <%@ taglib uri="/struts-bean.tld" prefix="bean" %> ! <%@ taglib uri="/struts-html.tld" prefix="html" %> ! <%@ taglib uri="/struts-logic.tld" prefix="logic" %> ! <%@ include file="/themes/standardtheme/includes/page_init.jsp" %> <bean:define id="pageTitleKey" value="itracker.web.forgotpass.title"/> --- 1,9 ---- <%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/itracker.tld" prefix="it" %> ! <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %> ! <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %> ! <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %> ! <%@ taglib uri="/tags/fmt" prefix="fmt" %> ! <%@ taglib uri="/tags/c" prefix="c" %> <%@ include file="/themes/standardtheme/includes/page_init.jsp" %> <bean:define id="pageTitleKey" value="itracker.web.forgotpass.title"/> Index: login.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/themes/standardtheme/module-portalhome-unauthenticated/Attic/login.jsp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** login.jsp 30 Nov 2005 19:08:57 -0000 1.1.2.1 --- login.jsp 1 Dec 2005 07:47:19 -0000 1.1.2.2 *************** *** 1,7 **** <%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/itracker.tld" prefix="it" %> ! <%@ taglib uri="/struts-bean.tld" prefix="bean" %> ! <%@ taglib uri="/struts-html.tld" prefix="html" %> ! <%@ taglib uri="/struts-logic.tld" prefix="logic" %> <%@ page import="cowsultants.itracker.ejb.client.util.*" %> --- 1,9 ---- <%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/itracker.tld" prefix="it" %> ! <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %> ! <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %> ! <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %> ! <%@ taglib uri="/tags/fmt" prefix="fmt" %> ! <%@ taglib uri="/tags/c" prefix="c" %> <%@ page import="cowsultants.itracker.ejb.client.util.*" %> |
|
From: Marky G. <mar...@us...> - 2005-12-01 07:47:28
|
Update of /cvsroot/itracker/itracker/web/themes/standardtheme/module-preferences In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4803/web/themes/standardtheme/module-preferences Modified Files: Tag: itrackerhibernate edit_preferences.jsp Log Message: JSTL import and first usage in header. Index: edit_preferences.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/themes/standardtheme/module-preferences/Attic/edit_preferences.jsp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** edit_preferences.jsp 30 Nov 2005 19:08:58 -0000 1.1.2.1 --- edit_preferences.jsp 1 Dec 2005 07:47:19 -0000 1.1.2.2 *************** *** 1,7 **** <%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/itracker.tld" prefix="it" %> ! <%@ taglib uri="/struts-bean.tld" prefix="bean" %> ! <%@ taglib uri="/struts-html.tld" prefix="html" %> ! <%@ taglib uri="/struts-logic.tld" prefix="logic" %> <%@ page import="cowsultants.itracker.ejb.client.util.UserUtilities" %> --- 1,9 ---- <%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/itracker.tld" prefix="it" %> ! <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %> ! <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %> ! <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %> ! <%@ taglib uri="/tags/fmt" prefix="fmt" %> ! <%@ taglib uri="/tags/c" prefix="c" %> <%@ page import="cowsultants.itracker.ejb.client.util.UserUtilities" %> *************** *** 52,56 **** <html:hidden property="login" value="<%= user.getLogin() %>"/> ! <table border="0" cellspacing="0" cellspacing="1" width="100%" align="center"> <tr> <td class="editColumnTitle"><it:message key="itracker.web.attr.login"/>:</td> --- 54,58 ---- <html:hidden property="login" value="<%= user.getLogin() %>"/> ! <table border="1" cellspacing="0" cellspacing="1" align="center"> <tr> <td class="editColumnTitle"><it:message key="itracker.web.attr.login"/>:</td> |
|
From: Marky G. <mar...@us...> - 2005-12-01 07:47:28
|
Update of /cvsroot/itracker/itracker/web/themes/standardtheme/module-reports In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4803/web/themes/standardtheme/module-reports Modified Files: Tag: itrackerhibernate list_reports.jsp Log Message: JSTL import and first usage in header. Index: list_reports.jsp =================================================================== RCS file: /cvsroot/itracker/itracker/web/themes/standardtheme/module-reports/Attic/list_reports.jsp,v retrieving revision 1.1.2.1 retrieving revision 1.1.2.2 diff -C2 -d -r1.1.2.1 -r1.1.2.2 *** list_reports.jsp 30 Nov 2005 19:08:58 -0000 1.1.2.1 --- list_reports.jsp 1 Dec 2005 07:47:19 -0000 1.1.2.2 *************** *** 1,7 **** <%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/itracker.tld" prefix="it" %> ! <%@ taglib uri="/struts-bean.tld" prefix="bean" %> ! <%@ taglib uri="/struts-html.tld" prefix="html" %> ! <%@ taglib uri="/struts-logic.tld" prefix="logic" %> <%@ page import="java.util.Arrays" %> --- 1,9 ---- <%@ page language="java" contentType="text/html;charset=UTF-8" %> <%@ taglib uri="/itracker.tld" prefix="it" %> ! <%@ taglib uri="/WEB-INF/tld/struts-bean.tld" prefix="bean" %> ! <%@ taglib uri="/WEB-INF/tld/struts-logic.tld" prefix="logic" %> ! <%@ taglib uri="/WEB-INF/tld/struts-html.tld" prefix="html" %> ! <%@ taglib uri="/tags/fmt" prefix="fmt" %> ! <%@ taglib uri="/tags/c" prefix="c" %> <%@ page import="java.util.Arrays" %> |