Documente Academic
Documente Profesional
Documente Cultură
Page 1
JDeveloper Steps
I used JDeveloper to build and deploy the webservice,
Open JDeveloper
Page 2
Page 3
Page 4
Page 5
Paste in the contents of ChngPwd.java to your new class file in JDeveloper. o Changepwd.java Note: You will need to update the variables for weblogic hostname, port, username, and password.
package ChngPwd; import java.io.IOException; import java.net.MalformedURLException; import javax.jws.WebMethod; import javax.jws.WebService; import javax.management.MBeanServerConnection; import javax.management.ObjectName; import javax.management.remote.JMXConnector; import javax.management.remote.JMXConnectorFactory; import javax.management.remote.JMXServiceURL; import java.util.HashMap; import java.util.Hashtable; import javax.naming.Context;
Page 6
@WebService public class ChngPwd { private static JMXConnector jmxConnector = null; private static MBeanServerConnection mBeanServerConnection = null; private static String webLogicHostname = "172.16.12.166"; // Set to the weblogic host private static String webLogicPort = "9704"; // Set to the port of the admin server on the weblogic instance // private static String webLogicUsername = "weblogic"; // Set to the weblogic admin user //private static String webLogicPassword = "welcome123"; // Set to the password of the weblogic admin user private static final String validationFailed = "[Security:090237]"; private static final String mustBeEightChars = "[Security:090285]"; private static final String missingSpecialChars = "[Security:099116]"; public ChngPwd() {} // for JAXB @WebMethod(exclude = true) public String changeUserPassword( String userId, String oldPassword, String newPassword, String confirmPassword ) throws Exception { ObjectName securityMBeanName = new ObjectName("Security:Name=myrealmDefaultAuthenticator"); Object objUser[] = new Object[]{(userId), (oldPassword), (newPassword) }; String objStr[] = new String[]{("java.lang.String"), ("java.lang.String"), ("java.lang.String") }; try { if ( confirmPassword.equals(newPassword) ) { mBeanServerConnection.invoke(securityMBeanName, "changeUserPassword", objUser, objStr); return "Password successfully changed."; } else { return "New passwords do not match."; } } catch (Exception e) { if( e.getCause().getMessage().contains( validationFailed ) ) return "Validation of old password failed."; else if ( e.getCause().getMessage().contains( mustBeEightChars ) ) PREPARED BY RAVI KUMAR LANKE Page 7
return "Password must be at least 8 characters long."; else if ( e.getCause().getMessage().contains( missingSpecialChars ) ) return "Password must contain at least 1 number or special character."; else return "Can not reset password at this time. Please contact an Administrator."; } } @WebMethod(exclude = true) public static void initConnection(String hostname, String portString,String webLogicUsername,String webLogicPassword) throws IOException, MalformedURLException { Integer portInteger = Integer.valueOf(portString); int port = portInteger.intValue(); String mserver = "/weblogic.management.mbeanservers.runtime"; JMXServiceURL serviceURL = new JMXServiceURL("service:jmx:iiop:///jndi/iiop://" + hostname + ":" + port + mserver); Hashtable h = new Hashtable(); String[] credentials = new String[] {webLogicUsername, webLogicPassword }; h.put("jmx.remote.credentials", credentials); jmxConnector = JMXConnectorFactory.connect(serviceURL, h); //jmxConnector = JMXConnectorFactory.connect(serviceURL); mBeanServerConnection = jmxConnector.getMBeanServerConnection(); } /*@WebMethod(exclude = true) public static void main(String[] args) throws Exception { }*/ public String passwordchange( String userId, String oldPassword, String newPassword, String confirmPassword ) throws Exception { ChngPwd c = new ChngPwd(); initConnection(webLogicHostname, webLogicPort,userId,oldPassword); String result = c.changeUserPassword( userId, oldPassword, newPassword, confirmPassword ); jmxConnector.close(); return result; } } PREPARED BY RAVI KUMAR LANKE Page 8
Page 9
Page 10
Lets now deploy the web service to the Weblogic server. Right Click on the project and click Deploy > Webservices
Page 11
Page 12
Page 13
Page 14
Page 15
Page 16
Page 17
Page 18
Page 19
Create a new Dashboard,called DemoSettings. Under Location, select Browser From the Shared Folders folder, select New Folder. Name it DemoAccount.
Select the radio button for Add content later (Create empty dashboard). Click Ok.
Page 20
Page 21
Click on the Catalog link, and navigate to the newly created folder, DemoAccount.
Select Permissions to set the appropriate permissions on the new folder, BI Administrator should have Full Control. BI Consumer should have Open. Make sure that Apply permissions to sub-folders and Apply permissions to items within folder are both selected. Click Ok.
Page 22
From the New menu in the OBIEE global navigation, select Action
Page 23
Page 24
Plug in the WSDL and click Open. The URL would look like: http://<weblogic host>:<obiee port>/<package name>-<project name>-contextroot/<package name>Port?WSDL
Drill down until you can select passwordChange, and select it. Click Ok
Page 25
This opens up a new dialog box, enter the following values for the prompts (no quotes): o passwordChange_arg0 = "Username:" o passwordChange_arg1 = "Old Password:" o passwordChange_arg2 = "New Password:" o passwordChange_arg3 = "Confirm Password:"
For the Username argument, for Value select Session Variable, then type in USER and mark it as fixed and hidden. This will force the password change to only work for the current logged in user.
Page 26
Click the Options button to personalize the messages (again, no quotes): Set Dialog Title to "Change Password" Set Action Help Text to "Please enter your existing password and new password below." Set Execute Button Text to "Change Password" Leave all other options blank.
Page 27
Click on the Action Results tab and enter the parameters for the return messages (again, no quotes): Set Dialog Text to "@{passwordChangeResponse}" Create one XPath variable: Name: passwordChangeResponse XPath Expression: Body/passwordChangeResponse/return Set Dialog Title to "Result"
Page 28
Click Ok. Click Save Action. Save the action as ChangePassword into the DemoAccount Shared Folder you created above.
Page 29
Navigate to your newly created Dashboard, DemoSettings. Edit the dashboard by placing a new section. In that section, add a text item. Place the following into the text item (making sure to check the Contains HTML Markup box):
Page 30
<script type="text/javascript"> document.getElementById("idPageOptions").style.display = "none"; </script> Welcome to the change password page. This page will allow you to change your password for access to the Business Intelligence reporting application.<br><br> You are currently logged in as <b>@{biServer.variables['NQ_SESSION.USER']}</b>.<br><br> Please click the link below to begin the password reset process.
Page 31
Page 32
Page 33
Click Ok. Edit the Column Properties. Click on Custom CSS Style Options (HTML Only) and add the following to the Use Custom CSS Style: position:absolute;height:120px; margin-top:40px;
Drag an Action Link below your text item in that same section. Name the link Change Password, and navigate to the saved Action Link you saved to the Shared Folder. Dont define any values, just click on the Ok button. Click Ok to close the Action Link Properties window.
Page 34
On the main section properties, unselect Collapsible. Additionally, from the Section Properties, set the border position to None.
Page 35
Page 36
Page 37
Click the
Page 38
Page 39
The following steps take place on the OBIEE server. All files references are for a Linux/Solaris install, but file locations will be similar for Windows.
Update the following files, to place a link to the Change Password in the header bar: /apps/applobi/OBIEE11g/Oracle_BI1/bifoundation/web/app/res/b_mozilla/header.js /apps/applobi/OBIEE11g/user_projects/domains/bifoundation_domain/servers/bi_server1/tmp/_WL_user/ analytics_11.1.1/7dezjl/war/res/b_mozilla/header.js
Page 40
saw.header.NavBar.prototype.onMyAccount=function(){saw.header.Menubar.getMana ger().hidePopupPanel();var a=new saw.ondemandload.FuncProxy("obips.AccountInfo.launchDialog", {messageTemplate:"kuiMyAccountDialogHead"});a.exec()};saw.header.NavBar.proto type.onCustomURL=function(){var w = 1920, h = 1080; if (document.all) { w = document.body.clientWidth;h = document.body.clientHeight;x = window.screenTop;y = window.screenLeft;} else if (document.layers) { w = window.innerWidth;h = window.innerHeight;x = window.screenX;y = window.screenY;} var popW = 450, popH = 276;var leftPos = ((w-popW)/2)+y, topPos = ((h-popH)/2)+x;window.open('saw.dll?PortalPages&PortalPath %2Fshared%2FUser%20Account%2F_portal%2FUser%20Settings','passwordresetwindow' ,'toolbar=no, menubar=no, scrollbars=no, resizable=no,location=no,
Page 41
Note: Replace the bold part with the path to the location you saved the Action Link in OBIEE above.
Page 42
Page 43
Update the following file to add the resource id /apps/applobi/OBIEE11g/Oracle_BI1/bifoundation/web/msgdb/common/saw.header.xml For this file, add the following line: <resource id="kmsgHeaderCustomURL" />
Page 44
Page 45
<webmessagetables xmlns:sawm="com.siebel.analytics.web/message/v1"> <webmessagetable lang="en-us" system="saw.header" table="Messages"> <webmessage name="kmsgHeaderCustomURL"><text>Change Password</text></webmessage> </webmessagetable> </webmessagetables>
Page 46
Restart the OBIEE services. You should now see a link under the User menu called Change Password. This will open a new window providing the user with simple instructions to change their password.
Page 47
Page 48
Page 49
Page 50
Page 51
Page 52
Page 53
Page 54
Page 55
Page 56
Page 57
Page 58
Page 59
Page 60
Page 61
Page 62
Page 63
Page 64