ODS Specification Components

ODS database back end

Tables

ODS base class web_app


  CREATE TYPE WEB_APP AS
  (
    WA_NAME VARCHAR,      -- i.e., blog
    WA_MEMBER_MODEL INT   -- how registration can be made
  )
  METHOD wa_id_string ()                              RETURNS any,     -- string in memberships list
  METHOD wa_new_inst (login varchar)                  RETURNS any,     -- registering
  METHOD wa_join_request (login varchar)              RETURNS any,     -- registering
  METHOD wa_leave_notify (login varchar)              RETURNS any,     -- cancel join
  METHOD wa_state_edit_form (stream any)              RETURNS any,     -- emit a state edit form into the stream present this to owner for setting the state
  METHOD wa_membership_edit_form (stream any)         RETURNS any,     -- emit a membership edit form into the stream present this to owner for setting the state
  METHOD wa_front_page (stream any)                   RETURNS any,     -- emit a front page into the stream present this to owner for setting the state
  METHOD wa_state_posted (post any, 
                          stream any)                 RETURNS any,     -- process a post, updating state and writing a reply into the stream for web interface
  METHOD wa_periodic_activity ()                      RETURNS any,     -- send reminders, invoices, refresh content whatever is regularly done.
  METHOD wa_drop_instance ()                          RETURNS any,
  METHOD wa_private_url ()                            RETURNS any,
  METHOD wa_notify_member_changed (account int, 
                                   otype int, 
                                   ntype int, 
                                   odata any, 
                                   ndata any, 
                                   ostatus any, 
                                   nstatus any)       RETURNS any,
  METHOD wa_member_data (u_id int, 
                         stream any)                  RETURNS any,     -- application specific membership attributes
  METHOD wa_member_data_edit_form (u_id int, 
                                   stream any)        RETURNS any,     -- application specific membership attributes edit form
  METHOD wa_class_details ()                          RETURNS varchar, -- returns details about the nature of the instance class
  METHOD wa_https_supported ()                        RETURNS int,
  METHOD wa_dashboard ()                              RETURNS any,
  METHOD wa_home_url ()                               RETURNS varchar,
  METHOD wa_dashboard ()                              RETURNS any,
  METHOD wa_addition_urls ()                          RETURNS any,
  METHOD wa_addition_instance_urls ()                 RETURNS any,
  METHOD wa_addition_instance_urls (in lpath any)     RETURNS any,
  METHOD wa_domain_set (in domain varchar)            RETURNS any,                                                  
  METHOD wa_size ()                                   RETURNS int,                                        
  METHOD wa_front_page_as_user (in stream any, 
                                in user_name varchar) RETURNS any,
  METHOD wa_rdf_url (in vhost varchar, 
                     in lhost varchar)                RETURNS varchar,                 
  METHOD wa_post_url (in vhost varchar, 
                      in lhost varchar, 
                      in inst_name varchar, 
                      in post any)                    RETURNS varchar,
  METHOD wa_domain_set(in domain varchar)             RETURNS any,
  wa_new_instance_url()                               RETURNS any,
  wa_edit_instance_url()                              RETURNS any
)
;

ODS methods for base class web_app


CREATE METHOD wa_id_string () for web_app
{
  return '';
};


CREATE METHOD wa_dashboard () for web_app
{
  return '';
};


CREATE METHOD wa_member_data (in u_id int, inout stream any) for web_app
{
  return 'N/A';
};


CREATE METHOD wa_member_data_edit_form (in u_id int, inout stream any) for web_app
{
  return;
};


CREATE METHOD wa_membership_edit_form (inout stream any) for web_app
{
  return;
};


CREATE METHOD wa_front_page (inout stream any) for web_app
{
  return;
};


CREATE METHOD wa_front_page_as_user (inout stream any, in user_name varchar) for web_app
{
  return;
};


CREATE METHOD wa_size () for web_app
{
  return 0;
};


CREATE METHOD wa_join_request (in login varchar) for web_app
{
  return;
};


CREATE METHOD wa_class_details() for web_app
{
  return null;
};


CREATE METHOD wa_state_edit_form (inout stream any) for web_app
{
  return;
};


CREATE METHOD wa_state_posted (in post any, inout stream any) for web_app
{
  return;
};


CREATE METHOD wa_home_url () for web_app
{
  return null;
};


CREATE METHOD wa_rdf_url (in vhost varchar, in lhost varchar) for web_app
{
  return null;
};


CREATE METHOD wa_post_url (in vhost varchar, in lhost varchar, in inst_name varchar, in post any) for web_app
{
  return null;
};


CREATE METHOD wa_addition_urls () for web_app
{
  return null;
};


CREATE METHOD wa_addition_instance_urls () for web_app
{
  return null;
};


CREATE METHOD wa_addition_instance_urls (in lpath any) for web_app
{
  return null;
};


CREATE METHOD wa_domain_set (in domain varchar) for web_app
{
  return self;
};


CREATE METHOD wa_private_url () for web_app
{
  return null;
};


CREATE METHOD wa_https_supported () for web_app
{
  return;
};


CREATE METHOD wa_drop_instance () for web_app {
for select VH_HOST as _host, VH_LISTEN_HOST as _lhost, VH_LPATH as _path, WAI_INST as _inst
  from WA_INSTANCE, WA_VIRTUAL_HOSTS where WAI_NAME = self.wa_name and WAI_ID = VH_INST and VH_HOST not like '%ini%'
  do
  {
    declare inst web_app;
    inst := _inst;
    -- Application additional URL
    declare len, i, ssl_port integer;
    declare cur_add_url, addons any;

    addons := inst.wa_addition_urls();
    len := length(addons);
    i := 0;
    while (i < len)
    {
      cur_add_url := addons [i];
      VHOST_REMOVE(
        vhost=>_host,
        lhost=>_lhost,
        lpath=>cur_add_url[2]);
      i := i + 1;
    }
    -- Instance additional URL
    addons := inst.wa_addition_instance_urls(_path);
    len := length(addons);
    i := 0;
    while (i < len)
    {
      cur_add_url := addons[i];
      VHOST_REMOVE(
        vhost=>_host,
        lhost=>_lhost,
        lpath=>cur_add_url[2]);
      i := i + 1;
    }
    -- Home URL
    VHOST_REMOVE(vhost=>_host, lhost=>_lhost, lpath=>_path);
  }
  delete from WA_MEMBER where WAM_INST = self.wa_name;
  delete from WA_INSTANCE where WAI_NAME = self.wa_name;
};


CREATE METHOD wa_periodic_activity () for web_app
{
  return;
};


CREATE METHOD wa_new_inst (in login varchar) for web_app
{
  declare uid, id, tn, is_pub, is_memb_visb any;

  uid := (select U_ID from SYS_USERS where U_NAME = login);
  select WAI_ID, WAI_TYPE_NAME, WAI_IS_PUBLIC, WAI_MEMBERS_VISIBLE
      into id, tn, is_pub, is_memb_visb from WA_INSTANCE where WAI_NAME = self.wa_name;
  -- WAM_STATUS = 1 means OWNER
  -- XXX: check this why is off
  --set triggers off;
  insert into WA_MEMBER
      (WAM_USER, WAM_INST, WAM_MEMBER_TYPE, WAM_STATUS, WAM_HOME_PAGE, WAM_APP_TYPE, WAM_IS_PUBLIC, WAM_MEMBERS_VISIBLE)
      values (uid, self.wa_name, 1, 1, wa_set_url_t (self), tn, is_pub, is_memb_visb);
  --set triggers on;
  return id;
};

CREATE METHOD wa_new_instance_url () for web_app{
  return 'new_inst.vspx';
};

CREATE METHOD wa_edit_instance_url () for web_app{
  return 'edit_inst.vspx';
};

App membership processing

PL APIs

OpenID APIs

Location: openid.sql

OPENID_INIT Creates user "OpenID"
yadis Automatic creation of user yadis doc format.
in uname varchar, User name
RESULT is XML composed yadis doc for the user
server Depending on the openid mode performs: associates, checkid_immediate, checkid_setup, check_authentication
in "openid.mode" varchar := 'unknown', OpenID? of the Server
RESULT depends on the openid mode
associate Creates xenc_key_3DES key and inserts it into SERVER_SESSIONS
in "openid.mode" varchar := 'unknown',
in assoc_type varchar := 'HMAC-SHA1',
in session_type varchar := '',
in dh_modulus varchar := null,
in dh_gen varchar := null,
in dh_consumer_public varchar := null
RESULT is string
checkid_immediate Check OpenID? verification
in _identity varchar,
in assoc_handle varchar := null,
in return_to varchar,
in trust_root varchar := null,
in sid varchar,
in flag int := 0, -- called via checkid_setup
in sreg_required varchar := null,
in sreg_optional varchar := null,
in policy_url varchar := null
RESULT is empty string
checkid_setup Setup OpenID? verification and perform check
in _identity varchar,
in assoc_handle varchar := null,
in return_to varchar,
in trust_root varchar := null,
in sid varchar,
in sreg_required varchar := null,
in sreg_optional varchar := null,
in policy_url varchar := null
RESULT is empty string
check_authentication Check for OpenID? authentication
in assoc_handle varchar,
in sig varchar,
in signed varchar,
in invalidate_handle varchar := null,
in params any := null,
in sid varchar
RESULT is empty string
check_signature Check OpenID? authentication comparing the xenc_key-s
in params varchar
RESULT is integer, 1 if the signature matches, 0 if not

CategoryODS CategoryOpenSource CategoryAPI