Codota Logo
MandatoryDocumentInitializer
Code IndexAdd Codota to your IDE (free)

How to use
MandatoryDocumentInitializer
in
com.xpn.xwiki.doc

Best Java code snippets using com.xpn.xwiki.doc.MandatoryDocumentInitializer (Showing top 3 results out of 315)

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
ScheduledThreadPoolExecutor s =
  • Codota Iconnew ScheduledThreadPoolExecutor(corePoolSize)
  • Codota IconThreadFactory threadFactory;new ScheduledThreadPoolExecutor(corePoolSize, threadFactory)
  • Codota IconString str;new ScheduledThreadPoolExecutor(1, new ThreadFactoryBuilder().setNameFormat(str).build())
  • Smart code suggestions by Codota
}
origin: org.xwiki.platform/xwiki-platform-rendering-wikimacro-store

@Override
public void installOrUpgradeWikiMacroClasses() throws Exception
{
  XWikiContext xcontext = getContext();
  // Install or Upgrade XWiki.WikiMacroClass
  XWikiDocument doc = xcontext.getWiki().getDocument(this.wikiMacroInitializer.getDocumentReference(), xcontext);
  if (this.wikiMacroInitializer.updateDocument(doc)) {
    update(doc);
  }
  // Install or Upgrade XWiki.WikiMacroParameterClass
  doc = xcontext.getWiki().getDocument(WIKI_MACRO_PARAMETER_CLASS, xcontext);
  if (this.wikiMacroParameterInitializer.updateDocument(doc)) {
    update(doc);
  }
}
origin: org.xwiki.platform/xwiki-platform-annotation-io

  @Override
  public void onEvent(Event event, Object source, Object data)
  {
    DocumentReference annotationClassReference = this.configuration.getAnnotationClassReference();

    try {
      if (!this.configuration.isInstalled()) {
        // If the Annotations Application is not installed on the current wiki, do nothing.
        return;
      }

      XWikiContext deprecatedContext = this.xcontextProvider.get();
      XWikiDocument annotationClassDocument =
        deprecatedContext.getWiki().getDocument(annotationClassReference, deprecatedContext);

      if (this.initializer.updateDocument(annotationClassDocument)) {
        deprecatedContext.getWiki().saveDocument(annotationClassDocument,
          "Automatically added missing annotation class fields required by the Annotation Application.",
          deprecatedContext);
      }
    } catch (Exception e) {
      this.logger.error("Failed to update the configured annotation class [{}]", annotationClassReference, e);
    }
  }
}
origin: org.xwiki.platform/xwiki-platform-watchlist-api

/**
 * @param context the context to use. Since everything happens in the same thread, it's safe to assume that this is
 *            the request's context and not a synthetic one.
 */
private void reinitializeWatchListClass(XWikiContext context)
{
  String currentWikiId = context.getWikiId();
  try {
    // Reinitialize on all wikis.
    for (String wikiId : wikiDescriptorManager.getAllIds()) {
      try {
        context.setWikiId(wikiId);
        XWikiDocument document =
          context.getWiki().getDocument(watchListClassInitializer.getDocumentReference(), context);
        if (watchListClassInitializer.updateDocument(document)) {
          context.getWiki().saveDocument(document, context);
        }
      } catch (XWikiException e) {
        logger.error("Failed to re-initialize mandatory document [{}] on wiki [{}]",
          WatchListClassDocumentInitializer.DOCUMENT_FULL_NAME, wikiId, e);
      }
    }
  } catch (Exception e) {
    logger.error("Failed to re-initialize mandatory document [{}]",
      WatchListClassDocumentInitializer.DOCUMENT_FULL_NAME, e);
  } finally {
    // Restore the contex wiki.
    context.setWikiId(currentWikiId);
  }
}
com.xpn.xwiki.docMandatoryDocumentInitializer

Most used methods

  • updateDocument
  • getDocumentReference

Popular in Java

  • Start an intent from android
  • getApplicationContext (Context)
  • orElseThrow (Optional)
  • getSharedPreferences (Context)
  • PrintWriter (java.io)
    Prints formatted representations of objects to a text-output stream. This class implements all of th
  • KeyStore (java.security)
    This class represents an in-memory collection of keys and certificates. It manages two types of entr
  • Random (java.util)
    This class provides methods that return pseudo-random values.It is dangerous to seed Random with the
  • ThreadPoolExecutor (java.util.concurrent)
    An ExecutorService that executes each submitted task using one of possibly several pooled threads, n
  • SSLHandshakeException (javax.net.ssl)
    The exception that is thrown when a handshake could not be completed successfully.
  • LoggerFactory (org.slf4j)
    The LoggerFactory is a utility class producing Loggers for various logging APIs, most notably for lo
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now