T - the java class of the entity that this ERTaggableEntity is associated withpublic class ERTaggableEntity<T extends ERXGenericRecord>
extends java.lang.Object
public class Person extends _Person {
...
public static ERTaggableEntity<Person> taggableEntity() {
return ERTaggableEntity.taggableEntity(Person.ENTITY_NAME);
}
}
| Modifier and Type | Field and Description |
|---|---|
static java.lang.String |
DEFAULT_TAGS_RELATIONSHIP_NAME
The default name of the flattened to-many relationship to the tag entity.
|
static java.lang.String |
ERTAGGABLE_KEY
The key stored in entity userInfo that flags an entity as taggable.
|
static java.lang.String |
ERTAGGABLE_TAG_ENTITY_KEY
The key stored in entity userInfo that specifies the name of the tag entity.
|
static java.lang.String |
ERTAGGABLE_TAG_RELATIONSHIP_KEY
The key stored in entity userInfo that specifies the name of the tag relationship.
|
| Modifier | Constructor and Description |
|---|---|
protected |
ERTaggableEntity(EOEntity entity)
Constructs an ERTaggableEntity.
|
| Modifier and Type | Method and Description |
|---|---|
protected EOQualifier |
additionalTagCountQualifier() |
<U> NSDictionary<java.lang.String,U> |
cloud(EOEditingContext editingContext,
NSArray<U> categoryList)
Takes the result of a tagCount call and an array of categories and
distributes the entries in the tagCount hash evenly across the
categories based on the count value for each tag.
|
<U> NSDictionary<java.lang.String,U> |
cloud(NSDictionary<java.lang.String,java.lang.Integer> tagHash,
NSArray<U> categoryList)
Takes the result of a tagCount call and an array of categories and
distributes the entries in the tagCount hash evenly across the
categories based on the count value for each tag.
|
int |
countUniqueTaggedWith(EOEditingContext editingContext,
ERTag.Inclusion inclusion,
java.lang.Object tags)
This method returns a simple count of the number of distinct objects which match the tags provided.
|
ERTag |
createTagNamed(EOEditingContext editingContext,
java.lang.String tagName)
Creates a tag with the given name.
|
boolean |
equals(java.lang.Object obj) |
static NSDictionary<EOEntity,NSArray<? extends ERXGenericRecord>> |
fetchAllTaggedWith(EOEditingContext editingContext,
ERTag.Inclusion inclusion,
int limit,
java.lang.Object tags)
Fetches all the EOs of all taggable entities that are associated with the given tags.
|
static NSDictionary<EOEntity,NSArray<? extends ERXGenericRecord>> |
fetchAllTaggedWith(EOEditingContext editingContext,
ERTag.Inclusion inclusion,
java.lang.Object tags)
Fetches all the EOs of all taggable entities that are associated with the given tags (unlimited).
|
static NSDictionary<EOEntity,NSArray<? extends ERXGenericRecord>> |
fetchAllTaggedWith(EOEditingContext editingContext,
java.lang.Object tags)
Fetches all the EOs of all taggable entities that are associated with all of the given tags (unlimited).
|
NSArray<java.lang.String> |
fetchAllTags(EOEditingContext editingContext)
Returns an array of all of the available tags in the system.
|
NSArray<java.lang.String> |
fetchRelatedTags(EOEditingContext editingContext,
java.lang.Object tags)
Finds other tags that are related to the tags passed through the tags
parameter, by finding common records that share similar sets of tags.
|
NSArray<T> |
fetchTaggedWith(EOEditingContext editingContext,
ERTag.Inclusion inclusion,
int limit,
java.lang.Object tags)
Fetches the list of objects of this entity type that are tagged
with the given tags.
|
NSArray<T> |
fetchTaggedWith(EOEditingContext editingContext,
ERTag.Inclusion inclusion,
int limit,
java.lang.Object tags,
EOQualifier additionalQualifier)
Fetches the list of objects of this entity type that are tagged
with the given tags.
|
NSArray<T> |
fetchTaggedWith(EOEditingContext editingContext,
ERTag.Inclusion inclusion,
int limit,
java.lang.Object tags,
EOQualifier additionalQualifier,
NSArray<EOSortOrdering> sortOrderings)
Fetches the sorted list of objects of this entity type that are tagged
with the given tags.
|
NSArray<T> |
fetchTaggedWith(EOEditingContext editingContext,
ERTag.Inclusion inclusion,
java.lang.Object tags)
Fetches the list of objects of this entity type that are tagged
with the given tags with unlimited results.
|
NSArray<T> |
fetchTaggedWith(EOEditingContext editingContext,
java.lang.Object tags)
Fetches the list of objects of this entity type that are tagged
with all of the given tags with unlimited results.
|
ERTag |
fetchTagNamed(EOEditingContext editingContext,
java.lang.String tagName,
boolean createIfMissing)
Fetches the tag with the given name.
|
NSArray<java.lang.String> |
fetchTagsLike(EOEditingContext editingContext,
java.lang.String startsWith)
Returns an array of all of the available tags in the system that start with
the given string.
|
int |
hashCode() |
static boolean |
isTaggable(EOEntity entity)
Returns whether or not the given entity has been registered as taggable.
|
static boolean |
isWhitespaceSeparator(java.lang.String separator)
Returns whether or not the given separator contains whitespace (and should be escaped).
|
ERTagNormalizer |
normalizer()
Returns the tag normalizer for this entity.
|
static EOEntity |
registerTaggable(EOEntity entity)
Registers the given entity as taggable.
|
static EOEntity |
registerTaggable(EOEntity entity,
java.lang.String tagsRelationshipName)
Registers the given entity as taggable.
|
static EOEntity |
registerTaggable(EOEntity entity,
java.lang.String tagsRelationshipName,
EOEntity tagEntity,
java.lang.Class<? extends ERTaggableEntity<?>> taggableEntity)
Registers the given entity as taggable.
|
static EOEntity |
registerTaggable(java.lang.String entityName)
Registers the given entity name in the default model group as taggable.
|
static EOEntity |
registerTaggable(java.lang.String entityName,
java.lang.Class<? extends ERTaggableEntity<?>> taggableEntity)
Registers the given entity name in the default model group as taggable.
|
void |
removeTags(EOEditingContext editingContext,
java.lang.Object tags)
Remove all of the tags from instances of this entity type.
|
void |
replaceTags(EOEditingContext editingContext,
ERTag.Inclusion inclusion,
java.lang.Object oldTags,
java.lang.Object newTags)
Looks for items with oldTags and replaces them with all of newTags.
|
void |
setNormalizer(ERTagNormalizer normalizer)
Sets the tag normalizer for this entity.
|
static void |
setTaggableEntityForEntityNamed(java.lang.Class<? extends ERTaggableEntity<?>> taggableEntity,
java.lang.String entityName)
Sets the taggable entity class for the given entity name.
|
NSArray<java.lang.String> |
splitTagNames(java.lang.Object tags)
Splits the given "tags" object (String, array of Strings, etc) into an array of normalized tag strings.
|
NSDictionary<java.lang.String,java.lang.Integer> |
tagCount(EOEditingContext editingContext)
This method counts the number of times the tags have been applied to your objects
and, by default, returns a dictionary in the form of { 'tag_name' => count, ...
|
NSDictionary<java.lang.String,java.lang.Integer> |
tagCount(EOEditingContext editingContext,
EOQualifier additionalQualifier)
This method counts the number of times the tags have been applied to your objects
and, by default, returns a dictionary in the form of { 'tag_name' => count, ...
|
NSDictionary<java.lang.String,java.lang.Integer> |
tagCount(EOEditingContext editingContext,
int limit)
This method counts the number of times the tags have been applied to your objects
and, by default, returns a dictionary in the form of { 'tag_name' => count, ...
|
NSDictionary<java.lang.String,java.lang.Integer> |
tagCount(EOEditingContext editingContext,
int limit,
EOQualifier additionalQualifier)
This method counts the number of times the tags have been applied to your objects
and, by default, returns a dictionary in the form of { 'tag_name' => count, ...
|
NSDictionary<java.lang.String,java.lang.Integer> |
tagCount(EOEditingContext editingContext,
NSSelector selector,
int count,
int limit)
This method counts the number of times the tags have been applied to your objects
and, by default, returns a dictionary in the form of { 'tag_name' => count, ...
|
NSDictionary<java.lang.String,java.lang.Integer> |
tagCount(EOEditingContext editingContext,
NSSelector selector,
int count,
int limit,
EOQualifier additionalQualifier)
This method counts the number of times the tags have been applied to your objects
and, by default, returns a dictionary in the form of { 'tag_name' => count, ...
|
ERTaggable<T> |
taggable(T eo)
Factory method for generating an ERTaggable wrapper for an EO.
|
static NSArray<EOEntity> |
taggableEntities()
Returns an array of taggable entities.
|
static <T extends ERXGenericRecord> |
taggableEntity(EOEntity entity)
Constructs an ERTaggableEntity.
|
static <T extends ERXGenericRecord> |
taggableEntity(java.lang.String entityName)
Constructs an ERTaggableEntity.
|
static <T extends ERXGenericRecord> |
taggableEntity(T eo)
Shortcut for getting an ERTaggableEntity for an EO.
|
EORelationship |
tagsRelationship()
Returns the tags relationship for this entity.
|
static EORelationship |
tagsRelationshipForEntity(EOEntity entity,
EOEntity tagEntity)
Returns the flattened to-many relationship from the taggable entity to the given tag entity.
|
java.lang.String |
tagsRelationshipName()
Returns the name of the tags relationship for this entity.
|
public static final java.lang.String ERTAGGABLE_KEY
public static final java.lang.String ERTAGGABLE_TAG_ENTITY_KEY
public static final java.lang.String ERTAGGABLE_TAG_RELATIONSHIP_KEY
public static final java.lang.String DEFAULT_TAGS_RELATIONSHIP_NAME
protected ERTaggableEntity(EOEntity entity)
entity - the entity to tagpublic int hashCode()
hashCode in class java.lang.Objectpublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic static void setTaggableEntityForEntityNamed(java.lang.Class<? extends ERTaggableEntity<?>> taggableEntity, java.lang.String entityName)
taggableEntity - the taggable entity classentityName - the name of the entity to associate withpublic static <T extends ERXGenericRecord> ERTaggableEntity<T> taggableEntity(EOEntity entity)
entity - the entity to tagpublic static <T extends ERXGenericRecord> ERTaggableEntity<T> taggableEntity(java.lang.String entityName)
entityName - the name of the entity to tagpublic static <T extends ERXGenericRecord> ERTaggableEntity<T> taggableEntity(T eo)
T - the type of the entityeo - the EOpublic static NSDictionary<EOEntity,NSArray<? extends ERXGenericRecord>> fetchAllTaggedWith(EOEditingContext editingContext, java.lang.Object tags)
editingContext - the editing context to fetch intotags - the tags to search (String to tokenize, NSArray<String>, etc)public static NSDictionary<EOEntity,NSArray<? extends ERXGenericRecord>> fetchAllTaggedWith(EOEditingContext editingContext, ERTag.Inclusion inclusion, java.lang.Object tags)
editingContext - the editing context to fetch intotags - the tags to search (String to tokenize, NSArray<String>, etc)inclusion - find matches for ANY tags or ALL tags providedpublic static NSDictionary<EOEntity,NSArray<? extends ERXGenericRecord>> fetchAllTaggedWith(EOEditingContext editingContext, ERTag.Inclusion inclusion, int limit, java.lang.Object tags)
editingContext - the editing context to fetch intotags - the tags to search (String to tokenize, NSArray<String>, etc)inclusion - find matches for ANY tags or ALL tags providedlimit - the limit of the number of objects to return (or -1 for unlimited)public static boolean isTaggable(EOEntity entity)
entity - the entity to checkpublic static NSArray<EOEntity> taggableEntities()
public static EORelationship tagsRelationshipForEntity(EOEntity entity, EOEntity tagEntity)
entity - the taggable entitytagEntity - the tag entitypublic static EOEntity registerTaggable(java.lang.String entityName, java.lang.Class<? extends ERTaggableEntity<?>> taggableEntity)
entityName - the name of the entity to lookuptaggableEntity - the taggable entity to associate with this taggablepublic static EOEntity registerTaggable(java.lang.String entityName)
entityName - the name of the entity to lookuppublic static EOEntity registerTaggable(EOEntity entity)
entity - the entity to registerpublic static EOEntity registerTaggable(EOEntity entity, java.lang.String tagsRelationshipName)
entity - the entity to registertagsRelationshipName - the name of the flattened to-many tags relationshippublic static EOEntity registerTaggable(EOEntity entity, java.lang.String tagsRelationshipName, EOEntity tagEntity, java.lang.Class<? extends ERTaggableEntity<?>> taggableEntity)
entity - the entity to registertagsRelationshipName - the name of the flattened to-many tags relationshiptagEntity - the ERTag entity that contains the tags for this entitytaggableEntity - the taggable entity to associate with this taggablepublic ERTagNormalizer normalizer()
public void setNormalizer(ERTagNormalizer normalizer)
normalizer - the tag normalizer for this entitypublic ERTag fetchTagNamed(EOEditingContext editingContext, java.lang.String tagName, boolean createIfMissing)
editingContext - the editing context to fetch intotagName - the name of the tag to lookupcreateIfMissing - if true, missing tags will be createdpublic ERTag createTagNamed(EOEditingContext editingContext, java.lang.String tagName)
editingContext - the editing context to create withintagName - the new tag namepublic ERTaggable<T> taggable(T eo)
eo - the EO to wrappublic java.lang.String tagsRelationshipName()
public EORelationship tagsRelationship()
public static boolean isWhitespaceSeparator(java.lang.String separator)
public NSArray<java.lang.String> splitTagNames(java.lang.Object tags)
tags - the object that contains the tags to splitpublic NSArray<T> fetchTaggedWith(EOEditingContext editingContext, java.lang.Object tags)
editingContext - the editing context to fetch intotags - the tags to search (String to tokenize, NSArray<String>, etc)public NSArray<T> fetchTaggedWith(EOEditingContext editingContext, ERTag.Inclusion inclusion, java.lang.Object tags)
editingContext - the editing context to fetch intotags - the tags to search (String to tokenize, NSArray<String>, etc)inclusion - find matches for ANY tags or ALL tags providedpublic NSArray<T> fetchTaggedWith(EOEditingContext editingContext, ERTag.Inclusion inclusion, int limit, java.lang.Object tags)
editingContext - the editing context to fetch intotags - the tags to search (String to tokenize, NSArray<String>, etc)inclusion - find matches for ANY tags or ALL tags providedlimit - limit the number of results to be returned (-1 for unlimited)public NSArray<T> fetchTaggedWith(EOEditingContext editingContext, ERTag.Inclusion inclusion, int limit, java.lang.Object tags, EOQualifier additionalQualifier)
editingContext - the editing context to fetch intotags - the tags to search (String to tokenize, NSArray<String>, etc)inclusion - find matches for ANY tags or ALL tags providedlimit - limit the number of results to be returned (-1 for unlimited)additionalQualifier - an additional qualifier to chain inpublic NSArray<T> fetchTaggedWith(EOEditingContext editingContext, ERTag.Inclusion inclusion, int limit, java.lang.Object tags, EOQualifier additionalQualifier, NSArray<EOSortOrdering> sortOrderings)
editingContext - the editing context to fetch intotags - the tags to search (String to tokenize, NSArray<String>, etc)inclusion - find matches for ANY tags or ALL tags providedlimit - limit the number of results to be returned (-1 for unlimited)additionalQualifier - an additional qualifier to chain insortOrderings - sort orderings for the fetch specpublic void removeTags(EOEditingContext editingContext, java.lang.Object tags)
editingContext - the editing context to fetch intotags - the tags to remove (String to tokenize, NSArray<String>, etc)public void replaceTags(EOEditingContext editingContext, ERTag.Inclusion inclusion, java.lang.Object oldTags, java.lang.Object newTags)
editingContext - the editing context to remove witholdTags - the tags to find and remove (String to tokenize, NSArray<String>, etc)newTags - the tags to addinclusion - if ANY, finds any tags that match, removes them all, and adds newTags; if all, requires all tags to match before replacingpublic NSDictionary<java.lang.String,java.lang.Integer> tagCount(EOEditingContext editingContext)
editingContext - the editing context to fetch intopublic NSDictionary<java.lang.String,java.lang.Integer> tagCount(EOEditingContext editingContext, EOQualifier additionalQualifier)
editingContext - the editing context to fetch intoadditionalQualifier - an optional restrictingQualifierpublic NSDictionary<java.lang.String,java.lang.Integer> tagCount(EOEditingContext editingContext, int limit)
editingContext - the editing context to fetch intolimit - the limit of the number of results to return (ordered by count DESC)public NSDictionary<java.lang.String,java.lang.Integer> tagCount(EOEditingContext editingContext, int limit, EOQualifier additionalQualifier)
editingContext - the editing context to fetch intolimit - the limit of the number of results to return (ordered by count DESC)additionalQualifier - an optional restrictingQualifierpublic NSDictionary<java.lang.String,java.lang.Integer> tagCount(EOEditingContext editingContext, NSSelector selector, int count, int limit)
editingContext - the editing context to fetch intoselector - a selector for the count restriction (see EOQualifier.QualifierOperators)count - the count restriction required for the result to be returnedlimit - the limit of the number of results to return (ordered by count DESC)public NSDictionary<java.lang.String,java.lang.Integer> tagCount(EOEditingContext editingContext, NSSelector selector, int count, int limit, EOQualifier additionalQualifier)
editingContext - the editing context to fetch intoselector - a selector for the count restriction (see EOQualifier.QualifierOperators)count - the count restriction required for the result to be returnedlimit - the limit of the number of results to return (ordered by count DESC)additionalQualifier - an optional restrictingQualifier. This is combined with the qualifier returned by additionalTagCountQualifier()public int countUniqueTaggedWith(EOEditingContext editingContext, ERTag.Inclusion inclusion, java.lang.Object tags)
editingContext - the editing context to fetch intotags - the tags to search (String to tokenize, NSArray<String>, etc)inclusion - find matches for ANY tags or ALL tags providedpublic NSArray<java.lang.String> fetchRelatedTags(EOEditingContext editingContext, java.lang.Object tags)
tags - the tags to search (String to tokenize, NSArray<String>, etc)public <U> NSDictionary<java.lang.String,U> cloud(EOEditingContext editingContext, NSArray<U> categoryList)
categoryList - An array containing the categories to split the tagspublic <U> NSDictionary<java.lang.String,U> cloud(NSDictionary<java.lang.String,java.lang.Integer> tagHash, NSArray<U> categoryList)
tagHash - the tag dictionary returned from a tagCount callcategoryList - An array containing the categories to split the tagspublic NSArray<java.lang.String> fetchAllTags(EOEditingContext editingContext)
editingContext - the editing context to fetch intopublic NSArray<java.lang.String> fetchTagsLike(EOEditingContext editingContext, java.lang.String startsWith)
startsWith - the prefix to lookupeditingContext - the editing context to fetch intoprotected EOQualifier additionalTagCountQualifier()
Copyright © 2002 – 2022 Project Wonder.