org.nuiton.wikitty.publication.ui.action
Class PublicationActionEval

java.lang.Object
  extended by com.opensymphony.xwork2.ActionSupport
      extended by org.nuiton.web.struts2.BaseAction
          extended by org.nuiton.wikitty.publication.ui.action.PublicationBaseAction
              extended by org.nuiton.wikitty.publication.ui.action.PublicationActionEval
All Implemented Interfaces:
com.opensymphony.xwork2.Action, com.opensymphony.xwork2.LocaleProvider, com.opensymphony.xwork2.TextProvider, com.opensymphony.xwork2.Validateable, com.opensymphony.xwork2.ValidationAware, Serializable, org.apache.struts2.interceptor.ServletRequestAware, org.apache.struts2.interceptor.ServletResponseAware, org.apache.struts2.interceptor.SessionAware, EvalInterface, PublicationContext

public class PublicationActionEval
extends PublicationBaseAction
implements org.apache.struts2.interceptor.ServletResponseAware, org.apache.struts2.interceptor.ServletRequestAware, PublicationContext, EvalInterface

Java class

Author:
mfortun
See Also:
Serialized Form

Field Summary
protected  WikittyPublicationClassLoader classloader
           
protected  List<File> classPathSup
           
protected  String contentType
           
protected  InputStream inputStream
           
protected static String JAR_TEMP_DIR_NAME
           
protected static String JAVA_TEMP_DIR_NAME
           
protected static String MD5_FILE
           
protected  javax.servlet.http.HttpServletRequest request
           
protected  javax.servlet.http.HttpServletResponse response
           
 
Fields inherited from class org.nuiton.wikitty.publication.ui.action.PublicationBaseAction
ARG_CONTENT_FIELD, ARG_MIMETYPE, ARG_QUERY, ARGS_KEY, CONTEXT_ACTION_KEY, CONTEXT_APPS_KEY, CONTEXT_DATA_KEY, contextApps, contextData, SEARCH_SEPARATOR, SEPARATOR, session
 
Fields inherited from class com.opensymphony.xwork2.ActionSupport
LOG
 
Fields inherited from interface com.opensymphony.xwork2.Action
ERROR, INPUT, LOGIN, NONE, SUCCESS
 
Constructor Summary
PublicationActionEval()
           
 
Method Summary
 Object doAction(PublicationContext context)
           
 Object doAction(PublicationContext context, List<String> subContext)
           
 Object doAction(PublicationContext context, String subContextAsText)
           
protected  Object evalJava(PublicationContext context, List<String> subContext, CodeDecorator decorator, Criteria criteria, Wikitty w)
          Method to evaluate java kind of wikittyPubText
 String execute()
           
 String getArgument(String name)
           
 Map<String,String> getArguments()
           
 String getContentType()
           
 InputStream getInputStream()
           
protected  URL[] getJarsDependency()
          extract jars from wikitty service, and return urls to thoses extracted jars
 List<String> getMandatoryArguments()
           
 String getMimeType()
           
 javax.servlet.http.HttpServletRequest getRequest()
           
 javax.servlet.http.HttpServletResponse getResponse()
           
 WikittyProxy getWikittyProxy()
           
 WikittyService getWikittyService()
           
 String makeUrl(String url)
           
 void setContentType(String contentType)
           
 void setInputStream(InputStream inputStream)
           
 void setMimeType(String mimeType)
           
 void setResponse(javax.servlet.http.HttpServletResponse response)
           
 void setServletRequest(javax.servlet.http.HttpServletRequest arg0)
           
 void setServletResponse(javax.servlet.http.HttpServletResponse arg0)
           
 
Methods inherited from class org.nuiton.wikitty.publication.ui.action.PublicationBaseAction
getArgs, getArgument, getContextApps, getContextArgs, getContextData, getError, getWikittyPublicationProxy, getWikittyPublicationSession, searchCriteria, setContextApps, setContextData, setSession
 
Methods inherited from class org.nuiton.web.struts2.BaseAction
_, _
 
Methods inherited from class com.opensymphony.xwork2.ActionSupport
addActionError, addActionMessage, addFieldError, clearActionErrors, clearErrors, clearErrorsAndMessages, clearFieldErrors, clearMessages, clone, doDefault, getActionErrors, getActionMessages, getErrorMessages, getErrors, getFieldErrors, getLocale, getText, getText, getText, getText, getText, getText, getText, getText, getText, getTexts, getTexts, hasActionErrors, hasActionMessages, hasErrors, hasFieldErrors, hasKey, input, pause, setActionErrors, setActionMessages, setContainer, setFieldErrors, validate
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.nuiton.wikitty.publication.PublicationContext
getArgument, toString
 

Field Detail

JAVA_TEMP_DIR_NAME

protected static String JAVA_TEMP_DIR_NAME

JAR_TEMP_DIR_NAME

protected static String JAR_TEMP_DIR_NAME

MD5_FILE

protected static String MD5_FILE

contentType

protected String contentType

response

protected javax.servlet.http.HttpServletResponse response

request

protected javax.servlet.http.HttpServletRequest request

inputStream

protected InputStream inputStream

classloader

protected WikittyPublicationClassLoader classloader

classPathSup

protected List<File> classPathSup
Constructor Detail

PublicationActionEval

public PublicationActionEval()
Method Detail

setServletResponse

public void setServletResponse(javax.servlet.http.HttpServletResponse arg0)
Specified by:
setServletResponse in interface org.apache.struts2.interceptor.ServletResponseAware

setServletRequest

public void setServletRequest(javax.servlet.http.HttpServletRequest arg0)
Specified by:
setServletRequest in interface org.apache.struts2.interceptor.ServletRequestAware

execute

public String execute()
               throws Exception
Specified by:
execute in interface com.opensymphony.xwork2.Action
Overrides:
execute in class com.opensymphony.xwork2.ActionSupport
Throws:
Exception

getJarsDependency

protected URL[] getJarsDependency()
                           throws IOException,
                                  MalformedURLException
extract jars from wikitty service, and return urls to thoses extracted jars

Returns:
urls to jars that must be add to classpath
Throws:
IOException
MalformedURLException

doAction

public Object doAction(PublicationContext context,
                       List<String> subContext)
Specified by:
doAction in interface EvalInterface

evalJava

protected Object evalJava(PublicationContext context,
                          List<String> subContext,
                          CodeDecorator decorator,
                          Criteria criteria,
                          Wikitty w)
Method to evaluate java kind of wikittyPubText

Parameters:
context - the context
subContext - the subcontex
decorator - instance codeDecorator
criteria - the criteria
w - the wikitty
Returns:
the result of wikittyPubText content evaluation

doAction

public Object doAction(PublicationContext context,
                       String subContextAsText)
Specified by:
doAction in interface EvalInterface

doAction

public Object doAction(PublicationContext context)
Specified by:
doAction in interface EvalInterface

getMimeType

public String getMimeType()

setMimeType

public void setMimeType(String mimeType)

getResponse

public javax.servlet.http.HttpServletResponse getResponse()
Specified by:
getResponse in interface PublicationContext

setResponse

public void setResponse(javax.servlet.http.HttpServletResponse response)

getInputStream

public InputStream getInputStream()

setInputStream

public void setInputStream(InputStream inputStream)

getRequest

public javax.servlet.http.HttpServletRequest getRequest()
Specified by:
getRequest in interface PublicationContext

makeUrl

public String makeUrl(String url)
Specified by:
makeUrl in interface PublicationContext

getWikittyService

public WikittyService getWikittyService()
Specified by:
getWikittyService in interface PublicationContext

getMandatoryArguments

public List<String> getMandatoryArguments()
Specified by:
getMandatoryArguments in interface PublicationContext

getContentType

public String getContentType()
Specified by:
getContentType in interface PublicationContext

setContentType

public void setContentType(String contentType)
Specified by:
setContentType in interface PublicationContext

getWikittyProxy

public WikittyProxy getWikittyProxy()
Specified by:
getWikittyProxy in interface PublicationContext

getArguments

public Map<String,String> getArguments()
Specified by:
getArguments in interface PublicationContext

getArgument

public String getArgument(String name)
Specified by:
getArgument in interface PublicationContext


Copyright © 2010-2011 CodeLutin. All Rights Reserved.