本文整理了Java中org.xwiki.context.Execution.getContext()
方法的一些代码示例,展示了Execution.getContext()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。Execution.getContext()
方法的具体详情如下:
包路径:org.xwiki.context.Execution
类名称:Execution
方法名:getContext
暂无
代码示例来源:origin: org.xwiki.commons/xwiki-commons-observation-local
/**
* @return the events stacked in the execution context
*/
private Stack<BeginEvent> getCurrentEvents()
{
Stack<BeginEvent> events = null;
ExecutionContext context = this.execution.getContext();
if (context != null) {
events = (Stack<BeginEvent>) context.getProperty(KEY_EVENTS);
}
return events;
}
代码示例来源:origin: org.xwiki.commons/xwiki-commons-observation-local
/**
* @return the events stacked in the execution context
*/
private Stack<BeginEvent> getCurrentEvents()
{
Stack<BeginEvent> events = null;
ExecutionContext context = this.execution.getContext();
if (context != null) {
events = (Stack<BeginEvent>) context.getProperty(DefaultObservationContext.KEY_EVENTS);
}
return events;
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-url-api
@Override
public void setURLFormatId(String urlFormatId)
{
ExecutionContext ec = this.execution.getContext();
ec.setProperty(CONTEXT_KEY, urlFormatId);
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-extension-script
/**
* Get the error generated while performing the previously called action.
*
* @return an eventual exception or {@code null} if no exception was thrown
*/
public Exception getLastError()
{
return (Exception) this.execution.getContext().getProperty(EXTENSIONERROR_KEY);
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-component-wiki
/**
* @return the XWikiContext extracted from the execution.
*/
private XWikiContext getXWikiContext()
{
return (XWikiContext) this.execution.getContext().getProperty("xwikicontext");
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-icon-script
/**
* Store a caught exception in the context, so that it can be later retrieved using {@link #getLastError()}.
*
* @param e the exception to store, can be {@code null} to clear the previously stored exception
* @see #getLastError()
* @since 6.3RC1
*/
private void setLastError(IconException e)
{
this.execution.getContext().setProperty(ERROR_KEY, e);
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-component-script
/**
* Get the error generated while performing the previously called action.
*
* @return the last exception or {@code null} if no exception was thrown
* @since 6.1M2
*/
public Exception getLastError()
{
return (Exception) this.execution.getContext().getProperty(ERROR_KEY);
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-component-script
/**
* Store a caught exception in the context, so that it can be later retrieved using {@link #getLastError()}.
*
* @param exception the exception to store, can be {@code null} to clear the previously stored exception
* @see #getLastError()
* @since 6.1M2
*/
private void setError(Exception exception)
{
this.execution.getContext().setProperty(ERROR_KEY, exception);
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-observation-remote
@Override
public void popRemoteState()
{
this.execution.getContext().setProperty(REMOTESTATE, Boolean.FALSE);
}
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-wiki-template-script
/**
* Store a caught exception in the context, so that it can be later retrieved using {@link #getLastError()}.
*
* @param e the exception to store, can be {@code null} to clear the previously stored exception
* @see #getLastError()
*/
private void setLastError(Exception e)
{
this.execution.getContext().setProperty(WIKITEMPLATEERROR_KEY, e);
}
代码示例来源:origin: org.xwiki.platform/xwiki-core-observation-remote
/**
* {@inheritDoc}
*
* @see org.xwiki.observation.remote.RemoteObservationManagerContext#isRemoteState()
*/
public boolean isRemoteState()
{
ExecutionContext context = this.execution.getContext();
return context != null && context.getProperty(REMOTESTATE) == Boolean.TRUE;
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-rendering-async-api
@Override
public void setEnabled(boolean enabled)
{
this.execution.getContext().setProperty(KEY_ENABLED, enabled);
}
代码示例来源:origin: org.xwiki.platform/xwiki-core-officeimporter
/**
* @return any error messages encountered.
*/
public String getLastErrorMessage()
{
Object error = execution.getContext().getProperty(OFFICE_MANAGER_ERROR);
return (error != null) ? (String) error : null;
}
代码示例来源:origin: org.phenotips/lims-integration-api
/**
* Helper method for obtaining a valid xcontext from the execution context.
*
* @return the current request context
*/
private XWikiContext getXContext()
{
return (XWikiContext) this.execution.getContext().getProperty(XWikiContext.EXECUTIONCONTEXT_KEY);
}
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Utility method for accessing XWikiContext.
*
* @return the XWikiContext.
*/
private XWikiContext getContext()
{
return (XWikiContext) this.execution.getContext().getProperty("xwikicontext");
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-rendering-wikimacro-store
/**
* @return the XWiki context
*/
private XWikiContext getContext()
{
return (XWikiContext) this.execution.getContext().getProperty("xwikicontext");
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
/**
* Get XWiki context from execution context.
*
* @return the XWiki context for the current thread
*/
private XWikiContext getXWikiContext()
{
Execution execution = Utils.getComponent(Execution.class);
ExecutionContext ec = execution.getContext();
return ec != null ? (XWikiContext) ec.getProperty("xwikicontext") : null;
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-search-lucene-api
private XWikiContext getContext()
{
return (XWikiContext) Utils.getComponent(Execution.class).getContext()
.getProperty(XWikiContext.EXECUTIONCONTEXT_KEY);
}
代码示例来源:origin: com.xpn.xwiki.platform/xwiki-core
protected XWikiContext getContext()
{
Execution execution = Utils.getComponent(Execution.class);
ExecutionContext executionContext = execution.getContext();
return (XWikiContext) executionContext.getProperty("xwikicontext");
}
代码示例来源:origin: org.xwiki.platform/xwiki-platform-mail-send-storage
@Override
public void onPrepareMessageSuccess(ExtendedMimeMessage message, Map<String, Object> parameters)
{
super.onPrepareMessageSuccess(message, parameters);
MailStatus status = new MailStatus(getBatchId(), message, MailState.PREPARE_SUCCESS);
status.setWiki(
((XWikiContext) execution.getContext().getProperty(XWikiContext.EXECUTIONCONTEXT_KEY)).getWikiId());
saveStatus(status, parameters);
}
内容来源于网络,如有侵权,请联系作者删除!