<h1>ACIS::Web - ACIS -, Perl module</h1>

 -  ,       
.   - -.

 new:

-     ,  
$ACIS::LocalConfig::local_path.
-        ACIS::Web::Config.
-         .
-   CGI

 handle_request:

-   (ACIS::Web::Config),   
.

-         
. 
  -         
        (, HTTP Redirect). 
           
  ,     - .
  -   ,  ,   
  ACIS::Web::Session. 

-           , 
 xml  presenter',  ACIS::Web::handle_request 
    ( ),  xml .

-       

-  

<h2>   ACIS::Web</h2>

   ACIS::Web    CGI   
.     ,   URL  ,
ACIS::Web        (login). 
        request/user 
session/request/screen.

<h2> </h2>

ACIS::Web::Config -   -  - 

 ,      .    - 
"", ,  , -  , 
.

        "": 
( perl-)   (     )

    ,  ACIS::Web::Config   ,
      .


<h2>  .</h2>

   ACIS::Web  . ,   - 
 $acis.

<h3> ,    .</h3>

       
.   ,       
(HTTP ),    ,   .
   .

     ,  :
    ,  
        (IP)
    (user id)

,     ,     
  .

       
  (full name, user id, login id, password, user type) 
, ,  ,  .


   - .

	'request'

		"CGI" 	  CGI
		'screen'	  
		'session-id'

     :

  -  ACIS::Web::Session.

        'created'	 
	'user-id'
	'IP'			IP  
	'last-interaction'	time, seconds since the epoch
			(interaction - , )

     :

        'current-record-number'		integer -   

#        'search'  -  .   , 
#                        .

  :

	'user'
		'user'			string, human readable name
		'login'			string, email
		'type'			???
		'file'			???
#		'password'		  

	'records'	 (ARRAY)
		  :
		'id'
		'type' FIXED "person"
		'name'
			'first'
			'middle'
			'last'
		'email' - string, email
		'email-publish' - boolean
		'name-variations' - array of strings
		'affiliations' - array of institution identifiers or institution records
		'contributions' - array of [role (string), document (id)]
		'sci-fields' - array of strings
		'photo' - string, filename or URL

	'records-hash' - hash (auxiliary - )
    RECORDID => RECORD, as described above


       
  ACIS::Web,  variables.

  my $vars = $acis -> variables;
  my $request = $acis -> request;
  my $user = $acis -> user;

       
  ACIS::Web,  session.

  my $session = $acis -> session;

 ACIS::Web::Session      
  .

       
  ACIS::Web,  user_data.

  my $userdata = $acis -> user_data;

 ACIS::Web::UserData      
  .

<h4> </h4>

     :

)        ,     : 
   BerkeleyDB       .          ,     ,      

)     ,        :
       
"$acis->{home}/sessions/pAB101", :
  p -    (  short_id),
  AB -   (    short_id),
  101 -       pAB (  short_id)
  $acis -> {home}   .

 ,        .         ,       .      20 ,   ip  .  ip    ,     ,   ,            .   ip     ,     ,        .

 2 :
   ,     URL,    .

    ,     ,   . ,      ,    ,    .

<h4></h4>

       .
        
,   $session->{'current-record-number'}     
 records.

   : 

  my $record = $userdata -> {records} -> [ $record_number ];

      :

  $record -> {'postal-address'} = $post;

  e-mail  :

  $email = $record -> {"e-mail"};

    :

  $full_user_name = $record -> {"full-name"};

  ()   :

  $record -> {"full-name"} = $full_user_name;
  $userdata -> changed;

      XML , 
  ,    ,    ,  
 $userdata -> changed;       
  $userdata   (tied hash), , , 
 .

<h4> </h4>

     ,     .

  $acis-> request -> {screen}

    .

  $acis -> user -> {id}


<h3>  (my) sql </h3>

   sql_helper      ACIS::Web  sql_object.  sql_object     'sql-object'   ACIS::Web, ,    ,    sql_helper       'sql-object'.      'sql-object'  ACIS::Web

  $acis -> sql_object

<h3>     </h3>

<h4></h4>

       ACIS::Web::Config,     
  
  my $config = $acis -> config;

     :

  $config -> screen ($screen_id)

<h4>   </h4>

 ,       presenter':

  $acis -> clear_process_queue( );

 ,      presenter:

  $acis -> set_presenter( $screen_name );

 ,       presenter' 
 :

  $acis -> clear_process_queue( );
  $acis -> set_presenter( $screen_name );
  
 ,    -   :

  $acis -> add_to_process_queue ( $screen_name ); 

 ,        :

  $acis -> clear_process_queue( );
  $acis -> add_to_process_queue ( $screen_name );

 ,      URL   :

  $acis -> redirect( $URL );

 ,         :

  $acis -> redirect_to_screen( $screen_name );

<h2>  </h2>

ACIS::Web::UserData - 

 :
 load( user_id )  -      user_id  xml .
 save( ) -   

my $user_data = load ACIS::Web::UserData ( user_id );
$user_data -> save;

<h2>presenters</h2>

  presenter    :

  $acis -> variables -> {search} -> {results} = ...;

  presenter' ,    ,       .

  my $search = {};
  $search -> {start_from} = 10;
  $search -> {results} = 58;
  while (my ($id, $title) = each %search_results)
    {
     push @{$search -> {items}},
                {
                  id => $id,
                  title => $title,
                };
    }
  $acis -> variables -> {search} = $search;

   presenter'      XML :

user_data.xml:

 <data ...>
  ...
  <records>
   <list-item pos='1'>
    <email>...</email>
    <name first="..." last ="..." full="..."/>
    <name-variations>
    ...
    </name-variations>
   </list-item>
  </records>
 ...
 </data>

  " " XML   :

<data>
 <search>
  <results>58</results>
  <items>
   <list-item>
    <handle></handle>
    <name></name>
    ...
   </list-item> 
  </items>
 </search>
 <form-data>
    ...
 </form-data>
</data>

presenter'    XML   .

  , presenter (.. xslt )   
 user_data.xml. 


 ,  ,   
 :
   acis::web    
 ,   , 
    (     
web),    ,    
 ,       
      
user-data.

 ,  ,   
  user-data,  
acis::web::handler::authenticate  :  
user-data,  lock-  user-data,  ,  
    user-data.
         
,    .  create  
acis::web::session      
 ,     ,  
      
 .

        
   ,    
  ,     

    current_record  
acis::web::session

:

ACIS::Web::new
'home'              => ,
'shared'            => ,
'static'            => ,
'session'           => ,
'unconfirmed'       => ,
'presenters'        => ,

ACIS::Web::Handler::Authenticate::authorize
'user-data'         => ,
'lock'              => ,
'deleted-user-data' => ,

ACIS::Web::Session::create
'session'           => ,
'unconfirmed'       => ,

ACIS::Web::Session::current_record
'personal-path'     => ,
'personal-url'      => ,


       .
   ,   
     .

,   'personal-data'  
 .        
  ,    .   
           
.     ,   
 .   :

 <screen id='personal-data'>
   
   <param name='full-name'       required='yes' type='name'      place='record:full-name'/>
   ...
   <param name='postal'          type='printable'                place='record:postal'/>

   <call function='ACIS::Web::Handler::Authenticate::authenticate' />
   
   <init>
     <call function='ACIS::Web::Handler::Main::prepare_form_data' />
   </init>
   
   <process>
     <call function='ACIS::Web::Handler::Main::check_input_parameters' />
     <call function='ACIS::Web::Handler::Main::commit_form_data' />
     <call function='ACIS::Web::Handler::User::personal_data' />
   </process>
   
   <presentation type='xslt' filename='user/personal-data.xsl' />
 </screen>
 
