text stringlengths 0 234 |
|---|
Outcome : in out Ada.Strings.Unbounded.Unbounded_String) is |
use type AWA.Comments.Beans.Comment_List_Bean_Access; |
Comment_List : AWA.Comments.Beans.Comment_List_Bean_Access; |
begin |
Bean.Module.Load_Ticket (Bean, Bean.Project.all, Bean.Tags, Bean.Ticket_Id); |
Comment_List := AWA.Comments.Beans.Get_Comment_List_Bean ("ticketComments"); |
if Comment_List /= null then |
Comment_List.Load_Comments (Bean.Get_Id); |
end if; |
Outcome := Ada.Strings.Unbounded.To_Unbounded_String ("loaded"); |
end Load; |
-- ------------------------------ |
-- Get the value identified by the name. |
-- ------------------------------ |
overriding |
function Get_Value (From : in Ticket_Bean; |
Name : in String) return Util.Beans.Objects.Object is |
begin |
if Name = "project_id" then |
if From.Project.Is_Inserted then |
return ADO.Utils.To_Object (From.Project.Get_Id); |
else |
return ADO.Utils.To_Object (From.Project.Get_Id); |
end if; |
elsif Name = "ticket_id" or Name = "id" then |
if From.Is_Inserted or From.Is_Loaded then |
return ADO.Utils.To_Object (From.Get_Id); |
else |
return ADO.Utils.To_Object (From.Ticket_Id); |
end if; |
elsif Name = "tags" then |
return Util.Beans.Objects.To_Object (From.Tags_Bean, Util.Beans.Objects.STATIC); |
else |
return Jason.Tickets.Models.Ticket_Bean (From).Get_Value (Name); |
end if; |
end Get_Value; |
-- ------------------------------ |
-- Set the value identified by the name. |
-- ------------------------------ |
overriding |
procedure Set_Value (From : in out Ticket_Bean; |
Name : in String; |
Value : in Util.Beans.Objects.Object) is |
begin |
if Name = "project_id" and not Util.Beans.Objects.Is_Empty (Value) then |
From.Project.Set_Id (ADO.Utils.To_Identifier (Value)); |
elsif Name = "ticket_id" and not Util.Beans.Objects.Is_Empty (Value) then |
From.Ticket_Id := ADO.Utils.To_Identifier (Value); |
elsif Name = "id" and not Util.Beans.Objects.Is_Empty (Value) then |
From.Ticket_Id := ADO.Utils.To_Identifier (Value); |
From.Module.Load_Ticket (From, From.Project.all, From.Tags, From.Ticket_Id); |
else |
Jason.Tickets.Models.Ticket_Bean (From).Set_Value (Name, Value); |
end if; |
end Set_Value; |
-- ------------------------------ |
-- Create the Ticket_Bean bean instance. |
-- ------------------------------ |
function Create_Ticket_Bean (Module : in Jason.Tickets.Modules.Ticket_Module_Access) |
return Util.Beans.Basic.Readonly_Bean_Access is |
Object : constant Ticket_Bean_Access := new Ticket_Bean; |
begin |
Object.Module := Module; |
Object.Tags_Bean := Object.Tags'Access; |
Object.Tags.Set_Entity_Type (Jason.Tickets.Models.TICKET_TABLE); |
Object.Tags.Set_Permission ("ticket-update"); |
Object.Project := Jason.Projects.Beans.Get_Project_Bean ("project"); |
return Object.all'Access; |
end Create_Ticket_Bean; |
-- Get the value identified by the name. |
overriding |
function Get_Value (From : in Ticket_List_Bean; |
Name : in String) return Util.Beans.Objects.Object is |
Pos : Natural; |
begin |
if Name = "tags" then |
Pos := From.Tickets.Get_Row_Index; |
if Pos = 0 then |
return Util.Beans.Objects.Null_Object; |
end if; |
declare |
Item : constant Models.List_Info := From.Tickets.List.Element (Pos - 1); |
begin |
return From.Tags.Get_Tags (Item.Id); |
Function Definition: function Create_Ticket_List_Bean (Module : in Jason.Tickets.Modules.Ticket_Module_Access) |
Function Body: return Util.Beans.Basic.Readonly_Bean_Access is |
Object : constant Ticket_List_Bean_Access := new Ticket_List_Bean; |
begin |
Object.Module := Module; |
Object.Page_Size := 20; |
Object.Count := 0; |
Object.Page := 1; |
Object.Priority := 0; |
Object.Project_Id := ADO.NO_IDENTIFIER; |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.