Retrieves the properties of a piece of content.

@param spaceID
@param contentID
@return Map of content properties
181874
@Override
    public Map<String, String> getContentProperties(String spaceID,
                                                    String contentID,
                                                    String storeID)
        throws ResourceException {
        try {
            StorageProvider storage =
                storageProviderFactory.getStorageProvider(storeID);
            return storage.getContentProperties(spaceID, contentID);
        } catch (NotFoundException e) {
            throw new ResourceNotFoundException("get properties for content",
                                                spaceID,
                                                contentID,
                                                e);
        } catch (Exception e) {
            storageProviderFactory.expireStorageProvider(storeID);
            throw new ResourceException("get properties for content",
                                        spaceID,
                                        contentID,
                                        e);
        }
    }
34638
String getSpaceIdOrThrow(CMAResource resource, String param) {
    final String spaceId = resource.getSpaceId();
    if (spaceId == null) {
      throw new IllegalArgumentException(String.format(
          "%s must have a space associated.", param));
    }
    return spaceId;
  }
1238036
protected function getEmbeddedData($contentId)
    {
        foreach ($this->parts as $part) {
            if ($this->getPart('content-id', $part) == $contentId) {
                $embeddedData = 'data:';
                $embeddedData .= $this->getPart('content-type', $part);
                $embeddedData .= ';'.$this->getPart('transfer-encoding', $part);
                $embeddedData .= ','.$this->getPartBody($part);
                return $embeddedData;
            }
        }
        return '';
    }
754969
protected void addSnapshotIdToSpaceProps(String spaceId, String snapshotId) {
        Map<String, String> spaceProps =
            snapshotProvider.getSpaceProperties(spaceId);
        spaceProps.put(Constants.SNAPSHOT_ID_PROP, snapshotId);
        unwrappedSnapshotProvider.setNewSpaceProperties(spaceId, spaceProps);
    }
441273
@POST
    public Response updateContentProperties(@PathParam("spaceID") String spaceID,
                                            @PathParam("contentID") String contentID,
                                            @QueryParam("storeID") String storeID) {
        StringBuilder msg = new StringBuilder("updating content properties(");
        msg.append(spaceID);
        msg.append(", ");
        msg.append(contentID);
        msg.append(", ");
        msg.append(storeID);
        msg.append(")");

        try {
            log.debug(msg.toString());
            return doUpdateContentProperties(spaceID, contentID, storeID);

        } catch (ResourceNotFoundException e) {
            return responseNotFound(msg.toString(), e, NOT_FOUND);
        } catch (ResourcePropertiesInvalidException e) {
            return responseBad(e.getMessage(), BAD_REQUEST);
        } catch (ResourceStateException e) {
            return responseBad(msg.toString(), e, CONFLICT);
        } catch (ResourceException e) {
            return responseBad(msg.toString(), e, INTERNAL_SERVER_ERROR);

        } catch (Exception e) {
            return responseBad(msg.toString(), e, INTERNAL_SERVER_ERROR);
        }
    }
156712
public static Map<String, String> readProperties(CmsObject cms, I_CmsXmlContentLocation baseLocation) {

        Map<String, String> result = new HashMap<String, String>();
        String elementName = CmsXmlContentProperty.XmlNode.Properties.name();
        String nameElementName = CmsXmlContentProperty.XmlNode.Name.name();
        List<I_CmsXmlContentValueLocation> propertyLocations = baseLocation.getSubValues(elementName);
        for (I_CmsXmlContentValueLocation propertyLocation : propertyLocations) {
            I_CmsXmlContentValueLocation nameLocation = propertyLocation.getSubValue(nameElementName);
            String name = nameLocation.asString(cms).trim();
            String value = null;
            I_CmsXmlContentValueLocation valueLocation = propertyLocation.getSubValue(
                CmsXmlContentProperty.XmlNode.Value.name());
            I_CmsXmlContentValueLocation stringLocation = valueLocation.getSubValue(
                CmsXmlContentProperty.XmlNode.String.name());
            I_CmsXmlContentValueLocation fileListLocation = valueLocation.getSubValue(
                CmsXmlContentProperty.XmlNode.FileList.name());
            if (stringLocation != null) {
                value = stringLocation.asString(cms).trim();
            } else if (fileListLocation != null) {
                List<CmsUUID> idList = new ArrayList<CmsUUID>();
                List<I_CmsXmlContentValueLocation> fileLocations = fileListLocation.getSubValues(
                    CmsXmlContentProperty.XmlNode.Uri.name());
                for (I_CmsXmlContentValueLocation fileLocation : fileLocations) {
                    CmsUUID structureId = fileLocation.asId(cms);
                    idList.add(structureId);
                }
                value = CmsStringUtil.listAsString(idList, CmsXmlContentProperty.PROP_SEPARATOR);
            }
            if (value != null) {
                result.put(name, value);
            }
        }
        return result;
    }
740550
private Response addSpacePropertiesToResponse(ResponseBuilder response,
                                                  String spaceID,
                                                  String storeID)
        throws ResourceException {
        Map<String, String> properties =
            spaceResource.getSpaceProperties(spaceID, storeID);

        return addPropertiesToResponse(response, properties);
    }
609772
public function contentfulSpaceName(string $spaceId): string
    {
        $client = $this->contentful->getClientBySpaceId($spaceId);
        if (!$client instanceof Client) {
            return '';
        }

        return $client->getSpace()->getName();
    }
1344010
private Response addContent(String spaceID, String contentID, String storeID) {

        StringBuilder msg = new StringBuilder("adding content(");
        msg.append(spaceID);
        msg.append(", ");
        msg.append(contentID);
        msg.append(", ");
        msg.append(storeID);
        msg.append(")");
        try {
            log.info(msg.toString());

            return doAddContent(spaceID, contentID, storeID);

        } catch (InvalidIdException e) {
            return responseBad(msg.toString(), e, BAD_REQUEST);

        } catch (ResourcePropertiesInvalidException e) {
            return responseBad(msg.toString(), BAD_REQUEST);

        } catch (ResourceNotFoundException e) {
            return responseNotFound(msg.toString(), e, NOT_FOUND);

        } catch (ResourceChecksumException e) {
            return responseBad(msg.toString(), e, CONFLICT);

        } catch (ResourceException e) {
            return responseBad(msg.toString(), e, INTERNAL_SERVER_ERROR);

        } catch (Exception e) {
            return responseBad(msg.toString(), e, INTERNAL_SERVER_ERROR);
        }
    }
555042
protected Iterator<String> getSpaceContents(String spaceId) {
        for (int i = 0; i < maxRetries; i++) {
            try {
                return s3Provider.getSpaceContents(spaceId, null);
            } catch (Exception e) {
                log.warn("Exception encountered attempting to get contents " +
                         "for streaming space: " + spaceId +
                         ", error message: " + e.getMessage());
                wait(i);
            }
        }
        throw new DuraCloudRuntimeException("Exceeded retries attempting to " +
                                            "get space contents for " + spaceId);
    }
1281388
public CmsListItem getItem(String id) {

        Iterator<CmsListItem> it = getAllContent().iterator();
        while (it.hasNext()) {
            CmsListItem item = it.next();
            if (item.getId().equals(id)) {
                return item;
            }
        }
        return null;
    }
1299040
public function loadLocationsForContent($contentId, Request $request)
    {
        $restLocations = array();
        $contentInfo = $this->contentService->loadContentInfo($contentId);
        foreach ($this->locationService->loadLocations($contentInfo) as $location) {
            $restLocations[] = new Values\RestLocation(
                $location,
                // @todo Remove, and make optional in VO. Not needed for a location list.
                $this->locationService->getLocationChildCount($location)
            );
        }

        return new Values\CachedValue(
            new Values\LocationList($restLocations, $request->getPathInfo()),
            array('locationId' => $contentInfo->mainLocationId)
        );
    }
23249
public static String resourceProviderFromResourceId(String id) {
        return (id != null) ? ResourceId.fromString(id).providerNamespace() : null;
    }
126203
public function getContentName($contentId): ?string
    {
        try {
            $content = $this->loadService->loadContent($contentId);
        } catch (UnauthorizedException | NotFoundException | TranslationNotMatchedException $e) {
            return null;
        }

        return $content->name;
    }
1195175
protected Document createDocument(String spaceId, String key) {
        Document doc = new Document();
        doc.add(new StringField(FIELD_SPACE_ID, spaceId.trim(), Store.YES));
        doc.add(new StringField(FIELD_KEY, key.trim(), Store.YES));
        doc.add(new StringField(FIELD_ID, spaceId.trim() + ":" + key.trim(), Store.NO));
        return doc;
    }
416512
public SpaceMember getSpaceMembership(int spaceId, int userId) {
		return getResourceFactory().getApiResource(
				"/space/" + spaceId + "/member/" + userId).get(
				SpaceMember.class);
	}
1067834
@Override
    public void updateContentProperties(String spaceID,
                                        String contentID,
                                        String contentMimeType,
                                        Map<String, String> userProperties,
                                        String storeID)
        throws ResourceException {

        validateProperties(userProperties, "update properties for content", spaceID, contentID);

        try {

            StorageProvider storage =
                storageProviderFactory.getStorageProvider(storeID);

            // Update content properties
            if (userProperties != null) {
                storage.setContentProperties(spaceID, contentID, userProperties);
            }
        } catch (NotFoundException e) {
            throw new ResourceNotFoundException("update properties for content",
                                                spaceID,
                                                contentID,
                                                e);
        } catch (StorageStateException e) {
            throw new ResourceStateException("update properties for content",
                                             spaceID,
                                             contentID,
                                             e);
        } catch (Exception e) {
            storageProviderFactory.expireStorageProvider(storeID);
            throw new ResourceException("update properties for content",
                                        spaceID,
                                        contentID,
                                        e);
        }
    }