Category Archives: ajax

ajax displaying jboss server state

We aim to have web page which displays continually three jboss7 servers states.
For this we need the shell script (status.sh) to be found here.

environment requirement

    servers in same machine :
  • apache server
  • three jboss7 servers: jboss1, jboss2, jboss3

get result of status.sh in our php file

Following php code displays one jboss server state

For our example we need three php files containing the previous one line php code corresponding to each one of the three jboss server : state-jboss1.php, state-jboss2.php, and state-jboss3.php

ajax state display

We need here the load() method of jquery javascript framework.

continuous update of servers state

We’ll resort to javascript timer

deloyment

    root folder :
  • create folder jboss-state in apache server root www
    files :
  • www/jboss-state/status.sh
  • www/jboss-state/index.html
  • www/jboss-state/state-jboss1.php
  • www/jboss-state/state-jboss2.php
  • www/jboss-state/state-jboss3.php

full code

status.sh (myArtifactName string in code must be replaced by the right artifact name)

state-jboss1.php

state-jboss2.php

state-jboss3.php

index.html

ajax loader with APEX

1. Prerequisites in plsql oracle packages

1.1. Stored procedure GENERATE_REPORT

1.2. Stored function START_GENERATE_REPORT

1.3. Stored function GET_REPORT_STATUS

2. APEX application

HIDDEN TEXT ELEMENT ‘PAGE_REPORT_ID’
BUTTON ELEMENT ‘generate’: button click submits page
PAGE PROCESS ELEMENT ‘processGenerate’: activated on ‘generate’ button click

HTML FORM ELEMENT ‘loader’
– condition : PAGE_REPORT_ID content is not null
– content :

APPLICATION PROCESS ELEMENT : PROCESS_REPORT_STATUS
In apex go to application process and create new process. be sure you select “On Demand” as Point property of your process. 

IN PAGE HEADER
put javascript following javascript function :

3. how to use

click on button ‘generate’ and see the loader div which must change content according to REPORT.STATUS