org.xwiki.context.ExecutionContext.setProperty()方法的使用及代码示例

x33g5p2x  于2022-01-19 转载在 其他  
字(6.4k)|赞(0)|评价(0)|浏览(82)

本文整理了Java中org.xwiki.context.ExecutionContext.setProperty()方法的一些代码示例,展示了ExecutionContext.setProperty()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。ExecutionContext.setProperty()方法的具体详情如下:
包路径:org.xwiki.context.ExecutionContext
类名称:ExecutionContext
方法名:setProperty

ExecutionContext.setProperty介绍

暂无

代码示例

代码示例来源:origin: org.xwiki.commons/xwiki-commons-context

/**
 * @param properties the properties to add to the context
 */
public void setProperties(Map<String, Object> properties)
{
  for (Map.Entry<String, Object> entry : properties.entrySet()) {
    setProperty(entry.getKey(), entry.getValue());
  }
}

代码示例来源:origin: org.xwiki.commons/xwiki-commons-script

@Override
  public void initialize(ExecutionContext executionContext) throws ExecutionContextException
  {
    // We're storing an instance of the Script Context class in the Execution Context so that it can be
    // shared between different script invocations during the lifetime of the Execution Context.
    executionContext.setProperty(SCRIPT_CONTEXT_ID, new SimpleScriptContext());
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-script

/**
   * {@inheritDoc}
   * 
   * @see org.xwiki.context.ExecutionContextInitializer#initialize(org.xwiki.context.ExecutionContext)
   */
  public void initialize(ExecutionContext executionContext) throws ExecutionContextException
  {
    // We're storing an instance of the Script Context class in the Execution Context so that it can be
    // shared between different script invocations during the lifetime of the Execution Context.        
    executionContext.setProperty(SCRIPT_CONTEXT_ID, new SimpleScriptContext());
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-officeimporter

/**
 * Utility method for setting an error message inside current execution.
 * 
 * @param message error message.
 */
private void setErrorMessage(String message)
{
  execution.getContext().setProperty(OFFICE_IMPORTER_ERROR, message);
}

代码示例来源: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-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

/**
 * 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-platform-rendering-async-api

@Override
public void setEnabled(boolean enabled)
{
  this.execution.getContext().setProperty(KEY_ENABLED, enabled);
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-observation-remote

/**
 * {@inheritDoc}
 * 
 * @see org.xwiki.observation.remote.RemoteObservationManagerContext#pushRemoteState()
 */
public void pushRemoteState()
{
  this.execution.getContext().setProperty(REMOTESTATE, Boolean.TRUE);
}

代码示例来源:origin: org.phenotips/patient-tools

public void setMessageMap(Map<String, String> messages)
{
  Map<String, String> messageMap = new LinkedHashMap<>();
  messageMap.putAll(messages);
  this.execution.getContext().setProperty(MESSAGES_KEY, messageMap);
}

代码示例来源:origin: org.xwiki.platform/xwiki-core-officeimporter

/**
 * Sets an error message inside the execution context.
 * 
 * @param message error message.
 */
private void setErrorMessage(String message)
{
  execution.getContext().setProperty(OFFICE_MANAGER_ERROR, message);
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-extension-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()
   */
  protected void setError(Exception e)
  {
    this.execution.getContext().setProperty(ExtensionManagerScriptService.EXTENSIONERROR_KEY, e);
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-observation-remote

@Override
public void pushRemoteState()
{
  this.execution.getContext().setProperty(REMOTESTATE, Boolean.TRUE);
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-refactoring-api

/**
 * 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 setError(Exception e)
{
  this.execution.getContext().setProperty(REFACTORING_ERROR_KEY, e);
}

代码示例来源:origin: org.xwiki.commons/xwiki-commons-blame-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 setError(Exception e)
  {
    this.execution.getContext().setProperty(BLAME_ERROR_KEY, e);
  }
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-wiki-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(WIKIERROR_KEY, e);
}

代码示例来源:origin: org.xwiki.platform/xwiki-platform-extension-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()
   */
  protected void setError(Exception e)
  {
    this.execution.getContext().setProperty(EXTENSIONERROR_KEY, e);
  }
}

代码示例来源:origin: org.phenotips/patient-tools

private FormData getFormData()
{
  FormData data = (FormData) this.execution.getContext().getProperty(CONTEXT_KEY);
  if (data == null) {
    data = new FormData();
    this.execution.getContext().setProperty(CONTEXT_KEY, data);
  }
  return data;
}

相关文章