Skip to content

Instantly share code, notes, and snippets.

@catm705
Last active August 29, 2015 14:21
Show Gist options
  • Save catm705/0ca0884ce2906a92c544 to your computer and use it in GitHub Desktop.
Save catm705/0ca0884ce2906a92c544 to your computer and use it in GitHub Desktop.
NOTES on the new components/categories - (NO cards/article-refactor)
____ Example Case _____
TAGS (category) - is a parent to the 'article_artifact' (or 'video_article_artifact') --> The article_artifact is a parent to the components it has.
Components:
-video ('video artifact'), audio, section, image, headline, text, etc
____________ ENDPOINTS _____________
1.) Components Endpoint ('/components')
- You can get only components (for video components - their binaries - binaries are children, but not artifacts)
- no relationships are found here.
2.) Artifact_Relationship Endpoint ('/artifact_relationships')
- You get categories/components relationships here - if you include "related artifacts" you can also get the actual component objects.
- f you include 'artifacts' - you can get the categories.
3.) There is no categories endpoint.
_______________________________________________________________
Artifact_Relationship ID is set from:
a.) Category object has the relatedArtifact.id set from the $scope.artifact.id.
var artifactRelationship = new ArtifactRelationship( {
name: 'category',
relatedArtifactPosition:position,
relatedArtifactId: $scope.artifact.id
} );
b.) Component object has the artifact.id set from the artifact.id - the article that its attached to.
var artifactRelationship = new ArtifactRelationship( {
name: 'component',
relatedArtifactPosition: position,
artifactId: $scope.artifact.id
} );
_______________________________________________________________
Note:
Artifacts - are parent artifacts
Related Artifacts - are child artifacts
author & attributions - their relationship 'name' is author or attribution accordingly.
Hypothetically:
- If you wanted to get the data on a video_article_artifact --> You would go to the endpoint /artifacts/:id/components
Every Artifact requires:
- provider (for tags/playlists it's "Boxxspring")
- provider_uid -> (tags/playlist) - uses the id of the object.
On a video_artifact - the provider is "Boxxspring" and the id is the binary.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment