text
stringlengths
0
234
-- Create the Wiki_Space_Bean bean instance.
-- ------------------------------
function Create_Wiki_Space_Bean (Module : in AWA.Wikis.Modules.Wiki_Module_Access)
return Util.Beans.Basic.Readonly_Bean_Access is
Object : constant Wiki_Space_Bean_Access := new Wiki_Space_Bean;
begin
Object.Module := Module;
return Object.all'Access;
end Create_Wiki_Space_Bean;
-- ------------------------------
-- Get the value identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Page_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "wiki_id" then
if From.Wiki_Space.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return ADO.Utils.To_Object (From.Wiki_Space.Get_Id);
end if;
elsif Name = "text" then
if From.Has_Content then
return Util.Beans.Objects.To_Object (From.New_Content);
elsif From.Content.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (String '(From.Content.Get_Content));
end if;
elsif Name = "date" then
if From.Content.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return From.Content.Get_Value ("create_date");
end if;
elsif Name = "format" then
if not From.Content.Is_Null then
return From.Content.Get_Value ("format");
elsif not From.Wiki_Space.Is_Null then
return From.Wiki_Space.Get_Value ("format");
else
return Util.Beans.Objects.Null_Object;
end if;
elsif Name = "comment" then
if From.Content.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (String '(From.Content.Get_Save_Comment));
end if;
elsif Name = "tags" then
return Util.Beans.Objects.To_Object (From.Tags_Bean, Util.Beans.Objects.STATIC);
elsif Name = "is_public" then
if not From.Is_Null then
return AWA.Wikis.Models.Wiki_Page_Bean (From).Get_Value (Name);
elsif not From.Wiki_Space.Is_Null then
return From.Wiki_Space.Get_Value (Name);
else
return Util.Beans.Objects.Null_Object;
end if;
elsif From.Is_Null then
return Util.Beans.Objects.Null_Object;
else
return AWA.Wikis.Models.Wiki_Page_Bean (From).Get_Value (Name);
end if;
end Get_Value;
-- ------------------------------
-- Set the value identified by the name.
-- ------------------------------
overriding
procedure Set_Value (From : in out Wiki_Page_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is
begin
if Name = "id" then
if not Util.Beans.Objects.Is_Empty (Value) then
declare
Id : constant ADO.Identifier := ADO.Utils.To_Identifier (Value);
begin
From.Module.Load_Page (From, From.Content, From.Tags, Id);
Function Definition: procedure Load_List (Into : in out Wiki_List_Bean) is
Function Body: use AWA.Wikis.Models;
use AWA.Services;
use type Ada.Strings.Unbounded.Unbounded_String;
use type ADO.Identifier;
Ctx : constant Contexts.Service_Context_Access := AWA.Services.Contexts.Current;
User : constant ADO.Identifier := Ctx.Get_User_Identifier;
Session : ADO.Sessions.Session := Into.Module.Get_Session;
Query : ADO.Queries.Context;
Count_Query : ADO.Queries.Context;
Tag_Id : ADO.Identifier;
First : constant Natural := (Into.Page - 1) * Into.Page_Size;
Tag : constant String := Ada.Strings.Unbounded.To_String (Into.Tag);
begin
if Into.Wiki_Id = ADO.NO_IDENTIFIER then
return;