Sets metainfo properties as JCR properties to node.
34
private void setJCRProperties(NodeImpl parent, Properties props) throws Exception
   {
      if (!parent.isNodeType("dc:elementSet"))
      {
         parent.addMixin("dc:elementSet");
      }

      ValueFactory vFactory = parent.getSession().getValueFactory();
      LocationFactory lFactory = parent.getSession().getLocationFactory();

      for (Entry entry : props.entrySet())
      {
         QName qname = (QName)entry.getKey();
         JCRName jcrName = lFactory.createJCRName(new InternalQName(qname.getNamespace(), qname.getName()));

         PropertyDefinitionData definition =
            parent
               .getSession()
               .getWorkspace()
               .getNodeTypesHolder()
               .getPropertyDefinitions(jcrName.getInternalName(), ((NodeData)parent.getData()).getPrimaryTypeName(),
                  ((NodeData)parent.getData()).getMixinTypeNames()).getAnyDefinition();

         if (definition != null)
         {
            if (definition.isMultiple())
            {
               Value[] values = {createValue(entry.getValue(), vFactory)};
               parent.setProperty(jcrName.getAsString(), values);
            }
            else
            {
               Value value = createValue(entry.getValue(), vFactory);
               parent.setProperty(jcrName.getAsString(), value);
            }
         }
      }
   }
877044
private function setMixins(Mapping\ClassMetadata $metadata, NodeInterface $node, $document)
    {
        $repository = $this->session->getRepository();
        if ($metadata->versionable === 'full') {
            if ($repository->getDescriptor(RepositoryInterface::OPTION_VERSIONING_SUPPORTED)) {
                $node->addMixin('mix:versionable');
            } elseif ($repository->getDescriptor(RepositoryInterface::OPTION_SIMPLE_VERSIONING_SUPPORTED)) {
                $node->addMixin('mix:simpleVersionable');
            }
        } elseif ($metadata->versionable === 'simple'
            && $repository->getDescriptor(RepositoryInterface::OPTION_SIMPLE_VERSIONING_SUPPORTED)
        ) {
            $node->addMixin('mix:simpleVersionable');
        }

        if (!$node->isNodeType('mix:referenceable') && $metadata->referenceable) {
            $node->addMixin('mix:referenceable');
        }

        // manually set the uuid if it is not present yet, so we can assign it to documents
        if ($node->isNodeType('mix:referenceable') && !$node->hasProperty('jcr:uuid')) {
            $uuid = false;

            $uuidFieldName = $metadata->getUuidFieldName();
            if ($uuidFieldName) {
                $uuid = $metadata->getFieldValue($document, $uuidFieldName);
            }

            if (!$uuid) {
                $uuid = $this->generateUuid();
            }

            $node->setProperty('jcr:uuid', $uuid);

            if ($uuidFieldName && !$metadata->getFieldValue($document, $uuidFieldName)) {
                $metadata->setFieldValue($document, $uuidFieldName, $uuid);
            }
        }
    }
1264549
@Override
    protected void includeProperties(Set<Property> allProperties) {
        super.includeProperties(allProperties);
        nodes.forEach(n -> n.includeProperties(allProperties));
    }
149900
def set_properties(self, properties):
        """"""
        if isinstance(properties, dict):
            self.properties = properties
            self.sync_properties()
        else:
            self.text = properties
1181980
def rdfs_properties(rdf):
    """"""

    # find out the subproperty mappings
    superprops = {}  # key: property val: set([superprop1, superprop2..])
    for s, o in rdf.subject_objects(RDFS.subPropertyOf):
        superprops.setdefault(s, set())
        for sp in rdf.transitive_objects(s, RDFS.subPropertyOf):
            if sp != s:
                superprops[s].add(sp)

    # add the superproperty relationships
    for p, sps in superprops.items():
        logging.debug("setting superproperties: %s -> %s", p, str(sps))
        for s, o in rdf.subject_objects(p):
            for sp in sps:
                rdf.add((s, sp, o))
599543
function build_meta_information(object) {
      var res = {
        "timestamp": object.timestamp,
        "version": object.version,
        "changeset": object.changeset,
        "user": object.user,
        "uid": object.uid
      };
      for (var k in res)
        if (res[k] === undefined)
          delete res[k];
      return res;
    }
729387
def alter(node, metadata):
    """"""
    if node is not None and metadata and 'node' in metadata:
        node.attrib.update(
            dict((k, str(v)) for k, v in metadata['node'].items())
        )
1350003
private Collection<JcrProperty> getProperties( String repository, String workspace, String path, Node node ) throws RepositoryException {
        ArrayList<PropertyDefinition> names = new ArrayList<>();
        
        NodeType primaryType = node.getPrimaryNodeType();
        PropertyDefinition[] defs = primaryType.getPropertyDefinitions();

        names.addAll(Arrays.asList(defs));
        
        NodeType[] mixinType = node.getMixinNodeTypes();
        for (NodeType type : mixinType) {
            defs = type.getPropertyDefinitions();
            names.addAll(Arrays.asList(defs));
        }

        ArrayList<JcrProperty> list = new ArrayList<>();
        for (PropertyDefinition def :  names) {
            
            String name = def.getName();
            String type = PropertyType.nameFromValue(def.getRequiredType());
            
            Property p = null;
            try {
                p = node.getProperty(def.getName());
            } catch (PathNotFoundException e) {
            }

            String display = values(def, p);
            String value = def.isMultiple() ? multiValue(p)
                    : singleValue(p, def, repository, workspace, path);
            list.add(new JcrProperty(name, type, value, display));
            
        }
        return list;
    }
271171
public void putPropertyMetadata(PropertyMetadata propertyMetadata) {
    String mappedName = propertyMetadata.getMappedName();
    PropertyMetadata old = propertyMetadataMap.put(mappedName, propertyMetadata);
    if (old != null) {
      String format = "Class %s has two fields, %s and %s, both mapped to the same property "
          + "name, %s";
      String message = String.format(format, clazz.getName(), old.getName(),
          propertyMetadata.getName(), mappedName);
      throw new EntityManagerException(message);
    }
  }
580817
public void buildPropertiesSummary(XMLNode node, Content memberSummaryTree) {
        MemberSummaryWriter writer =
                memberSummaryWriters[VisibleMemberMap.PROPERTIES];
        VisibleMemberMap visibleMemberMap =
                visibleMemberMaps[VisibleMemberMap.PROPERTIES];
        addSummary(writer, visibleMemberMap, true, memberSummaryTree);
    }
444241
private void extractProperties(final Node node) {

		for (final String key : node.getPropertyKeys()) {

			final Object value = node.getProperty(key);
			if (value != null) {
				properties.put(key, value.getClass());
			}
		}
	}
826780
public static void initializeMetadata()
    {
        // TODO: merge inside meta API.
        DbConn cnx = null;
        try
        {
            cnx = Helpers.getNewDbSession();
            Helpers.updateConfiguration(cnx);
            cnx.commit();
        }
        catch (Exception e)
        {
            throw new JqmRuntimeException("Could not set metadata", e);
        }
        finally
        {
            Helpers.closeQuietly(cnx);
        }
    }
305055
public void buildDeprecationInfo(XMLNode node, Content propertyDocTree) {
        writer.addDeprecated(
                (MethodDoc) properties.get(currentPropertyIndex), propertyDocTree);
    }
88920
public Object setMetadata(ITree node, String key, Object value) {
        if (node == null)
            return setMetadata(key, value);
        else {
            Object res = node.setMetadata(key, value);
            if (res == null)
                return getMetadata(key);
            return res;
        }
    }
68390
private void setFromMetadata(Metadata md) {
        // TODO: add pom.properties support?
        String vendorkey = Attributes.Name.IMPLEMENTATION_VENDOR.toString();
        String versionkey = Attributes.Name.IMPLEMENTATION_VERSION.toString();
        String namekey = Attributes.Name.IMPLEMENTATION_TITLE.toString();
        if (this.vendor.equals(UNKNOWN) && md.containsKey(vendorkey)) {
            this.vendor = md.get(vendorkey);
        }
        if (this.version.equals(UNKNOWN) && md.containsKey(versionkey)) {
            this.version = md.get(versionkey);
        }
        if (this.name.equals(UNKNOWN) && md.containsKey(namekey)) {
            this.name = md.get(namekey);
        }
    }
291318
function setAttr(node, name, val, asProp, initial) {
	var el = node.el;

	if (node.ns != null)
		{ el.setAttribute(name, val); }
	else if (name === "class")
		{ el.className = val; }
	else if (name === "id" || typeof val === "boolean" || asProp)
		{ el[name] = val; }
	else if (name[0] === ".")
		{ el[name.substr(1)] = val; }
	else
		{ el.setAttribute(name, val); }
}
191591
public static String formatNodeProperties(String id, Node node, Map<String, Set<String>> uniqueConstraints, Set<String> indexNames, boolean jsonStyle) {
        StringBuilder result = formatProperties(id, node.getAllProperties(), jsonStyle);
        if (getNodeIdLabels(node, uniqueConstraints, indexNames).endsWith(label(UNIQUE_ID_LABEL))) {
            result.append(", ");
            result.append(formatPropertyName(id, UNIQUE_ID_PROP, node.getId(), jsonStyle));
        }
        return result.length() > 0 ? result.substring(2) : "";
    }