text
stringlengths
0
234
Object.Status := Jason.Tickets.Models.OPEN;
Object.Status_Filter := Ada.Strings.Unbounded.To_Unbounded_String ("pending");
Object.Tickets_Bean := Object.Tickets'Access;
Object.Project := Jason.Projects.Beans.Get_Project_Bean ("project");
return Object.all'Access;
end Create_Ticket_List_Bean;
procedure Initialize (Object : in out Ticket_Raw_Stat_Bean) is
begin
Object.Low_Bean := Util.Beans.Objects.To_Object (Object.Low'Unchecked_Access,
Util.Beans.Objects.STATIC);
Object.High_Bean := Util.Beans.Objects.To_Object (Object.High'Unchecked_Access,
Util.Beans.Objects.STATIC);
Object.Medium_Bean := Util.Beans.Objects.To_Object (Object.Medium'Unchecked_Access,
Util.Beans.Objects.STATIC);
Object.Closed_Bean := Util.Beans.Objects.To_Object (Object.Closed'Unchecked_Access,
Util.Beans.Objects.STATIC);
end Initialize;
-- ------------------------------
-- Get the value identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Ticket_Raw_Stat_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "low" then
return From.Low_Bean;
elsif Name = "medium" then
return From.Medium_Bean;
elsif Name = "high" then
return From.High_Bean;
elsif Name = "closed" then
return From.Closed_Bean;
elsif Name = "progress" then
return Util.Beans.Objects.To_Object (From.Progress);
else
return Jason.Tickets.Models.Stat_Bean (From).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Get the value identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Ticket_Report_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if name = "count" then
return Util.Beans.Objects.To_Object (Natural (From.Report.Length));
elsif name = "total" then
return From.Total_Bean;
end if;
return Util.Beans.Objects.Null_Object;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name.
-- ------------------------------
overriding
procedure Set_Value (From : in out Ticket_Report_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
null;
end Set_Value;
-- ------------------------------
-- Get the number of elements in the list.
-- ------------------------------
function Get_Count (From : Ticket_Report_Bean) return Natural is
begin
return Natural (From.Report.Length);
end Get_Count;
-- ------------------------------
-- Set the current row index. Valid row indexes start at 1.
-- ------------------------------
overriding
procedure Set_Row_Index (From : in out Ticket_Report_Bean;
Index : in Natural) is
begin
if Index = 1 then
From.Current := From.Report.First;
From.Current_Pos := Index;
elsif Index = Natural (From.Report.Length) then
From.Current := From.Report.Last;
From.Current_Pos := Index;
else
while Index > From.Current_Pos and Ticket_Stat_Vectors.Has_Element (From.Current) loop
Ticket_Stat_Vectors.Next (From.Current);
From.Current_Pos := From.Current_Pos + 1;
end loop;
end if;
Ticket_Stat_Bean (From.Element) := Ticket_Stat_Vectors.Element (From.Report,
From.Current_Pos);
end Set_Row_Index;
-- ------------------------------
-- Get the element at the current row index.