|
![]() |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.nitido.nim.NiMKernelService
com.nitido.nim.BrandService
com.nitido.nimx.services.brand.ldap.BrandServiceImpl
public class BrandServiceImpl
This BrandService implementation caches the domains, brands and applications in CacheContainers.
The data is retrieved from the LDAP.
The following configuration properties are required for this implementation to start up properly. (In addition to all the system defaults)
Field Summary |
---|
Fields inherited from class com.nitido.nim.BrandService |
---|
_confService |
Constructor Summary | |
---|---|
BrandServiceImpl(NiMKernelServiceVisa visa)
|
Method Summary | |
---|---|
protected Brand |
doGetBrand(java.lang.String domainID,
java.lang.String brandID,
Entity user,
NimletInput input)
|
java.util.List<Application> |
getApplications(java.util.List<java.lang.String> brandApps,
Entity user)
Get a list of application objects for a given list of application IDs. |
Brand |
getBrand(NimletInput input,
Entity user)
Determines which brand to use based on HttpNimletInput and user's pref. |
protected Brand |
getDefaultBrand(java.lang.String domainID,
Entity user)
Get the system default brand. |
Brand |
getDomainBrand(java.lang.String domainID)
Get the domain's default brand. |
java.lang.String |
getDomainID(NimletInput input)
Attempt to retrieve the name of the domain from which the request is being made. |
protected java.lang.String |
getDomainIDFromRequest(javax.servlet.http.HttpServletRequest request)
Get the domain name from an HTTP servlet request. |
java.lang.String |
getMessage(java.lang.String domainID,
java.lang.String brandID,
java.lang.String msgID,
java.lang.String locale,
java.lang.Object... msgParams)
Get the translated message. |
protected java.util.List<java.lang.String> |
getStringListProperty(java.lang.String propKey)
|
Brand |
getSystemDefaultBrand()
Getting the system default brand. |
protected com.nitido.nimx.services.brand.cache.CachedBrand |
getSystemDefaultCachedBrand()
Get the system default cached brand object. |
java.lang.String |
getSystemDefaultLocale()
Getting the system default locale string. |
protected java.util.Map<java.lang.String,java.lang.String> |
getUserAppPrefs(Entity user,
java.lang.String appId)
Retrieve properties for a single application from the user space. |
protected java.util.List<java.lang.String> |
getUserApps(Entity user)
Get the list of application IDs configured in the user's profile. |
protected void |
init(NiMKernel kernel,
ConfigurationService confService)
This method is used to initialize the kernel service. |
protected void |
preloadLangBundles()
|
Methods inherited from class com.nitido.nim.BrandService |
---|
getBooleanPropertyWithDefault, getLongProperty, getLongPropertyWithDefault, getStringProperty, getStringPropertyWithDefault, loadLocaleMap, loadSysDefaultApps |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public BrandServiceImpl(NiMKernelServiceVisa visa)
Method Detail |
---|
protected void init(NiMKernel kernel, ConfigurationService confService) throws InitializationFailedException, NiMException
NiMKernelService
init
in class BrandService
kernel
- Reference to the NiMKernel object that instantiated the
service.confService
- A reference to the configuration service. All the service
implementations (except ConfigurationService)
should retrieve the setting information from it.
InitializationFailedException
- If unable to initialize the kernel service.
NiMException
- If service initialization can not be done due to failure in
establish a connection to the back-end service. Not all
service implementation will throw this exception.protected java.util.List<java.lang.String> getStringListProperty(java.lang.String propKey)
protected void preloadLangBundles()
protected java.util.Map<java.lang.String,java.lang.String> getUserAppPrefs(Entity user, java.lang.String appId)
Multivalue stored in LDAP for this user:
return value:
Map of all the properties only for the mail app:
Empty map signifies that no specific settings were available for this app.
user
- the userappId
- the application ID
protected java.util.List<java.lang.String> getUserApps(Entity user)
NOTE: At the moment the presence of an "appId=name,key=val" in the user's profile is interpreted as that user having access to the application. So, in order to allow a user to access an application that might not be available for the brand all we need to do is place that string into their profile under the US_KEY_APP_LIST property.
user
- the user
public Brand getBrand(NimletInput input, Entity user)
getBrand
in class BrandService
input
- the current request's nimlet input object. If this brand object is
required for an unauthenticated entity it may be left null.user
- the current user
public Brand getDomainBrand(java.lang.String domainID)
getDomainBrand
in class BrandService
domainID
- domain whose default brand is to be retrieved
protected Brand doGetBrand(java.lang.String domainID, java.lang.String brandID, Entity user, NimletInput input)
domainID
- domain for which the brand is being requested. If it is
null the system default brand will be returned.brandID
- user's active brand ID. If it is not found the domain's
default brand will be returneduser
- the user for whom the brand is being retrieved. may be nullinput
- the nimlet input. may be null
public Brand getSystemDefaultBrand()
BrandService
getSystemDefaultBrand
in class BrandService
public java.util.List<Application> getApplications(java.util.List<java.lang.String> brandApps, Entity user)
getApplications
in class BrandService
brandApps
- the list of application IDsuser
- the user, if the user is null then applications are loaded,
but no attempt to load personal preferences for that application is made
public java.lang.String getMessage(java.lang.String domainID, java.lang.String brandID, java.lang.String msgID, java.lang.String locale, java.lang.Object... msgParams)
getMessage
in class BrandService
domainID
- the requesting user's domainID (used for fail over forbrandID
- the ID of the brand (this brand's dictionary will be used
to retrieve the message)
the error message)msgID
- the ID of the messagelocale
- the locale for which to retrieve this messagemsgParams
- variable argument which can take an array of objects, or
1 or more objects, or not be supplied at all
protected Brand getDefaultBrand(java.lang.String domainID, Entity user)
user
- the user for whom the brand is being retrieved
protected com.nitido.nimx.services.brand.cache.CachedBrand getSystemDefaultCachedBrand()
public java.lang.String getDomainID(NimletInput input)
input
- the input
public java.lang.String getSystemDefaultLocale()
BrandService
getSystemDefaultLocale
in class BrandService
protected java.lang.String getDomainIDFromRequest(javax.servlet.http.HttpServletRequest request)
request
- the request
|
Nitido NiM 2.5 Java API | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 1999-2009 Nitido Inc. Proprietary and Confidential. All Rights Reserved.