IDEMPIERE-362 Drop deprecated connection profile

This commit is contained in:
Carlos Ruiz 2012-12-19 23:50:45 -05:00
parent be49e0e790
commit dda97fbadd
9 changed files with 42 additions and 248 deletions

View File

@ -0,0 +1,18 @@
-- Dec 19, 2012 11:41:02 PM COT
-- Drop deprecated connection profile
UPDATE AD_Field SET IsDisplayed='N', IsActive='N',Updated=TO_DATE('2012-12-19 23:41:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12640
;
-- Dec 19, 2012 11:41:44 PM COT
-- Drop deprecated connection profile
UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-12-19 23:41:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14619
;
-- Dec 19, 2012 11:43:43 PM COT
-- Drop deprecated connection profile
UPDATE AD_Column SET IsActive='N',Updated=TO_DATE('2012-12-19 23:43:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14618
;
SELECT register_migration_script('201212192345_IDEMPIERE-362_ConnectionProfile.sql') FROM dual
;

View File

@ -0,0 +1,18 @@
-- Dec 19, 2012 11:41:02 PM COT
-- Drop deprecated connection profile
UPDATE AD_Field SET IsDisplayed='N', IsActive='N',Updated=TO_TIMESTAMP('2012-12-19 23:41:02','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Field_ID=12640
;
-- Dec 19, 2012 11:41:44 PM COT
-- Drop deprecated connection profile
UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-12-19 23:41:44','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14619
;
-- Dec 19, 2012 11:43:43 PM COT
-- Drop deprecated connection profile
UPDATE AD_Column SET IsActive='N',Updated=TO_TIMESTAMP('2012-12-19 23:43:43','YYYY-MM-DD HH24:MI:SS'),UpdatedBy=100 WHERE AD_Column_ID=14618
;
SELECT register_migration_script('201212192345_IDEMPIERE-362_ConnectionProfile.sql') FROM dual
;

View File

@ -32,7 +32,6 @@ import org.compiere.interfaces.Server;
import org.compiere.interfaces.Status;
import org.compiere.util.CLogger;
import org.compiere.util.Ini;
import org.compiere.util.ValueNamePair;
/**
* Adempiere Connection Descriptor
@ -44,34 +43,15 @@ import org.compiere.util.ValueNamePair;
public class CConnection implements Serializable, Cloneable
{
/**
*
*
*/
private static final long serialVersionUID = -7893119456331485444L;
private static final long serialVersionUID = -858558852550858165L;
/** Connection */
private volatile static CConnection s_cc = null;
/** Logger */
private static CLogger log = CLogger.getCLogger (CConnection.class);
/** Connection profiles */
@Deprecated
public static ValueNamePair[] CONNECTIONProfiles = new ValueNamePair[]{
new ValueNamePair("L", "LAN")};
/** Connection Profile LAN */
@Deprecated
public static final String PROFILE_LAN = "L";
/**
* Connection Profile Terminal Server
* @deprecated
**/
public static final String PROFILE_TERMINAL = "T";
/** Connection Profile VPM */
@Deprecated
public static final String PROFILE_VPN = "V";
/** Connection Profile WAN */
@Deprecated
public static final String PROFILE_WAN = "W";
/**
* Get/Set default client/server Connection
* @return Connection Descriptor
@ -98,7 +78,6 @@ public class CConnection implements Serializable, Cloneable
if (apps_host != null && Adempiere.isWebStartClient())
{
cc = new CConnection(apps_host);
cc.setConnectionProfile(CConnection.PROFILE_LAN);
if (cc.testAppsServer() == null)
{
s_cc = cc;
@ -553,77 +532,6 @@ public class CConnection implements Serializable, Cloneable
return false;
} // isRMIoverHTTP
/**
* Set Connection Profile
* @param connectionProfile connection profile
* @deprecated
*/
public void setConnectionProfile (ValueNamePair connectionProfile)
{
if (connectionProfile != null)
setConnectionProfile(PROFILE_LAN);
} // setConnectionProfile
/**
* Set Connection Profile
* @param connectionProfile connection profile
* @deprecated
*/
public void setConnectionProfile (String connectionProfile)
{
} // setConnectionProfile
/**
* Get Connection Profile
* @return connection profile
* @deprecated
*/
public String getConnectionProfile ()
{
return PROFILE_LAN;
} // getConnectionProfile
/**
* Get Connection Profile Text
* @param connectionProfile
* @return connection profile text
* @deprecated
*/
public String getConnectionProfileText (String connectionProfile)
{
for (int i = 0; i < CONNECTIONProfiles.length; i++)
{
if (CONNECTIONProfiles[i].getValue().equals(connectionProfile))
return CONNECTIONProfiles[i].getName();
}
return CONNECTIONProfiles[0].getName();
} // getConnectionProfileText
/**
* Get Connection Profile Text
* @return connection profile text
* @deprecated
*/
public String getConnectionProfileText ()
{
return getConnectionProfileText(getConnectionProfile());
} // getConnectionProfileText
/**
* Get Connection Profile
* @return connection profile
* @deprecated
*/
public ValueNamePair getConnectionProfilePair ()
{
for (int i = 0; i < CONNECTIONProfiles.length; i++)
{
if (CONNECTIONProfiles[i].getValue().equals(getConnectionProfile()))
return CONNECTIONProfiles[i];
}
return CONNECTIONProfiles[0];
} // getConnectionProfilePair
/**
* Should objects be created on Server ?
* @return true if client and VPN/WAN

View File

@ -258,19 +258,6 @@ public interface I_AD_Role
*/
public int getConfirmQueryRecords();
/** Column name ConnectionProfile */
public static final String COLUMNNAME_ConnectionProfile = "ConnectionProfile";
/** Set Connection Profile.
* How a Java Client connects to the server(s)
*/
public void setConnectionProfile (String ConnectionProfile);
/** Get Connection Profile.
* How a Java Client connects to the server(s)
*/
public String getConnectionProfile();
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";

View File

@ -192,19 +192,6 @@ public interface I_AD_User
*/
public String getComments();
/** Column name ConnectionProfile */
public static final String COLUMNNAME_ConnectionProfile = "ConnectionProfile";
/** Set Connection Profile.
* How a Java Client connects to the server(s)
*/
public void setConnectionProfile (String ConnectionProfile);
/** Get Connection Profile.
* How a Java Client connects to the server(s)
*/
public String getConnectionProfile();
/** Column name Created */
public static final String COLUMNNAME_Created = "Created";

View File

@ -32,7 +32,7 @@ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20121031L;
private static final long serialVersionUID = 20121219L;
/** Standard Constructor */
public X_AD_Role (Properties ctx, int AD_Role_ID, String trxName)
@ -518,34 +518,6 @@ public class X_AD_Role extends PO implements I_AD_Role, I_Persistent
return ii.intValue();
}
/** ConnectionProfile AD_Reference_ID=364 */
public static final int CONNECTIONPROFILE_AD_Reference_ID=364;
/** LAN = L */
public static final String CONNECTIONPROFILE_LAN = "L";
/** Terminal Server = T */
public static final String CONNECTIONPROFILE_TerminalServer = "T";
/** VPN = V */
public static final String CONNECTIONPROFILE_VPN = "V";
/** WAN = W */
public static final String CONNECTIONPROFILE_WAN = "W";
/** Set Connection Profile.
@param ConnectionProfile
How a Java Client connects to the server(s)
*/
public void setConnectionProfile (String ConnectionProfile)
{
set_Value (COLUMNNAME_ConnectionProfile, ConnectionProfile);
}
/** Get Connection Profile.
@return How a Java Client connects to the server(s)
*/
public String getConnectionProfile ()
{
return (String)get_Value(COLUMNNAME_ConnectionProfile);
}
/** Set Days Approval Accumulated.
@param DaysApprovalAccum
The days approval indicates the days to take into account to verify the accumulated approval amount.

View File

@ -31,7 +31,7 @@ public class X_AD_User extends PO implements I_AD_User, I_Persistent
/**
*
*/
private static final long serialVersionUID = 20121031L;
private static final long serialVersionUID = 20121219L;
/** Standard Constructor */
public X_AD_User (Properties ctx, int AD_User_ID, String trxName)
@ -306,34 +306,6 @@ public class X_AD_User extends PO implements I_AD_User, I_Persistent
return (String)get_Value(COLUMNNAME_Comments);
}
/** ConnectionProfile AD_Reference_ID=364 */
public static final int CONNECTIONPROFILE_AD_Reference_ID=364;
/** LAN = L */
public static final String CONNECTIONPROFILE_LAN = "L";
/** Terminal Server = T */
public static final String CONNECTIONPROFILE_TerminalServer = "T";
/** VPN = V */
public static final String CONNECTIONPROFILE_VPN = "V";
/** WAN = W */
public static final String CONNECTIONPROFILE_WAN = "W";
/** Set Connection Profile.
@param ConnectionProfile
How a Java Client connects to the server(s)
*/
public void setConnectionProfile (String ConnectionProfile)
{
set_Value (COLUMNNAME_ConnectionProfile, ConnectionProfile);
}
/** Get Connection Profile.
@return How a Java Client connects to the server(s)
*/
public String getConnectionProfile ()
{
return (String)get_Value(COLUMNNAME_ConnectionProfile);
}
/** Set Date Account Locked.
@param DateAccountLocked Date Account Locked */
public void setDateAccountLocked (Timestamp DateAccountLocked)

View File

@ -157,9 +157,6 @@ public class Login
private static CLogger log = CLogger.getCLogger(Login.class);
/** Context */
private Properties m_ctx = null;
/** Connection Profile */
private String m_connectionProfile = null;
/**
* (Test) Client Login.
@ -409,18 +406,6 @@ public class Login
Ini.setProperty(Ini.P_UID, "");
if (Ini.isPropertyBool(Ini.P_STORE_PWD) && MSystem.isSwingRememberPasswordAllowed())
Ini.setProperty(Ini.P_PWD, app_pwd);
m_connectionProfile = rs.getString(4); // User Based
if (m_connectionProfile != null)
{
CConnection cc = CConnection.get();
if (!cc.getConnectionProfile().equals(m_connectionProfile))
{
cc.setConnectionProfile(m_connectionProfile);
Ini.setProperty(Ini.P_CONNECTION, cc.toStringLong());
Ini.saveProperties(false);
}
}
}
do // read all roles
@ -508,20 +493,6 @@ public class Login
// User Level
Env.setContext(m_ctx, "#User_Level", rs.getString(1)); // Format 'SCO'
// ConnectionProfile
CConnection cc = CConnection.get();
if (m_connectionProfile == null) // No User Based
{
m_connectionProfile = rs.getString(2); // Role Based
if (m_connectionProfile != null
&& !cc.getConnectionProfile().equals(m_connectionProfile))
{
cc.setConnectionProfile(m_connectionProfile);
Ini.setProperty(Ini.P_CONNECTION, cc.toStringLong());
Ini.saveProperties(false);
}
}
// load Clients
do
{
@ -615,18 +586,6 @@ public class Login
Ini.setProperty(Ini.P_ROLE, rol.getName());
// User Level
Env.setContext(m_ctx, "#User_Level", rs.getString(1)); // Format 'SCO'
// ConnectionProfile
CConnection cc = CConnection.get();
if (m_connectionProfile == null) // No User Based
{
m_connectionProfile = rs.getString(2); // Role Based
if (m_connectionProfile != null && !cc.getConnectionProfile().equals(m_connectionProfile))
{
cc.setConnectionProfile(m_connectionProfile);
Ini.setProperty(Ini.P_CONNECTION, cc.toStringLong());
Ini.saveProperties(false);
}
}
// load Orgs
do{

View File

@ -49,7 +49,6 @@ import javax.swing.table.DefaultTableModel;
import org.adempiere.plaf.AdempierePLAF;
import org.adempiere.plaf.PLAFEditorPanel;
import org.compiere.db.CConnection;
import org.compiere.grid.ed.VDate;
import org.compiere.minigrid.MiniTable;
import org.compiere.model.MRole;
@ -93,7 +92,7 @@ public final class Preference extends CDialog
/**
*
*/
private static final long serialVersionUID = -8923143271736597338L;
private static final long serialVersionUID = -4691368295400769754L;
/**
* Standard Constructor
@ -165,8 +164,6 @@ public final class Preference extends CDialog
private CPrinter fPrinter = new CPrinter();
private CLabel lDate = new CLabel();
private VDate fDate = new VDate();
private CComboBox connectionProfile = new CComboBox(CConnection.CONNECTIONProfiles);
private CLabel connectionProfileLabel = new CLabel();
private CPanel errorPane = new CPanel();
private BorderLayout errorLayout = new BorderLayout();
private JScrollPane errorScrollPane = new JScrollPane();
@ -239,7 +236,6 @@ public final class Preference extends CDialog
showAcct.setToolTipText(Msg.getMsg(Env.getCtx(), "ShowAcctTab", false));
showAdvanced.setText(Msg.getMsg(Env.getCtx(), "ShowAdvancedTab", true));
showAdvanced.setToolTipText(Msg.getMsg(Env.getCtx(), "ShowAdvancedTab", false));
connectionProfileLabel.setText(Msg.getElement(Env.getCtx(), "ConnectionProfile"));
cacheWindow.setText(Msg.getMsg(Env.getCtx(), "CacheWindow", true));
cacheWindow.setToolTipText(Msg.getMsg(Env.getCtx(), "CacheWindow", false));
lPrinter.setText(Msg.getMsg(Env.getCtx(), "Printer"));
@ -288,10 +284,6 @@ public final class Preference extends CDialog
CPanel connPanel = new CPanel();
connPanel.setBorder(BorderFactory.createTitledBorder(Msg.getMsg(Env.getCtx(), "Connection")));
connPanel.setLayout(new GridBagLayout());
connPanel.add(connectionProfileLabel, new GridBagConstraints(0, 0, 1, 1, 0.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
connPanel.add(connectionProfile, new GridBagConstraints(1, 0, 1, 1, 1.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
connPanel.add(validateConnectionOnStartup, new GridBagConstraints(0, 1, 2, 1, 1.0, 0.0
,GridBagConstraints.WEST, GridBagConstraints.NONE, new Insets(2, 2, 2, 0), 0, 0));
customizePane.add(connPanel, new GridBagConstraints(0, 2, 1, 1, 1.0, 0.0
@ -505,17 +497,6 @@ public final class Preference extends CDialog
showTrl.setSelected(Ini.isPropertyBool(Ini.P_SHOW_TRL));
showAdvanced.setSelected(Ini.isPropertyBool(Ini.P_SHOW_ADVANCED));
// Connection Profile
MUser user = MUser.get(Env.getCtx());
String cp = user.getConnectionProfile();
if (cp == null)
cp = MRole.getDefault().getConnectionProfile();
if (cp != null)
{
CConnection.get().setConnectionProfile(cp);
connectionProfile.setReadWrite(false);
}
connectionProfile.setSelectedItem(CConnection.get().getConnectionProfilePair());
cacheWindow.setSelected(Ini.isCacheWindow());
// Print Preview
@ -594,14 +575,6 @@ public final class Preference extends CDialog
Ini.setProperty(Ini.P_SHOW_ADVANCED, (showAdvanced.isSelected()));
Env.setContext(Env.getCtx(), "#ShowAdvanced", (showAdvanced.isSelected()));
// ConnectionProfile
ValueNamePair ppNew = (ValueNamePair)connectionProfile.getSelectedItem();
String cpNew = ppNew.getValue();
String cpOld = CConnection.get().getConnectionProfile();
CConnection.get().setConnectionProfile(cpNew);
if (!cpNew.equals(cpOld)
&& (cpNew.equals(CConnection.PROFILE_WAN) || cpOld.equals(CConnection.PROFILE_WAN)))
ADialog.info(0, this, "ConnectionProfileChange");
Ini.setProperty(Ini.P_CACHE_WINDOW, cacheWindow.isSelected());
// Print Preview