Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Login User and Password

Status
Not open for further replies.

dckamo

IS-IT--Management
Nov 11, 2003
27
0
0
ZA
Hi,

I intend creating a web application in java/Jdeveloper that is an add on to ellipse. I need to use the user id and password validation modules as a front end to my application (Similar to Ellipse).

Has anyone done something similar or have any ideas.

Regards
Kes
 
I'm not sure what exactly you are referring to in your question... Ellipse User id and password validation occurs on login to Ellipse after a connection to the Ellipse server.

The Ellipse WinView Client login screen (mlog.exe) is a Windows COM based object. This is only used in a win32 environment.

You will have to create you own login screen and use the connect and login methods of the MimsSession class... see the EllipseConnection.java code below:

Code:
package com.mincom.ellipse.myapp.connection;

import java.io.IOException;
import java.io.InterruptedIOException;

import com.mincom.mims.tech.mware.cbr.CBRException;
import com.mincom.mims.tech.mware.common.*;


/**
 * The EllipseConnection class is used to establish a connection to Ellipse
 */
public class EllipseConnection {

	private IMimsSession mySession;
	private String buflib = "";
	
	private String hostName;
	private String portNumber;
	private String hostUsername;
	private String hostPassword;
	
	/**
	 * EllipseConnection constructor
	 */
	public EllipseConnection() {
		
	}
	
	/**
	 * Set the location of the bfl files (for MSO access)
	 * @param location
	 */
	public void setBufferLibraryLocation(String location) {
		buflib = location;
	}

	/**
	 * Connect to the Ellipse server
	 * @param TP
	 * @param hostName
	 * @param portNumber
	 * @param hostUsername
	 * @param hostPassword
	 * @throws EllipseConnectionException
	 */

	public void connect(String TP, String hostName, int portNumber, String hostUsername, String hostPassword) throws EllipseConnectionException {
		
		MimsSessionFactory sessionFactory = MimsSessionFactory.getMimsSessionFactory();
		mySession = sessionFactory.getMimsSession(TP,buflib);
	
		try {
            mySession.connect(hostName, portNumber, hostUsername, hostPassword);
        } catch (InterruptedIOException e) {
        	throw new EllipseConnectionException(e.toString());
        } catch (IOException e) {
        	throw new EllipseConnectionException(e.toString());
        } catch (CBRException e) {
        	throw new EllipseConnectionException(e.toString());
        }
	}  
	
	/**
	 * This method attempts to login to the Ellipse server.
	 * @param mimsUser
	 * @param mimsPwd
	 * @param district
	 * @param position
	 * @throws EllipseConnectionException
	 */
	//login to mims
	public void login(String mimsUser,String mimsPwd,String district,String position) throws EllipseConnectionException {
		try {
			mySession.login(mimsUser,mimsPwd,district,position);
		} catch (CBRException e) {
        	throw new EllipseConnectionException(trimQuotes(e.toString()));
		} catch (MwareException e) {
        	throw new EllipseConnectionException(trimQuotes(e.toString()));
		} catch (ServerException e) {
			throw new EllipseConnectionException(trimQuotes(e.getLocalizedMessage()));
		} catch (IOException e) {
        	throw new EllipseConnectionException(trimQuotes(e.toString()));
		}
	}


	/**
	 * This method attempts to disconnect from the Ellipse server.
	 * @throws EllipseConnectionException
	 */
	//disconnect from mims server
    public void disconnect() throws EllipseConnectionException {
        try {
            mySession.disconnect();
        } catch (IOException e) {
        	throw new EllipseConnectionException(e.toString());
        } catch (CBRException e) {
        	throw new EllipseConnectionException(e.toString());
        }
    }
	
	/**
	 * Get the current connection to Ellipse
	 * @return IMimsSession: The current Ellipse session
	 */
	public IMimsSession getSession() {
		return mySession;
	}
	
	/**
	 * Trim the error message and remove double quotes
	 * from the ends of the message. 
	 */
	private String trimQuotes(String errorMessage) {
		// Start with initial trim
		String trimMessage = errorMessage.trim();
		// Strip double quotes (") from error message
		if (trimMessage.startsWith("\"") && trimMessage.endsWith("\"")) {
			trimMessage = trimMessage.substring(1, trimMessage.length()-1);
		}
		// Trim again on the way out
		return trimMessage.trim();
	}
}
 
Hi,

Thank you for the java code. This is what I will use.

Regards
Kes
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top