@Override public String createConnectIFrameServletUri(final String addOnKey, final String moduleKey, final ModuleContextParameters moduleContext) { return urlVariableSubstitutor.append(ConnectIFrameServletPath.forModule(addOnKey, moduleKey), moduleContext); }
@Override public KeyboardShortcutOperation mapToOperation(String addOnKey, String moduleKey) { return KeyboardShortcutOperation.goTo(ConnectIFrameServletPath.forModule(addOnKey, moduleKey)); } }, DIALOG {
@Override public String createConnectIFrameServletUri(final String addOnKey, final String moduleKey, final ModuleContextParameters moduleContext) { return urlVariableSubstitutor.append(ConnectIFrameServletPath.forModule(addOnKey, moduleKey), moduleContext); }
private void addPluginInfoParameterForPageIfDeclared(PluginInformation pluginInfo, String parameterKey, ConnectAddonBean addon, String moduleType) { Optional<List<ModuleBean>> optionalPages = addon.getModules().getValidModuleListOfType( moduleType, moduleValidationExceptionHandler); optionalPages.ifPresent(moduleBeans -> { ConnectPageModuleBean page = (ConnectPageModuleBean) moduleBeans.get(0); if (null != page && !Strings.isNullOrEmpty(page.getUrl())) { pluginInfo.addParameter(parameterKey, ConnectIFrameServletPath.forModule(addon.getKey(), page.getRawKey())); } }); } }
private void addPluginInfoParameterForPagesIfDeclared(PluginInformation pluginInfo, String addonKey) { ModuleCompleteKey configPageCompleteKey = new ModuleCompleteKey(pluginRetrievalService.getPlugin().getKey(), ModuleKeyUtils.prefixAndAddonAndModuleKey("upm-page", addonKey, "configure-page")); Optional<UpmPageMetadata> configurePageData = Optional.ofNullable(pluginAccessor.getEnabledPluginModule(configPageCompleteKey.getCompleteKey())) .map(ModuleDescriptor::getModule) .filter(UpmPageMetadata.class::isInstance) .map(UpmPageMetadata.class::cast); if (configurePageData.isPresent()) { pluginInfo.addParameter(PARAM_CONFIGURE_URL, ConnectIFrameServletPath.forModule(addonKey, configurePageData.get().getRawModuleKey())); } ModuleCompleteKey postInstallPageCompleteKey = new ModuleCompleteKey(pluginRetrievalService.getPlugin().getKey(), ModuleKeyUtils.prefixAndAddonAndModuleKey("upm-page", addonKey, "post-install-page")); Optional<UpmPageMetadata> postInstallPageData = Optional.ofNullable(pluginAccessor.getEnabledPluginModule(postInstallPageCompleteKey.getCompleteKey())) .map(ModuleDescriptor::getModule) .filter(UpmPageMetadata.class::isInstance) .map(UpmPageMetadata.class::cast); if (postInstallPageData.isPresent()) { pluginInfo.addParameter(PARAM_POST_INSTALL_URL, ConnectIFrameServletPath.forModule(addonKey, postInstallPageData.get().getRawModuleKey())); } } }
@Override public List<ModuleDescriptor<?>> createPluginModuleDescriptors(List<ConnectPageModuleBean> modules, ConnectAddonBean addon) { List<ModuleDescriptor<?>> descriptors = new ArrayList<>(); for (ConnectPageModuleBean bean : modules) { if (hasWebItem()) { WebItemModuleBean webItemBean = createWebItemModuleBean(bean, ConnectIFrameServletPath.forModule(addon.getKey(), bean.getRawKey())); descriptors.add(webItemModuleDescriptorFactory.createModuleDescriptor( webItemBean, addon, getAdditionalConditions())); } descriptors.add(iFrameModuleDescriptorGenerator.createModuleDescriptor( new ConnectIFrameBean(createPageIFrame(bean, addon), bean.getRawKey(), Optional.empty()), addon.getKey())); descriptors.add(iFrameModuleDescriptorGenerator.createModuleDescriptor( new ConnectIFrameBean(createRawIFrame(bean, addon), bean.getRawKey(), Optional.of(RAW_CLASSIFIER)), addon.getKey())); } return descriptors; }
@Override public List<ModuleDescriptor<?>> createPluginModuleDescriptors(List<ConnectPageModuleBean> modules, ConnectAddonBean addon) { List<ModuleDescriptor<?>> descriptors = new ArrayList<>(); for (ConnectPageModuleBean bean : modules) { if (hasWebItem()) { // create a web item targeting the iframe page Integer weight = bean.getWeight() == null ? getDefaultWeight() : bean.getWeight(); String location = isNullOrEmpty(bean.getLocation()) ? getDefaultSection() : bean.getLocation(); WebItemModuleBean webItemBean = newWebItemBean() .withName(bean.getName()) .withKey(bean.getRawKey()) .withContext(page) .withUrl(ConnectIFrameServletPath.forModule(addon.getKey(), bean.getRawKey())) .withLocation(location) .withWeight(weight) .withIcon(bean.getIcon()) .withConditions(bean.getConditions()) .setNeedsEscaping(needsEscaping()) .build(); descriptors.add(webItemModuleDescriptorFactory.createModuleDescriptor( webItemBean, addon, getConditionClasses())); } descriptors.add(createPageIFrame(bean, addon)); descriptors.add(createRawIFrame(bean, addon)); } return descriptors; }
@Override public List<ModuleDescriptor> createPluginModuleDescriptors(List<ConnectPageModuleBean> modules, ConnectModuleProviderContext moduleProviderContext) { List<ModuleDescriptor> descriptors = new ArrayList<>(); final ConnectAddonBean connectAddonBean = moduleProviderContext.getConnectAddonBean(); for (ConnectPageModuleBean bean : modules) { if (hasWebItem()) { // create a web item targeting the iframe page Integer weight = bean.getWeight() == null ? getDefaultWeight() : bean.getWeight(); String location = isNullOrEmpty(bean.getLocation()) ? getDefaultSection() : bean.getLocation(); WebItemModuleBean webItemBean = newWebItemBean() .withName(bean.getName()) .withKey(bean.getRawKey()) .withContext(page) .withUrl(ConnectIFrameServletPath.forModule(connectAddonBean.getKey(), bean.getRawKey())) .withLocation(location) .withWeight(weight) .withIcon(bean.getIcon()) .withConditions(bean.getConditions()) .setNeedsEscaping(needsEscaping()) .build(); descriptors.add(webItemModuleDescriptorFactory.createModuleDescriptor(moduleProviderContext, pluginRetrievalService.getPlugin(), webItemBean, getConditionClasses())); } registerIframeRenderStrategy(bean, connectAddonBean); } return descriptors; }