Skip to content

Instantly share code, notes, and snippets.

View CedricL46's full-sized avatar

Cedric L CedricL46

View GitHub Profile
@CedricL46
CedricL46 / forwardAfterLogic.java
Created February 20, 2018 08:04
How to fix a java.lang.IllegalStateException: Cannot forward a response that is already committed on a jsf action with sendRedirect/forward in ADF
//ADF : jsf :
<h:commandButton id="myBtnId"
action="#{myBean.doLogic}"
value="click me"
type="submit"
actionListener="#{myBean.forwardAfterLogic}"/>
//ADF : myBean :
public String defaultNextStatus() {
String value = (String) getAttributeInternal(AttributesEnum.NextStatus.index());
if (value == null) {
XxcrWorkflowUvVORowImpl nextStatut = (XxcrWorkflowUvVORowImpl) getWfkVA().first();
//Wkfva is the VO of the LOV
if (nextStatut != null) {
return nextStatut.getTxtValeur();
}
}
return value;
@CedricL46
CedricL46 / warnAndPreventUserInputADF.js
Last active April 12, 2018 13:31
How to display a please wait message when the server is processing using addBusyStateListener in ADF ? https://cedricleruth.com/how-to-display-a-please-wait-message-when-the-server-is-processing-using-addbusystatelistener-in-adf/
var popup = null;
var clickedElem = null;
function triggerOnLoad(event) {
//You can either set the popup using the pure html div id (recommended)
popup = AdfPage.PAGE.findComponentByAbsoluteId(document.getElementById('loaderId').nextSibling.id);
//or set the popup knowing the full id of your popup for example :
//popup = AdfPage.PAGE.findComponentByAbsoluteId('p1:processingP');
//popup = AdfPage.PAGE.findComponent('processingP');
return true;
@CedricL46
CedricL46 / addBusyStateListenerPopUp.html
Last active April 12, 2018 13:31
How to display a please wait message when the server is processing using addBusyStateListener in ADF ? https://cedricleruth.com/how-to-display-a-please-wait-message-when-the-server-is-processing-using-addbusystatelistener-in-adf/
<af:group id="pt_g3">
<div id="loaderId"></div>
<af:popup id="processingP" contentDelivery="immediate" clientComponent="true">
<af:dialog id="d2" title="Processing..." type="none" closeIconVisible="false" inlineStyle="text-align:center;" clientComponent="true"
modal="true">
<f:facet name="buttonBar"/>
<af:panelGroupLayout id="pgl2" layout="vertical" halign="center">
<af:spacer width="10" height="10" id="s11"/>
<af:outputText value="Please wait..." id="ot2669"/>
</af:panelGroupLayout>
ubuntu@ip-YourComputer:~/FbJokeBot$ claudia update --configure-fb-bot
updating REST API apigateway.createResource parentId=parentId pathPart=facebook restApiId=0s7tsgupdating REST API apigateway.createResource parentId=parentId pathPart=telegram restApiId=0s7tsgupdating REST API apigateway.createResource parentId=parentId pathPart=groupme restApiId=0s7tsgrate-limited by AWS, waiting before retry apigateway.setAcceptHeader
Facebook Messenger setup
Following info is required for the setup, for more info check the documentation.
#Initialize your project folder using npm
ubuntu@YourComputer:~/FbJokeBot$ npm init
This utility will walk you through creating a package.json file.
It only covers the most common items, and tries to guess sensible defaults.
See `npm help json` for definitive documentation on these fields
and exactly what they do.
Use `npm install <pkg>` afterwards to install a package and
save it as a dependency in the package.json file.
const botBuilder = require("claudia-bot-builder");
const fbTemplate = botBuilder.fbTemplate;
//to install run 'npm i sync-request' in the project folder terminal
var request = require("sync-request");
//to install run 'npm i keyword-extractor' in the project folder terminal
var keywordExtractor = require("keyword-extractor");
//function to query the really nice icanhazdadjoke API for a joke
function getJoke(keyword) {
#How to fix BEA-141281 – unable to get file lock or BEA-280060 The persistent store encountered a fatal error in weblogic
#After an unexpected crash the following error can occur when you startup your weblogic server:
nohup /YOUR_DOMAIN_PATH/domains/YOUR_DOMAIN_NAME/bin/startManagedWebLogic.sh YOUR_SERVER_NAME t3://YOUR_WEBLOGIC_SERVER:7004 2>&1 &
[YOUR_WEBLOGIC_USER@YOUR_WEBLOGIC_SERVER ~]$ nohup /YOUR_DOMAIN_PATH/domains/YOUR_DOMAIN_NAME/bin/startManagedWebLogic.sh YOUR_SERVER_NAME t3://YOUR_WEBLOGIC_SERVER:7004 2>&1 &
[1] 14150
[YOUR_WEBLOGIC_USER@YOUR_WEBLOGIC_SERVER ~]$ nohup: ignoring input and appending output to nohup.out
#read the nohup.out to get the startup error message
[YOUR_WEBLOGIC_USER@YOUR_WEBLOGIC_SERVER ~]$ tail -f nohup.out
/**** Run this query to get the boundary time or your AWR report ****/
select snap_id,
snap_level,
to_char(begin_interval_time, 'dd/mm/yy hh24:mi:ss') begin
from
dba_hist_snapshot
order by 1
desc;
/***
#Connect to the Weblogic Host through FTP and upload your keystore.jks and truststore.jks to your user home
#Connect to the Weblogic Host through SSH with your user
#Copy the trustStore and keyStore to a tmp folder available from your {YourWeblogicUser}
[{YourSSHUser}@{YourWeblogicHost} ~]$ cp truststore.jks /tmp/
[{YourSSHUser}@{YourWeblogicHost} ~]$ cp keystore.jks /tmp/
#Sudo to {YourWeblogicUser}
[{YourSSHUser}@{YourWeblogicHost} ~]$ sudo su - {YourWeblogicUser}
#Copy files to {YourWeblogicDomainPath}/{YourWeblogicDomainName}/certificates
[{YourWeblogicUser}@{YourWeblogicHost} ~]$ mkdir {YourWeblogicDomainPath}/{YourWeblogicDomainName}/certificates
[{YourWeblogicUser}@{YourWeblogicHost} ~]$ cp /tmp/truststore.jks {YourWeblogicDomainPath}/{YourWeblogicDomainName}/certificates