T
- the java class of the entity that this ERTaggableEntity is associated withpublic class ERTaggableEntity<T extends ERXGenericRecord> extends Object
public class Person extends _Person {
...
public static ERTaggableEntity<Person> taggableEntity() {
return ERTaggableEntity.taggableEntity(Person.ENTITY_NAME);
}
}
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_TAGS_RELATIONSHIP_NAME
The default name of the flattened to-many relationship to the tag entity.
|
static String |
ERTAGGABLE_KEY
The key stored in entity userInfo that flags an entity as taggable.
|
static String |
ERTAGGABLE_TAG_ENTITY_KEY
The key stored in entity userInfo that specifies the name of the tag entity.
|
static 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(com.webobjects.eoaccess.EOEntity entity)
Constructs an ERTaggableEntity.
|
Modifier and Type | Method and Description |
---|---|
protected com.webobjects.eocontrol.EOQualifier |
additionalTagCountQualifier() |
<U> NSDictionary<String,U> |
cloud(com.webobjects.eocontrol.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<String,U> |
cloud(NSDictionary<String,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(com.webobjects.eocontrol.EOEditingContext editingContext,
ERTag.Inclusion inclusion,
Object tags)
This method returns a simple count of the number of distinct objects which match the tags provided.
|
ERTag |
createTagNamed(com.webobjects.eocontrol.EOEditingContext editingContext,
String tagName)
Creates a tag with the given name.
|
boolean |
equals(Object obj) |
static NSDictionary<com.webobjects.eoaccess.EOEntity,NSArray<? extends ERXGenericRecord>> |
fetchAllTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext,
ERTag.Inclusion inclusion,
int limit,
Object tags)
Fetches all the EOs of all taggable entities that are associated with the given tags.
|
static NSDictionary<com.webobjects.eoaccess.EOEntity,NSArray<? extends ERXGenericRecord>> |
fetchAllTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext,
ERTag.Inclusion inclusion,
Object tags)
Fetches all the EOs of all taggable entities that are associated with the given tags (unlimited).
|
static NSDictionary<com.webobjects.eoaccess.EOEntity,NSArray<? extends ERXGenericRecord>> |
fetchAllTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext,
Object tags)
Fetches all the EOs of all taggable entities that are associated with all of the given tags (unlimited).
|
NSArray<String> |
fetchAllTags(com.webobjects.eocontrol.EOEditingContext editingContext)
Returns an array of all of the available tags in the system.
|
NSArray<String> |
fetchRelatedTags(com.webobjects.eocontrol.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.
|
NSArray<T> |
fetchTaggedWith(com.webobjects.eocontrol.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.
|
NSArray<T> |
fetchTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext,
ERTag.Inclusion inclusion,
int limit,
Object tags,
com.webobjects.eocontrol.EOQualifier additionalQualifier)
Fetches the list of objects of this entity type that are tagged
with the given tags.
|
NSArray<T> |
fetchTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext,
ERTag.Inclusion inclusion,
int limit,
Object tags,
com.webobjects.eocontrol.EOQualifier additionalQualifier,
NSArray<com.webobjects.eocontrol.EOSortOrdering> sortOrderings)
Fetches the sorted list of objects of this entity type that are tagged
with the given tags.
|
NSArray<T> |
fetchTaggedWith(com.webobjects.eocontrol.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.
|
NSArray<T> |
fetchTaggedWith(com.webobjects.eocontrol.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.
|
ERTag |
fetchTagNamed(com.webobjects.eocontrol.EOEditingContext editingContext,
String tagName,
boolean createIfMissing)
Fetches the tag with the given name.
|
NSArray<String> |
fetchTagsLike(com.webobjects.eocontrol.EOEditingContext editingContext,
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(com.webobjects.eoaccess.EOEntity entity)
Returns whether or not the given entity has been registered as taggable.
|
static boolean |
isWhitespaceSeparator(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 com.webobjects.eoaccess.EOEntity |
registerTaggable(com.webobjects.eoaccess.EOEntity entity)
Registers the given entity as taggable.
|
static com.webobjects.eoaccess.EOEntity |
registerTaggable(com.webobjects.eoaccess.EOEntity entity,
String tagsRelationshipName)
Registers the given entity as taggable.
|
static com.webobjects.eoaccess.EOEntity |
registerTaggable(com.webobjects.eoaccess.EOEntity entity,
String tagsRelationshipName,
com.webobjects.eoaccess.EOEntity tagEntity,
Class<? extends ERTaggableEntity<?>> taggableEntity)
Registers the given entity as taggable.
|
static com.webobjects.eoaccess.EOEntity |
registerTaggable(String entityName)
Registers the given entity name in the default model group as taggable.
|
static com.webobjects.eoaccess.EOEntity |
registerTaggable(String entityName,
Class<? extends ERTaggableEntity<?>> taggableEntity)
Registers the given entity name in the default model group as taggable.
|
void |
removeTags(com.webobjects.eocontrol.EOEditingContext editingContext,
Object tags)
Remove all of the tags from instances of this entity type.
|
void |
replaceTags(com.webobjects.eocontrol.EOEditingContext editingContext,
ERTag.Inclusion inclusion,
Object oldTags,
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(Class<? extends ERTaggableEntity<?>> taggableEntity,
String entityName)
Sets the taggable entity class for the given entity name.
|
NSArray<String> |
splitTagNames(Object tags)
Splits the given "tags" object (String, array of Strings, etc) into an array of normalized tag strings.
|
NSDictionary<String,Integer> |
tagCount(com.webobjects.eocontrol.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<String,Integer> |
tagCount(com.webobjects.eocontrol.EOEditingContext editingContext,
com.webobjects.eocontrol.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<String,Integer> |
tagCount(com.webobjects.eocontrol.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<String,Integer> |
tagCount(com.webobjects.eocontrol.EOEditingContext editingContext,
int limit,
com.webobjects.eocontrol.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<String,Integer> |
tagCount(com.webobjects.eocontrol.EOEditingContext editingContext,
com.webobjects.foundation.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<String,Integer> |
tagCount(com.webobjects.eocontrol.EOEditingContext editingContext,
com.webobjects.foundation.NSSelector selector,
int count,
int limit,
com.webobjects.eocontrol.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<com.webobjects.eoaccess.EOEntity> |
taggableEntities()
Returns an array of taggable entities.
|
static <T extends ERXGenericRecord> |
taggableEntity(com.webobjects.eoaccess.EOEntity entity)
Constructs an ERTaggableEntity.
|
static <T extends ERXGenericRecord> |
taggableEntity(String entityName)
Constructs an ERTaggableEntity.
|
static <T extends ERXGenericRecord> |
taggableEntity(T eo)
Shortcut for getting an ERTaggableEntity for an EO.
|
com.webobjects.eoaccess.EORelationship |
tagsRelationship()
Returns the tags relationship for this entity.
|
static com.webobjects.eoaccess.EORelationship |
tagsRelationshipForEntity(com.webobjects.eoaccess.EOEntity entity,
com.webobjects.eoaccess.EOEntity tagEntity)
Returns the flattened to-many relationship from the taggable entity to the given tag entity.
|
String |
tagsRelationshipName()
Returns the name of the tags relationship for this entity.
|
public static final String ERTAGGABLE_KEY
public static final String ERTAGGABLE_TAG_ENTITY_KEY
public static final String ERTAGGABLE_TAG_RELATIONSHIP_KEY
public static final String DEFAULT_TAGS_RELATIONSHIP_NAME
protected ERTaggableEntity(com.webobjects.eoaccess.EOEntity entity)
entity
- the entity to tagpublic static void setTaggableEntityForEntityNamed(Class<? extends ERTaggableEntity<?>> taggableEntity, String entityName)
taggableEntity
- the taggable entity classentityName
- the name of the entity to associate withpublic static <T extends ERXGenericRecord> ERTaggableEntity<T> taggableEntity(com.webobjects.eoaccess.EOEntity entity)
entity
- the entity to tagpublic static <T extends ERXGenericRecord> ERTaggableEntity<T> taggableEntity(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<com.webobjects.eoaccess.EOEntity,NSArray<? extends ERXGenericRecord>> fetchAllTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext, Object tags)
editingContext
- the editing context to fetch intotags
- the tags to search (String to tokenize, NSArray<String>, etc)public static NSDictionary<com.webobjects.eoaccess.EOEntity,NSArray<? extends ERXGenericRecord>> fetchAllTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext, ERTag.Inclusion inclusion, 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<com.webobjects.eoaccess.EOEntity,NSArray<? extends ERXGenericRecord>> fetchAllTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext, ERTag.Inclusion inclusion, int limit, 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(com.webobjects.eoaccess.EOEntity entity)
entity
- the entity to checkpublic static NSArray<com.webobjects.eoaccess.EOEntity> taggableEntities()
public static com.webobjects.eoaccess.EORelationship tagsRelationshipForEntity(com.webobjects.eoaccess.EOEntity entity, com.webobjects.eoaccess.EOEntity tagEntity)
entity
- the taggable entitytagEntity
- the tag entitypublic static com.webobjects.eoaccess.EOEntity registerTaggable(String entityName, Class<? extends ERTaggableEntity<?>> taggableEntity)
entityName
- the name of the entity to lookuptaggableEntity
- the taggable entity to associate with this taggablepublic static com.webobjects.eoaccess.EOEntity registerTaggable(String entityName)
entityName
- the name of the entity to lookuppublic static com.webobjects.eoaccess.EOEntity registerTaggable(com.webobjects.eoaccess.EOEntity entity)
entity
- the entity to registerpublic static com.webobjects.eoaccess.EOEntity registerTaggable(com.webobjects.eoaccess.EOEntity entity, String tagsRelationshipName)
entity
- the entity to registertagsRelationshipName
- the name of the flattened to-many tags relationshippublic static com.webobjects.eoaccess.EOEntity registerTaggable(com.webobjects.eoaccess.EOEntity entity, String tagsRelationshipName, com.webobjects.eoaccess.EOEntity tagEntity, 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(com.webobjects.eocontrol.EOEditingContext editingContext, 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(com.webobjects.eocontrol.EOEditingContext editingContext, String tagName)
editingContext
- the editing context to create withintagName
- the new tag namepublic ERTaggable<T> taggable(T eo)
eo
- the EO to wrappublic String tagsRelationshipName()
public com.webobjects.eoaccess.EORelationship tagsRelationship()
public static boolean isWhitespaceSeparator(String separator)
public NSArray<String> splitTagNames(Object tags)
tags
- the object that contains the tags to splitpublic NSArray<T> fetchTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext, Object tags)
editingContext
- the editing context to fetch intotags
- the tags to search (String to tokenize, NSArray<String>, etc)public NSArray<T> fetchTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext, ERTag.Inclusion inclusion, 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(com.webobjects.eocontrol.EOEditingContext editingContext, ERTag.Inclusion inclusion, int limit, 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(com.webobjects.eocontrol.EOEditingContext editingContext, ERTag.Inclusion inclusion, int limit, Object tags, com.webobjects.eocontrol.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(com.webobjects.eocontrol.EOEditingContext editingContext, ERTag.Inclusion inclusion, int limit, Object tags, com.webobjects.eocontrol.EOQualifier additionalQualifier, NSArray<com.webobjects.eocontrol.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(com.webobjects.eocontrol.EOEditingContext editingContext, Object tags)
editingContext
- the editing context to fetch intotags
- the tags to remove (String to tokenize, NSArray<String>, etc)public void replaceTags(com.webobjects.eocontrol.EOEditingContext editingContext, ERTag.Inclusion inclusion, Object oldTags, 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<String,Integer> tagCount(com.webobjects.eocontrol.EOEditingContext editingContext)
editingContext
- the editing context to fetch intopublic NSDictionary<String,Integer> tagCount(com.webobjects.eocontrol.EOEditingContext editingContext, com.webobjects.eocontrol.EOQualifier additionalQualifier)
editingContext
- the editing context to fetch intoadditionalQualifier
- an optional restrictingQualifierpublic NSDictionary<String,Integer> tagCount(com.webobjects.eocontrol.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<String,Integer> tagCount(com.webobjects.eocontrol.EOEditingContext editingContext, int limit, com.webobjects.eocontrol.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<String,Integer> tagCount(com.webobjects.eocontrol.EOEditingContext editingContext, com.webobjects.foundation.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<String,Integer> tagCount(com.webobjects.eocontrol.EOEditingContext editingContext, com.webobjects.foundation.NSSelector selector, int count, int limit, com.webobjects.eocontrol.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(com.webobjects.eocontrol.EOEditingContext editingContext, ERTag.Inclusion inclusion, 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<String> fetchRelatedTags(com.webobjects.eocontrol.EOEditingContext editingContext, Object tags)
tags
- the tags to search (String to tokenize, NSArray<String>, etc)public <U> NSDictionary<String,U> cloud(com.webobjects.eocontrol.EOEditingContext editingContext, NSArray<U> categoryList)
categoryList
- An array containing the categories to split the tagspublic <U> NSDictionary<String,U> cloud(NSDictionary<String,Integer> tagHash, NSArray<U> categoryList)
tagHash
- the tag dictionary returned from a tagCount callcategoryList
- An array containing the categories to split the tagspublic NSArray<String> fetchAllTags(com.webobjects.eocontrol.EOEditingContext editingContext)
editingContext
- the editing context to fetch intopublic NSArray<String> fetchTagsLike(com.webobjects.eocontrol.EOEditingContext editingContext, String startsWith)
startsWith
- the prefix to lookupeditingContext
- the editing context to fetch intoprotected com.webobjects.eocontrol.EOQualifier additionalTagCountQualifier()
Copyright © 2002 – 2020 Project Wonder.