text
stringlengths
0
234
end if;
Into.Wiki_Space.Set_Id (Into.Wiki_Id);
if Tag'Length > 0 then
AWA.Tags.Modules.Find_Tag_Id (Session, Tag, Tag_Id);
if Tag_Id = ADO.NO_IDENTIFIER then
return;
end if;
Query.Set_Query (AWA.Wikis.Models.Query_Wiki_Page_Tag_List);
Query.Bind_Param (Name => "tag", Value => Tag_Id);
Count_Query.Set_Count_Query (AWA.Wikis.Models.Query_Wiki_Page_Tag_List);
Count_Query.Bind_Param (Name => "tag", Value => Tag_Id);
ADO.Sessions.Entities.Bind_Param (Params => Query,
Name => "page_table",
Table => AWA.Wikis.Models.WIKI_PAGE_TABLE,
Session => Session);
ADO.Sessions.Entities.Bind_Param (Params => Count_Query,
Name => "page_table",
Table => AWA.Wikis.Models.WIKI_PAGE_TABLE,
Session => Session);
else
Query.Set_Query (AWA.Wikis.Models.Query_Wiki_Page_List);
Count_Query.Set_Count_Query (AWA.Wikis.Models.Query_Wiki_Page_List);
end if;
if Into.Sort = "name" then
Query.Bind_Param (Name => "order1",
Value => ADO.Parameters.Token '("page.name"));
elsif Into.Sort = "recent" then
Query.Bind_Param (Name => "order1",
Value => ADO.Parameters.Token '("content.create_date DESC"));
elsif Into.Sort = "popular" then
Query.Bind_Param (Name => "order1",
Value => ADO.Parameters.Token '("page.read_count DESC"));
else
return;
end if;
Query.Bind_Param (Name => "first", Value => First);
Query.Bind_Param (Name => "count", Value => Into.Page_Size);
Query.Bind_Param (Name => "wiki_id", Value => Into.Wiki_Id);
Query.Bind_Param (Name => "user_id", Value => User);
Count_Query.Bind_Param (Name => "wiki_id", Value => Into.Wiki_Id);
Count_Query.Bind_Param (Name => "user_id", Value => User);
ADO.Sessions.Entities.Bind_Param (Params => Query,
Name => "table",
Table => AWA.Wikis.Models.WIKI_SPACE_TABLE,
Session => Session);
ADO.Sessions.Entities.Bind_Param (Params => Count_Query,
Name => "table",
Table => AWA.Wikis.Models.WIKI_SPACE_TABLE,
Session => Session);
AWA.Wikis.Models.List (Into.Pages, Session, Query);
Into.Count := ADO.Datasets.Get_Count (Session, Count_Query);
declare
List : ADO.Utils.Identifier_Vector;
Iter : Wiki_Page_Info_Vectors.Cursor := Into.Pages.List.First;
begin
while Wiki_Page_Info_Vectors.Has_Element (Iter) loop
List.Append (Wiki_Page_Info_Vectors.Element (Iter).Id);
Wiki_Page_Info_Vectors.Next (Iter);
end loop;
Into.Tags.Load_Tags (Session, AWA.Wikis.Models.WIKI_PAGE_TABLE.Table.all,
List);
Function Definition: function Create_Wiki_List_Bean (Module : in AWA.Wikis.Modules.Wiki_Module_Access)
Function Body: return Util.Beans.Basic.Readonly_Bean_Access is
Object : constant Wiki_List_Bean_Access := new Wiki_List_Bean;
begin
Object.Module := Module;
Object.Pages_Bean := Object.Pages'Access;
Object.Page_Size := 20;
Object.Page := 1;
Object.Count := 0;
Object.Wiki_Id := ADO.NO_IDENTIFIER;
Object.Wiki_Space := Get_Wiki_Space_Bean ("adminWikiSpace");
return Object.all'Access;
end Create_Wiki_List_Bean;
-- ------------------------------
-- Get the value identified by the name.
-- ------------------------------
overriding
function Get_Value (From : in Wiki_Version_List_Bean;
Name : in String) return Util.Beans.Objects.Object is
begin
if Name = "versions" then
return Util.Beans.Objects.To_Object (Value => From.Versions_Bean,
Storage => Util.Beans.Objects.STATIC);
elsif Name = "page_count" then
return Util.Beans.Objects.To_Object ((From.Count + From.Page_Size - 1) / From.Page_Size);
else
return AWA.Wikis.Models.Wiki_Version_List_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_Version_List_Bean;
Name : in String;
Value : in Util.Beans.Objects.Object) is