-------------------------------------------------------------------------------
--
--  @Copyright (c) 2002, Oracle Corporation. All rights reserved.
--  @headcom
--
--  Install the database services example
--
--  This file is used to install the services example
--  package and the packages of the portlets it implements.
--
--  @usage   Login to sqlplus and type the following:
--           @install.sql
--
--  @scope   Public
--
-------------------------------------------------------------------------------

set serveroutput on size 1000000
set define on
set verify off
spool install.log

prompt    #############################################
prompt    Installation of Services Portlet:  
prompt    bundled with the Services_Provider. 
prompt    #############################################
prompt Sample Portlets SQL*Plus Installer

--
-- description: This shell script installs the services portlet. 
--              It uses sqlplus. All arguments will be validated before the
--              install starts.  A typical install will take about 5 minutes.
--
set define '&'
prompt
prompt Please enter the database name(ORACLE_SID) you wish to connect to...
undefine portal_sid
define portal_sid=&portal_sid
prompt
prompt Please enter the schema name of the Portal database objects...
undefine portal_schema
define portal_schema=&portal_schema
prompt
prompt Please enter the password of this Portal schema...
undefine portal_password
define portal_password = &portal_password
prompt
prompt Please enter the schema name for the Provider of the Sample portlets...
undefine prov_schema
define prov_schema=&prov_schema
prompt
prompt Please enter the password of this Provider schema...
undefine prov_password
define prov_password=&prov_password
prompt
prompt 
prompt Begining Sample Portlets install ..
prompt ...portal_sid:            &&portal_sid
prompt ...portal_schema:         &&portal_schema
prompt ...portal_password:       *************
prompt ...prov_schema:           &&prov_schema
prompt ...prov_password:         *************
prompt 
prompt Note:  If the schema where this provider is installed
prompt is not the portal schema then the provsyns.sql script
prompt needs to be run prior to running this script.  
prompt The provsyns.sql script is in the wwc directory.  
prompt Instructions of how to run the provsyns.sql
prompt script is included in the script.
prompt 
prompt If everything is o.k, just press <enter>
prompt otherwise kill this SQL*Plus session and run it again
undefine ok_to_proceed
define ok_to_proceed=OK&ok_to_proceed
prompt

Rem Connecting to Provider Schema
connect &&prov_schema./&&prov_password.@&&portal_sid;
show user
Rem Installing the portlet package and the services provider package 
@@services_install &&portal_schema

Rem Connecting to Provider Schema
connect &&prov_schema./&&prov_password.@&&portal_sid;
show user
Rem Seeding the Database with the NLS strings for the portlet 
@@services_seed 

Rem Connecting to Portal Schema
connect &&portal_schema./&&portal_password.@&&portal_sid; 
Rem Installing and registering the Provider 
@@services_register &&portal_schema &&prov_schema 


prompt =======================================================
prompt Installation of services portlets finished.
prompt Please check install.log file for any errors.
prompt If no errors mentioned in the log file, you can now
prompt add the DB Services Portlet implemented by the 
prompt Services_Provider to your Portal pages.  
prompt =======================================================

spool off;
