Adempiere 3.5.2a

org.compiere.model
Class MUser

java.lang.Object
  extended by org.compiere.model.PO
      extended by org.compiere.model.X_AD_User
          extended by org.compiere.model.MUser
All Implemented Interfaces:
Serializable, Comparator, I_AD_User, I_Persistent, Evaluatee

public class MUser
extends X_AD_User

User Model

Version:
$Id: MUser.java,v 1.3 2006/07/30 00:58:18 jjanke Exp $
Author:
Jorg Janke
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.compiere.model.X_AD_User
AD_ORGTRX_ID_AD_Reference_ID, CONNECTIONPROFILE_AD_Reference_ID, CONNECTIONPROFILE_LAN, CONNECTIONPROFILE_TerminalServer, CONNECTIONPROFILE_VPN, CONNECTIONPROFILE_WAN, NOTIFICATIONTYPE_AD_Reference_ID, NOTIFICATIONTYPE_EMail, NOTIFICATIONTYPE_EMailPlusNotice, NOTIFICATIONTYPE_None, NOTIFICATIONTYPE_Notice, SUPERVISOR_ID_AD_Reference_ID
 
Fields inherited from class org.compiere.model.PO
ACCESSLEVEL_ALL, ACCESSLEVEL_CLIENT, ACCESSLEVEL_CLIENTORG, ACCESSLEVEL_ORG, ACCESSLEVEL_SYSTEM, ACCESSLEVEL_SYSTEMCLIENT, ENTITYTYPE_Dictionary, ENTITYTYPE_UserMaintained, I_ZERO, log, p_ctx, p_info, XML_ATTRIBUTE_AD_Table_ID, XML_ATTRIBUTE_Record_ID
 
Fields inherited from interface org.compiere.model.I_AD_User
accessLevel, COLUMNNAME_AD_OrgTrx_ID, COLUMNNAME_AD_User_ID, COLUMNNAME_Birthday, COLUMNNAME_C_BPartner_ID, COLUMNNAME_C_BPartner_Location_ID, COLUMNNAME_C_Greeting_ID, COLUMNNAME_C_Job_ID, COLUMNNAME_Comments, COLUMNNAME_ConnectionProfile, COLUMNNAME_Description, COLUMNNAME_EMail, COLUMNNAME_EMailUser, COLUMNNAME_EMailUserPW, COLUMNNAME_EMailVerify, COLUMNNAME_EMailVerifyDate, COLUMNNAME_Fax, COLUMNNAME_IsFullBPAccess, COLUMNNAME_IsInPayroll, COLUMNNAME_LastContact, COLUMNNAME_LastResult, COLUMNNAME_LDAPUser, COLUMNNAME_Name, COLUMNNAME_NotificationType, COLUMNNAME_Password, COLUMNNAME_Phone, COLUMNNAME_Phone2, COLUMNNAME_Processing, COLUMNNAME_Supervisor_ID, COLUMNNAME_Title, COLUMNNAME_UserPIN, COLUMNNAME_Value, Model, Table_ID, Table_Name
 
Constructor Summary
MUser(Properties ctx, int AD_User_ID, String trxName)
          Default Constructor
MUser(Properties ctx, ResultSet rs, String trxName)
          Load Constructor
MUser(X_C_BPartner partner)
          Parent Constructor
 
Method Summary
 void addDescription(String description)
          Add to Description
protected  boolean beforeSave(boolean newRecord)
          Before Save
static MUser get(Properties ctx)
          Get Current User (cached)
static MUser get(Properties ctx, int AD_User_ID)
          Get User (cached) Also loads Admninistrator (0)
static MUser get(Properties ctx, String name, String password)
          Get User
 X_AD_UserBPAccess[] getBPAccess(boolean requery)
          Get active BP Access records
 String getEMailVerifyCode()
          Get EMail Validation Code
 String getFirstName()
          Get First Name
 InternetAddress getInternetAddress()
          Convert EMail
 String getLastName()
          Get Last Name
static String getNameOfUser(int AD_User_ID)
          Get Name of AD_User
static MUser[] getOfBPartner(Properties ctx, int C_BPartner_ID)
          Get active Users of BPartner
 MRole[] getRoles(int AD_Org_ID)
          Get User Roles for Org
 String getValue()
          Get Value - 7 bit lower case alpha numerics max length 8
static MUser[] getWithRole(MRole role)
          Get Users with Role
 boolean hasBPAccess(String BPAccessType, Object[] params)
          Has the user Access to BP info and resources
 boolean isAdministrator()
          Is User an Administrator?
 boolean isCanSendEMail()
          Could we send an email
 boolean isEMailValid()
          Is the email valid
 boolean isEMailVerified()
          Is EMail Verified by response
 boolean isNotificationEMail()
          Get Notification via EMail
 boolean isNotificationNote()
          Get Notification via Note
 boolean isOnline()
          Is it an Online Access User
static boolean isSalesRep(int AD_User_ID)
          User is SalesRep
 void setEMail(String EMail)
          Set EMail - reset validation
 boolean setEMailVerifyCode(String code, String info)
          Check & Set EMail Validation Code.
 void setValue(String Value)
          Set Value - 7 bit lower case alpha numerics max length 8
 String toString()
          String Representation
 
Methods inherited from class org.compiere.model.X_AD_User
get_AccessLevel, getAD_OrgTrx_ID, getAD_User_ID, getBirthday, getC_BPartner_ID, getC_BPartner_Location_ID, getC_BPartner_Location, getC_BPartner, getC_Greeting_ID, getC_Greeting, getC_Job_ID, getC_Job, getComments, getConnectionProfile, getDescription, getEMail, getEMailUser, getEMailUserPW, getEMailVerify, getEMailVerifyDate, getFax, getKeyNamePair, getLastContact, getLastResult, getLDAPUser, getName, getNotificationType, getPassword, getPhone, getPhone2, getSupervisor_ID, getTitle, getUserPIN, initPO, isFullBPAccess, isInPayroll, isProcessing, setAD_OrgTrx_ID, setAD_User_ID, setBirthday, setC_BPartner_ID, setC_BPartner_Location_ID, setC_Greeting_ID, setC_Job_ID, setComments, setConnectionProfile, setDescription, setEMailUser, setEMailUserPW, setEMailVerify, setEMailVerifyDate, setFax, setIsFullBPAccess, setIsInPayroll, setLastContact, setLastResult, setLDAPUser, setName, setNotificationType, setPassword, setPhone, setPhone2, setProcessing, setSupervisor_ID, setTitle, setUserPIN
 
Methods inherited from class org.compiere.model.PO
afterDelete, afterSave, beforeDelete, compare, copyValues, copyValues, createAttachment, delete_Accounting, delete_Tree, delete, delete, deleteEx, deleteEx, dump, dump, equals, get_ColumnCount, get_ColumnDescription, get_ColumnDisplayType, get_ColumnIndex, get_ColumnLabel, get_ColumnLookup, get_ColumnName, get_DisplayValue, get_HashMap, get_ID, get_IDOld, get_KeyColumns, get_Logger, get_Table_ID, get_TableName, get_Translation, get_TrxName, get_Value, get_Value, get_ValueAsInt, get_ValueAsString, get_ValueDifference, get_ValueDifference, get_ValueE, get_ValueOfColumn, get_ValueOld, get_ValueOld, get_ValueOldAsInt, get_WhereClause, get_xmlDocument, get_xmlString, getAD_Client_ID, getAD_Org_ID, getAllIDs, getAttachment, getAttachment, getAttachmentData, getCreated, getCreatedBy, getCtx, getDoc, getFindParameter, getPdfAttachment, getUpdated, getUpdatedBy, insert_Accounting, insert_Tree, insert_Tree, is_Changed, is_new, is_ValueChanged, is_ValueChanged, isActive, isAttachment, isColumnMandatory, isColumnUpdateable, isMandatoryOK, isPdfAttachment, isReplication, load, load, load, load, loadComplete, loadDefaults, loadSpecial, lock, save, save, saveEx, saveEx, saveNew_getID, saveNewSpecial, saveReplica, saveUpdate, set_ColumnUpdateable, set_CustomColumn, set_TrxName, set_TrxName, set_Value, set_Value, set_ValueE, set_ValueNoCheck, set_ValueNoCheckE, set_ValueOfColumn, set_ValueOfColumn, setAD_Client_ID, setAD_Org_ID, setClientOrg, setClientOrg, setDoc, setDocWorkflowMgr, setIsActive, setReplication, setStandardDefaults, setUpdateable, setUpdatedBy, unlock
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.compiere.model.I_Persistent
save
 

Constructor Detail

MUser

public MUser(Properties ctx,
             int AD_User_ID,
             String trxName)
Default Constructor

Parameters:
ctx - context
AD_User_ID - id
trxName - transaction

MUser

public MUser(X_C_BPartner partner)
Parent Constructor

Parameters:
partner - partner

MUser

public MUser(Properties ctx,
             ResultSet rs,
             String trxName)
Load Constructor

Parameters:
ctx - context
rs - current row of result set to be loaded
trxName - transaction
Method Detail

getOfBPartner

public static MUser[] getOfBPartner(Properties ctx,
                                    int C_BPartner_ID)
Get active Users of BPartner

Parameters:
ctx - context
C_BPartner_ID - id
Returns:
array of users

getWithRole

public static MUser[] getWithRole(MRole role)
Get Users with Role

Parameters:
role - role
Returns:
array of users

get

public static MUser get(Properties ctx,
                        int AD_User_ID)
Get User (cached) Also loads Admninistrator (0)

Parameters:
ctx - context
AD_User_ID - id
Returns:
user

get

public static MUser get(Properties ctx)
Get Current User (cached)

Parameters:
ctx - context
Returns:
user

get

public static MUser get(Properties ctx,
                        String name,
                        String password)
Get User

Parameters:
ctx - context
name - name
password - password
Returns:
user or null

getNameOfUser

public static String getNameOfUser(int AD_User_ID)
Get Name of AD_User

Parameters:
AD_User_ID - System User
Returns:
Name of user or ?

isSalesRep

public static boolean isSalesRep(int AD_User_ID)
User is SalesRep

Parameters:
AD_User_ID - user
Returns:
true if sales rep

getValue

public String getValue()
Get Value - 7 bit lower case alpha numerics max length 8

Specified by:
getValue in interface I_AD_User
Overrides:
getValue in class X_AD_User
Returns:
value

setValue

public void setValue(String Value)
Set Value - 7 bit lower case alpha numerics max length 8

Specified by:
setValue in interface I_AD_User
Overrides:
setValue in class X_AD_User
Parameters:
Value -

getFirstName

public String getFirstName()
Get First Name

Returns:
first name

getLastName

public String getLastName()
Get Last Name

Returns:
first name

addDescription

public void addDescription(String description)
Add to Description

Parameters:
description - description to be added

toString

public String toString()
String Representation

Overrides:
toString in class X_AD_User
Returns:
Info

isOnline

public boolean isOnline()
Is it an Online Access User

Returns:
true if it has an email and password

setEMail

public void setEMail(String EMail)
Set EMail - reset validation

Specified by:
setEMail in interface I_AD_User
Overrides:
setEMail in class X_AD_User
Parameters:
EMail - email

getInternetAddress

public InternetAddress getInternetAddress()
Convert EMail

Returns:
Valid Internet Address

isEMailValid

public boolean isEMailValid()
Is the email valid

Returns:
return true if email is valid (artificial check)

isCanSendEMail

public boolean isCanSendEMail()
Could we send an email

Returns:
true if EMail Uwer/PW exists

getEMailVerifyCode

public String getEMailVerifyCode()
Get EMail Validation Code

Returns:
code

setEMailVerifyCode

public boolean setEMailVerifyCode(String code,
                                  String info)
Check & Set EMail Validation Code.

Parameters:
code - code
info - info
Returns:
true if valid

isEMailVerified

public boolean isEMailVerified()
Is EMail Verified by response

Returns:
true if verified

isNotificationEMail

public boolean isNotificationEMail()
Get Notification via EMail

Returns:
true if email

isNotificationNote

public boolean isNotificationNote()
Get Notification via Note

Returns:
true if note

getRoles

public MRole[] getRoles(int AD_Org_ID)
Get User Roles for Org

Parameters:
AD_Org_ID - org
Returns:
array of roles

isAdministrator

public boolean isAdministrator()
Is User an Administrator?

Returns:
true id Admin

hasBPAccess

public boolean hasBPAccess(String BPAccessType,
                           Object[] params)
Has the user Access to BP info and resources

Parameters:
BPAccessType - access type
params - opt parameter
Returns:
true if access

getBPAccess

public X_AD_UserBPAccess[] getBPAccess(boolean requery)
Get active BP Access records

Parameters:
requery - requery
Returns:
access list

beforeSave

protected boolean beforeSave(boolean newRecord)
Before Save

Overrides:
beforeSave in class PO
Parameters:
newRecord - new
Returns:
true

Adempiere 3.5.2a

Adempiere® is a registered trademark of ADempiere Business Inc. ©2004-2008 HumanFlash.com All rights reserved.