Login User and Password
Login User and Password
(OP)
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 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
RE: Login User and Password
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
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();
}
}
RE: Login User and Password
Thank you for the java code. This is what I will use.
Regards
Kes