com.clickntap.smart
Class SmartContext

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<String,Object>
          extended by com.clickntap.smart.SmartContext
All Implemented Interfaces:
Serializable, Cloneable, Map<String,Object>

public class SmartContext
extends HashMap<String,Object>
implements Serializable

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Field Summary
static String SMART_USER
           
static String SMART_USER_ID
           
 
Constructor Summary
SmartContext(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
           
 
Method Summary
 void authorize(AuthenticatedUser user)
           
 SmartBindingResult bind(Object object)
           
 SmartBindingResult bind(Object object, String objectName)
           
 SmartBindingResult bind(Object object, String objectName, String[] allowedFields, String[] disallowedFields)
           
 SmartBindingResult bind(String objectName, String objectClass, String channel, String[] allowedFields, String[] disallowedFields, String scope)
           
 boolean canTryAutoLogin()
           
 String code(String key)
           
 String conf(String key)
           
 String css(String less)
           
 Datetime date()
           
 Datetime date(String date)
           
 boolean dateEquals(Datetime t1, Datetime t2, String format)
           
 void deauthorize(AuthenticatedUser user)
           
 String eval(Map map, String script)
           
 String eval(String script)
           
 boolean evalRule(Map map, String rule)
           
 boolean evalRule(String rule)
           
 org.springframework.context.ApplicationContext getApplicationContext()
           
 Object getBean(String ref)
           
 org.springframework.web.servlet.support.BindStatus getBindStatus(String path)
           
 org.springframework.web.servlet.support.BindStatus getBindStatus(String path, String propertyName)
           
 String getBrowser()
           
 String getClientData(String key)
           
 SmartController getController()
           
 Exception getException()
           
 String getFacebookAppId()
           
 String getRef()
           
 String getReferer()
           
 javax.servlet.http.HttpServletRequest getRequest()
           
 org.springframework.web.servlet.support.RequestContext getRequestContext()
           
 org.springframework.core.io.Resource getResource(String path)
           
 javax.servlet.http.HttpServletResponse getResponse()
           
 javax.servlet.http.HttpSession getSession()
           
 SmartApp getSmartApp()
           
 SmartFacebook getSmartFacebook()
           
 SmartRequest getSmartRequest()
           
 SmartRequest getStoredRequest()
           
 String getURI()
           
 String getURI(String ref)
           
 SmartUserAgent getUserAgent()
           
 Number getUserId()
           
 String getVersion()
           
 int intParam(String key)
           
 boolean isAuthenticated()
           
 boolean isBreak()
           
 boolean isDemoLocked()
           
 boolean isDevice()
           
 boolean isHilited(String ref)
           
 boolean isLoginRequest()
           
 boolean isLogoutRequest()
           
 boolean isRedirected()
           
 boolean isStoredRequest()
           
 List<SmartController> level(int i)
           
 String limit(String text, int limit)
           
 void load(String objectName, String objectClass, String channel, String scope)
           
 void loadRequest()
           
 void logout()
           
 List newList()
           
 Map newMap()
           
 Pager newPager(List list, int pageNumber)
           
 Pager newPager(List list, int pageNumber, int linksNum, int itemsForPageNum)
           
 String now()
           
 String param(String key)
           
 Datetime parseDate(String date)
           
 String plainText(String html)
           
 int rand()
           
 int rand(int num)
           
 void redirect(String ref)
           
 void reverse(List list)
           
 void sendError(String errorMessageKey, String errorMessage)
           
 void sendmail(String email, String name, boolean starttl)
           
 void sendRedirect(String uri)
           
 void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)
           
 void setBreak(boolean isBreak)
           
 void setClientData(String key, String value)
           
 void setException(Exception exception)
           
 void setRef(String ref)
           
 void setRef(String name, String extension)
           
 void setSmartApp(SmartApp smartApp)
           
 void shuffle(List list)
           
 void stop()
           
 void storeRequest()
           
 Datetime toDate(String s)
           
 org.json.JSONArray toJsonArray(String array)
           
 org.json.JSONObject toJsonObject(String object)
           
 Long toLong(String s)
           
 String tr(String key)
           
 String tr(String key, Object target)
           
 void tryAutoLogin()
           
 boolean tryLogin(boolean always)
           
 boolean tryLogout()
           
 String utf7(String text)
           
 
Methods inherited from class java.util.HashMap
clear, clone, containsKey, containsValue, entrySet, get, isEmpty, keySet, put, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
equals, hashCode
 

Field Detail

SMART_USER

public static final String SMART_USER
See Also:
Constant Field Values

SMART_USER_ID

public static final String SMART_USER_ID
See Also:
Constant Field Values
Constructor Detail

SmartContext

public SmartContext(javax.servlet.http.HttpServletRequest request,
                    javax.servlet.http.HttpServletResponse response)
Method Detail

getVersion

public String getVersion()

toJsonArray

public org.json.JSONArray toJsonArray(String array)

toJsonObject

public org.json.JSONObject toJsonObject(String object)

isBreak

public boolean isBreak()

setBreak

public void setBreak(boolean isBreak)

stop

public void stop()

getException

public Exception getException()

toDate

public Datetime toDate(String s)

getReferer

public String getReferer()

setException

public void setException(Exception exception)

getSmartApp

public SmartApp getSmartApp()

setSmartApp

public void setSmartApp(SmartApp smartApp)

getApplicationContext

public org.springframework.context.ApplicationContext getApplicationContext()

setApplicationContext

public void setApplicationContext(org.springframework.context.ApplicationContext applicationContext)

setRef

public void setRef(String name,
                   String extension)

getSmartRequest

public SmartRequest getSmartRequest()

getSession

public javax.servlet.http.HttpSession getSession()

setRef

public void setRef(String ref)

storeRequest

public void storeRequest()

getStoredRequest

public SmartRequest getStoredRequest()

isStoredRequest

public boolean isStoredRequest()

loadRequest

public void loadRequest()

getRequestContext

public org.springframework.web.servlet.support.RequestContext getRequestContext()

tr

public String tr(String key)

plainText

public String plainText(String html)

tr

public String tr(String key,
                 Object target)

level

public List<SmartController> level(int i)
                            throws SmartControllerNotFoundException
Throws:
SmartControllerNotFoundException

isHilited

public boolean isHilited(String ref)

getRequest

public javax.servlet.http.HttpServletRequest getRequest()

getResponse

public javax.servlet.http.HttpServletResponse getResponse()

getRef

public String getRef()

getURI

public String getURI()
              throws SmartControllerNotFoundException
Throws:
SmartControllerNotFoundException

getURI

public String getURI(String ref)

getBean

public Object getBean(String ref)

getResource

public org.springframework.core.io.Resource getResource(String path)

param

public String param(String key)

intParam

public int intParam(String key)

isAuthenticated

public boolean isAuthenticated()
                        throws Exception
Throws:
Exception

canTryAutoLogin

public boolean canTryAutoLogin()
                        throws Exception
Throws:
Exception

getUserId

public Number getUserId()

tryLogin

public boolean tryLogin(boolean always)
                 throws Exception
Throws:
Exception

authorize

public void authorize(AuthenticatedUser user)
               throws Exception
Throws:
Exception

deauthorize

public void deauthorize(AuthenticatedUser user)
                 throws Exception
Throws:
Exception

tryLogout

public boolean tryLogout()
                  throws Exception
Throws:
Exception

logout

public void logout()
            throws Exception
Throws:
Exception

isLoginRequest

public boolean isLoginRequest()
                       throws Exception
Throws:
Exception

isLogoutRequest

public boolean isLogoutRequest()
                        throws Exception
Throws:
Exception

redirect

public void redirect(String ref)
              throws IOException
Throws:
IOException

sendRedirect

public void sendRedirect(String uri)
                  throws IOException
Throws:
IOException

isRedirected

public boolean isRedirected()

getController

public SmartController getController()
                              throws SmartControllerNotFoundException
Throws:
SmartControllerNotFoundException

eval

public String eval(Map map,
                   String script)
            throws Exception
Throws:
Exception

eval

public String eval(String script)
            throws Exception
Throws:
Exception

evalRule

public boolean evalRule(Map map,
                        String rule)
                 throws Exception
Throws:
Exception

evalRule

public boolean evalRule(String rule)
                 throws Exception
Throws:
Exception

bind

public SmartBindingResult bind(String objectName,
                               String objectClass,
                               String channel,
                               String[] allowedFields,
                               String[] disallowedFields,
                               String scope)
                        throws Exception
Throws:
Exception

load

public void load(String objectName,
                 String objectClass,
                 String channel,
                 String scope)
          throws Exception
Throws:
Exception

bind

public SmartBindingResult bind(Object object,
                               String objectName,
                               String[] allowedFields,
                               String[] disallowedFields)
                        throws Exception
Throws:
Exception

bind

public SmartBindingResult bind(Object object,
                               String objectName)
                        throws Exception
Throws:
Exception

bind

public SmartBindingResult bind(Object object)
                        throws Exception
Throws:
Exception

utf7

public String utf7(String text)

rand

public int rand()
         throws Exception
Throws:
Exception

rand

public int rand(int num)

getBindStatus

public org.springframework.web.servlet.support.BindStatus getBindStatus(String path)

getBindStatus

public org.springframework.web.servlet.support.BindStatus getBindStatus(String path,
                                                                        String propertyName)

now

public String now()

code

public String code(String key)

date

public Datetime date()

date

public Datetime date(String date)

parseDate

public Datetime parseDate(String date)

reverse

public void reverse(List list)

shuffle

public void shuffle(List list)

limit

public String limit(String text,
                    int limit)

tryAutoLogin

public void tryAutoLogin()
                  throws Exception
Throws:
Exception

sendmail

public void sendmail(String email,
                     String name,
                     boolean starttl)
              throws Exception
Throws:
Exception

conf

public String conf(String key)

setClientData

public void setClientData(String key,
                          String value)
                   throws Exception
Throws:
Exception

getClientData

public String getClientData(String key)
                     throws Exception
Throws:
Exception

isDemoLocked

public boolean isDemoLocked()
                     throws SmartControllerNotFoundException
Throws:
SmartControllerNotFoundException

getBrowser

public String getBrowser()

isDevice

public boolean isDevice()

getUserAgent

public SmartUserAgent getUserAgent()

getSmartFacebook

public SmartFacebook getSmartFacebook()
                               throws Exception
Throws:
Exception

getFacebookAppId

public String getFacebookAppId()
                        throws Exception
Throws:
Exception

sendError

public void sendError(String errorMessageKey,
                      String errorMessage)
               throws Exception
Throws:
Exception

toLong

public Long toLong(String s)

dateEquals

public boolean dateEquals(Datetime t1,
                          Datetime t2,
                          String format)

css

public String css(String less)
           throws Exception
Throws:
Exception

newMap

public Map newMap()

newList

public List newList()

newPager

public Pager newPager(List list,
                      int pageNumber)
               throws Exception
Throws:
Exception

newPager

public Pager newPager(List list,
                      int pageNumber,
                      int linksNum,
                      int itemsForPageNum)
               throws Exception
Throws:
Exception


Copyright © 2014. All rights reserved.