I really do want to know Java, but my approach to getting there involves
backing into it with Perl. The code is the easy part.

 

I think my hang-up is OO programming in general and trying to visualize
the flow from class to interface to method and where each is called and
why interfaces can sometimes be instantiated and sometimes not (public
vs. private?)

 

In BO there is one Class at the top (for my needs). Everything that
follows is an Interface. 

http://devlibrary.businessobjects.com/BusinessObjectsXI/en/en/BOE_SDK/bo
esdk_java_api_doc/doc/boesdk_java_apiRef/doc-files/images/ObjectModel.ht
ml

 

All of the Java code examples for the SDK I have been studying seem to
rely on casting to instantiate any object beyond the second level. I
have played with the type casting in Inline but no success just yet. I
may not even be going in the right direction.

 

For example

 

#!/opt/app/p2etl1c1/edsapps/local/bin/perl

 

use Inline

        Java => '

                import
com.crystaldecisions.enterprise.ocaframework.ServiceNames;

                import com.crystaldecisions.sdk.exception.SDKException;

                import
com.crystaldecisions.sdk.framework.CrystalEnterprise;

                import
com.crystaldecisions.sdk.framework.IEnterpriseSession;

                import com.crystaldecisions.sdk.framework.ISessionMgr;

                import
com.crystaldecisions.sdk.occa.infostore.IInfoStore;

                import com.crystaldecisions.sdk.occa.pluginmgr.*;

                import com.crystaldecisions.sdk.plugin.CeProgID;

                import com.crystaldecisions.sdk.occa.security.IUserInfo;

                import
com.crystaldecisions.sdk.occa.security.ILogonTokenMgr;

                import java.util.*;

                import java.io.*;

        ',

         STUDY => [ qw(

                com.crystaldecisions.sdk.exception.SDKException

                com.crystaldecisions.sdk.framework.CrystalEnterprise

                com.crystaldecisions.sdk.framework.IEnterpriseSession

                com.crystaldecisions.sdk.framework.ISessionMgr

                com.crystaldecisions.sdk.occa.infostore.IInfoObjects

                com.crystaldecisions.sdk.occa.infostore.IInfoObject

                com.crystaldecisions.sdk.occa.infostore.IInfoStore

                com.crystaldecisions.sdk.occa.pluginmgr.IPluginMgr

                com.crystaldecisions.sdk.occa.security.IUserInfo

                com.crystaldecisions.sdk.occa.security.ILogonTokenMgr

                java.lang.Object

                java.lang.Class

        ) ],

        AUTOSTUDY => 1,

        DEBUG => 1;

 

use Inline::Java qw {cast};

 

my $sessionMgr =
com::crystaldecisions::sdk::framework::CrystalEnterprise->getSessionMgr(
);

my $enterpriseSession = $sessionMgr->logon(userid, "password",
'td334.us.company.net:6400', secEnterprise);

 

I get this far. I establish a session and get logged on. After this, I
have no success.

 

#Retrieve the InfoStore object

$iStore = cast(IInfoStore, $enterpriseSession)->getService("",
"InfoStore");

 

Here I get error "Class IInfoStore not found," but I have had a variety
or messages with various tweaks.

 

In other attempts I'm not allowed to do something like this as I expect,
and which makes sense to me.

$iStore = $enterpriseSession->getService("", "InfoStore");

 

Error: You are not allowed to invoke method getService in class
com.crystaldecisions.sdk.framework.internal.EnterpriseSession: Class
InlineJavaUserClassLink can not access a member of class
com.crystaldecisions.sdk.framework.internal.EnterpriseSession with
modifiers "public"

 

The Java version of the iStore line I'm trying to make perly:

IInfoStore iStore = (IInfoStore)
enterpriseSession.getService("InfoStore");

 

A lot for me to learn.

 

Thanks for the reply, Jason. I've posted on two Business Objects
development forums without even a nibble. I guess my approach is not
very mainstream - unfortunately.

 

Mike

________________________________

From: Jason Stelzer [mailto:[EMAIL PROTECTED] 
Sent: Tuesday, July 08, 2008 8:33 AM
To: Vanole, Mike
Cc: inline@perl.org
Subject: Re: Inline Java and the Business Objects SDK

 

I used Inline::Java to integrate with several J2EE applications from
within a fairly large perl codebase. There's no dodging picking up java
as you go really. For some things (mostly collections) you'll probably
want to evaluate using a tied reference to hide the java behind a
familiar perl interface. Otherwise you'll wind up with a leaky
abstraction and have java-esque code all through the perl codebase. 

Other than that, what's the nature if the question? I didn't use
Business Objects, but I imagine that they provide some sort of ejb you
can get a reference to and make rmi calls on, yes? Otherwise, if it's
all via local jars and whatnot, then making sure your class path is
correct and using the documented api is probably the way to go and
eliminates some complexity.

On Mon, Jul 7, 2008 at 10:17 PM, Vanole, Mike <[EMAIL PROTECTED]> wrote:

Hi,

I'm trying to use Inline::Java to use the Business Objects SDK without
coding Java. The STUDY and AUTOSTUDY look like they set me up to do
this.

Before I get into the specifics of my challenges I was looking for
anybody who may have had success doing this. I am having limited
success, but I'm not a Java programmer so I'm not even sure how to ask
the Java questions to get the Perl answer.

Regards,
Mike





 

Reply via email to