Search This Blog

Friday, October 11, 2013

Convert string to jbo date

Make sure the format of the date is set as per your requirement. 

                  formatter = new SimpleDateFormat("EEE MMM d hh:mm:ss z yyyy");
                  date = formatter.parse(aDate);
                  java.sql.Date sqlDate = new java.sql.Date(date.getTime());
                  oracle.jbo.domain.Date jboDate = new oracle.jbo.domain.Date(sqlDate);

If you want the date to be locale specific, use the following

                 formatter = new SimpleDateFormat(pattern, currentLocale); 

Here are some customized Date and Time formats (from Oracle Site)


Customized Date and Time Formats
Pattern Output
dd.MM.yy 30.06.09
yyyy.MM.dd G 'at' hh:mm:ss z 2009.06.30 AD at 08:29:36 PDT
EEE, MMM d, ''yy Tue, Jun 30, '09
h:mm a 8:29 PM
H:mm 8:29
H:mm:ss:SSS 8:28:36:249
K:mm a,z 8:29 AM,PDT
yyyy.MMMMM.dd GGG hh:mm aaa 2009.June.30 AD 08:29 AM

Wednesday, August 7, 2013

Authentication/Authorization managed by OAM in Weblogic

Configuration from Weblogic Console

Security Configuration

1. Login to weblogic console.

2. Click on Security Realms -> myrealm -> Providers.
    Click New.
    Enter Name : WebLogic_IdentityAsserter
    Type: "OAM Identity Asserter"
    Click OK.

3. Once done, Click on WebLogic_IdentityAsserter.
    Make the Control Flag to “SUFFICIENT”
    Add “OAM_REMOTE_USER” to chosen side of Active Types.
    Save the changes.

4. Go to the Provider Specific tab.
    And update the SSOHeadername to OAM_REMOTE_USER
    Save the changes.

5. Go to Security Realms -> myrealm -> Providers.
    Click New.
    Name: DSX
    Type: OpenLDAPAuthenticator.
    Click OK

6. Go to provider page and click on DSX.
    Mark the Control Flag as “OPTIONAL”

7. Click on Provider Specific tab.
    Update the following details for LDAP configuration.

Host :
Port 389 (Default port)
Principal
Credentials
Confirm Credentials
User Base DN O=<>
User From Name Filter (&(uid=%u)(objectclass=person))
User Name Attribute uid
User Object Class person
Use Retrieved User Name as Principal
Group Base DN ou=GROUPS,o=<>
Group From Name Filter (&(cn=%g)(objectclass=group))
Static Group Name Attribute cn
Static Group Object Class group
Static Member DN Attribute member
Static Group DNs From Member DN Filter (&(member=%M)(objectclass=group))
GUID Attribute objectGUID

Save the changes.


8. Go to Security Realms -> myrealm ->Providers.
    Click on DefaultAuthenticator
    Make the Control Flag as “OPTIONAL”.
    Save the changes.

9. Make sure Provider Specific setting is a below:
    Go to Security Realms -> myrealm -> Providers.
    Select the check box for DefaultIdentityAsserter.
    Click Delete.

10. Activate the changes & Restart all servers.

Tuesday, July 30, 2013

To Find Dirty data (uncommitted) in ADF task flow

ControllerContext cctx = ControllerContext.getInstance();
cctx.getCurrentViewPort().getTaskFlowContext().is DataDirty();

or

cctx.getCurrentViewPort().isDataDirty();

or

ViewPortContext.isDataDirty();

Sunday, June 30, 2013

OAF - Pass parameters between pages and session

OAPageContext (called from UI client)
putSessionValue( )
removeSessionValue( )
getSessionValue( )

OAPageContext (called from UI client for encryption)
PutEncryptedParameter( )
GetDecryptedParameter( )

OAPageContext (called from UI client)
putTransactionValue( )
getTransactionValue( )
removeTransactionValue( )

OADBTransaction (called from server)
putValue( )
getValue( )
removeValue( )

Format negative numbers with bracket in ADF screens.

In Financials, it is important that negative numbers are displayed/formatted within brackets or braces.

Challenge comes in when the the column or UI attribute holds both positive and negative number.

Solution : On the UI Attribute, place with pattern as "#,##,###.00;(##,##,###.00)"
Or
If the UI is based on a VO, edit the attribute properties and specify the below details as part of the Control Hints. without the double quotes formattype as "Number" and format as "#,##,###.00;(##,##,###.00)"

The key here is semi-colon(;) seperating the value of the format, ADF internally recognizes that the second format value is for negative number.

Reference scope variable in VO as bind parameter

Reference scope variable in VO as bind parameter.

Note: Accessing scope variable in VO is violation of MVC but can be performed using below groovy experssion.

adf.context.expressionEvaluator.evaluate('#{pageFlowScope.empNo}')

get ADF Logger root directory at runtime

ADFLogger logger;

logger = ADFLogger.createADFLogger(MyClass.class);

InitialContext ctx = new InitialContext();
           
MBeanServer server = (MBeanServer)ctx.lookup("java:comp/env/jmx/runtime");
        
ObjectName service =new ObjectName("com.bea:Name=RuntimeService,Type=weblogic.management.mbeanservers.
runtime.RuntimeServiceMBean");

ObjectName domain =(ObjectName)server.getAttribute(service, "DomainConfiguration");

rootDir = (String)server.getAttribute(domain, "RootDirectory");

logger.info("Root Dir : " + rootDir);

Wednesday, May 22, 2013

Essential Date functions for ADF


    public static java.util.Date convertSqlToUtilDate(java.sql.Date date) {
        Date utilDate = null;
        if (date != null) {
            utilDate = new Date(date.getTime());
        }
        return utilDate;
    }

    public static oracle.jbo.domain.Date convertSqlToJboDate(java.sql.Date date) {
        oracle.jbo.domain.Date jboDate = null;
        if (date != null) {
            jboDate = new oracle.jbo.domain.Date(date);
        }
        return jboDate;
    }

    public static java.sql.Date convertUtilToSQLDate(java.util.Date date) {
        java.sql.Date sqlDate = null;
        if (date != null) {
            sqlDate = new java.sql.Date(date.getTime());
        }
        return sqlDate;
    }

    public static oracle.jbo.domain.Date convertUtilToJboDate(java.util.Date date) {
        oracle.jbo.domain.Date jboDate = null;
        if (date != null) {
            jboDate = new oracle.jbo.domain.Date(convertUtilToSQLDate(date));
        }
        return jboDate;
    }

    public static java.sql.Date convertJboToSqlDate(oracle.jbo.domain.Date date) {
        java.sql.Date sqlDate = null;
        if (date != null) {
            sqlDate = (Date)date.getValue();
        }
        return sqlDate;
    }


    public static java.util.Date convertJboToUtlDate(oracle.jbo.domain.Date date) {
        java.util.Date sqlDate = null;
        if (date != null) {
            sqlDate = (java.util.Date)date.getValue();
        }
        return sqlDate;
    }

Friday, May 10, 2013

Oracle Projects Navigation Paths

Accounting Calendar : Setup > Financials > Calendar > Periods

Agreement : Billing > Agreements

Agreement Template : Setup > Billing > Agreement Templates

Agreement Types : Setup > Billing > Agreement Types

AR Payment Terms : Setup > Billing > Payment Terms

Assign AutoAccounting Rules : Setup > AutoAccounting > Assign Rules

Assign Descriptive Security Rules : Setup > Flexfields > Descriptive > Security > Assign

Assign Key Flexfield Security Rules : Setup > Flexfields > Key > Security > Assign

AutoAccounting Lookup Sets : Setup > AutoAccounting > Lookup Sets

AutoAccounting Rules : Setup > AutoAccounting > Rules

Bill Rate Schedules : Setup > Billing > Bill Rate Schedules

Billing Extensions : Setup > Billing Extensions

Budget Change Reasons : Setup > Budgets > Change Reasons

Budget Entry Methods : Setup > Budgets > Entry Methods

Budget Types : Setup > Budgets > Budget Types

Budgets Budgets

Burden Cost Codes : Setup > Costing > Burden > Cost Codes

Burden Schedules : Setup > Costing > Burden > Schedules

Burden Structures : Setup > Costing > Burden > Structures

Capital Projects

Class Categories and Codes : Setup > Projects > Classifications

Compensation Rules : Setup > Costing > Labor > Compensation Rules

Contact Types : Setup > Project > Customers > Contact Types

Control Actions : Setup > Activity Management Gateway > Control Actions

Control Billing by Top Task : Billing > Control Billing by Top Task

Cost Bases : Setup > Costing > Burden > Bases

Credit Types : Setup > Billing > Credit Types

Cross Validation Rules : Setup > Flexfields > Key > Rules

Customers : Setup > Customers > Customer Entry

Descriptive Flexfield Security Rules : Setup > Flexfields > Descriptive > Security > Define

Descriptive Flexfield Segments : Setup > Flexfields > Descriptive > Segments

Descriptive Flexfield Values : Setup > Flexfields > Descriptive > Values

Dimensions : Setup > Collection Pack > Dimension

Employee Cost Rates : Setup > Costing > Labor > Employee Cost Rates

Enter Person : Setup > Human Resources > Employees

Event Entry and Inquiry Windows : Billing > Events

Event Types : Setup > Billing > Event Types

Expenditure Batches : Expenditures > Pre-Approved Batches > Enter

Expenditure Batches Summary : Expenditures > Pre-Approved Batches > Review

Expenditure Categories : Setup > Expenditures > Expenditure Categories

Expenditure Inquiry : Expenditures > Expenditure Inquiry Project

Expenditure Inquiry Across Projects : Expenditures > Expenditure Inquiry All

Expenditure Items : Expenditures > Expenditure Inquiry Project or All

Expenditure Types : Setup > Expenditures > Expenditure Types

Find Expenditure Batches : Expenditures > Pre-Approved Batches > Review

Find Invoices : Billing > Invoice Review

Flexfield Security Rules : Setup > Flexfields > Validation > Security > Define

Flexfield Value Sets : Setup > Flexfields > Validation > Sets

Flexfield Values : Setup > Flexfields > Validation > Values

GL Accounts : Setup > Financials > Accounts

Implementation Options : Setup > System > Implementation Options

Invoice Formats : Setup > Billing > Invoice Formats

Invoice Summary : Billing > Invoice Review

Job : Setup > Human Resources > Jobs

Key Flexfield Security Rules : Setup > Flexfields > Key > Security > Define

Key Flexfield Segments : Setup > Flexfields > Key > Segments

Labor Cost Multipliers : Setup > Costing > Labor > Cost Multipliers

Location : Setup > Human Resources > Locations

Maintain PA Period Statuses : Setup > System > PA Periods

Mass Update Batches Project : Maintenance > Mass Update Batches

Non-Labor Resources : Setup > Expenditures > Non-Labor Resources

Organization : Setup > Human Resources > Organizations > Define

Organization Hierarchies : Setup > Human Resources > Organizations > Hierarchies

PA Periods : Setup > System > PA Periods

Payment Terms : Setup > Billing > Payment Terms

Percent Complete Project : Status > Percent Complete

Period Types : Setup > Financials > Calendar > Types

Personal Profile Values : Other > Profile

Pre-Approved Expenditure Batch Review : Expenditures > Pre-Approved Batches > Review

Pre-Approved Expenditure Entry : Expenditures > Pre-Approved Batches > Enter

Project Customer Relationships : Setup > Projects > Customers > Relationships

Project Funding Inquiry : Billing > Funding Inquiry

Project Role Types : Setup > Projects > Role Types

Project Status Inquiry : Project Status > Project Status Inquiry

Project Status Inquiry Columns : Setup > Project Status Columns

Project Statuses : Setup > Projects > Statuses

Project Types : Setup > Projects > Project Types

Projects Templates Summary : Setup > Projects > Project Templates

PTE Employee Assignment to Operating Unit : Setup > Expenditures > PTE-Multiple Org

QuickCodes : Setup > Human Resources > QuickCodes

Request Set  : Other > Requests > Set

Resource Lists : Setup > Budgets > Resource Lists

Revenue Categories : Setup > Expenditures > Revenue Categories

Revenue Review Windows : Billing > Revenue Review

Review Online Time and Expense : Expenditures > Online Expenditure Review > Supervisor

or

Expenditures > Online Expenditure Review > All

Review Transactions : Expenditures > Transaction Import > Review Transactions

Role Types : Setup > Projects > Role Types

Rollup Groups : Setup > Flexfields > Key > Groups

Segment Values : Setup > Flexfields > Key > Values

or

Setup > Flexfields > Descriptive > Values

or

Setup > Flexfields > Validation > Values

Service Types : Setup > Projects > Service Types

Set of Books : Setup > Financials > Books

Shorthand Aliases : Setup > Flexfields > Key > Aliases

Source Products : Setup > Activity Management Gateway > Source Products

Submit Requests : Other > Requests > Run

System Options : Setup > Customers > System Options

Transaction Controls Projects. Find the project for which you want to enter transaction controls. Choose Open. Select Transaction Controls from the Project Options.

or

Projects. Find the project. Choose Open. Select Tasks. Chose the task for which you want to enter transaction controls. Choose Options. Choose Transaction Controls from the Task Options.

Transaction Sources : Setup > Expenditures > Transaction Sources

Units : Setup > Expenditures > Units

Value Sets : Setup > Flexfields > Validation Sets

View Burdened Costs : Setup > Costing > Burden > View

Monday, March 4, 2013

Add/Remove row from a table and subsequently Refresh a table

Add/Remove row from a table and subsequently Refresh a table.

The button ID is referenced in the table's "partialTrigger" property so that clicking the button initiates a table refresh

BindingContainer bindings = BindingContext.getCurrent().getCurrentBindingsEntry();
OperationBinding operationBinding = bindings.getOperationBinding("Commit");
Object result = operationBinding.execute();
if (!operationBinding.getErrors().isEmpty()) {
//handle errors if any //... return;
}
AdfFacesContext.getCurrentInstance().addPartialTarget( this.getDepartmentsTable());

----------------------------------
1. Creating a binding for the table on which you want to delete the row. Binding creates setter method setMyTable(RichTable table) and getter method like getMyTable() returning RichTable.

2. On a button click or on any other action delete the table row as below.

DCIteratorBinding dciter = (DCIteratorBinding) bindings.get("MyVOIterator");
Row currentRow = dciter.getCurrentRow();
dciter.removeCurrentRow();
AdfFacesContext.getCurrentInstance().addPartialTarget( this.getMyTable());

Wednesday, February 20, 2013

JDeveloper closes abruptly on trying to open

Sometimes its frustrating to see Jdev closing immediately on opening. We try restarting the machine, re-installing jdev...and nothing seems to be working.
 
This is a sign that something got corrupted on Jdeveloper.
 
Best way to get over this issue is to restore it back to the original setting (Ofcourse you loose all your settings, preferences, svn connection, DB settings, external tools, etc ..).
 
The way you do this is by removing system11.1.1.* folder under jdeveloper. Yes, not the best soution, but better than re-installing jdeveloper.

On restarting JDeveloper, it creates a new system11.1.1* directory.