Friday, December 29, 2017

Deploying Oracle JET application ( .war file ) to Weblogic/ JCS

These steps are tested for Oracle JET 4.X release as well.

I was searching for the details on how to generate WAR file out of JET application and then deploy it to JCS / Weblogic.

I have found some really nice articles, however i would like to present the same in the way I understood them.

Not demeaning the content from those posts, I would like to condense the steps a little bit, so that it would be a reference to me as well. So here we go : 

a. Install the grunt-war using below command : 
         npm install grunt-war --save-dev

b. Verify if the directory "/grunt-war" is generated in the node_modules directory.

c. Create a javascript file as below in scripts folder : 


The file content is as below :

/*******************************************************************************/

module.exports =  {

  /*
   * Build a WAR (web archive) without Maven or the JVM installed.
   *
   * Template strings in the <%= %> tags are set in the data section of Gruntfile.js,
   *  or you can hardcode the strings here instead
   */
      
        target: {
          options: {
            war_dist_folder: '<%= distdir %>',      /* Folder to generate the WAR into, set in data section of Gruntfile.js */
            war_name: '<%= appname %>',            /* The name for the WAR file (.war will be the extension) */
            webxml_webapp_version: '2.5', /* I needed this older version for JCS-SX */  
            war_extras: [ {filename: 'grunt-war-credits.txt', data: 'This line will appear in the file!\n see http://likeahouseafire.com/2017/08/09/updated-using-grunt-to-create-war-jet3x/ '}, 
                          {filename: 'WEB-INF/weblogic.xml', data: '<?xml version="1.0" encoding="UTF-8"?>\n<weblogic-web-app xmlns="http://www.bea.com/ns/weblogic/90" xmlns:j2ee="http://java.sun.com/xml/ns/j2ee" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://www.bea.com/ns/weblogic/90 http://www.bea.com/ns/weblogic/90/weblogic-web-app.xsd">\n  <jsp-descriptor>\n    <keepgenerated>true</keepgenerated>\n    <debug>true</debug>\n  </jsp-descriptor>\n  <context-root>/<%= appname %></context-root>\n</weblogic-web-app>'}],
                                          /* the war_extras are extra files to be generated, needed since grunt-war doesn't create a weblogic.xml */                                          /* also notice that we're using the <%= appname %> variable in there */  
            webxml_welcome: 'index.html', /* to point web.xml to the default page */
            webxml_webapp_extras: [ '<login-config />\n', '<session-config>\n    <session-timeout>\n    30\n    </session-timeout>\n</session-config>\n' ]  
                                          /* some extra settings for web.xml to work with JCS-SX */

          },
          files: [
            {
              expand: true,
              cwd: '<%= appdir %>',             /* find the source files for the WAR in the /web folder, set in Gruntfile.js */
              src: ['**'],
              dest: ''
            }
          ]
        }
};

/*******************************************************************************/

Deploying an ADF application from JDev to JCS weblogic server directly

Hi,

I would like to share the steps to deploy the ADF application from JDEv to JCS Weblogic ( or any standalone weblogic server ).

1. Create an Application Server connection from the JDev by giving Hostname, Port, Credentials , Weblogic Domain from below navigation.

 

a. Select Standalone server as below : 

                                           b. Give connection name :
c. Give server credentials with which you login to weblogic console.

                                         d. Give hostname, ports, domain name
                                          e. Next click on Test. The Test status would be shown as below
f. If all the tests are successfull, click on finish.

2. Select the required deployment profile from below menu :

    Application ==> Deploy

                     
               

The log will show the status of the deployment.
If the application context names are already use in server, the deployment might fail.
In such case, change the J2EE context of the application and redeploy.

3. Verify the deployment from JCS.

Thanks for reading,
Srikanth


Wednesday, December 27, 2017

Oracle JET : How to control the number of records shown in Oj-Table, apart from pagination.


This post is to share a trivial issue I faced with OjTable and how I resolved the same.
This might be a simple and common issue, but might help those who have not figured out the root cause.

Here ADFBC REST service was returning expected data and the JET table was also set with correct pagination setup.


<oj-paging-control id="paging" data='[[localPagingDatasource]]' page-size='5' layout="auto" maxPageLinks="10" slot='bottom'>
</oj-paging-control>

Here I expected the table to show 5 rows per page. However the data exceeded this and showed all the data at once.

To resolve this , I have used fetchSize:5  in the oj collection as below : 


This will make sure only 5 rows are shown per page.

Thanks for reading,
Srikanth

Saturday, December 23, 2017

Oracle JET : How to get OJTables current selected rowkey

I would like to share a simple snippet which can be used to get the current selected rowkey.

This is useful in creating Master Detail oj data tables in JET.
This is also useful where you want a different section to be refreshed based on selected row.


In the view level , enter the below handler "[[actionSequence]]" for the "on-oj-before-current-row" attribute : 





Also in the corresponding viewModel javascript file, implement the handler as below :
   "data.detail.currentRow.rowKey"

Added this content/ topic as this snippet was not readily available on the net. Hope this helps and might save your lot of time in implementing the same.

Thanks for reading.

Fusion BIP : How to show one parameter in report and pass different value to the datamodel

Hi All, There can be a scenario where we might need to show one value in the report and a different value to the actual query. Lets say a...