|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.arsdigita.kernel.KernelHelper
Provides static methods for accessing kernel-specific data. $Id: //core-platform/dev/src/com/arsdigita/kernel/KernelHelper.java#17 $
Constructor Summary | |
KernelHelper()
|
Method Summary | |
static boolean |
emailIsPrimaryIdentifier()
Deprecated. Use Kernel.getConfig().getPrimaryUserIdentifier() |
static Party |
getCurrentEffectiveParty()
|
static Party |
getCurrentParty()
|
static User |
getCurrentUser()
Deprecated. Call KernelContext.getParty() e.g.,
Kernel.getContext().getParty(). |
static User |
getCurrentUser(javax.servlet.http.HttpServletRequest request)
Deprecated. See getCurrentUser() |
static String |
getHostName()
Deprecated. This method will no longer exist in an upcoming release. |
static KernelRequestContext |
getKernelRequestContext(javax.servlet.http.HttpServletRequest req)
Extracts the KernelRequestContext from the given request. |
static javax.servlet.http.HttpServletRequest |
getRequest()
Deprecated. Use DispatcherHelper.getRequest() . |
static String |
getServerName()
Deprecated. This method now delegates to WebConfig. Use WebConfig.getServer() and the object it returns instead of this method. |
static String |
getServerPort()
Deprecated. This method now delegates to WebConfig. Use WebConfig.getServer() and the object it
returns instead of this method. |
static String |
getServerURL()
Deprecated. Use "http://" + Web.getConfig().getServer() +
"/" instead. |
static String |
getSiteName()
Deprecated. Use Web.getConfig().getSiteName()
instead. |
static String |
getSystemAdministratorEmailAddress()
Get the system administrator's email address. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public KernelHelper()
Method Detail |
public static KernelRequestContext getKernelRequestContext(javax.servlet.http.HttpServletRequest req)
IllegalStateException
- if the current request context does not
subclass KernelRequestContext.public static javax.servlet.http.HttpServletRequest getRequest()
DispatcherHelper.getRequest()
.
public static String getServerName()
WebConfig.getServer()
and the object it returns instead of this method.
The value of serverName is controlled by enterprise.init:
init com.arsdigita.kernel.Initializer { hostName = "prd001.redhat.com"; serverName = "www.redhat.com"; serverPort = "80"; }
If serverName is not defined in enterprise.init, this method will return hostName. If hostName is not defined it will return null.
public static String getServerPort()
WebConfig.getServer()
and the object it
returns instead of this method.
public static String getServerURL()
"http://" + Web.getConfig().getServer() +
"/"
instead.
getServerName()
and getServerPort()
. If the server port is not defined or set to
the standard HTTP port 80 it will not be included in the
URL. If neither the server name nor port are defined, the return
value is simply "http://localhost/".
public static String getHostName()
init com.arsdigita.kernel.Initializer { hostName = "redhat.com"; siteName = "Red Hat Web Site"; }
public static String getSiteName()
Web.getConfig().getSiteName()
instead.
init com.arsdigita.kernel.Initializer { hostName = "redhat.com"; siteName = "Red Hat Web Site"; }
public static String getSystemAdministratorEmailAddress()
For example, when a user tries to change their password, they receive confirmation via email. This email must appear to originate from a valid email address on the system. Ideally it will also correspond to a real person who can be replied to for help.
public static boolean emailIsPrimaryIdentifier()
Kernel.getConfig().getPrimaryUserIdentifier()
public static User getCurrentUser(javax.servlet.http.HttpServletRequest request)
getCurrentUser()
. In the
general case, those are preferrable.
request
- The HTTP request
RuntimeException
- if the logged-in user doesn't exist in
the databasepublic static User getCurrentUser()
KernelContext.getParty()
e.g.,
Kernel.getContext().getParty().
public static Party getCurrentParty()
public static Party getCurrentEffectiveParty()
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |