RSS
 

Pentaho Kettle Scheduled Task: Windows

08 Jul

To run a Spoon/Kettle job from the command line (convenient for creating a scheduled task) use the following syntax:

kitchen.bat /rep:”REPOSITORY NAME” /job:”JOB NAME” /dir:/LOCATION /user:USER_NAME /pass:PASSWORD /level:Basic

Replace /job: with /file: to run a job from a file if you’re not using a repository.

 
3 Comments

Posted in RIA

 

Warehouse Dashboard Architecture

22 Jun

If Flex has a sweet spot, dashboards would be it. The technology provides a richness that makes engaging UIs very easy to implement.

For those evaluating possible solutions, I’m showcasing a simple architecture for a data warehouse / dashboard project. This particular architecture encapsulates the extract / transform so those are the only steps (simple SQL=>CSV) that need to be recreated for each environment (client) that has different source systems.

Warehouse Dashboard Architecture

 
No Comments

Posted in RIA

 

Flex OLAP Take Two

15 Jun

After running some OLAP benchmarks it was obvious that a more scalable OLAP solution was needed.

After some quick searching and downloading, I’ve wired up a scalable Flex OLAP UI.

I downloaded and setup Mondrian from Pentaho for my OLAP server. Mondrian supports XMLA making integration easy.

I found a few Flex projects interfacing to OLAP via XMLA. The most robust appears to be Grebulon by the guys over at Sherlock Informatics

Mondrian setup required a few tweaks, as I’m running Java 6:

Added the following JARs
axis.jar
commons-discovery-0.2.jar (removed commons-logging)
jaxrpc.jar
wsdl4j-1.5.1.jar
xalan.jar

Also set the following parameters in tomcat
-Djavax.xml.soap.MessageFactory=org.apache.axis.soap.MessageFactoryImpl
-Djavax.xml.soap.SOAPConnectionFactory=org.apache.axis.soap.SOAPConnectionFactoryImpl
-Djavax.xml.soap.SOAPFactory=org.apache.axis.soap.SOAPFactoryImpl
-Djavax.xml.transform.TransformerFactory=org.apache.xalan.processor.TransformerFactoryImpl

Using the FoodMart as a reference, the setup was very straight forward.

I had to download the Grebulon source as the .swcs had hardcoded in a few references (PivotGrid) to the FoodMart datasource.

Commercially, I’d check out FlexMonster too :)

 
1 Comment

Posted in RIA

 

Flex OLAP Benchmarks

14 Jun

I ran some benchmarks for the OLAP components in Flex. The OLAP components allow you to perform you’re OLAP operations client side out of the box. You *can* utilize the SDK interfaces and move your processing to the backend, should you have too much data for the browser.

That said, the benchmarks below should help define the line for “too much data.”

Record Structure:

Course:String
School:String
GradeLevel:String
SubjectArea:String
Grade:Number (Our measure)

Records / Processing Time (s)

1,000 / 3 sec
5,000 / 12 sec
10,000 / 22 sec
15,000 / 33 sec
20,000 / 43 sec

The processing times listed above are for the *client* side processing time. The data was loaded from the server before starting the benchmark.

I ran the benchmarks at various rollup depths (multiple hierarchies) which the components actually handled very well, the processing time was not significantly affected.

Extending the dataset to 125K+ records caused errors with the script timeouts occurring.

For datasets above 5-10K records, I’d suggest moving the processing to the server and passing the results to the UI. (assuming you’re looking to leverage the OLAP components as provided)

 
3 Comments

Posted in RIA

 

BlazeDS Custom Authentication

30 Apr

Here are the steps to roll your own BlazeDS Custom Authentication:

You’ll need to write a Java Class that implements the following class(es):

flex.messaging.security.LoginCommand;
flex.messaging.security.LoginCommandExt;

For example:

package com.dl.login;

import flex.messaging.security.LoginCommand;
import flex.messaging.security.LoginCommandExt;

import com.dl.login.UserVO;

public class LoginProxy implements LoginCommand,LoginCommandExt
{
public Principal doAuthentication(String username, Object attributes)
{

String password = (String)attributes;
//At this point you’d typically check against a datastore / LDAP / etc

if(username.equals(“riafan”) && password.equals(“mysecret”))
{
UserVO vo = new UserVO(username);
return vo;
}
return null;
}

public boolean doAuthorization(Principal user, List roles)
{

UserVO u = (UserVO)user;

if(u == null)
return false;

for(int i=0;i<roles.size();i++)
{
String role = (String)roles.get(i);
if(u.hasRole(role))
return true;
}
return false;
}

public boolean logout(Principal arg0) {
// TODO Auto-generated method stub
return false;
}

public void start(ServletConfig arg0) {
// TODO Auto-generated method stub

}

public void stop() {
// TODO Auto-generated method stub

}

public String getPrincipalNameFromCredentials(String arg0, Object arg1) {
// TODO Auto-generated method stub
return null;
}
}

In this example UserVO must implement java.security.Principal

package com.dl.login;

import java.security.Principal;

public class UserVO implements Principal
{

public String [] groups;
public String username;

public UserVO(String username)
{
this.username = username;
// Make sure we apply the array groups (roles) this user belongs to at some point :)
}

public String getName() {

return this.username;
}

public boolean hasRole(String role)
{
for(int i=0;i<groups.length;i++)
{
if(groups[i].equals(role))
return true;
}
return false;
}

}

Okay, now we just need to point the services-config.xml to our class
<security>

<login-command class=”com.dl.login.LoginProxy” server=”all”>
<!– a.k.a. true = per ‘tab’ authentication –>
<!– when set to true a browser refresh will also reset auth –>
<per-client-authentication>false</per-client-authentication>
</login-command>

<security-constraint id=”trusted”>
<auth-method>Basic</auth-method>
<roles>
<role>guests</role>
<role>accountants</role>
<role>employees</role>
<role>managers</role>
</roles>
</security-constraint>

</security>

That’s it.

To actually secure a destination, use the remoting-config.xml

<destination id=”AlertProxy” >
<properties>
<source>com.dl.alerts.AlertDAO</source>
<scope>application</scope>
</properties>

<security>
<security-constraint ref=”trusted”/>
</security>

</destination>

 
No Comments

Posted in Java

 

jQuery, Objective C

23 Apr

I’ve been diving into both as I’m looking to land some more iPhone projects. I’m really excited with the breath of fresh air the platform provides.

The big question this year….

WWDC 2010 or MAX 2010

MAX has been great, I’ve met some really great members of the community. For those of us who are Flex veterans, the conference seems a bit light, at least that’s the impression I’ve had the past two years.

Looking over the 2009 sessions of WWDC, I’m impressed, looks like a lot of great sessions.

Cheers
Josh

 
No Comments

Posted in RIA

 

Debugging Apache

23 Apr

Problem: Apache quit working

Solution: Debug via gdb httpd2

Apache quit working after some network changes. The error log contained numerous

child pid 20038 exit signal Segmentation fault (11) lines.

Running gdb httpd2 along with a backtrace (bt) revealed the function / line of code throwing the error. The problem was quickly tracked down to the LDAP config (ldap.conf).

 
No Comments

Posted in Suse

 

BlazeDS Context.xml

23 Apr

While deploying a BlazeDS project, I ran into a small problem that the META-INF/context.xml was not being loaded by tomcat.

The context.xml has a simple JNDI datasource defined

auth="Container"
type="javax.sql.DataSource"
username="username"
password="password"
driverClassName="com.mysql.jdbc.Driver"
url="jdbc:mysql://yourhost.com:3306/dbname" />

Reading up on the tomcat docs it became obvious that tomcat was loading the Adobe BlazeDZ tomcat/conf/context.xml.

 
No Comments

Posted in Java

 

Java Soap Client

19 Nov

I ran into a short problem writing a Java SOAP client. I was using the Axis[2] wsdl2java class to generate my Java classes. The latest version of wsdl2java has omitted the -T parameter that’s used to specify the SOAP version for the generate classes. The client’s soap endpoint only accepts SOAP 1.1 (not 1.2) so this proved to be a problem. I downloaded an older version of Axis [1.4] so I could specify the -T 1.1 and build against SOAP 1.1.
Download hip hop songs mp3
Buy Levitra Vardenafil
This time around the generated Java classes are missing the soap envelope headers needed by the service. I found a great article covering this exact problem.

The only change needed from there was in the service stub…

The org.apache.axis.soap.SOAPConstants.SOAP12_CONSTANTS needed to be changed to org.apache.axis.soap.SOAPConstants.SOAP11_CONSTANTS. I was a bit surpised to see those constants after building w/the wsdl2java -T 1.1 argument.

Disclaimer: I’m not a SOAP *expert* so feel free to provide feedback :-)

 
No Comments

Posted in Java

 

Glassfish LCDS Flex Up Next

19 Nov

It’s been a busy year getting a J2EE and Data Warehousing education. I’m wrapping up the ETL portion of a large Data Warehousing project. The next phase of the project is building a Flex front-end for the warehouse. I’m looking forward to using the Spark Architecture in Flex 4 for the UI, we should be able to generate some amazing UIs.

Cheers
Josh

 
No Comments

Posted in RIA

 

Debug Server/Client LCDS Java Helloworld in Flex Builder

02 Sep

Prerequisites

Install Flex Builder
Install LCDS Data Services
Install WTP in Flex Builder

Here’s a simple project that shows you how to create a simple Hello World for Flex + Java via LCDS. I’ll also show you how to debug the server [java] code as we move along.

File->New->Flex Project

  • For application server type select J2EE
  • User remote object access
  • LiveCycle Data Services
  • Create combined Java/Flex project using WTP
  • 01 Setup

    Select the target runtime. You will need to click ‘New’ to create one if none are available.

    02 Server

    Create a new target runtime if needed.

    03 Tomcat

    04 Tomcat

    05 Server

    Be sure to change your Output URL to match the LCDS [tomcat] config (defaults to 8400)
    06 Setup

    Run->Debug->Other

    Again, make sure the URLs are using the correct port

    07 Debug Server

    Project->Properties->Flex Server

    08 URL Context

    Okay, are setup is complete now we’re ready to code.

    Here’s the MXML

    <mx:Application xmlns:mx="http://www.adobe.com/2006/mxml" layout="absolute">

    <mx:Script>
    <![CDATA[
    import mx.controls.Alert;
    import mx.rpc.events.ResultEvent;
    import mx.rpc.events.FaultEvent;

    private function sayHello():void
    {
    testService.getOperation('sayHelloTo').send(txtName.text);
    }

    private function onFault(event:FaultEvent):void
    {
    trace(event);
    }

    private function onSayHelloToResult(event:ResultEvent):void
    {
    Alert.show(event.result as String);
    }

    ]]>
    </mx:Script>

    <mx:RemoteObject id="testService" fault="onFault(event)" destination="helloDest">
    <mx:method name="sayHelloTo" result="onSayHelloToResult(event)"/>
    </mx:RemoteObject>

    <mx:TextInput id="txtName" x="10" y="10"/>
    <mx:Button click="sayHello()" x="178" y="10" label="Go"/>
    </mx:Application>

    Note the destination=”helloDest” line, we’ll have to configure a LCDS destination with this name in a few steps…

    Create a simple java class to test against:

    
    public class HelloWorld {
    
    	public String sayHelloTo(String name)
    	{
    		return "Hello " + name;
    	}
    }
    

    And finally, we need to setup the destination

    To do so, edit \WebContent\WEB-INF\flex\remoting-config.xml, adding the following

    <destination id="helloDest">
    <properties>
    <source>HelloWorld</source>
    </properties>
    </destination>

    That’s it, now we are ready to test.

    Set a breakpoint on the on ‘return “Hello ” + name;‘ line in you’re java code.

    Launch the server in debug mode

    09 Server

    Now, launch the flex app [in debug mode if you want to debug the front end as well].

    Type your name in the input box and click ‘Go.’

    You’ll see your breakpoint being caught, both server [java] side and client side :)

    Flex Project Archive

     
    No Comments

    Posted in RIA

     

    Install WTP in Flex Builder

    02 Sep

    A quick walkthrough on installing the Web Tools Platform (WTP) in Flex Builder.

    Help->Software Updates->Find and Install

    Help Software Update

    Search for new features to install

    Search for New

    Select the [Europa] discovery site

    Europa

    Select ‘Web and JEE development’

    You may need to click ‘Select Required’

    WTP

     
    2 Comments

    Posted in RIA

     

    AMFPHP Support for JSON POSTs

    24 Jul

    I found myself wanting to use JSON POSTs (not just GETs) with AMFPHP. Here’s the addition.

    Open up core\json\app\Gateway.php.

    After

    $rawArgs = explode('/', $args);

    add the following

    if(isset($_POST) && count($_POST) > 0)
    {
    $len = count($rawArgs);
    // Check for and remove [last] empty arg from URL '/' explosion
    if($len && trim($rawArgs[$len-1]) == "")
    unset($rawArgs[$len-1]);

    // Append the POST variables
    for($i=0;$i $rawArgs[] = $_POST[$i];
    }

    The format of the post variables would be argNo=value
    Ex.
    Backend Function

    public function ResetPassword($username,$password,$oldpassword)
    {
    // Code HERE
    }

    Javascript POST parameters for the latter

    request.send("0=" + escape(username) + "&1=" + escape(oldpassword) + "&2=" + escape(newpassword));

    Hoping to jump into ZendAMF soon :)

     
    No Comments

    Posted in JSON

     

    What, My Flash Gateway is Already AJAX Ready? Sweet.

    23 Jul

    I’m integrating existing Flex functionality with some new COTS [AJAX RIA] software. Looks like I’m golden on two fronts:

    1. My existing dashboarding app leverages the dynamic module architecture blogged hear in the past. Each module was cleanly encapsulated so it’s about a dozen lines of code to convert each module into a stand-alone app that integrates w/the AJAX page.
    2. My AMFPHP backend is fully reusable!! Using JSON for my AJAX calls, I can simply hit
      path_to_amfphp_install/json.php/class.package.classname.methodname/arg1/arg2/arg3

    I really need to take some time and check out Wayne’s ZendAMF to see what he’s cooked up there, I’ve been far too busy as of late.

     
    No Comments

    Posted in RIA

     

    VerifyError: Error #1053: Illegal override of removeChildBridge in mx.managers.SystemManagerProxy

    25 Mar

    Ran into this error recently when using automation testing (RunTimeLoading.html/swf).

    Turned out to be a recently updated SWC (library) that was compiled under a newer SDK than the main app.

    With the mixed SDKs main app / SWC(s) RunTimeLoading.swf was unable to load regardless of which SDK version RunTimeLoading was compiled under.

     
     

    DBF->MySQL

    23 Mar

    While working on a staging area for a warehouse, I ran across the need to capture a table schema from a DBF file.

    If found this link http://ae.inc.ru/dbf2mysql.php

    Problem:
    While running the program I received this error

    error connecting to database client does not support authentication protocol requested by server; consider upgrading MySQL client

    Solution:
    You simply need to (in mysql):

    SET PASSWORD FOR username@’host’ = OLD_PASSWORD(‘password’);

     

    Connecting to 32 bit / 64 bit data sources from Tomcat (Java).

    03 Mar

    Problem:

    When running tomcat your receive the following error when connecting to an ODBC data source
    java.sql.SQLException: [Microsoft][ODBC Driver Manager] Data source name not found and no default driver specified

    Solution:

    There are *two* ODBC managers in 64 bit windows. 64 bit ODBC data sources are separate from 32 bit data sources.

    The ODBC manager accessed from the Control Panel contains the *64 bit* ODBC data sources.

    Launch C:\windows\syswow64\odbcad32.exe to configure the 32 bit ODBC data sources.

    If your running a 64 bit app, you’ll have access to the 64 bit data sources. Likewise, if your running a 32 bit app you’ll have access to the 32 bit data sources.

    For Java apps, you’ll need to invoke the app with the correct JVM (32 bit or 64 bit) to have access to the desired data sources (32 bit or 64 bit).

    On Vista, the 32 bit JVM(s) can be found (by default) at C:\Program Files (x86)\Java\jre6\bin. The 64 bit JVM is at C:\Program Files\Java\jre6

    Catalina.bat (used to start tomcat) looks to see if JRE_HOME is defined so make sure this is pointing to the correct JRE or update catalina.bat accordingly.

     
    4 Comments

    Posted in RIA

     

    Iterating a Filtered Collection

    12 Feb

    Okay, nothing profound here but thought I’d post as it’s a common question.

    If you have filtered a collection,

    ex

    var ac:ArrayCollection = new ArrayCollection();
    ...
    ...
    ac.filterFunction = myFilter
    ac.refresh()

    but you’d like to iterate over / access the unfiltered collection, simply use the .list property


    var items:IList = ac.list

    cheers

    Josh

     
     

    Diving back into the blog

    12 Feb

    I’ve had a crazy past few months. If I’ve been slow to reply to your comments – sorry !!!

    I’ll be posting regularly again now :)

    Josh

     
    No Comments

    Posted in RIA

     

    RSL Loading Multiple Dynamic Modules

    12 Feb

    So I ran into a Flex bug recently documented here .

    If your using the framework RSL (Runtime Shared Library) and loading modules, you should read the latter link. I was loading multiple modules and noticed that that they all didn’t necessary load. A little searching and I stumbled upon the open bug in JIRA.

    One suggested work around was to load the modules sequentially. This works but doesn’t make for the best user experience. In my case the modules were being loaded dynamically and added to a viewstack. I opted to create a ‘lazy module loader’ component that loads the module on creationComplete().

    I filled my viewstack with these components, made sure the viewstacks creation policy was set to ‘auto’ and voila, every things is working great. Of course one could avoid this component and add each module to the viewstack directly – in my use case I don’t want the main app to have to compile in [i.e. bloat] all [any of] the modules when, depending on the users auth they modules may not be used.

     
    No Comments

    Posted in RIA