See {@link GeneratorAdapter#ifCmp}
184577
public void ifCmp(Type type, int mode, Label label) {
    adapter.ifCmp(type, mode, label);
  }
492533
public void run() {

        try {
            CmsObject cms = m_moduleData.getCms();
            CmsModule module = m_moduleData.getModule();
            CmsModule oldModule = OpenCms.getModuleManager().getModule(module.getName());
            Map<CmsUUID, CmsUUID> conflictingIds = m_moduleData.getConflictingIds();
            if (!conflictingIds.isEmpty()) {
                deleteConflictingResources(cms, module, conflictingIds);
            }
            CmsProject importProject = createAndSetModuleImportProject(cms, module);
            CmsModuleImportExportHandler.reportBeginImport(m_report, module.getName());

            Map<CmsUUID, CmsResourceImportData> importResourcesById = new HashMap<>();
            for (CmsResourceImportData resData : m_moduleData.getResourceData()) {
                importResourcesById.put(resData.getResource().getStructureId(), resData);
            }
            Set<CmsResource> oldModuleResources = getAllResourcesInModule(cms, oldModule);
            List<CmsResource> toDelete = new ArrayList<>();
            Set<String> immutables = OpenCms.getImportExportManager().getImmutableResources().stream().flatMap(
                path -> Arrays.asList(
                    CmsFileUtil.removeTrailingSeparator(path),
                    CmsFileUtil.addTrailingSeparator(path)).stream()).collect(Collectors.toSet());
            for (CmsResource oldRes : oldModuleResources) {
                if (immutables.contains(oldRes.getRootPath())) {
                    continue;
                }
                CmsResourceImportData newRes = importResourcesById.get(oldRes.getStructureId());
                if (newRes == null) {
                    toDelete.add(oldRes);
                }
            }
            int index = 0;
            for (CmsResourceImportData resData1 : m_moduleData.getResourceData()) {
                index += 1;
                processImportResource(cms, resData1, index);
            }
            processDeletions(cms, toDelete);
            parseLinks(cms);

            importRelations(cms);
            if (!CmsStringUtil.isEmptyOrWhitespaceOnly(module.getImportScript())) {
                runImportScript(cms, module);
            }
            cms.unlockProject(importProject.getUuid());
            OpenCms.getModuleManager().updateModule(cms, module);
            module.setCheckpointTime(System.currentTimeMillis());
            // reinitialize the resource manager with additional module resource types if necessary
            if (module.getResourceTypes() != Collections.EMPTY_LIST) {
                OpenCms.getResourceManager().initialize(cms);
            }
            // reinitialize the workplace manager with additional module explorer types if necessary
            if (module.getExplorerTypes() != Collections.EMPTY_LIST) {
                OpenCms.getWorkplaceManager().addExplorerTypeSettings(module);
            }
            OpenCms.getPublishManager().publishProject(cms, m_report);
            OpenCms.getPublishManager().waitWhileRunning();
            CmsModuleImportExportHandler.reportEndImport(m_report);
        } catch (Exception e) {
            m_report.println(e);
        } finally {
            cleanUp();
        }
    }
1765
private Map<String, CmsTemplateContext> initMap() throws Exception {

        Map<String, CmsTemplateContext> result = new LinkedHashMap<String, CmsTemplateContext>();
        String path = getConfigurationPropertyPath();
        CmsResource resource = m_cms.readResource(path);
        CmsFile file = m_cms.readFile(resource);
        String fileContent = new String(file.getContents(), "UTF-8");
        CmsMacroResolver resolver = new CmsMacroResolver();
        resolver.setCmsObject(m_cms);
        for (Map.Entry<String, String> param : m_params.entrySet()) {
            resolver.addMacro(param.getKey(), param.getValue());
        }
        fileContent = resolver.resolveMacros(fileContent);
        JSONTokener tok = new JSONTokener(fileContent);
        tok.setOrdered(true);
        JSONObject root = new JSONObject(tok, true);
        for (String templateContextName : root.keySet()) {
            JSONObject templateContextJson = (JSONObject)(root.opt(templateContextName));
            CmsJsonMessageContainer jsonMessage = new CmsJsonMessageContainer(templateContextJson.opt(A_NICE_NAME));
            String templatePath = (String)templateContextJson.opt(A_PATH);
            JSONObject variantsJson = (JSONObject)templateContextJson.opt(A_VARIANTS);
            List<CmsClientVariant> variants = new ArrayList<CmsClientVariant>();
            if (variantsJson != null) {
                for (String variantName : variantsJson.keySet()) {
                    JSONObject variantJson = (JSONObject)variantsJson.opt(variantName);
                    CmsJsonMessageContainer variantMessage = new CmsJsonMessageContainer(variantJson.opt(A_NICE_NAME));
                    int width = variantJson.optInt(A_WIDTH, 800);
                    int height = variantJson.optInt(A_HEIGHT, 600);
                    CmsClientVariant variant = new CmsClientVariant(
                        variantName,
                        variantMessage,
                        width,
                        height,
                        new HashMap<String, String>());
                    variants.add(variant);
                }
            }
            CmsTemplateContext templateContext = new CmsTemplateContext(
                templateContextName,
                templatePath,
                jsonMessage,
                this,
                variants,
                false);
            result.put(templateContextName, templateContext);

        }
        return result;
    }
675806
private void init(Window window, CmsResourceTypeApp app) {

        CmsObject rootCms = null;
        try {
            m_cms = OpenCms.initCmsObject(A_CmsUI.getCmsObject());
            rootCms = OpenCms.initCmsObject(m_cms);
            rootCms.getRequestContext().setSiteRoot("");
        } catch (CmsException e1) {
            m_cms = A_CmsUI.getCmsObject();
            rootCms = m_cms;
        }
        CmsVaadinUtils.readAndLocalizeDesign(this, CmsVaadinUtils.getWpMessagesForCurrentLocale(), null);

        m_typeID.addValidator(new IDValidator());
        m_typeShortName.addValidator(new NameValidator());

        m_parentSchema.setCmsObject(rootCms);
        m_parentFormatter.setCmsObject(rootCms);
        m_bundle.setCmsObject(rootCms);
        m_config.setCmsObject(rootCms);

        m_parentSchema.setRequired(true);
        m_parentFormatter.setRequired(true);
        m_typeID.setRequired(true);
        m_typeDescription.setRequired(true);
        m_typeShortName.setRequired(true);
        m_typeXPathName.setRequired(true);
        m_bundle.setRequired(true);

        m_typeName.setRequired(true);

        m_parentSchema.setRequiredError(CmsVaadinUtils.getMessageText(Messages.GUI_RESOURCETYPE_EDIT_NOT_EMPTY_0));
        m_parentFormatter.setRequiredError(CmsVaadinUtils.getMessageText(Messages.GUI_RESOURCETYPE_EDIT_NOT_EMPTY_0));
        m_typeID.setRequiredError(CmsVaadinUtils.getMessageText(Messages.GUI_RESOURCETYPE_EDIT_NOT_EMPTY_0));
        m_typeDescription.setRequiredError(CmsVaadinUtils.getMessageText(Messages.GUI_RESOURCETYPE_EDIT_NOT_EMPTY_0));
        m_typeShortName.setRequiredError(CmsVaadinUtils.getMessageText(Messages.GUI_RESOURCETYPE_EDIT_NOT_EMPTY_0));
        m_typeXPathName.setRequiredError(CmsVaadinUtils.getMessageText(Messages.GUI_RESOURCETYPE_EDIT_NOT_EMPTY_0));
        m_bundle.setRequiredError(CmsVaadinUtils.getMessageText(Messages.GUI_RESOURCETYPE_EDIT_NOT_EMPTY_0));

        m_typeName.setRequiredError(CmsVaadinUtils.getMessageText(Messages.GUI_RESOURCETYPE_EDIT_NOT_EMPTY_0));

        m_typeID.setValue(String.valueOf(getFreeId()));
        m_ok.addClickListener(e -> submit(window, app));
        m_cancel.addClickListener(e -> window.close());

    }
436750
@Override
    protected void executeImpl(CommandLine cmd) {
        try {

            boolean dryRun = Boolean.valueOf( cmd.hasOption( "d" ) );
            String host = cmd.getOptionValue( "host" );
            String port = cmd.getOptionValue( "port", "443" );
            String username = cmd.getOptionValue( "u" );
            String password = cmd.getOptionValue( "p" );
            String spaceId = cmd.getOptionValue( "s" );
            String storeId = cmd.getOptionValue( "t" );
            String auditQueueName = cmd.getOptionValue( "q" );

            String account = host.split( "[.]" )[0];
            ContentStoreManager storeManager = new ContentStoreManagerImpl( host, port );
            storeManager.login( new Credential( username, password ) );
            Map<String, ContentStore> contentStoreMap = storeManager.getContentStores();

            final ContentStore store;

            if (storeId != null) {
                store = storeManager.getContentStore( storeId );
            } else {
                store = storeManager.getPrimaryContentStore();
            }

            AuditTaskGenerator generator =
                new AuditTaskGenerator( store, spaceId, dryRun, account, auditQueueName, username );
            generator.execute();
        } catch (Exception e) {
            log.error( e.getMessage(), e );
        } finally {
            log.info( "exiting..." );
        }
    }
339960
public Map<String, Object> getThreadCpuUsages(CpuUsageComparator cmp) {
    final CpuUsage overall = getOverallCpuUsage();
    final List<CpuUsage> usages = getThreadCpuUsages();
    final Map<String, Object> result = new HashMap<>();

    Collections.sort(usages, cmp);

    final Date now = new Date();
    result.put(CURRENT_TIME, now.getTime());

    final long uptimeMillis = ManagementFactory.getRuntimeMXBean().getUptime();
    final long uptimeNanos = TimeUnit.NANOSECONDS.convert(uptimeMillis, TimeUnit.MILLISECONDS);
    result.put(UPTIME_MS, uptimeMillis);

    final Map<String, Long> jvmUsageTime = new HashMap<>();
    jvmUsageTime.put(ONE_MIN, overall.getOneMinute());
    jvmUsageTime.put(FIVE_MIN, overall.getFiveMinute());
    jvmUsageTime.put(FIFTEEN_MIN, overall.getFifteenMinute());
    jvmUsageTime.put(OVERALL, overall.getOverall());
    result.put(JVM_USAGE_TIME, jvmUsageTime);

    final Map<String, Double> jvmUsagePercent = new HashMap<>();
    final int numProcs = Runtime.getRuntime().availableProcessors();
    jvmUsagePercent.put(ONE_MIN, toPercent(overall.getOneMinute(),
        ONE_MINUTE_NANOS * numProcs));
    jvmUsagePercent.put(FIVE_MIN, toPercent(overall.getFiveMinute(),
        FIVE_MINUTE_NANOS * numProcs));
    jvmUsagePercent.put(FIFTEEN_MIN, toPercent(overall.getFifteenMinute(),
        FIFTEEN_MINUTE_NANOS * numProcs));
    jvmUsagePercent.put(OVERALL, toPercent(overall.getOverall(), uptimeNanos * numProcs));
    result.put(JVM_USAGE_PERCENT, jvmUsagePercent);

    List<Map<String, Object>> threads = new ArrayList<>();
    for (CpuUsage usage : usages) {
      Map<String, Object> threadInfo = new HashMap<>();
      threadInfo.put(ONE_MIN, toPercent(usage.getOneMinute(), overall.getOneMinute()));
      threadInfo.put(FIVE_MIN, toPercent(usage.getFiveMinute(), overall.getFiveMinute()));
      threadInfo.put(FIFTEEN_MIN, toPercent(usage.getFifteenMinute(),
          overall.getFifteenMinute()));
      threadInfo.put(OVERALL, toPercent(usage.getOverall(), overall.getOverall()));
      threadInfo.put(ID, usage.getThreadId());
      threadInfo.put(NAME, usage.getName());
      threads.add(threadInfo);
    }
    result.put(THREADS, threads);
    return result;
  }
118145
@Override
  public final IConverterIntoByName<?, ColumnsValues> lazyGet(
    final Map<String, Object> pAddParam,
      final String pBeanName) throws Exception {
    IConverterIntoByName<?, ColumnsValues> convrt =
      this.convertersMap.get(pBeanName);
    if (convrt == null) {
      // locking:
      synchronized (this.convertersMap) {
        // make sure again whether it's null after locking:
        convrt = this.convertersMap.get(pBeanName);
        if (convrt == null) {
          if (pBeanName
            .equals(CnvIbnLongToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnLongToCv();
          } else if (pBeanName
            .equals(CnvIbnFloatToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnFloatToCv();
          } else if (pBeanName
            .equals(CnvIbnDoubleToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnDoubleToCv();
          } else if (pBeanName
            .equals(CnvIbnBigDecimalToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnBigDecimalToCv();
          } else if (pBeanName
            .equals(CnvIbnBooleanToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnBooleanToCv();
          } else if (pBeanName
            .equals(CnvIbnDateToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnDateToCv();
          } else if (pBeanName
            .equals(CnvIbnEnumToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnEnumToCv();
          } else if (pBeanName
            .equals(CnvIbnStringToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnStringToCv();
          } else if (pBeanName
            .equals(CnvIbnEntitiesToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnEntitiesToCv();
          } else if (pBeanName
            .equals(CnvIbnVersionToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnVersionToCv();
          } else if (pBeanName
            .equals(CnvIbnIntegerToCv.class.getSimpleName())) {
            convrt = createPutCnvIbnIntegerToCv();
          }
        }
      }
    }
    if (convrt == null) {
      throw new ExceptionWithCode(ExceptionWithCode.CONFIGURATION_MISTAKE,
        "There is no converter with name " + pBeanName);
    }
    return convrt;
  }
1359041
public InputMapTemplate<S, E> ifProcessed(BiConsumer<? super S, ? super E> postProceed) {
        return postResult(Result.PROCEED, postProceed);
    }
1246438
public static <K,V> MapAdapter<K,V> mapAdapter(final Map<K,V> map) {
        return key -> Optional.ofNullable(map.get(key));
    }
74372
@SuppressWarnings("unchecked")
  public static int cmpObjval(final Comparable thisone, final Comparable thatone) {
    if (thisone == null) {
      if (thatone == null) {
        return 0;
      }

      return -1;
    }

    if (thatone == null) {
      return 1;
    }

    return thisone.compareTo(thatone);
  }
556524
@Override
    public int doEndTag() throws JspException {

        ServletRequest req = pageContext.getRequest();
        ServletResponse res = pageContext.getResponse();

        if (CmsFlexController.isCmsRequest(req)) {
            // this will always be true if the page is called through OpenCms
            CmsObject cms = CmsFlexController.getCmsObject(req);
            String target = null;

            // try to find out what to do
            if (m_target != null) {
                // option 1: target is set with "page" or "file" parameter
                target = m_target + getSuffix();
            } else if (m_property != null) {
                // option 2: target is set with "property" parameter
                try {
                    String prop = cms.readPropertyObject(cms.getRequestContext().getUri(), m_property, true).getValue();
                    if (prop != null) {
                        target = prop + getSuffix();
                    }
                } catch (RuntimeException e) {
                    // target must be null
                    target = null;
                } catch (Exception e) {
                    // target will be null
                    e = null;
                }
            } else if (m_attribute != null) {
                // option 3: target is set in "attribute" parameter
                try {
                    String attr = (String)req.getAttribute(m_attribute);
                    if (attr != null) {
                        target = attr + getSuffix();
                    }
                } catch (RuntimeException e) {
                    // target must be null
                    target = null;
                } catch (Exception e) {
                    // target will be null
                    e = null;
                }
            } else {
                // option 4: target might be set in body
                String body = null;
                if (getBodyContent() != null) {
                    body = getBodyContent().getString();
                    if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(body)) {
                        // target IS set in body
                        target = body + getSuffix();
                    }
                    // else target is not set at all, default will be used
                }
            }

            // now perform the include action
            includeTagAction(
                pageContext,
                target,
                m_element,
                null,
                m_editable,
                m_cacheable,
                m_parameterMap,
                CmsRequestUtil.getAtrributeMap(req),
                req,
                res);

            release();
        }

        return EVAL_PAGE;
    }
391784
public static <S, T extends Event> InputMapTemplate<S, T> unless(
            Predicate<? super S> condition, InputMapTemplate<S, T> imt) {
        return when(condition.negate(), imt);
    }
939061
private CmsGalleryDataBean getInitialSettingsInternal(CmsGalleryConfiguration conf) throws CmsRpcException {

        CmsGalleryDataBean data = new CmsGalleryDataBean();
        data.setMode(conf.getGalleryMode());
        data.setResultViewType(readResultViewType());
        boolean galleryShowInvalidDefault = Boolean.parseBoolean(
            getWorkplaceSettings().getUserSettings().getAdditionalPreference(PREF_GALLERY_SHOW_INVALID_DEFAULT, true));
        data.setIncludeExpiredDefault(galleryShowInvalidDefault);

        data.setGalleryStoragePrefix(conf.getGalleryStoragePrefix());
        data.setLocales(buildLocalesMap());
        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(conf.getLocale())) {
            data.setLocale(conf.getLocale());
        } else {
            data.setLocale(getCmsObject().getRequestContext().getLocale().toString());
        }
        data.setVfsRootFolders(getRootEntries());
        data.setScope(getWorkplaceSettings().getLastSearchScope());
        data.setSortOrder(getWorkplaceSettings().getLastGalleryResultOrder());

        List<CmsResourceTypeBean> types = null;
        data.setTabIds(conf.getGalleryMode().getTabs());
        switch (conf.getGalleryMode()) {
            case editor:
            case view:
            case adeView:
            case widget:
                if (conf.getTabIds() != null) {
                    data.setTabIds(conf.getTabIds());
                }
                data.setCurrentElement(conf.getCurrentElement());
                String referencePath = conf.getReferencePath();
                if (CmsStringUtil.isEmptyOrWhitespaceOnly(referencePath)) {
                    referencePath = conf.getGalleryPath();
                }
                data.setReferenceSitePath(referencePath);
                types = getResourceTypeBeans(
                    conf.getGalleryMode(),
                    data.getReferenceSitePath(),
                    conf.getResourceTypes(),
                    conf.getSearchTypes());
                data.setTypes(types);
                Map<String, CmsGalleryTypeInfo> galleryTypeInfos = readGalleryInfosByTypeBeans(types);
                // in case the 'gallerytypes' parameter is set, allow only the given galleries
                if (conf.getGalleryTypes() != null) {
                    Map<String, CmsGalleryTypeInfo> infos = new HashMap<String, CmsGalleryTypeInfo>();
                    for (int i = 0; i < conf.getGalleryTypes().length; i++) {
                        CmsGalleryTypeInfo typeInfo = galleryTypeInfos.get(conf.getGalleryTypes()[i]);
                        if (typeInfo != null) {
                            infos.put(conf.getGalleryTypes()[i], typeInfo);
                        }
                    }
                    galleryTypeInfos = infos;
                }
                data.setGalleries(buildGalleriesList(galleryTypeInfos));
                String startGallery = conf.getGalleryPath();
                // check if the configured gallery path really is an existing gallery
                boolean galleryAvailable = false;
                for (CmsGalleryFolderBean folderBean : data.getGalleries()) {
                    if (folderBean.getPath().equals(startGallery)) {
                        galleryAvailable = true;
                        break;
                    }
                }
                data.setStartGallery(galleryAvailable ? startGallery : null);
                if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(conf.getStartFolder())) {
                    try {
                        CmsObject cloneCms = OpenCms.initCmsObject(getCmsObject());
                        if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(conf.getStartSite())) {
                            cloneCms.getRequestContext().setSiteRoot(conf.getStartSite());
                        }
                        if (cloneCms.existsResource(conf.getStartFolder(), CmsResourceFilter.ONLY_VISIBLE_NO_DELETED)) {
                            data.setStartFolder(cloneCms.getRequestContext().addSiteRoot(conf.getStartFolder()));
                        }
                    } catch (CmsException e) {
                        log(e.getMessage(), e);
                    }
                }

                if (CmsStringUtil.isEmptyOrWhitespaceOnly(data.getStartGallery()) && !data.getGalleries().isEmpty()) {

                    String key = "";
                    if (!types.isEmpty() && !CmsStringUtil.isEmptyOrWhitespaceOnly(conf.getReferencePath())) {
                        key = types.get(0).getType();
                        try {
                            CmsResource refResource = getCmsObject().readResource(conf.getReferencePath());
                            String referenceType = OpenCms.getResourceManager().getResourceType(
                                refResource).getTypeName();
                            key = CmsGallerySearchBean.getGalleryStorageKey(
                                data.getGalleryStoragePrefix(),
                                referenceType);
                        } catch (Exception e) {
                            LOG.error("Could not read reference resource: " + conf.getReferencePath());
                        }
                    }

                    if (!data.getGalleries().isEmpty()) {
                        startGallery = getWorkplaceSettings().getLastUsedGallery(key);
                        if (CmsStringUtil.isEmptyOrWhitespaceOnly(startGallery)) {
                            // check the user preferences for any configured start gallery
                            String galleryTypeName = data.getGalleries().get(0).getType();
                            startGallery = getWorkplaceSettings().getUserSettings().getStartGallery(
                                galleryTypeName,
                                getCmsObject());
                            if (CmsWorkplace.INPUT_DEFAULT.equals(startGallery)) {
                                startGallery = OpenCms.getWorkplaceManager().getDefaultUserSettings().getStartGallery(
                                    galleryTypeName);
                            }
                            if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(startGallery)) {
                                startGallery = getCmsObject().getRequestContext().removeSiteRoot(startGallery);
                            }
                        }
                    }
                    // check if the gallery is available in this site and still exists
                    if (!conf.isResultsSelectable()) {
                        // if selecting results is explicitly disabled, opening the start gallery does not make much sense
                        data.setStartGallery(null);
                    } else if (CmsStringUtil.isNotEmptyOrWhitespaceOnly(startGallery)) {
                        boolean galleryExists = getCmsObject().existsResource(startGallery);
                        if (galleryExists) {
                            data.setStartGallery(startGallery);
                        } else {
                            LOG.error("Could not read start gallery: " + startGallery);
                            data.setStartGallery(null);
                        }
                    } else {
                        data.setStartGallery(null);
                    }
                }

                GalleryTabId defaultTab = conf.getTabConfiguration().getDefaultTab();
                data.setTabConfiguration(conf.getTabConfiguration());
                if (CmsStringUtil.isEmptyOrWhitespaceOnly(data.getStartGallery())
                    && CmsStringUtil.isEmptyOrWhitespaceOnly(data.getCurrentElement())
                    && CmsStringUtil.isEmptyOrWhitespaceOnly(data.getStartFolder())) {
                    data.setStartTab(defaultTab);
                } else {
                    data.setStartTab(GalleryTabId.cms_tab_results);
                }
                break;
            case ade:
                data.setReferenceSitePath(getCmsObject().getRequestContext().getUri());
                types = getResourceTypeBeans(
                    conf.getGalleryMode(),
                    data.getReferenceSitePath(),
                    conf.getResourceTypes(),
                    conf.getSearchTypes());
                data.setTypes(types);
                Map<String, CmsGalleryTypeInfo> adeGalleryTypeInfos = readGalleryInfosByTypeBeans(types);
                data.setGalleries(buildGalleriesList(adeGalleryTypeInfos));
                data.setStartTab(GalleryTabId.cms_tab_types);
                break;
            default:
                break;
        }

        if (CmsStringUtil.isEmptyOrWhitespaceOnly(data.getStartGallery())) {
            Set<String> folderFilter = readFolderFilters();
            data.setStartFolderFilter(folderFilter);
            if ((folderFilter != null) && !folderFilter.isEmpty()) {
                try {
                    data.setVfsPreloadData(
                        generateVfsPreloadData(
                            getCmsObject(),
                            CmsGalleryService.getVfsTreeState(getRequest(), conf.getTreeToken()),
                            folderFilter));
                } catch (Exception e) {
                    LOG.error(e.getLocalizedMessage(), e);
                }
            }
        }

        CmsSiteSelectorOptionBuilder optionBuilder = new CmsSiteSelectorOptionBuilder(getCmsObject());
        optionBuilder.addNormalSites(true, getWorkplaceSettings().getUserSettings().getStartFolder());
        optionBuilder.addSharedSite();
        data.setVfsSiteSelectorOptions(optionBuilder.getOptions());

        CmsSiteSelectorOptionBuilder sitemapOptionBuilder = new CmsSiteSelectorOptionBuilder(getCmsObject());
        sitemapOptionBuilder.addNormalSites(false, null);
        if (data.getReferenceSitePath() != null) {
            sitemapOptionBuilder.addCurrentSubsite(getCmsObject().addSiteRoot(data.getReferenceSitePath()));
        }
        data.setSitemapSiteSelectorOptions(sitemapOptionBuilder.getOptions());
        data.setDefaultScope(OpenCms.getWorkplaceManager().getGalleryDefaultScope());
        return data;
    }
1128696
final public ThenExpressionBuilder<T> ifExp() {
    return new ThenExpressionBuilder<T>(new ExpressionHandler<ThenBuilder<T>>() {
      public ThenBuilder<T> handleExpression(final Expression e) {
        return new ThenBuilder<T>(e, new IfStatementHandler<T>() {
          public T handleStatement(IfStatement ifStatement) {
            return statementHandler().handleStatement(ifStatement);
          }
        }, builder);
      }
    });
  }
1342465
protected AstNode cmp(boolean required) throws ScanException, ParseException {
		AstNode v = add(required);
		if (v == null) {
			return null;
		}
		while (true) {
			switch (token.getSymbol()) {
				case LT:
					consumeToken();
					v = createAstBinary(v, add(true), AstBinary.LT);
					break;
				case LE:
					consumeToken();
					v = createAstBinary(v, add(true), AstBinary.LE);
					break;
				case GE:
					consumeToken();
					v = createAstBinary(v, add(true), AstBinary.GE);
					break;
				case GT:
					consumeToken();
					v = createAstBinary(v, add(true), AstBinary.GT);
					break;
				case EXTENSION:
					if (getExtensionHandler(token).getExtensionPoint() == ExtensionPoint.CMP) {
						v = getExtensionHandler(consumeToken()).createAstNode(v, add(true));
						break;
					}
				default:
					return v;
			}
		}
	}
542669
public void init(CmsUpdateUI ui, boolean hasPrev, boolean hasNext) {

        m_ui = ui;

        if (hasPrev) {
            m_back = getBackButton();
            m_back.addClickListener(new ClickListener() {

                private static final long serialVersionUID = 1L;

                public void buttonClick(ClickEvent event) {

                    ui.displayDialog(getPreviousDialog());
                }

            });
            addButton(m_back, true);
        }

        if (hasNext) {
            m_ok = getOkButton();
            m_ok.addClickListener(new ClickListener() {

                private static final long serialVersionUID = 1L;

                public void buttonClick(ClickEvent event) {

                    if (submitDialog()) {
                        ui.displayDialog(getNextDialog());
                    }
                }

            });
            addButton(m_ok, true);
        }
    }
532323
public static <S, T extends Event> InputMapTemplate<S, T> when(
            Predicate<? super S> condition, InputMapTemplate<S, T> imt) {

        return new InputMapTemplate<S, T>() {
            @Override
            protected InputHandlerTemplateMap<S, T> getInputHandlerTemplateMap() {
                return imt.getInputHandlerTemplateMap().map(
                        h -> (s, evt) -> condition.test(s) ? h.process(s, evt) : Result.PROCEED);
            }
        };
    }