Tabnine Logo
ConnectIFrame
Code IndexAdd Tabnine to your IDE (free)

How to use
ConnectIFrame
in
com.atlassian.plugin.connect.api.web.iframe

Best Java code snippets using com.atlassian.plugin.connect.api.web.iframe.ConnectIFrame (Showing top 7 results out of 315)

origin: com.atlassian.plugins/atlassian-connect-api

public static String renderToString(ModuleContextParameters moduleContextParameters, ConnectIFrame connectIFrame) {
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  try {
    connectIFrame.render(moduleContextParameters, new OutputStreamWriter(out), Optional.empty());
  } catch (IOException e) {
    // no I/O, so no IOException.. right?
    throw new IllegalStateException(e);
  }
  return out.toString();
}
origin: com.atlassian.plugins/atlassian-connect-api

public static String renderAccessDeniedToString(ConnectIFrame connectIFrame) {
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  try {
    connectIFrame.renderAccessDenied(new OutputStreamWriter(out));
  } catch (IOException e) {
    // no I/O, so no IOException.. right?
    throw new IllegalStateException(e);
  }
  return out.toString();
}
origin: com.atlassian.plugins/atlassian-connect-server-core

@Override
protected void doGet(final HttpServletRequest req, final HttpServletResponse resp)
    throws ServletException, IOException {
  Optional<AddOnKeyAndModuleKey> keys = keysFromPathMatcher.getAddOnKeyAndModuleKey(req.getPathInfo());
  if (!keys.isPresent()) {
    resp.sendError(SC_NOT_FOUND);
    return;
  }
  final AddOnKeyAndModuleKey addOnKeyAndModuleKey = keys.get();
  String classifier = req.getParameter(CLASSIFIER_PARAMETER);
  Optional<String> lookupClassifier = StringUtils.isBlank(classifier) || JSON_CLASSIFIER.equals(classifier) ? Optional.empty() : Optional.of(classifier);
  Optional<ConnectIFrame> maybeIFrame = iFrameAccessor.fetchConnectIFrame(addOnKeyAndModuleKey.getAddOnKey(), addOnKeyAndModuleKey.getModuleKey(), lookupClassifier);
  if (maybeIFrame.isPresent()) {
    ConnectIFrame iFrame = maybeIFrame.get();
    if (JSON_CLASSIFIER.equals(classifier)) {
      iFrame = iFrame.toJsonIFrame();
    }
    resp.setContentType(iFrame.getContentType());
    ModuleContextParameters moduleContextParameters = moduleContextParser.parseContextParameters(req);
    if (iFrame.shouldShow(moduleContextParameters)) {
      Optional<String> moduleUiParameters = moduleUiParamParser.parseUiParameters(req);
      iFrame.render(moduleContextParameters, resp.getWriter(), moduleUiParameters);
      eventPublisher.publish(new IFrameRenderedEvent(addOnKeyAndModuleKey.getAddOnKey(), addOnKeyAndModuleKey.getModuleKey(), moduleContextParameters));
    } else {
      iFrame.renderAccessDenied(resp.getWriter());
    }
  } else {
    resp.sendError(SC_NOT_FOUND);
  }
}
origin: com.atlassian.plugins/atlassian-connect-extension-spi

private Collection<TypedPluginModule> serializeConnectIframes(ConnectPageModuleBean module, ConnectAddonBean addon) {
  String pageIframePluginModuleKey = ConnectIFrameModuleDescriptorGenerator.getModuleKey(addon.getKey(), module.getRawKey(), Optional.empty());
  TypedPluginModule pageIframePluginModule = TypedPluginModule.of(ConnectIFrame.IFRAME_PLUGIN_MODULE_DESERIALIZER_IDENTIFIER, pageIframePluginModuleKey, createPageIFrame(module, addon).serialize());
  String rawIframepluginModuleKey = ConnectIFrameModuleDescriptorGenerator.getModuleKey(addon.getKey(), module.getRawKey(), Optional.of(RAW_CLASSIFIER));
  TypedPluginModule rawIframePluginModule = TypedPluginModule.of(ConnectIFrame.IFRAME_PLUGIN_MODULE_DESERIALIZER_IDENTIFIER, rawIframepluginModuleKey, createRawIFrame(module, addon).serialize());
  return ImmutableList.of(pageIframePluginModule, rawIframePluginModule);
}
origin: com.atlassian.plugins/atlassian-connect-core

ConnectIFrame iFrame = maybeIFrame.get();
if (JSON_CLASSIFIER.equals(classifier)) {
  iFrame = iFrame.toJsonIFrame();
resp.setContentType(iFrame.getContentType());
ModuleContextParameters moduleContextParameters = moduleContextParser.parseContextParameters(req);
if (iFrame.shouldShow(moduleContextParameters.getOriginalContext())) {
  Optional<String> moduleUiParameters = moduleUiParamParser.parseUiParameters(req);
  iFrame.render(moduleContextParameters, resp.getWriter(), moduleUiParameters);
  eventPublisher.publish(new IFrameRenderedEvent(addOnKeyAndModuleKey.getAddOnKey(), addOnKeyAndModuleKey.getModuleKey(), moduleContextParameters));
} else {
  iFrame.renderAccessDenied(resp.getWriter());
origin: com.atlassian.plugins/atlassian-connect-server-api

public static String renderAccessDeniedToString(ConnectIFrame connectIFrame) {
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  try {
    connectIFrame.renderAccessDenied(new OutputStreamWriter(out));
  } catch (IOException e) {
    // no I/O, so no IOException.. right?
    throw new IllegalStateException(e);
  }
  return out.toString();
}
origin: com.atlassian.plugins/atlassian-connect-server-api

public static String renderToString(ModuleContextParameters moduleContextParameters, ConnectIFrame connectIFrame) {
  ByteArrayOutputStream out = new ByteArrayOutputStream();
  try {
    connectIFrame.render(moduleContextParameters, new OutputStreamWriter(out), Optional.empty());
  } catch (IOException e) {
    // no I/O, so no IOException.. right?
    throw new IllegalStateException(e);
  }
  return out.toString();
}
com.atlassian.plugin.connect.api.web.iframeConnectIFrame

Most used methods

  • render
  • renderAccessDenied
  • getContentType
  • shouldShow
  • toJsonIFrame
  • serialize

Popular in Java

  • Reading from database using SQL prepared statement
  • getSupportFragmentManager (FragmentActivity)
  • setRequestProperty (URLConnection)
  • getApplicationContext (Context)
  • ServerSocket (java.net)
    This class represents a server-side socket that waits for incoming client connections. A ServerSocke
  • Scanner (java.util)
    A parser that parses a text string of primitive types and strings with the help of regular expressio
  • Stack (java.util)
    Stack is a Last-In/First-Out(LIFO) data structure which represents a stack of objects. It enables u
  • Stream (java.util.stream)
    A sequence of elements supporting sequential and parallel aggregate operations. The following exampl
  • Filter (javax.servlet)
    A filter is an object that performs filtering tasks on either the request to a resource (a servlet o
  • Runner (org.openjdk.jmh.runner)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now