public class Customer extends GeneratedCustomer
protected Item createItem(final SessionContext ctx, final ComposedType type, final ItemAttributeMap allAttributes)
throws JaloBusinessException
{
if (allAttributes.get(Customer.CUSTOMERID) == null)
{
allAttributes.put(Customer.CUSTOMERID, UserManager.getInstance().generateCustomerID());
}
return super.createItem(ctx, type, allAttributes);
}
In case you do not have an own customer type add the following code to your manager class:
public void beforeItemCreation(final SessionContext ctx, final ComposedType type, final ItemAttributeMap attributes)
throws JaloBusinessException
{
if (TypeManager.getInstance().getComposedType(Customer.class).isAssignableFrom(type))
{
if (attributes.get(Customer.CUSTOMERID) == null)
{
attributes.put(Customer.CUSTOMERID, UserManager.getInstance().generateCustomerID());
}
}
super.beforeItemCreation(ctx, type, attributes);
}
Also see PLA-6951.GenericItem.GenericItemImplLocalizableItem.LocalizableItemImplExtensibleItem.ExtensibleItemImplItem.AttributeFilter, Item.AttributeMode, Item.CachedGetter, Item.CachedSetter, Item.ItemAttributeMap, Item.ItemConstraint, Item.ItemImpl, Item.JaloCachedComputationException| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
LOGIN_ANONYMOUS_ALWAYS_DISABLED
Configuration constant for
login.anonymous.always.disabled/ |
CUSTOMERID, DEFAULT_INITIAL_ATTRIBUTESCURRENT_DATE, CURRENT_TIME, DEFAULT_PAYMENT_ADDRESS, DEFAULT_SHIPPING_ADDRESS, LAST_LOGIN, LOGIN_DISABLED, PASSWORD, PASSWORD_ANSWER, PASSWORD_QUESTION, PAYMENT_MODES, SESSION_CURRENCY, SESSION_LANGUAGE, USER_AUDIT_ENABLEDADDRESSES, ADDRESSESHANDLER, CARTS, CARTSHANDLER, CONTACTINFOS, CONTACTINFOSHANDLER, DEACTIVATIONDATE, DEFAULTPAYMENTADDRESS, DEFAULTSHIPMENTADDRESS, ENCODEDPASSWORD, HMCLOGINDISABLED, LASTLOGIN, LOGINDISABLED, ORDERS, ORDERSHANDLER, PASSWORDANSWER, PASSWORDENCODING, PASSWORDQUESTION, PAYMENTINFOS, PAYMENTINFOSHANDLER, QUOTES, QUOTESHANDLER, RETENTIONSTATE, SESSIONCURRENCY, SESSIONLANGUAGE, USERPROFILEALLGROUPS, ALLSEARCHRESTRICTIONS, DISPLAYNAME, PRINCIPAL_GROUP_RELATION_NAMEDESCRIPTION, GROUPS, NAME, PRINCIPALGROUPRELATION_MARKMODIFIED, PRINCIPALGROUPRELATION_SRC_ORDERED, PRINCIPALGROUPRELATION_TGT_ORDERED, SEARCHRESTRICTIONS, SEARCHRESTRICTIONSHANDLER, UIDLANGUAGE_FALLBACK_ENABLED_CREATION_TIME_INTERNAL, _MODIFIED_TIME_INTERNAL, accessorLog, CREATION_TIME, DISABLE_ATTRIBUTE_CHECK, DISABLE_ITEMCHECK_BEFORE_REMOVABLE, EVEN, FEATURE_ACCESSMAP_QUALIFIER, INITIAL_CREATION_FLAG, isJaloOnly, MODIFIED_TIME, NEGATIVE, NOT_FOUND, OWNER, PK, POSITIVE, SAVE_FROM_SERVICE_LAYER, staticTransientObjects, TYPEimpl, tenant| Constructor and Description |
|---|
Customer() |
| Modifier and Type | Method and Description |
|---|---|
boolean |
checkPassword(LoginToken token)
Deprecated.
since ages - use
AuthenticationService.checkCredentials(String, String) |
boolean |
checkPassword(SessionContext ctx,
java.lang.String plainPassword)
Deprecated.
since ages - use
AuthenticationService.checkCredentials(String, String) |
boolean |
isAdmin()
Deprecated.
since ages - use
UserService.isAdmin(UserModel) |
protected boolean |
isAnonymousAndAnonymousLoginIsDisabled()
Deprecated.
since ages - This logic is now moved to
JaloSession.isAnonymousAndAnonymousLoginIsDisabled(String) |
java.lang.Boolean |
isLoginDisabled(SessionContext ctx)
Deprecated.
since ages - Method doesn't check for anonymous login or if it is disabled before getting the attribute value anymore.
See
JaloSession.performLogin(String, String, Map) |
protected boolean |
isNotAnonymousOrAnonymousLoginIsAllowed()
Deprecated.
since ages - This logic is now moved to
JaloSession.isNotAnonymousOrAnonymousLoginIsAllowed(String) |
static void |
registerAsJaloObject()
Deprecated.
since ages - this is done automatically on loading hybris platform implementation
|
void |
setLoginDisabled(SessionContext ctx,
java.lang.Boolean disabled)
Overwritten to log a warning as long as
login.anonymous.always.disabled is set to true. |
getCustomerID, getCustomerID, getDefaultAttributeModes, setCustomerID, setCustomerIDauditUserPasswordChange, checkPassword, checkPasswordPolicies, checkRemovable, checkSystemPrincipal, createAddress, createAddress, createAddress, createAddress, createAddress, createAddress, createAddress, createAddress, createItem, createPaymentInfo, createPaymentInfo, getAllAddresses, getAllDisplayName, getCart, getCurrentDate, getCurrentDate, getCurrentDateOldStyle, getCurrentTime, getCurrentTime, getDefaultDeliveryAddress, getDefaultDeliveryAddress, getDefaultShippingAddress, getDefaultShippingAddress, getDisplayName, getEncoder, getLogin, getLogin, getPassword, getPassword, getRealEncoding, isAdminEmployee, isAnonymousCustomer, saveCurrentCart, saveCurrentCart, setDefaultDeliveryAddress, setDefaultDeliveryAddress, setDefaultShippingAddress, setDefaultShippingAddress, setEncodedPassword, setEncodedPassword, setEncodedPassword, setEncodedPassword, setLogin, setLogin, setPassword, setPassword, setPassword, setPassword, setUidaddToAddresses, addToAddresses, addToCarts, addToCarts, addToContactInfos, addToContactInfos, addToOrders, addToOrders, addToPaymentInfos, addToPaymentInfos, addToQuotes, addToQuotes, getAddresses, getAddresses, getCarts, getCarts, getContactInfos, getContactInfos, getDeactivationDate, getDeactivationDate, getDefaultPaymentAddress, getDefaultPaymentAddress, getDefaultShipmentAddress, getDefaultShipmentAddress, getEncodedPassword, getEncodedPassword, getLastLogin, getLastLogin, getOrders, getOrders, getPasswordAnswer, getPasswordAnswer, getPasswordEncoding, getPasswordEncoding, getPasswordQuestion, getPasswordQuestion, getPaymentInfos, getPaymentInfos, getQuotes, getQuotes, getRetentionState, getRetentionState, getSessionCurrency, getSessionCurrency, getSessionLanguage, getSessionLanguage, getUserprofile, getUserprofile, isHmcLoginDisabled, isHmcLoginDisabled, isHmcLoginDisabledAsPrimitive, isHmcLoginDisabledAsPrimitive, isLoginDisabled, isLoginDisabledAsPrimitive, isLoginDisabledAsPrimitive, removeFromAddresses, removeFromAddresses, removeFromCarts, removeFromCarts, removeFromContactInfos, removeFromContactInfos, removeFromOrders, removeFromOrders, removeFromPaymentInfos, removeFromPaymentInfos, removeFromQuotes, removeFromQuotes, setAddresses, setAddresses, setCarts, setCarts, setContactInfos, setContactInfos, setDeactivationDate, setDeactivationDate, setDefaultPaymentAddress, setDefaultPaymentAddress, setDefaultShipmentAddress, setDefaultShipmentAddress, setHmcLoginDisabled, setHmcLoginDisabled, setHmcLoginDisabled, setHmcLoginDisabled, setLastLogin, setLastLogin, setLoginDisabled, setLoginDisabled, setLoginDisabled, setOrders, setOrders, setPasswordAnswer, setPasswordAnswer, setPasswordEncoding, setPasswordEncoding, setPasswordQuestion, setPasswordQuestion, setPaymentInfos, setPaymentInfos, setQuotes, setQuotes, setRetentionState, setRetentionState, setSessionCurrency, setSessionCurrency, setSessionLanguage, setSessionLanguage, setUserprofile, setUserprofileaddGlobalNegativePermission, addGlobalPermission, addGlobalPermissions, addGlobalPositivePermission, addToGroup, checkConsistencyUid, checkGlobalPermission, checkOwnGlobalPermission, clearGlobalPermission, clearGlobalPermissions, getAllDisplayName, getAllGlobalNegativePermissions, getAllGlobalPositivePermissions, getAllGroups, getAllGroups, getAllSearchRestrictions, getAllSearchRestrictions, getDisplayName, getGlobalNegativePermissions, getGlobalPermissions, getGlobalPositivePermissions, getGroups, getItemPermissionsMap, getUID, getUid, isMemberOf, isMemberOf, remove, removeFromGroup, setGroups, setItemPermissionsByMap, setUID, toStringaddToGroups, addToGroups, getDescription, getDescription, getGroups, getGroupsCount, getGroupsCount, getName, getName, getSearchRestrictions, getSearchRestrictions, getUid, isMarkModifiedDisabled, removeFromGroups, removeFromGroups, setDescription, setDescription, setGroups, setName, setName, setUidgetInitialProperties, getNonInitialAttributesgetAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllLocalizedProperties, getAllValuesSessionContext, getLocalizedProperty, getLocalizedProperty, getLocalizedPropertyInternal, getLocalizedPropertyNames, getLocalizedPropertyNames, hasLanguage, isEmptyValue, isFallbackEnabled, removeLocalizedProperty, removeLocalizedProperty, setAllLocalizedProperties, setAllLocalizedProperties, setLocalizedProperty, setLocalizedPropertycreateNonClassAccessor, getAllProperties, getAllProperties, getImplementation, getProperty, getProperty, getPropertyNames, getPropertyNames, removeProperty, removeProperty, setAllProperties, setAllProperties, setProperty, setPropertyaddLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addLinkedItems, addNegativePermission, addPermission, addPositivePermission, assureExtensionsLoaded, changeTypeAfterCreation, checkConstraint, checkItemPermission, checkMandatoryAttribute, checkMandatoryAttribute, checkPermission, checkPermission, clearPermission, compareTo, ctx, doAfterRemove, doBeforeRemove, equals, getAccessorFor, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributes, getAllAttributesInternal, getAllLinkedItems, getAndCheckCacheBoundItem, getAttribute, getAttribute, getCacheBoundItem, getComposedType, getComposedTypePK, getCreationTime, getCurrentlyRemovingCount, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItems, getLinkedItemsCount, getLinkedItemsCount, getLinkedItemsCount, getModificationTime, getNegativePermissions, getOwner, getPermissionMap, getPermissions, getPersistenceVersion, getPK, getPositivePermissions, getRestrictedPrincipals, getSession, getSyncObject, getTenant, getTransientObject, getTransientObjectMap, hashCode, hasRegisteredClassAccessorFor, internal_registerClassAccessorFor, internal_registerNonClassAccessorFor, invalidateLocalCaches, isAlive, isCacheBound, isCurrentlyRemoving, isCurrentlyRemoving, isEmptyRelationValue, isInCreate, isInstanceOf, isItemCheckBeforeRemoveableDisabled, isRelationLocalizationFallbackEnabled, newInstance, notifyExtensionsAfterItemCreation, notifyExtensionsBeforeItemCreation, notifyItemRemoval, notifyManagerAboutItemRemoval, readResolve, registerAccessFor, registerAccessFor, registerJaloInvalidationListeners, remove, removeItemCollection, removeItemCollection, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinkedItems, removeLinks, removePartOfItems, removePartOfItems, setAllAttributes, setAllAttributes, setAllAttributesInternal, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAllLinkedItems, setAttribute, setAttribute, setAttributeFromString, setAttributeFromString, setCacheBound, setComposedType, setCreationTime, setImplementation, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setLinkedItems, setModificationTime, setNonInitialAttributes, setOwner, setPermissionsByMap, setTransientObject, setUseTA, useTA, writeReplacesetTenantpublic static final java.lang.String LOGIN_ANONYMOUS_ALWAYS_DISABLED
login.anonymous.always.disabled/ which allows changing the (default)
disabling of the anonymous account.@Deprecated public static void registerAsJaloObject()
@Deprecated public boolean checkPassword(LoginToken token)
AuthenticationService.checkCredentials(String, String)false in case this is the anonymous account and anonymous login has been
disable via configuration ( which is the default setting).checkPassword in class User@Deprecated public boolean checkPassword(SessionContext ctx, java.lang.String plainPassword)
AuthenticationService.checkCredentials(String, String)false in case this is the anonymous account and anonymous login has been
disable via configuration ( which is the default setting).checkPassword in class User@Deprecated public boolean isAdmin()
UserService.isAdmin(UserModel)User@Deprecated public java.lang.Boolean isLoginDisabled(SessionContext ctx)
JaloSession.performLogin(String, String, Map)login.anonymous.always.disabled configuration property is set to true (which is also
the default value).isLoginDisabled in class GeneratedUserpublic void setLoginDisabled(SessionContext ctx, java.lang.Boolean disabled)
login.anonymous.always.disabled is set to true.setLoginDisabled in class Userdisabled - the loginDisabled - Determines whether user is allowed to login to system.@Deprecated protected boolean isAnonymousAndAnonymousLoginIsDisabled()
JaloSession.isAnonymousAndAnonymousLoginIsDisabled(String)login.anonymous.always.disabled configuration parameter ).@Deprecated protected boolean isNotAnonymousOrAnonymousLoginIsAllowed()
JaloSession.isNotAnonymousOrAnonymousLoginIsAllowed(String)login.anonymous.always.disabled configuration parameter to false.isAnonymousAndAnonymousLoginIsDisabled()Copyright © 2018 SAP SE. All Rights Reserved.