
Public Member Functions | |
| int | countUniqueTaggedWith (EOEditingContext editingContext, ERTag.Inclusion inclusion, Object tags) |
| ERTag | createTagNamed (EOEditingContext editingContext, String tagName) |
| boolean | equals (Object obj) |
| NSArray< String > | fetchAllTags (EOEditingContext editingContext) |
| NSArray< String > | fetchRelatedTags (EOEditingContext editingContext, Object tags) |
| NSArray< T > | fetchTaggedWith (EOEditingContext editingContext, ERTag.Inclusion inclusion, int limit, Object tags, EOQualifier additionalQualifier) |
| NSArray< T > | fetchTaggedWith (EOEditingContext editingContext, ERTag.Inclusion inclusion, int limit, Object tags) |
| NSArray< T > | fetchTaggedWith (EOEditingContext editingContext, ERTag.Inclusion inclusion, Object tags) |
| NSArray< T > | fetchTaggedWith (EOEditingContext editingContext, Object tags) |
| ERTag | fetchTagNamed (EOEditingContext editingContext, String tagName, boolean createIfMissing) |
| NSArray< String > | fetchTagsLike (EOEditingContext editingContext, String startsWith) |
| int | hashCode () |
| ERTagNormalizer | normalizer () |
| void | removeTags (EOEditingContext editingContext, Object tags) |
| void | replaceTags (EOEditingContext editingContext, ERTag.Inclusion inclusion, Object oldTags, Object newTags) |
| void | setNormalizer (ERTagNormalizer normalizer) |
| NSArray< String > | splitTagNames (Object tags) |
| NSDictionary< String, Integer > | tagCount (EOEditingContext editingContext, NSSelector selector, int count, int limit, EOQualifier additionalQualifier) |
| NSDictionary< String, Integer > | tagCount (EOEditingContext editingContext, NSSelector selector, int count, int limit) |
| NSDictionary< String, Integer > | tagCount (EOEditingContext editingContext, int limit, EOQualifier additionalQualifier) |
| NSDictionary< String, Integer > | tagCount (EOEditingContext editingContext, int limit) |
| NSDictionary< String, Integer > | tagCount (EOEditingContext editingContext, EOQualifier additionalQualifier) |
| NSDictionary< String, Integer > | tagCount (EOEditingContext editingContext) |
| ERTaggable< T > | taggable (T eo) |
| EORelationship | tagsRelationship () |
| String | tagsRelationshipName () |
Static Public Member Functions | |
| static NSDictionary< EOEntity, NSArray<?extends ERXGenericRecord > > | fetchAllTaggedWith (EOEditingContext editingContext, ERTag.Inclusion inclusion, int limit, Object tags) |
| static NSDictionary< EOEntity, NSArray<?extends ERXGenericRecord > > | fetchAllTaggedWith (EOEditingContext editingContext, ERTag.Inclusion inclusion, Object tags) |
| static NSDictionary< EOEntity, NSArray<?extends ERXGenericRecord > > | fetchAllTaggedWith (EOEditingContext editingContext, Object tags) |
| static boolean | isTaggable (EOEntity entity) |
| static boolean | isWhitespaceSeparator (String separator) |
| static EOEntity | registerTaggable (EOEntity entity, String tagsRelationshipName, EOEntity tagEntity, Class<?extends ERTaggableEntity<?>> taggableEntity) |
| static EOEntity | registerTaggable (EOEntity entity, String tagsRelationshipName) |
| static EOEntity | registerTaggable (EOEntity entity) |
| static EOEntity | registerTaggable (String entityName) |
| static EOEntity | registerTaggable (String entityName, Class<?extends ERTaggableEntity<?>> taggableEntity) |
| static void | setTaggableEntityForEntityNamed (Class<?extends ERTaggableEntity<?>> taggableEntity, String entityName) |
| static NSArray< EOEntity > | taggableEntities () |
| static < TextendsERXGenericRecord > ERTaggableEntity< T > | taggableEntity (T eo) |
| static < TextendsERXGenericRecord > ERTaggableEntity< T > | taggableEntity (String entityName) |
| static < TextendsERXGenericRecord > ERTaggableEntity< T > | taggableEntity (EOEntity entity) |
| static EORelationship | tagsRelationshipForEntity (EOEntity entity, EOEntity tagEntity) |
Static Public Attributes | |
| static final String | DEFAULT_TAGS_RELATIONSHIP_NAME = "tags" |
| static final String | ERTAGGABLE_KEY = "_ERTaggable" |
| static final String | ERTAGGABLE_TAG_ENTITY_KEY = "_ERTaggableTagEntity" |
| static final String | ERTAGGABLE_TAG_RELATIONSHIP_KEY = "_ERTaggableTagRelationship" |
Protected Member Functions | |
| EOQualifier | additionalTagCountQualifier () |
| ERTaggableEntity (EOEntity entity) | |
Package Functions | |
| public< U > NSDictionary < String, U > | cloud (NSDictionary< String, Integer > tagHash, NSArray< U > categoryList) |
| public< U > NSDictionary < String, U > | cloud (EOEditingContext editingContext, NSArray< U > categoryList) |
Private Member Functions | |
| void | addNormalizedTags (NSMutableSet< String > set, Object[] tags) |
Private Attributes | |
| final EOEntity | _entity |
| ERTagNormalizer | _normalizer = new ERDefaultTagNormalizer() |
| final String | _separator = ERTaggableEntity.DEFAULT_SEPARATOR |
| final EOEntity | _tagEntity |
| final EORelationship | _tagsRelationship |
Static Private Attributes | |
| static final NSMutableDictionary< String, Class<?extends ERTaggableEntity<?> > > | _taggableEntities = new NSMutableDictionary<String, Class<? extends ERTaggableEntity<?>>>() |
| static final String | DEFAULT_SEPARATOR = "[\\s,]+" |
Typically you would provide a cover method from your entity class to an instance of an ERTaggableEntity:
public class Person extends _Person { ... public static ERTaggableEntity<Person> taggableEntity() { return ERTaggableEntity.taggableEntity(Person.ENTITY_NAME); } }
| <T> | the java class of the entity that this ERTaggableEntity is associated with |
| ERTaggableEntity | ( | EOEntity | entity | ) | [protected] |
Constructs an ERTaggableEntity.
| entity | the entity to tag |
| EOQualifier additionalTagCountQualifier | ( | ) | [protected] |
| void addNormalizedTags | ( | NSMutableSet< String > | set, | |
| Object[] | tags | |||
| ) | [private] |
Normalizes tags from tags array and adds them to set
| set | set that normalized tags should be added to | |
| tags | array of unclean tags |
| public<U> NSDictionary<String, U> cloud | ( | NSDictionary< String, Integer > | tagHash, | |
| NSArray< U > | categoryList | |||
| ) | [package] |
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.
Typically, this is used to display a 'tag cloud' in your UI.
| tagHash | the tag dictionary returned from a tagCount call | |
| categoryList | An array containing the categories to split the tags |
| public<U> NSDictionary<String, U> cloud | ( | EOEditingContext | editingContext, | |
| NSArray< U > | categoryList | |||
| ) | [package] |
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.
Typically, this is used to display a 'tag cloud' in your UI.
| categoryList | An array containing the categories to split the tags |
| int countUniqueTaggedWith | ( | EOEditingContext | editingContext, | |
| ERTag.Inclusion | inclusion, | |||
| Object | tags | |||
| ) |
This method returns a simple count of the number of distinct objects which match the tags provided.
| editingContext | the editing context to fetch into | |
| tags | the tags to search (String to tokenize, NSArray<String>, etc) | |
| inclusion | find matches for ANY tags or ALL tags provided |
Creates a tag with the given name.
| editingContext | the editing context to create within | |
| tagName | the new tag name |
| boolean equals | ( | Object | obj | ) |
| static NSDictionary<EOEntity, NSArray<? extends ERXGenericRecord> > fetchAllTaggedWith | ( | EOEditingContext | editingContext, | |
| ERTag.Inclusion | inclusion, | |||
| int | limit, | |||
| Object | tags | |||
| ) | [static] |
Fetches all the EOs of all taggable entities that are associated with the given tags.
| editingContext | the editing context to fetch into | |
| tags | the tags to search (String to tokenize, NSArray<String>, etc) | |
| inclusion | find matches for ANY tags or ALL tags provided | |
| limit | the limit of the number of objects to return (or -1 for unlimited) |
| static NSDictionary<EOEntity, NSArray<? extends ERXGenericRecord> > fetchAllTaggedWith | ( | EOEditingContext | editingContext, | |
| ERTag.Inclusion | inclusion, | |||
| Object | tags | |||
| ) | [static] |
Fetches all the EOs of all taggable entities that are associated with the given tags (unlimited).
| editingContext | the editing context to fetch into | |
| tags | the tags to search (String to tokenize, NSArray<String>, etc) | |
| inclusion | find matches for ANY tags or ALL tags provided |
| static NSDictionary<EOEntity, NSArray<? extends ERXGenericRecord> > fetchAllTaggedWith | ( | EOEditingContext | editingContext, | |
| Object | tags | |||
| ) | [static] |
Fetches all the EOs of all taggable entities that are associated with all of the given tags (unlimited).
| editingContext | the editing context to fetch into | |
| tags | the tags to search (String to tokenize, NSArray<String>, etc) |
| NSArray<String> fetchAllTags | ( | EOEditingContext | editingContext | ) |
Returns an array of all of the available tags in the system.
| editingContext | the editing context to fetch into |
| NSArray<String> fetchRelatedTags | ( | EOEditingContext | editingContext, | |
| 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. Useful for constructing 'Related tags' lists.
| tags | the tags to search (String to tokenize, NSArray<String>, etc) |
| NSArray<T> fetchTaggedWith | ( | EOEditingContext | editingContext, | |
| ERTag.Inclusion | inclusion, | |||
| int | limit, | |||
| Object | tags, | |||
| EOQualifier | additionalQualifier | |||
| ) |
Fetches the list of objects of this entity type that are tagged with the given tags.
| editingContext | the editing context to fetch into | |
| tags | the tags to search (String to tokenize, NSArray<String>, etc) | |
| inclusion | find matches for ANY tags or ALL tags provided | |
| limit | limit the number of results to be returned (-1 for unlimited) | |
| additionalQualifier | an additional qualifier to chain in |
| NSArray<T> fetchTaggedWith | ( | EOEditingContext | editingContext, | |
| ERTag.Inclusion | inclusion, | |||
| int | limit, | |||
| Object | tags | |||
| ) |
Fetches the list of objects of this entity type that are tagged with the given tags.
| editingContext | the editing context to fetch into | |
| tags | the tags to search (String to tokenize, NSArray<String>, etc) | |
| inclusion | find matches for ANY tags or ALL tags provided | |
| limit | limit the number of results to be returned (-1 for unlimited) |
| NSArray<T> fetchTaggedWith | ( | EOEditingContext | editingContext, | |
| ERTag.Inclusion | inclusion, | |||
| Object | tags | |||
| ) |
Fetches the list of objects of this entity type that are tagged with the given tags with unlimited results.
| editingContext | the editing context to fetch into | |
| tags | the tags to search (String to tokenize, NSArray<String>, etc) | |
| inclusion | find matches for ANY tags or ALL tags provided |
| NSArray<T> fetchTaggedWith | ( | EOEditingContext | editingContext, | |
| Object | tags | |||
| ) |
Fetches the list of objects of this entity type that are tagged with all of the given tags with unlimited results.
| editingContext | the editing context to fetch into | |
| tags | the tags to search (String to tokenize, NSArray<String>, etc) |
Fetches the tag with the given name. If that tag doesn't exist and createIfMissing is true, a tag with that name will be created (otherwise null will be returned). Tags are created in a separate transaction to prevent race conditions with duplicate tag names from rolling back your primary editing context, which means that even if you rollback your editingContext, any tags created during its lifetime will remain.
| editingContext | the editing context to fetch into | |
| tagName | the name of the tag to lookup | |
| createIfMissing | if true, missing tags will be created |
Returns an array of all of the available tags in the system that start with the given string.
| startsWith | the prefix to lookup | |
| editingContext | the editing context to fetch into |
| int hashCode | ( | ) |
| static boolean isTaggable | ( | EOEntity | entity | ) | [static] |
| static boolean isWhitespaceSeparator | ( | String | separator | ) | [static] |
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, | |
| String | tagsRelationshipName, | |||
| EOEntity | tagEntity, | |||
| Class<?extends ERTaggableEntity<?>> | taggableEntity | |||
| ) | [static] |
Registers the given entity as taggable. An entity must be registered as taggable prior to attempting any tagging operations on it. The application constructor is an obvious place to register an entity as taggable. If the entity does not contain a flattened to-many tags relationship, a join entity and a flattened tags relationship will be automatically generated.
| entity | the entity to register | |
| tagsRelationshipName | the name of the flattened to-many tags relationship | |
| tagEntity | the ERTag entity that contains the tags for this entity | |
| taggableEntity | the taggable entity to associate with this taggable |
| static EOEntity registerTaggable | ( | EOEntity | entity, | |
| String | tagsRelationshipName | |||
| ) | [static] |
Registers the given entity as taggable. An entity must be registered as taggable prior to attempting any tagging operations on it. The application constructor is an obvious place to register an entity as taggable. If the entity does not contain a flattened to-many tags relationship, a join entity and a flattened tags relationship will be automatically generated.
| entity | the entity to register | |
| tagsRelationshipName | the name of the flattened to-many tags relationship |
| static EOEntity registerTaggable | ( | EOEntity | entity | ) | [static] |
Registers the given entity as taggable. An entity must be registered as taggable prior to attempting any tagging operations on it. The application constructor is an obvious place to register an entity as taggable. If the entity does not contain a flattened to-many tags relationship, a join entity (between your entity and "ERTag") and a flattened tags relationship (named "tags") will be automatically generated.
| entity | the entity to register |
| static EOEntity registerTaggable | ( | String | entityName | ) | [static] |
Registers the given entity name in the default model group as taggable. An entity must be registered as taggable prior to attempting any tagging operations on it. The application constructor is an obvious place to register an entity as taggable. If the entity does not contain a flattened to-many tags relationship, a join entity (between your entity and "ERTag") and a flattened tags relationship (named "tags") will be automatically generated.
| entityName | the name of the entity to lookup |
| static EOEntity registerTaggable | ( | String | entityName, | |
| Class<?extends ERTaggableEntity<?>> | taggableEntity | |||
| ) | [static] |
Registers the given entity name in the default model group as taggable. An entity must be registered as taggable prior to attempting any tagging operations on it. The application constructor is an obvious place to register an entity as taggable. If the entity does not contain a flattened to-many tags relationship, a join entity (between your entity and "ERTag") and a flattened tags relationship (named "tags") will be automatically generated.
| entityName | the name of the entity to lookup | |
| taggableEntity | the taggable entity to associate with this taggable |
| void removeTags | ( | EOEditingContext | editingContext, | |
| Object | tags | |||
| ) |
Remove all of the tags from instances of this entity type.
| editingContext | the editing context to fetch into | |
| tags | the tags to remove (String to tokenize, NSArray<String>, etc) |
| void replaceTags | ( | EOEditingContext | editingContext, | |
| ERTag.Inclusion | inclusion, | |||
| Object | oldTags, | |||
| Object | newTags | |||
| ) |
Looks for items with oldTags and replaces them with all of newTags.
| editingContext | the editing context to remove with | |
| oldTags | the tags to find and remove (String to tokenize, NSArray<String>, etc) | |
| newTags | the tags to add | |
| inclusion | if ANY, finds any tags that match, removes them all, and adds newTags; if all, requires all tags to match before replacing |
| void setNormalizer | ( | ERTagNormalizer | normalizer | ) |
Sets the tag normalizer for this entity.
| normalizer | the tag normalizer for this entity |
| static void setTaggableEntityForEntityNamed | ( | Class<?extends ERTaggableEntity<?>> | taggableEntity, | |
| String | entityName | |||
| ) | [static] |
| NSArray<String> splitTagNames | ( | Object | tags | ) |
Splits the given "tags" object (String, array of Strings, etc) into an array of normalized tag strings.
| tags | the object that contains the tags to split |
| NSDictionary<String, 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, ... }. Providing a selector and count allows you to add a restriction on, for instance, the minimum number of occurrences required for a result to appear. As an example, you might have selector = EOQualifier.QualifierOperatorGreaterThan, count = 1 to only return tags with more than one occurrence.
| editingContext | the editing context to fetch into | |
| selector | a selector for the count restriction (see EOQualifier.QualifierOperators) | |
| count | the count restriction required for the result to be returned | |
| limit | 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() |
| NSDictionary<String, 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, ... }. Providing a selector and count allows you to add a restriction on, for instance, the minimum number of occurrences required for a result to appear. As an example, you might have selector = EOQualifier.QualifierOperatorGreaterThan, count = 1 to only return tags with more than one occurrence.
| editingContext | the editing context to fetch into | |
| selector | a selector for the count restriction (see EOQualifier.QualifierOperators) | |
| count | the count restriction required for the result to be returned | |
| limit | the limit of the number of results to return (ordered by count DESC) |
| NSDictionary<String, 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, ... }. This does not include any restriction on the count required for results to be returned.
| editingContext | the editing context to fetch into | |
| limit | the limit of the number of results to return (ordered by count DESC) | |
| additionalQualifier | an optional restrictingQualifier |
| NSDictionary<String, 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, ... }. This does not include any restriction on the count required for results to be returned.
| editingContext | the editing context to fetch into | |
| limit | the limit of the number of results to return (ordered by count DESC) |
| NSDictionary<String, 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, ... }. This does not include any restriction on the count required for results to be returned nor does it limit the number of results returned.
| editingContext | the editing context to fetch into | |
| additionalQualifier | an optional restrictingQualifier |
| NSDictionary<String, 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, ... }. This does not include any restriction on the count required for results to be returned nor does it limit the number of results returned.
| editingContext | the editing context to fetch into |
| ERTaggable<T> taggable | ( | T | eo | ) |
Factory method for generating an ERTaggable wrapper for an EO.
| eo | the EO to wrap |
| static NSArray<EOEntity> taggableEntities | ( | ) | [static] |
| static <TextendsERXGenericRecord> ERTaggableEntity<T> taggableEntity | ( | T | eo | ) | [static] |
Shortcut for getting an ERTaggableEntity for an EO.
| <T> | the type of the entity | |
| eo | the EO |
| static <TextendsERXGenericRecord> ERTaggableEntity<T> taggableEntity | ( | String | entityName | ) | [static] |
Constructs an ERTaggableEntity.
| entityName | the name of the entity to tag |
| static <TextendsERXGenericRecord> ERTaggableEntity<T> taggableEntity | ( | EOEntity | entity | ) | [static] |
Constructs an ERTaggableEntity.
| entity | the entity to tag |
| EORelationship tagsRelationship | ( | ) |
Returns the tags relationship for this entity.
| static EORelationship tagsRelationshipForEntity | ( | EOEntity | entity, | |
| EOEntity | tagEntity | |||
| ) | [static] |
| String tagsRelationshipName | ( | ) |
Returns the name of the tags relationship for this entity.
final EOEntity _entity [private] |
ERTagNormalizer _normalizer = new ERDefaultTagNormalizer() [private] |
final String _separator = ERTaggableEntity.DEFAULT_SEPARATOR [private] |
final EOEntity _tagEntity [private] |
final NSMutableDictionary<String, Class<? extends ERTaggableEntity<?> > > _taggableEntities = new NSMutableDictionary<String, Class<? extends ERTaggableEntity<?>>>() [static, private] |
final EORelationship _tagsRelationship [private] |
final String DEFAULT_SEPARATOR = "[\\s,]+" [static, private] |
Default is white-space and/or comma(s). Multiple string of separators treated as one.
final String DEFAULT_TAGS_RELATIONSHIP_NAME = "tags" [static] |
The default name of the flattened to-many relationship to the tag entity.
final String ERTAGGABLE_KEY = "_ERTaggable" [static] |
The key stored in entity userInfo that flags an entity as taggable.
final String ERTAGGABLE_TAG_ENTITY_KEY = "_ERTaggableTagEntity" [static] |
The key stored in entity userInfo that specifies the name of the tag entity.
final String ERTAGGABLE_TAG_RELATIONSHIP_KEY = "_ERTaggableTagRelationship" [static] |
The key stored in entity userInfo that specifies the name of the tag relationship.
1.5.8