|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectinfo.aduna.gee.publication.servlets.cache.TemplateCache
public class TemplateCache
Class TemplateCache
| Field Summary | |
|---|---|
protected static String[] |
_publicTemplates
|
protected static HashMap |
_templateMap
|
protected static HashMap |
_templateTimeMap
|
static String |
API_RESULT_STUB
|
| Fields inherited from interface info.aduna.gee.publication.servlets.ApiConstants |
|---|
CREATE_EMAIL_KEY, CREATE_NAME_KEY, CREATE_PASSWORD_KEY, CREATE_TIMETOLIVE_KEY, MESSAGE_KEY, RESULT_KEY, RETURN_CODE_KEY |
| Fields inherited from interface info.aduna.gee.publication.UserTypes |
|---|
API_BIT, COVER_BUILDER_BIT, ENGINE_BIT, GUEST_BITS, OWNER_BITS, PRO_BITS, PROUSER_BIT, SERVER_BIT, SHOP_BIT, SHOW_BIT, SHOW_BITS, VISITOR_BIT |
| Constructor Summary | |
|---|---|
TemplateCache()
|
|
| Method Summary | |
|---|---|
protected static String |
_getTemplateString(javax.servlet.http.HttpServletRequest request,
String fileName)
|
protected static String |
_getTypeFromRequest(javax.servlet.http.HttpServletRequest request)
|
protected static boolean |
_looksLikeStub(String stubCandidate)
|
static String |
convert(String templateString,
HashMap stubsMap)
|
static String |
convert(String templateString,
HashMap stubsMap,
boolean removeStubs)
Do the actual substitutions. |
static String |
get(javax.servlet.http.HttpServletRequest request,
String fileName,
UserInfo userInfo,
CoverInfo coverInfo,
HashMap stubsMap)
|
static String |
get(javax.servlet.http.HttpServletRequest request,
String fileName,
UserInfo userInfo,
CoverInfo coverInfo,
HashMap stubsMap,
boolean removeStubs)
Get the appropriate template and substitute "stubs". |
static int |
getDefaultType(javax.servlet.http.HttpServletRequest request)
Get the (overall) default zpad-code-type on this host. |
static int |
getDefaultType(javax.servlet.http.HttpServletRequest request,
UserInfo userInfo)
Get the default zpad-code-type for a user on this host. |
static int |
getUserType(javax.servlet.http.HttpServletRequest request,
UserInfo userInfo,
HashMap stubsMap)
Get the effective zpad-code-type for the user on this host. |
static boolean |
isApiRequest(int userType)
Is the current request a api request ? |
static boolean |
isApiRequest(String userType)
Is the current request a api request ? |
static boolean |
isPublicTemplate(String name)
|
static long |
lastModified(String host)
|
static void |
refresh(String host)
|
static int |
versionToType(String version)
Translate a symbolic version name to a numeric user type. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String API_RESULT_STUB
protected static HashMap _templateMap
protected static HashMap _templateTimeMap
protected static String[] _publicTemplates
| Constructor Detail |
|---|
public TemplateCache()
| Method Detail |
|---|
public static boolean isPublicTemplate(String name)
public static String get(javax.servlet.http.HttpServletRequest request,
String fileName,
UserInfo userInfo,
CoverInfo coverInfo,
HashMap stubsMap)
public static String get(javax.servlet.http.HttpServletRequest request,
String fileName,
UserInfo userInfo,
CoverInfo coverInfo,
HashMap stubsMap,
boolean removeStubs)
request - non-nullfileName - non-null, the name of the Template requesteduserInfo - may be nullcoverInfo - may be nullstubsMap - may be null, a set of stub/stubvalue pairsremoveStubs - whether or not to remove unknown stubs
protected static String _getTemplateString(javax.servlet.http.HttpServletRequest request,
String fileName)
public static String convert(String templateString,
HashMap stubsMap)
public static String convert(String templateString,
HashMap stubsMap,
boolean removeStubs)
protected static boolean _looksLikeStub(String stubCandidate)
public static void refresh(String host)
public static int getDefaultType(javax.servlet.http.HttpServletRequest request)
public static int getDefaultType(javax.servlet.http.HttpServletRequest request,
UserInfo userInfo)
request - The request, e.g. to determine the hostuserInfo - The userInfo or null.
public static int getUserType(javax.servlet.http.HttpServletRequest request,
UserInfo userInfo,
HashMap stubsMap)
protected static String _getTypeFromRequest(javax.servlet.http.HttpServletRequest request)
public static int versionToType(String version)
public static long lastModified(String host)
public static boolean isApiRequest(int userType)
userType - the client's Zpad typepublic static boolean isApiRequest(String userType)
userType - the client's Zpad type
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||