/* * SAND development/deployment environment * Copyright (C) 2004-2007 SAND Services Inc. * * This library is free software; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public * License as published by the Free Software Foundation; either * version 2.1 of the License, or (at your option) any later version. * * This library 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 * Lesser General Public License for more details. * * You should have received a copy of the GNU Lesser General Public * License along with this library; if not, write to the Free Software * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA */ package org.sandev.TaskHeap.structs; import java.util.Date; /** * A PlanComponent represents part of a Plan. It holds the base fields * common to both Tasks and Plans. PlanComponents may be queried, but * are not be modified directly. * * @sand.structmessage persist * @sand.verbforms update query collection * @sand.summaryfields name * @sand.printname "Plan Component" * @sand.help * A common description of anything that can be part of a plan. Tasks, * Plans, and External Plans are all Plan Components since they can be * part of another Plan. */ public class PlanComponentStruct { /** * Each plan component requires a name so that humans can refer to it * by something other than its unique identifier. Names should be short, * but descriptive enough to identify the element within a report. * *
Originally the name was declared to be unique, to avoid creating * heaps with multiple tasks or plans with generic names like "test" or * "requirements". Generic naming is strongly discouraged because * duplicate names
However, there are times when having two tasks with the same * name may be reasonable, and having the application disallow this * generally can get in the way. So the unique constraint was * removed, even though experience has shown that unique naming * greatly increases manageability, especially over time. Good names * are strongly recommended. The few additional seconds spent coming * up with a good name will easily save minutes when working through * the heap as a whole. * * @sand.invalid "TASKHEAP_INVALID_NAME" * @sand.stringlength 60 128 * @sand.help * A few words to identify this component in the summary display. */ protected String name; /** * The description of this plan component. Organizational plans * or milestones may have relatively short descriptions, while tasks * typically have fairly significant text describing the work to be * done. * * @sand.invalid "TASKHEAP_INVALID_DESCRIPTION" * @sand.stringlength 512 1048576 * @sand.help * The description of this plan component. Organizational plans * or milestones may have relatively short descriptions, while tasks * typically have fairly significant text describing the work to be * done. * *
To provide maximum display flexibility, the description field * is plain text (no HTML or word processor formatting). Only line * breaks are preserved. However the display will convert recognized * email addresses and URLs to display links, to allow for including * references to supporting documentation or email contacts.
*/ protected String description; /** * If a PlanComponent is part of a Plan, then this is a reference * to the plan that contains it. If the reference is null, then this * is a top level heap element. * * @sand.ref org.sandev.TaskHeap.structs.PlanStruct * @sand.help * If a PlanComponent is part of a Plan, then this is a reference * to the plan that contains it. If the reference is null, then this * is a top level heap element. */ protected long parent; /** * The heap this work belongs to. * * @sand.ref org.sandev.TaskHeap.structs.HeapAttributesStruct * @sand.help * The heap this work belongs to. */ protected long heap; /** * An estimate of the number of hours necessary to complete this * plan component. All estimates are in hours. The conversion of time * estimates into calendar elapsed time is based on the hours per day * in the heap attributes. * *For a Task, the time estimate is simply the value entered. For * a Plan, this is the value calculated from the tasks it contains. * For an ExternalPlan, this is the value retrieved from the Plan * being referenced. All automatic processing is done on behalf of * the current user by the system, so any cascading changes are * recorded based on the user that triggered them.
* * @sand.range >= 0 * @sand.default 0 * @sand.stringlength 3 20 * @sand.metatype hours * @sand.printname "time estimate" * @sand.help * An estimate of the number of hours necessary to complete this * plan component. All estimates are in even hours. Fractional * hours are not supported, see the * user manual for details. The * conversion of time estimates into calendar elapsed time is * based on the hours per day in the heap attributes. * *For a Task, the time estimate is simply the value entered. For * a Plan, this is the value calculated from the tasks it contains. * For an ExternalPlan, this is the value retrieved from the Plan * being referenced. All automatic processing is done on behalf of * the current user by the system, so any cascading changes are * recorded based on the user that triggered them.
*/ protected int timeEstimate; /** * The roles responsible for completion or oversight of this work. * * @sand.ref org.sandev.TaskHeap.structs.RoleStruct * @sand.flags dynamicselect * @sand.help * The roles responsible for completion or oversight of this work. */ protected long[] responsibilities; /** * The specific person this work is assigned to, if any. * * @sand.ref org.sandev.TaskHeap.structs.HeapAssociationStruct * @sand.flags dynamicselect * @sand.help * The specific person this work is assigned to, if any. */ protected long assignedTo; /** * The type of deadline due date calculation to be applied. * * @sand.enumint NONE 0 "None" * @sand.enumint FIXED 1 "Fixed" * @sand.enumint RELATIVE 2 "Relative" * * @sand.invalid -1 * @sand.default NONE * @sand.printname "due date type" * @sand.help * The type of deadline due date calculation to be applied. */ protected int dueType; /** * The date when this plan component must be completed. If the * estimated completion date goes beyond this date, then this * work item will be noted prominently in the heap display as * being overdue. * * @sand.default 1428458375000L * @sand.dateformat "MMM d, yyyy h:mm a" "MMM d, yyyy h:mm a" * @sand.printname "due date" * @sand.help * The date when this plan component must be completed. If the * estimated completion date goes beyond this date, then this * work item will be noted prominently in the heap display as * being overdue. * *Note that this means that work items are flagged as overdue * as soon as they slip, not when their due date is exceeded. This * provides advanced warning that additional work prioritization * planning will be required in order to meet the deadline established * by the due date.
*/ protected Date dueDate; /** * The time difference between when this is due, and when the * reference is due. * * @sand.printname "due date delta" * @sand.help * The time difference between when this is due, and when the * reference is due. So for example if this needs to be finished * five days before the reference, then the delta would be -5. If it * needs to be finished two days after the reference, the the delta * would be 2. If this needs to be finished at the same time then the * delta is 0. */ protected int dueDelta; /** * The absolute value of the dueDelta field. Used for display. * * @sand.printname "due date delta value" * @sand.help * How much before or after the reference is this due. */ protected transient int dueDeltaValue; /** * Whether this is due before or after the reference. * * @sand.enumint BEFORE 0 "before" * @sand.enumint AFTER 1 "after" * * @sand.default BEFORE * @sand.invalid -1 * @sand.printname "due date delta sense" * @sand.help * Whether this is due before or after the reference. */ protected transient int dueDeltaSense; /** * The time units for the due date delta value. * * @sand.enumint HOURS 0 "Hours" * @sand.enumint DAYS 1 "Days" * @sand.enumint WEEKS 2 "Weeks" * * @sand.invalid -1 * @sand.default DAYS * @sand.printname "delta time units" * @sand.help * The time units for the due date delta value. */ protected int dueTimeUnits; /** * The plan or task to use as a reference when calculating the due * date. Referenced only if the due date type is "Relative". A * zero value indicates the date is relative to the root due date * from the heap settings. * *This field should generally only be displayed when the the * dueDateType is "Relative", and then as a dropdown selection * rather than an open reference find. The idea is to display * dropdown selection containing the list of parent plans back to * the root (dueDate and name for each).
* * @sand.flags dynamicselect * @sand.ref org.sandev.TaskHeap.structs.PlanStruct * @sand.printname "due date reference" * @sand.help * The plan or task to use as a reference when calculating the due * date. Referenced only if the due date type is "Relative". */ protected long dueReference; /** * The rounding to be applied when calculating a relative due date. * The print values are lower case since they are sandwiched between * the target reference and the following day value when displayed. * * @sand.enumint EXACT 0 "Exact (no rounding)" * @sand.enumint NEAREST 1 "rounded to nearest" * @sand.enumint PRECEDING 2 "rounded to preceding" * @sand.enumint FOLLOWING 3 "rounded to following" * @sand.enumint MIDMONTH 4 "rounded to mid-month" * * @sand.invalid -1 * @sand.default EXACT * @sand.printname "rounding" * @sand.help * The rounding to be applied when calculating a relative due date. */ protected int relRounding; /** * The day of the week the rounding should default to. These values * correspond to the constant values declared in java.util.Calendar, * but structs aren't allowed to have external dependencies like * that so the integer values are used for the declaration here. * * @sand.enumint MONDAY 2 "Monday" * @sand.enumint TUESDAY 3 "Tuesday" * @sand.enumint WEDNESDAY 4 "Wednesday" * @sand.enumint THURSDAY 5 "Thursday" * @sand.enumint FRIDAY 6 "Friday" * @sand.enumint SATURDAY 7 "Saturday" * @sand.enumint SUNDAY 1 "Sunday" * * @sand.invalid -1 * @sand.default MONDAY * @sand.printname "round to day" * @sand.help * The day of the week the rounding should default to. */ protected int relRoundDay; /** * Attached comments. * * @sand.flags stringpersist * @sand.stringlength 512 1048576 * @sand.help * Attached comments providing additional detail about status, links * to background material, etc. */ protected NoteStruct[] notes; }