Pages

Wednesday, December 19, 2018

Javascript: switch among 3 class names

<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1">
<style>
.mystyle {
  width: 100%;
  padding: 25px;
  background-color: coral;
  color: white;
  font-size: 25px;
  box-sizing: border-box;
}
.mystyle2 {
  width: 100%;
  padding: 25px;
  background-color: green;
  color: yellow;
  font-size: 25px;
  box-sizing: border-box;
}
.mystyle3 {
  width: 100%;
  padding: 25px;
  background-color: blue;
  color: yellow;
  font-size: 25px;
  box-sizing: border-box;
}
.mystyle4 {
  width: 100%;
  padding: 25px;
  background-color: yellow;
  color: black;
  font-size: 25px;
  box-sizing: border-box;
}
.mystyle5 {
  width: 100%;
  padding: 25px;
  background-color: gold;
  color: black;
  font-size: 25px;
  box-sizing: border-box;
}
</style>
</head>
<body>

<p>Click the "Try it" button to toggle between adding and removing the "mystyle" class name of the DIV element:</p>

<Button Onclick="Myfunction()">Try It</Button>

<button id="xxx" onclick="myFunction2()">Blue</button>

<button id="yyy" onclick="myFunction3()">Yellow</button>

<button id="aaa" onclick="myFunction5()">Gold</button>

<div id="myDIV" class="mystyle">
This is a DIV element.
</div>
<div id="myDIV2" class="mystyle2">
This is a DIV2 element.
</div>
<div id="myDIV3" class="mystyle3">
This is a DIV3 element.
</div>
<div id="myDIV4" class="mystyle3">
This is a DIV4 element.
</div>

 <script>
function myFunction() {
   var element = document.getElementById("myDIV");
   alert(element.className);
   
   if (element.className=="mystyle2"){ 
    alert(1);
      element.classList.toggle("mystyle");
      }
   else
      element.classList.toggle("mystyle2");
}                                     

function myFunction2() {                              

if (document.getElementById("xxx").innerHTML=="Blue")
   { document.getElementById("xxx").innerHTML="Green"
     document.getElementById("myDIV2").className="mystyle3"
     }
else
   { document.getElementById("xxx").innerHTML="Blue"
     document.getElementById("myDIV2").className="mystyle2"
    }
}

function myFunction3() {                              

if (document.getElementById("yyy").innerHTML=="Yellow")
{ document.getElementById("yyy").innerHTML="Blue" 
   }
   else
{ document.getElementById("yyy").innerHTML="Yellow" 
 
   }

     var element = document.getElementsByClassName("mystyle3");  
     
     for(var i = 0; i < element.length; i++){   
           element[i].classList.toggle("mystyle4")
     } 
}

function myFunction5() {                              

   txt=document.getElementById("aaa").innerHTML
   switch(txt) {
    case 'Gold': txt="Yellow"
                break;

    case 'Yellow': txt="Blue"              ;  break;
    case 'Blue': txt="Gold"               ; break;
    default:  beark;   }
   document.getElementById("aaa").innerHTML=txt;
   
   var element = document.getElementsByClassName("mystyle3");  
    
     for(var i = 0; i < element.length; i++){  
      if (txt=="Yellow"){
      element[i].classList.remove("mystyle4")
         element[i].classList.toggle("mystyle5")
       }
      else 
      if (txt=="Blue") {
         element[i].classList.remove("mystyle5")
         element[i].classList.toggle("mystyle4")
       }
      else
      if (txt=="Gold"){
         element[i].classList.remove("mystyle4")
         element[i].classList.toggle("mystyle2");
       }
     } 
   
   
   
   
   
   
}



</script>

</body>
</html>

All unicode symbols
Unicode Symbols 2
Unicode symbols 3



Monday, December 10, 2018

Restore purged PS Reports


PRCSYSPURGE deletes reports per the retention value:

SELECT PT_RETENTIONDAYS FROM PS_PRCSSYSTEM

Tables impacted:
  • PSPRCSRQST
  • PSPRCSQUE
  • PSPRCSPARMS
  • PS_MESSAGE_LOG
  • PS_MESSAGE_LOGPARM
  • PS_PRCSRQSTDIST
  • PS_CDM_LIST
  • PS_CDM_AUTH
  • PS_CDM_FILE_LIST
Plug a file into PS's report depository - store a file into an existing folder and point url to it to access the file:

1. Choose an existing folder on web server, say /w/psft/psreports/AAA/20180119/928013 - there are some files in the folder, say AP_MATCH_111111. so Process Instance = 111111, CONTENT_ID=928013

2. Insert into 4 tables:
  • insert into PS_PRCSRQSTDIST values (111111,'MY_OPRID',2)
  • insert into PS_CDM_LIST values (111111, 928013,'AP_MATCH','Application Engine','$PS_CFG_HOME/appserv/prcs/$DB_NAME/log_output/AE_AP_MATCH_1889633','AP Matching',14,sysdate, sysdate, sysdate+7,5, '$REPORT_NODE', '$DB_NAME/20180119/928013', 9999999, 'Index.html',5,0,' ','GENERAL',0,' ',' ',' ')
  • insert into PS_CDM_AUTH values (928013,111111,'MY_OPRID',2)
  • insert into PS_CDM_FILE_LIST values (111111, 928013, 'AP_MATCH_1889633.log', 'LOG',2490,sysdate)