Constructs a {@link SortedProperties} map form the database with
the given language and status to export.
@param nodes the nodes
@param language the language
@param status the states
@return the {@link SortedProperties}
503208
protected SortedProperties getProperties(ITextNode[]nodes, String language, Status[] status) {
    SortedProperties properties = new SortedProperties();
    for (ITextNode node : nodes) {
      IValueNode valueNode = node.getValueNode(language);
      if (valueNode != null) {
        if (status == null || TremaCoreUtil.containsStatus(valueNode.getStatus(), status)) {
          IKeyValuePair keyValuePair = new KeyValuePair(node.getKey(), valueNode.getValue());
          if (iExportFilters != null) {
            for (IExportFilter filter : iExportFilters) {
              filter.filter(keyValuePair);
            }
          }
          properties.setProperty(keyValuePair.getKey(), keyValuePair.getValue());
        }
      }
    }
    return properties;
  }
1226010
function one(node) {
        var children = node.children;
        var length = children.length;
        var index = -1;
        var languages;
        var child;
        var dictionary = {};
        var tuple;

        while (++index < length) {
            child = children[index];
            languages = child.data && child.data.languages;

            if (languages) {
                tuple = languages[0];

                if (tuple[0] in dictionary) {
                    dictionary[tuple[0]] += tuple[1];
                } else {
                    dictionary[tuple[0]] = tuple[1];
                }
            }
        }

        return sortDistanceObject(dictionary);
    }
241263
public static <T extends HierarchyEntity<T, ?>> Map<T, String> sort(List<T> datas) {
    return sort(datas, null);
  }
701233
@Get("/projects")
    public CompletableFuture<List<ProjectDto>> listProjects(@Param("status") Optional<String> status) {
        if (status.isPresent()) {
            checkStatusArgument(status.get());
            return CompletableFuture.supplyAsync(() -> projectManager().listRemoved().stream()
                                                                       .map(ProjectDto::new)
                                                                       .collect(toImmutableList()));
        }

        return CompletableFuture.supplyAsync(() -> projectManager().list().values().stream()
                                                                   .map(DtoConverter::convert)
                                                                   .collect(toImmutableList()));
    }
754215
static ListGlossariesPagedResponse listGlossary(
      String projectId, String location, String filter) {

    try (TranslationServiceClient translationServiceClient = TranslationServiceClient.create()) {

      LocationName locationName =
          LocationName.newBuilder().setProject(projectId).setLocation(location).build();

      ListGlossariesPagedResponse response =
          translationServiceClient.listGlossaries(locationName.toString(), filter);

      // Call the API
      for (Glossary element : response.iterateAll()) {
        System.out.format("Name: %s\n", element.getName());
        System.out.format("Language Codes Set:\n");
        System.out.format(
            "Source Language Code: %s\n",
            element.getLanguageCodesSet().getLanguageCodesList().get(0));
        System.out.format(
            "Target Language Code: %s\n",
            element.getLanguageCodesSet().getLanguageCodesList().get(1));
        System.out.format("Input Uri: %s\n", element.getInputConfig().getGcsSource());
      }
      return response;
    } catch (Exception e) {
      throw new RuntimeException("Couldn't create client.", e);
    }
  }
554532
public String getValue(String property, String language) {
        Multimap<Optional<String>, String> values = properties.get(property);

        if (values == null) {
            return null;
        }

        Iterator<String> it = values.get(Optional.of(language)).iterator();
        return it.hasNext() ? it.next() : null;
    }
1174273
public static <T> GenericResponseBuilder<T> status(int status, T entity) {
    return genericResponseBuilderFactory.create(status, entity);
  }
494871
public Map<String, Map<String, String>> getPropertyLocale() {

        if (m_propertiesLocale == null) {
            m_propertiesLocale = CmsCollectionsGenericWrapper.createLazyMap(
                new CmsLocalePropertyLoaderTransformer(getCmsObject(), this, false));
            // result may still be null
            return (m_propertiesLocale == null) ? Collections.EMPTY_MAP : m_propertiesLocale;
        }
        return m_propertiesLocale;
    }
1183330
public static TDNode fromNode(Node node, List<String> preferredLanguages) {
        SpecialTagExtractionResult ster = OSMUtils.extractSpecialFields(node, preferredLanguages);
        Map<Short, Object> knownWayTags = OSMUtils.extractKnownPOITags(node);

        return new TDNode(node.getId(), LatLongUtils.degreesToMicrodegrees(node.getLatitude()),
                LatLongUtils.degreesToMicrodegrees(node.getLongitude()), ster.getElevation(), ster.getLayer(),
                ster.getHousenumber(), ster.getName(), knownWayTags);
    }
255935
public List<TaskSummary> getTasksByStatusByProcessInstanceId(
			long processInstanceId, List<Status> status, String language) {
		return executor.execute(new GetTasksByStatusByProcessInstanceIdCommand(processInstanceId, status));
	}
815456
private function doWrite(
        NodeInterface $node,
        PropertyInterface $property,
        $userId,
        $webspaceKey,
        $languageCode,
        $segmentKey,
        $isImport = false
    ) {
        if ($property->getIsBlock()) {
            /** @var BlockPropertyInterface $blockProperty */
            $blockProperty = $property;
            while (!($blockProperty instanceof BlockPropertyInterface)) {
                $blockProperty = $blockProperty->getProperty();
            }

            $data = $blockProperty->getValue();

            if (!$blockProperty->getIsMultiple()) {
                $data = [$data];
            }

            $data = array_filter($data);

            $len = count($data);

            // init properties
            $typeProperty = new Property('type', '', 'text_line');
            $lengthProperty = new Property('length', '', 'text_line');

            //save length
            $lengthProperty->setValue($len);
            $contentType = $this->contentTypeManager->get($lengthProperty->getContentTypeName());
            $contentType->write(
                $node,
                new BlockPropertyWrapper($lengthProperty, $property),
                $userId,
                $webspaceKey,
                $languageCode,
                $segmentKey
            );

            for ($i = 0; $i < $len; ++$i) {
                $blockPropertyType = $blockProperty->getProperties($i);

                // save type property
                $this->writeProperty(
                    $typeProperty,
                    $property,
                    $blockPropertyType->getName(),
                    $i,
                    $node,
                    $userId,
                    $webspaceKey,
                    $languageCode,
                    $segmentKey,
                    $isImport
                );

                foreach ($blockProperty->getProperties($i)->getChildProperties() as $subProperty) {
                    $this->writeProperty(
                        $subProperty,
                        $property,
                        $subProperty->getValue(),
                        $i,
                        $node,
                        $userId,
                        $webspaceKey,
                        $languageCode,
                        $segmentKey,
                        $isImport
                    );
                }
            }
        } else {
            throw new UnexpectedPropertyType($property, $this);
        }
    }
1023781
public static function fromArray(array $properties, $localeGroup, array $languages = [])
    {
        $resource = new Resource();

        if (array_key_exists('fields', $properties) && is_array($properties['fields'])) {
            $resource->fields = FieldTransformer::fromArray($properties['fields'], $localeGroup, $languages, true);
        }

        if (array_key_exists('relations', $properties) && is_array($properties['relations'])) {
            $resource->relations = self::getRelations($properties['relations']);
        }

        if (array_key_exists('indexes', $properties) && is_array($properties['indexes'])) {
            $resource->indexes = self::getIndexes($properties['indexes']);
        }

        if (array_key_exists('auto-manage-created-and-updated-at', $properties)) {
            $resource->setCreateAndUpdateAtManaged($properties['auto-manage-created-and-updated-at']);
        }

        if (array_key_exists('table-name', $properties)) {
            $resource->setTableName($properties['table-name']);
        }

        if (array_key_exists('protection', $properties) && is_array($properties['protection'])) {

            foreach ($properties['protection'] as $name => $value) {
                $resource->setProtection($name, $value);
            }

        }

        return $resource;
    }
410400
public NFPropertySpec getPropertySpec(String nodeType, String propertyName) {
        NFNodeSpec nodeSpec = graphSpec.getNodeSpec(nodeType);
        NFPropertySpec propertySpec = nodeSpec.getPropertySpec(propertyName);
        return propertySpec;
    }
1116862
public static Map<String,String> getLanguageToExtension() {
        if (languageToExtension == null) {
            languageToExtension = new HashMap<String,String>();
            // TODO map should be driven from properties
            languageToExtension.put("Groovy", ".groovy");
            languageToExtension.put("GROOVY", ".groovy");
            languageToExtension.put("Kotlin", ".kt");
            languageToExtension.put("KOTLIN", ".kt");
            languageToExtension.put("Kotlin Script", ".kts");
            languageToExtension.put("KOTLIN_SCRIPT", ".kts");
            languageToExtension.put("JavaScript", ".js");
            languageToExtension.put("JAVASCRIPT", ".js");
            languageToExtension.put("JSX", ".jsx");
            languageToExtension.put("WEBSCRIPT", ".js");
            languageToExtension.put("GPath", ".groovy");
            languageToExtension.put("GPATH", ".groovy");
            languageToExtension.put("xslt", ".xsl");
            languageToExtension.put("XSLT", ".xsl");
            languageToExtension.put("PAGELET", ".xml");
            languageToExtension.put("Pagelet", ".xml");
            languageToExtension.put("Drools", ".drl");
            languageToExtension.put("DROOLS", ".drl");
            languageToExtension.put("Guided", ".brl");
            languageToExtension.put("GUIDED", ".brl");
            languageToExtension.put("CSS", ".css");
            languageToExtension.put("VELOCITY", ".vsl");
            languageToExtension.put("Velocity", ".vsl");
            languageToExtension.put("EXCEL", ".xls");
            languageToExtension.put("EXCEL_2007", ".xlsx");
            languageToExtension.put("MS_WORD", ".docx");
            languageToExtension.put("MS Word", ".docx");
            languageToExtension.put("HTML", ".html");
            languageToExtension.put("Java", ".java");
            languageToExtension.put("CONFIG", ".xml");
            languageToExtension.put("TESTDATA", ".tst");
            languageToExtension.put("JAR", ".jar");
            languageToExtension.put("TEXT", ".txt");
            languageToExtension.put("XML", ".xml");
            languageToExtension.put("WSDL", ".wsdl");
            languageToExtension.put("XSL", ".xsl");
            languageToExtension.put("XSD", ".xsd");
            languageToExtension.put("CSV", ".csv");
            languageToExtension.put("SPRING", ".spring");
            languageToExtension.put("CAMEL_ROUTE", ".camel");
            languageToExtension.put("PROCESS", ".proc");
            languageToExtension.put("TEST", ".test");
            languageToExtension.put("POSTMAN", ".postman");
            languageToExtension.put("FEATURE", ".feature");
            languageToExtension.put("YAML", ".yaml");
            languageToExtension.put("JSON", ".json");
            languageToExtension.put("TASK", ".task");
            languageToExtension.put("MARKDOWN", ".md");
            languageToExtension.put("Markdown", ".md");
        }
        return languageToExtension;
    }
1114104
protected function generateStatusesPropertiesMap(array $statusCollection)
    {
        $statusMap = array();

        foreach ($statusCollection as $index => $status) {
            if ($status->isInitialState()) {
                $statusMap[$index]['initialState'] = '1';
            }
            if ($status->isTranslationState()) {
                $statusMap[$index]['translationState'] = '1';
            }
            if ($status->isPublishedState()) {
                $statusMap[$index]['publishedState'] = '1';
            }
            if ($status->isAutoPublishFromState()) {
                $statusMap[$index]['autoPublishFromState'] = '1';
            }
            if ($status->isAutoUnpublishToState()) {
                $statusMap[$index]['autoUnpublishToState'] = '1';
            }
        }

        return $statusMap;
    }
129179
public static void exportChildOrderProperty(JsonWriter writer, Resource resource)
            throws IOException {
        List<String> names = new ArrayList<>();
        Iterable<Resource> children = resource.getChildren();
        for (Resource child : children) {
            String name = child.getName();
            if (!ResourceUtil.CONTENT_NODE.equals(name)) {
                names.add(name);
            }
        }
        if (names.size() > 0) {
            writer.name(MappingRules.CHILD_ORDER_NAME);
            writer.beginArray();
            for (String name : names) {
                if (!ResourceUtil.CONTENT_NODE.equals(name)) {
                    writer.value(name);
                }
            }
            writer.endArray();
        }
    }
918422
@Override
    public Map<String, Number> status() {
        Map<String, Number> ret = new HashMap<>();
        ret.put("workers", workers);
        ret.put("accumulatedUpdates", numUpdates());
        return ret;
    }