-----------------------------------------------------------------------
--  awa-mail-client -- Mail client interface
--  Copyright (C) 2012 Stephane Carrez
--  Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
--  Licensed under the Apache License, Version 2.0 (the "License");
--  you may not use this file except in compliance with the License.
--  You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
--  Unless required by applicable law or agreed to in writing, software
--  distributed under the License is distributed on an "AS IS" BASIS,
--  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--  See the License for the specific language governing permissions and
--  limitations under the License.
-----------------------------------------------------------------------

--  The AWA.Mail.Clients package defines a mail client API used by the mail module.
--  It defines two interfaces that must be implemented.  This allows to have an implementation
--  based on an external application such as <tt>sendmail</tt> and other implementation that
--  use an SMTP connection.
package AWA.Mail.Clients is

   type Recipient_Type is (TO, CC, BCC);

   --  ------------------------------
   --  Mail Message
   --  ------------------------------
   --  The Mail_Message represents an abstract mail message that can be initialized
   --  before being sent.
   type Mail_Message is limited interface;
   type Mail_Message_Access is access all Mail_Message'Class;

   --  Set the <tt>From</tt> part of the message.
   procedure Set_From (Message : in out Mail_Message;
                       Name    : in String;
                       Address : in String) is abstract;

   --  Add a recipient for the message.
   procedure Add_Recipient (Message : in out Mail_Message;
                            Kind    : in Recipient_Type;
                            Name    : in String;
                            Address : in String) is abstract;

   --  Set the subject of the message.
   procedure Set_Subject (Message : in out Mail_Message;
                          Subject : in String) is abstract;

   --  Set the body of the message.
   procedure Set_Body (Message : in out Mail_Message;
                       Content : in String) is abstract;

   --  Send the email message.
   procedure Send (Message : in out Mail_Message) is abstract;

   --  ------------------------------
   --  Mail Manager
   --  ------------------------------
   --  The Mail_Manager is the entry point to create a new mail message
   --  and be able to send it.
   type Mail_Manager is limited interface;
   type Mail_Manager_Access is access all Mail_Manager'Class;

   --  Create a new mail message.
   function Create_Message (Manager : in Mail_Manager) return Mail_Message_Access is abstract;

end AWA.Mail.Clients;

Define a set of interface to send an email and have several possible implementations


-----------------------------------------------------------------------
--  util-properties-form-tests -- Test reading form file into properties
--  Copyright (C) 2020 Stephane Carrez
--  Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
--  Licensed under the Apache License, Version 2.0 (the "License");
--  you may not use this file except in compliance with the License.
--  You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
--  Unless required by applicable law or agreed to in writing, software
--  distributed under the License is distributed on an "AS IS" BASIS,
--  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--  See the License for the specific language governing permissions and
--  limitations under the License.
-----------------------------------------------------------------------

with Util.Tests;

package Util.Properties.Form.Tests is

   procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite);

   type Test is new Util.Tests.Test with null record;

   --  Test loading a form file into a properties object.
   procedure Test_Parse_Form (T : in out Test);

end Util.Properties.Form.Tests;

Add unit test for Parse_Form procedure

Add unit test for Parse_Form procedure


-----------------------------------------------------------------------
--  babel-stores-local-tests - Unit tests for babel streams
--  Copyright (C) 2016 Stephane Carrez
--  Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
--  Licensed under the Apache License, Version 2.0 (the "License");
--  you may not use this file except in compliance with the License.
--  You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
--  Unless required by applicable law or agreed to in writing, software
--  distributed under the License is distributed on an "AS IS" BASIS,
--  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--  See the License for the specific language governing permissions and
--  limitations under the License.
-----------------------------------------------------------------------

with Util.Tests;

package Babel.Stores.Local.Tests is

   procedure Add_Tests (Suite : in Util.Tests.Access_Test_Suite);

   type Test is new Util.Tests.Test with null record;

   --  Test the Read_File and Write_File operations.
   procedure Test_Read_File (T : in out Test);

end Babel.Stores.Local.Tests;

Add unit tests for local store and Read_File/Write_File operations


-----------------------------------------------------------------------
--  awa-blogs-servlets -- Serve files saved in the storage service
--  Copyright (C) 2017 Stephane Carrez
--  Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
--  Licensed under the Apache License, Version 2.0 (the "License");
--  you may not use this file except in compliance with the License.
--  You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
--  Unless required by applicable law or agreed to in writing, software
--  distributed under the License is distributed on an "AS IS" BASIS,
--  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--  See the License for the specific language governing permissions and
--  limitations under the License.
-----------------------------------------------------------------------
with Ada.Strings.Unbounded;
with Ada.Calendar;

with ADO;

with ASF.Requests;
with AWA.Storages.Servlets;
package AWA.Blogs.Servlets is

   --  The <b>Storage_Servlet</b> represents the component that will handle
   --  an HTTP request received by the server.
   type Image_Servlet is new AWA.Storages.Servlets.Storage_Servlet with private;

   --  Load the data content that correspond to the GET request and get the name as well
   --  as mime-type and date.
   procedure Load (Server   : in Image_Servlet;
                   Request  : in out ASF.Requests.Request'Class;
                   Name     : out Ada.Strings.Unbounded.Unbounded_String;
                   Mime     : out Ada.Strings.Unbounded.Unbounded_String;
                   Date     : out Ada.Calendar.Time;
                   Data     : out ADO.Blob_Ref);

private

   type Image_Servlet is new AWA.Storages.Servlets.Storage_Servlet with null record;

end AWA.Blogs.Servlets;

Add blog servlets definition with Image_Servlet type


-----------------------------------------------------------------------
--  widgets-factory -- Factory for widget Components
--  Copyright (C) 2013 Stephane Carrez
--  Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
--  Licensed under the Apache License, Version 2.0 (the "License");
--  you may not use this file except in compliance with the License.
--  You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
--  Unless required by applicable law or agreed to in writing, software
--  distributed under the License is distributed on an "AS IS" BASIS,
--  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--  See the License for the specific language governing permissions and
--  limitations under the License.
-----------------------------------------------------------------------

with ASF.Factory;

package ASF.Components.Widgets.Factory is

   --  Get the widget component factory.
   function Definition return ASF.Factory.Factory_Bindings_Access;

end ASF.Components.Widgets.Factory;

Define the factory for the creation of widget components


-----------------------------------------------------------------------
--  asf-rest-operation -- REST API Operation Definition
--  Copyright (C) 2017 Stephane Carrez
--  Written by Stephane Carrez (Stephane.Carrez@gmail.com)
--
--  Licensed under the Apache License, Version 2.0 (the "License");
--  you may not use this file except in compliance with the License.
--  You may obtain a copy of the License at
--
--      http://www.apache.org/licenses/LICENSE-2.0
--
--  Unless required by applicable law or agreed to in writing, software
--  distributed under the License is distributed on an "AS IS" BASIS,
--  WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
--  See the License for the specific language governing permissions and
--  limitations under the License.
-----------------------------------------------------------------------
package body ASF.Rest.Operation is

   URI_Mapping : aliased String := URI;
   Desc        : aliased Static_Descriptor
      := (Next       => null,
          Method     => Method,
          Handler    => Handler,
          Pattern    => URI_Mapping'Access,
          Permission => Permission);

   function Definition return Descriptor_Access is
   begin
      return Desc'Access;
   end Definition;

end ASF.Rest.Operation;

Implement the REST API definition package