Sunday, July 8, 2012

Using Groovy to set a Date using java.util.Calendar.Date


Here is one way to set the java.util.Calendar.Date in Groovy...

------------------------------------------------------
import static java.util.Calendar.* 
String year  = "2009";
String month = "6"; 
String day   = "1";


def aGCdate = new GregorianCalendar(Integer.parseInt(year),
     Integer.parseInt(month) - 1,
     Integer.parseInt(day))


 println aGCdate.getTime()
def mil = new Date(aGCdate.getTimeInMillis())
println mil


---------------------------------------------------------------
Test it with the Groovy Console here...

Sunday, June 3, 2012

bc4j.xcfg is not found in the classpath

Error:
oracle.jbo.JboException: JBO-29000: Unexpected exception caught: oracle.jbo.ConfigException, msg=JBO-33001: Configuration file /trendModel/View/common/bc4j.xcfg is not found in the classpath.

Hmmmmmmmmmmmmm???????

Found that somehow I had added an additional 2 AM's in my view "DataBindings.cpx" / Data Binding Registry under Data Control Usages...
So I looked in the source and found the culprits then removed them from the source and all was well!


   the culprits:


 <BC4JDataControl id="trendAMDataControl" Package="trendModel.View"
                     FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl" SupportsTransactions="true"
                     SupportsFindMode="true" SupportsRangesize="true" SupportsResetState="true"
                     SupportsSortCollection="true" Configuration="trendAMLocal" syncMode="Immediate"
                     xmlns="http://xmlns.oracle.com/adfm/datacontrol"/>
    <BC4JDataControl id="AppModuleDataControl" Package="model"
                     FactoryClass="oracle.adf.model.bc4j.DataControlFactoryImpl" SupportsTransactions="true"
                     SupportsFindMode="true" SupportsRangesize="true" SupportsResetState="true"
                     SupportsSortCollection="true" Configuration="AppModuleLocal" syncMode="Immediate"
                     xmlns="http://xmlns.oracle.com/adfm/datacontrol"/>






Friday, April 6, 2012

cwallet problem

Here is the Post:

Here is the summary of the above Post:
1. remove all connection from your project
2. close JDEV
3. remove the cwallet.sso file (search for it in the workspace folder first)
   Note: if cwallet is under source control - remove from source control
4. start JDEV
5. add the needed connection back to the application (the cwallet.sso file will be created)

Note:  Don't put cwallet.sso under version control

Thursday, April 5, 2012

Managing your code TODO list and tasks

To add a line to your task list -- Simply Type // TODO
Then check them in View / Tasks
============================================
This assumes you have "turned on" the TODO function --  here is how to turn on
  1. From the main menu, choose Tools > Preferences.
  2. In the Preferences dialog, select Tasks .
  3. On the Tasks page, Load.
  4. Click OK.
============================================
To create a task associated with a comment line in source code:
  1. Open the tasks window  View > Tasks .
  2. Within the source code file, Simply Type // TODO
  3. type the comment, which will appear in the task in the tasks window.
  4. Set the other options in the task window
============================================
To create a task associated with an application, project or file:
  1. In the navigator, object to task.
  2. Open the tasks window by choosing View > Tasks Window.
  3. Select the Add Tasks button, which will open the Add Task dialog.
  4. Complete the dialog for the task that you want to create. 

Sunday, April 1, 2012

Some cryptic thoughts on getting binding data via View Objects or RowImpl


       
//get the iterator ----------------------------
        BindingContext bc = BindingContext.getCurrent();
        DCBindingContainer binding = (DCBindingContainer)bc.getCurrentBindingsEntry();
        DCIteratorBinding iter = binding.findIteratorBinding("The_Iterator");


//get a View representation of the data via View Object   
         ViewObject voTableData = iter.getViewObject();


//get RowImpl representation via ViewRowClass
        RunTrendUVORowImpl aRowImpl;


// get the current Row
        Row theCurrentRow = voTableData.getCurrentRow();
        aRowImpl = (RunTrendUVORowImpl)voTableData.getCurrentRow();
// all the hitting the same data.        
        System.out.println("Daystweenpt: " + theCurrentRow.getAttribute("Daystweenpt").toString());
        System.out.println("Numdaysforavg: " + theCurrentRow.getAttribute("Numdaysforavg").toString());
        System.out.println("Rundate: " + theCurrentRow.getAttribute("Rundate").toString());
        System.out.println("RuntrendPk: " + theCurrentRow.getAttribute("RuntrendPk").toString());


        System.out.println("aRowImpl Daystweenpt: " + aRowImpl.getAttribute("Daystweenpt").toString());
        System.out.println("aRowImpl Numdaysforavg: " + aRowImpl.getAttribute("Numdaysforavg").toString());
        System.out.println("aRowImpl Rundate: " + aRowImpl.getAttribute("Rundate").toString());
        System.out.println("aRowImpl RuntrendPk: " + aRowImpl.getAttribute("RuntrendPk").toString());
        
        System.out.println("aRowImpl.get Daystweenpt: " + aRowImpl.getDaystweenpt());  
        System.out.println("aRowImpl.get Numdaysforavg: " + aRowImpl.getNumdaysforavg());   
        System.out.println("aRowImpl.get Rundate: " + aRowImpl.getRundate() );  
        System.out.println("aRowImpl.get RuntrendPk: " + aRowImpl.getRuntrendPk());

Friday, March 16, 2012

Master Table Summation of Detail Column

Master Table: "Stock"
Detail Table:  "UnitStockXrefUVO"

In my Master Table "Stock"we simply add the Transient Attribute "TotalSubQty";
as seen here below in the Attribute Detail Properites we have added the Transient Attribute TotalSubQty in Table "Stock"  and will use groovy to sum the column "SubQty" in Detail Table  "UnitStockXrefUVO" 


\Java\jre6\lib\ext\QTJava.zip was unexpected at this time.

Problem is with the entry below in the ClassPath - from QuickTime...

CLASSPATH=.;C:\Program Files (x86)\QuickTime\QTSystem\QTJava.zip

Remove from ClassPath --> C:\Program Files (x86)\QuickTime\QTSystem\QTJava.zip