Monday, April 30, 2012

Change Password (cont.)

I just noticed an interesting screen in BI-Publisher 11g (11.1.1.6) while looking at the screenshots in

Getting Started with Oracle BI Publisher 11.1.1.6.0

Using the "My Account" link, OBIEE 11g end-users can change their passwords without having to go through the not-so elegant approach documented in my previous blog entries.I might have missed this feature in 11.1.1.5, I remember seeing a screenshot in the help link, but the "Password" tab was missing in the app. 
- Log into BIP : http://HOST:PORT/xmlpserver/
- Select My Account

a+
Fiston

Friday, April 6, 2012

Change Password (cont.)

We’ve already compiled our application, we need now to expose the Change Password method via web services.
Right Click on your main class and select “Create Web Service”
p4
Select the default
p5
Click Next
p6
Click Next twice and make sure that the changePassword is selectable and select Finish.
p7
Let’s now deploy the web service to the Weblogic server.
Right Click on the project and click deploy –>Application Server
p8
Click + to add a connection to the Weblogic server
p9
p10
p11
p12
p13
Log into Weblogic em and make sure that your web service was deployed successfully (you can also look at the JDEV log)
p14
Login to the OBIEE portal and create a new action “Invoke Web Service”
p16
And plug in the WSDL
p17
and click open
p18
This opens up a new dialog box, enter the following values for the prompts:
· Username
· Old Password
· New Password
-Confirm Password
For the Username prompt value, select under the drop down “Session Variable”, type in USER and mark it as hidden.
p19
Select the “Options” tab and personalize the messages
p20
Click on the “Action Results” tab and enter the parameters
p22
Save the action.
p23
You can test it by running the action
p24
p25
p26

a+
Fiston

Monday, April 2, 2012

Calling bip runReport from job manager

Here is a quick experiment with Oracle job scheduler manager. As Venkat blogged about long time ago, Oracle Job Manager can be used to call custom Java code. One customer of ours asked about using Job manager to run/schedule BI-Publisher reports? Why would you do that I asked? The final solution we ended up chosing used ADF pages and taskflows.
Privately, I decided to take the challenge and see how to go about implementing the requested functionality. I am taking the WS route and luckily bip comes with several awesome web services, one of them is runReport.
Create a new Jdeveloper generic application:
Application Name: jobManager
Package prefix: bip
Click Next and name your project
Project Name: bip


Next, we’ll add a proxy web service for the BIP server
Add a java class: callBIP


We need to add the 3 jars to the project in order to be able to run custom Java jobs.
    - schedulerrpccalls.jar
    - xdocore.jar
- versioninfor.jar
The code below will call the bip web services, pass in the report xdo absolute path to be run and save the output to the local drive .


package bip;
import com.oracle.xmlns.oxp.service.v2.AccessDeniedException_Exception;
import com.oracle.xmlns.oxp.service.v2.InvalidParametersException_Exception;
import com.oracle.xmlns.oxp.service.v2.OperationFailedException_Exception;
import com.oracle.xmlns.oxp.service.v2.ReportRequest;
import com.oracle.xmlns.oxp.service.v2.ReportResponse;
import com.oracle.xmlns.oxp.service.v2.ReportService;
import com.oracle.xmlns.oxp.service.v2.ReportService_Service;
import com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJavaExtension;
import com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJobException;
import com.siebel.analytics.scheduler.javahostrpccalls.SchedulerJobInfo;
import java.io.FileNotFoundException;
import java.io.FileOutputStream;
import java.io.IOException;

public class callBIP implements SchedulerJavaExtension {
public static String userID = "weblogic";
public static String password = "welcome1";
private static ReportService_Service reportService_Service;
        public void cancel() {
        }
    public void run(SchedulerJobInfo jobInfo) throws SchedulerJobException {
        reportService_Service = new ReportService_Service();
        ReportService reportService = reportService_Service.getV2ReportService();
        try {
//Take the first paramater as the report xdo file and call the bip web service
            ReportResponse reportOutput =
                callBIP.runBipReport(reportService, jobInfo.parameter(0));
//Save output to local drive
       String strFilePath = "C://temp//report.pdf";
       FileOutputStream out = new FileOutputStream(strFilePath);
            out.write(reportOutput.getReportBytes());
            out.close();           
        } catch (IOException e) {
            jobInfo.setMessage(e.getMessage());
            jobInfo.setStatus(2);
        } catch (InvalidParametersException_Exception e) {
           jobInfo.setMessage(e.getMessage());
            jobInfo.setStatus(2);
        } catch (AccessDeniedException_Exception e) {
           jobInfo.setMessage(e.getMessage());
            jobInfo.setStatus(2);
        } catch (OperationFailedException_Exception e) {
           jobInfo.setMessage(e.getMessage());
            jobInfo.setStatus(2);
        }
    }
    public static ReportResponse runBipReport(ReportService reportService,
                                           String reportName) throws InvalidParametersException_Exception,
                                                                            AccessDeniedException_Exception,
                                                                            OperationFailedException_Exception,
                                                                            FileNotFoundException,
                                                                            IOException {
        ReportRequest req = new ReportRequest();
        req.setAttributeLocale("en-US");
        req.setAttributeFormat("pdf");
        req.setReportAbsolutePath(reportName);
        ReportResponse reportOutput = reportService.runReport(req, userID, password);
        return reportOutput;
    }

    }
}

Compile the code and deploy the JAR file to the javahost lib directory.
Change the javahost config.xml flag to enable custom java code processing by javahost.

Start Job Manager and enter the class name bip.callBIP, the class Path jar file: bipFile.jar. The report full xdo path is passed as a parameter in the parameters section



Execute the job et voila
Of course reports can be scheduled as well using this approach.

a+
Fiston