430 likes | 729 Views
The IBM-Informix WebBlade. The Most Productive tool in the IBM-Informix portfolio ?. Paul Watson Unemployed Using Informix since the beginning of time V7 since it was released – first UK installation V9 since 9.10. Can you write HTML ? Can you write SQL ?. The End. Agenda. Example Sites
E N D
The IBM-Informix WebBlade The Most Productive tool in the IBM-Informix portfolio ? Web Datablade
Paul Watson • Unemployed • Using Informix since the beginning of time • V7 since it was released – first UK installation • V9 since 9.10 Web Datablade
Can you write HTML ? • Can you write SQL ? Web Datablade
The End Web Datablade
Agenda • Example Sites • How it Works • Installation • How you use it Web Datablade
Movie File Web Datablade
How it Works • Supported Platforms • All IDS V9 platforms • Supported Web Servers • Apache V1 and V2 • Netscape • Microsoft IIS Web Datablade
Architecture Web Datablade
Installation • Untar the file • Run install script • Answer the difficult questions • What web server are you using • What is INFORMIXDIR • Where is the configuration file MI_WEBCONFIG • Provide a username • Where is the smart blobspace Web Datablade
Setup [Apache] • If Apache has not been built with DSO then rebuild apache for an easy life • Edit httpd.conf • LoadModule informix_module libexec/explode.so <Location /private/databases/boris/admin > SetHandler informix_explode AuthType Basic AuthName "admin" require valid-user </Location> • Copy library to correct location • Restart apache Web Datablade
Setup [Informix] • Run webconfig webconfig –addmap –p /private/databases/boris/admin –n ddw –u • This will update the configuration file, MI_WEBCONFIG Web Datablade
Test Setup • Run webconfig – verify • If all the questions have been answered correctly then it just works • Checking: /games/3 : database=boris : user=wboris : password=<encrypted> : config_name=ddw Connect : Success Config : 15 variables found Schema : ddw (source_table=wbPages, content_column=object, id_column=ID) AppPages: 318 Web Datablade
MI_WEBCONFIG FILE • Used to configure the library <global> debug_file /var/oninit/webdriver.log debug_level 2 anchorvar WEB_HOME/ config_user admin config_password c1b82752477fe6c62370eceb896687e </global> <setvar> INFORMIXDIR /home/informix INFORMIXSERVER oninit_net DBDATE=DMY4 </setvar> Web Datablade
MI_WEBCONFIG FILE (cont). <map path=/private/databases/wbe/admin> database wbe user wwbe password c4e582c979d323b07742efe3fd8684c3 password_key 38d8e369 config_name admin config_security on </map> <map path=/wbe> database wbe user wwbe password c4e582c979d323b07742efe3fd8684c3 password_key 38d8e369 Config_name ddw </map> Web Datablade
Web Setup Web Datablade
Web Setup (cont.) Web Datablade
Webconfig Use to configure and test the installation -addmap -p <url Prefix> -n <config name> -d <database -u <user> [-s <server>] -convert -p <url Prefix> -n <config name> -f <old-config filename> -verify [-p <url Prefix>] -secure [-iis] Web Datablade
Webpwencrypt Use to generrate new passwords for entry into the MI_WECONFIG file webpwencrypt <database> <user> <key> Web Datablade
Application Development • Can you write SQL? Have you got a HTML manual? • If you are sad and lonely, write the code by hand. • Use Data Director for Web • Site Manager • Application Page Editor Web Datablade
Web Page Structure • Html • SQL statements • Tags • Processing Blocks Web Datablade
Web Page Structure • Html • Hello World Insert into webpages(name, path, extension, object) Values(‘hello’, “/”, ‘html’,‘hello world’) Access via http://local/test/hello.html Web Datablade
Web Page Structure • SQL <?MISQL sql=“select tabname from systables;”> $1 </?MISQL> <?MISQL sql=“execute function sp_whoami();”> $1 </?MISQL> Web Datablade
Web Page Structure • Tags insert into wbtags(name,object) values(whoami, ‘<?MISQL sql=“execute function sp_whoami();”> $1 </?MISQL>’); Use in the html <body><?whoami></body> Web Datablade
Web Page Structure • Processing Blocks IF THEN FOR Loops WHILE Loops FOREACH Loops MIBLOCKs <?MIBLOCK cond”$(=,var,1)”> <b>Var is $1 </b> <?MIELSE> <b>Var should be $1 </b> <?MIBLOCK> Web Datablade
Forms • Get and Post actions • Pseudo Code • If ACTION = POST • Process Form • If ACTION = GET • Display form Web Datablade
Forms <?MIBLOCK cond=“$(EQ,$action,GET)” <FORM> <input name=action type=hidden>POST</input> <input name=MIval type=hidden>$MIval</input> <input name=var>0</input> <?submit> </FORM> <?/MIBLOCK> <?MIBLOCK cond=“$(EQ,$action,POST)”> <?MISQL sql=“insert into table values($var);”><?/MISQL> <?/MIBLOCK> Web Datablade
Session Management • Session Type • Url or cookie or auto • Session Home • WEB_HOME • http://localhost/mysite/?MIval=mypage.html • Session location • File system location for temporary files • Session Duration • How long is a session valid Web Datablade
Session Variables • Magic Variable $session • <?MIVAR name=session.myvar>Set this variable<?/MIVAR> • <?MIVAR name=session.mynum>20<?/MIVAR> Web Datablade
Caching • Two levels • Tags Allows tags to be evaluated once and the expand by all referring pages • Page Level Caches entire page on disk Cache administration pages Web Datablade
Deferred Variables • If the page is cached a mechanism is required to allow some elements to be evaluated at runtime • For example, HTTP_HOST, HTTP_REFERER • Configured via the Web admin pages Web Datablade
Deferred Variables <body> Coming from $HTTP_REFERER IP [$REMOTE_ADDR] <br> Current Server is $HTTP_HOST <br> Cached Variable $myvar <br> </body> Web Datablade
Data Director: Site Manager Web Datablade
Data Director: Site Manager (cont.) Web Datablade
Data Director: Site Manager (cont.) Web Datablade
Data Director: Site Manager (cont.) Web Datablade
Data Director: Application Page Editor Web Datablade
Problems • 64 bit Apache 2 – doesn’t work • Doesn’t work on W2K or XP Web Datablade
Questions ? Web Datablade