text
stringlengths
0
234
Storage => Util.Beans.Objects.STATIC);
elsif Name = "images" then
return Util.Beans.Objects.To_Object (Value => From.Page.Links_Bean,
Storage => Util.Beans.Objects.STATIC);
elsif Name = "templates" then
return Util.Beans.Objects.To_Object (Value => From.Page.Plugins_Bean,
Storage => Util.Beans.Objects.STATIC);
elsif Name = "imageThumbnail" then
declare
URI : Ada.Strings.Wide_Wide_Unbounded.Unbounded_Wide_Wide_String;
W : Natural := 64;
H : Natural := 64;
begin
if Image_Info_Maps.Has_Element (From.Page.Links.Pos) then
From.Page.Links.Make_Image_Link
(Link => Image_Info_Maps.Key (From.Page.Links.Pos),
Info => Image_Info_Maps.Element (From.Page.Links.Pos),
URI => URI,
Width => W,
Height => H);
end if;
return Util.Beans.Objects.To_Object (URI);
Function Definition: procedure Load_Wikis (List : in Wiki_Admin_Bean) is
Function Body: use AWA.Wikis.Models;
use AWA.Services;
Ctx : constant Contexts.Service_Context_Access := AWA.Services.Contexts.Current;
User : constant ADO.Identifier := Ctx.Get_User_Identifier;
Session : ADO.Sessions.Session := List.Module.Get_Session;
Query : ADO.Queries.Context;
begin
Query.Set_Query (AWA.Wikis.Models.Query_Wiki_List);
Query.Bind_Param ("user_id", User);
ADO.Sessions.Entities.Bind_Param (Params => Query,
Name => "table",
Table => AWA.Wikis.Models.WIKI_SPACE_TABLE,
Session => Session);
AWA.Wikis.Models.List (List.Wiki_List_Bean.all, Session, Query);
List.Flags (INIT_WIKI_LIST) := True;
end Load_Wikis;
-- ------------------------------
-- Get the wiki space identifier.
-- ------------------------------
function Get_Wiki_Id (List : in Wiki_Admin_Bean) return ADO.Identifier is
use type ADO.Identifier;
begin
if List.Wiki_Id = ADO.NO_IDENTIFIER then
if not List.Flags (INIT_WIKI_LIST) then
Load_Wikis (List);
end if;
if not List.Wiki_List.List.Is_Empty then
return List.Wiki_List.List.Element (0).Id;
end if;
end if;
return List.Wiki_Id;
end Get_Wiki_Id;
overriding
function Get_Value (List : in Wiki_Admin_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "wikis" then
if not List.Init_Flags (INIT_WIKI_LIST) then
Load_Wikis (List);
end if;
return Util.Beans.Objects.To_Object (Value => List.Wiki_List_Bean,
Storage => Util.Beans.Objects.STATIC);
elsif Name = "id" then
declare
use type ADO.Identifier;
Id : constant ADO.Identifier := List.Get_Wiki_Id;
begin
if Id = ADO.NO_IDENTIFIER then
return Util.Beans.Objects.Null_Object;
else
return Util.Beans.Objects.To_Object (Long_Long_Integer (Id));
end if;
Function Definition: function Get is new AWA.Modules.Get (Wiki_Module, Wiki_Module_Access, NAME);
Function Body: begin
return Get;
end Get_Wiki_Module;
-- ------------------------------
-- Create the wiki space.
-- ------------------------------
procedure Create_Wiki_Space (Module : in Wiki_Module;
Wiki : in out AWA.Wikis.Models.Wiki_Space_Ref'Class) is
procedure Copy_Page (Item : in String;
Done : out Boolean);
Ctx : constant Services.Contexts.Service_Context_Access := AWA.Services.Contexts.Current;
User : constant ADO.Identifier := Ctx.Get_User_Identifier;
DB : ADO.Sessions.Master_Session := AWA.Services.Contexts.Get_Master_Session (Ctx);
WS : AWA.Workspaces.Models.Workspace_Ref;