|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objecter.taggable.ERTaggableEntity<T>
T
- the java class of the entity that this ERTaggableEntity is associated withpublic class ERTaggableEntity<T extends ERXGenericRecord>
ERTaggableEntity provides entity-level tag management and fetching methods.
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
Field Summary | |
---|---|
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. |
Constructor Summary | |
---|---|
protected |
ERTaggableEntity(com.webobjects.eoaccess.EOEntity entity)
Constructs an ERTaggableEntity. |
Method Summary | ||
---|---|---|
protected com.webobjects.eocontrol.EOQualifier |
additionalTagCountQualifier()
|
|
|
cloud(com.webobjects.eocontrol.EOEditingContext editingContext,
com.webobjects.foundation.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. |
|
|
cloud(com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Integer> tagHash,
com.webobjects.foundation.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,
java.lang.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,
java.lang.String tagName)
Creates a tag with the given name. |
|
boolean |
equals(java.lang.Object obj)
|
|
static com.webobjects.foundation.NSDictionary<com.webobjects.eoaccess.EOEntity,com.webobjects.foundation.NSArray<? extends ERXGenericRecord>> |
fetchAllTaggedWith(com.webobjects.eocontrol.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 com.webobjects.foundation.NSDictionary<com.webobjects.eoaccess.EOEntity,com.webobjects.foundation.NSArray<? extends ERXGenericRecord>> |
fetchAllTaggedWith(com.webobjects.eocontrol.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 com.webobjects.foundation.NSDictionary<com.webobjects.eoaccess.EOEntity,com.webobjects.foundation.NSArray<? extends ERXGenericRecord>> |
fetchAllTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext,
java.lang.Object tags)
Fetches all the EOs of all taggable entities that are associated with all of the given tags (unlimited). |
|
com.webobjects.foundation.NSArray<java.lang.String> |
fetchAllTags(com.webobjects.eocontrol.EOEditingContext editingContext)
Returns an array of all of the available tags in the system. |
|
com.webobjects.foundation.NSArray<java.lang.String> |
fetchRelatedTags(com.webobjects.eocontrol.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. |
|
com.webobjects.foundation.NSArray<T> |
fetchTaggedWith(com.webobjects.eocontrol.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. |
|
com.webobjects.foundation.NSArray<T> |
fetchTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext,
ERTag.Inclusion inclusion,
int limit,
java.lang.Object tags,
com.webobjects.eocontrol.EOQualifier additionalQualifier)
Fetches the list of objects of this entity type that are tagged with the given tags. |
|
com.webobjects.foundation.NSArray<T> |
fetchTaggedWith(com.webobjects.eocontrol.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. |
|
com.webobjects.foundation.NSArray<T> |
fetchTaggedWith(com.webobjects.eocontrol.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(com.webobjects.eocontrol.EOEditingContext editingContext,
java.lang.String tagName,
boolean createIfMissing)
Fetches the tag with the given name. |
|
com.webobjects.foundation.NSArray<java.lang.String> |
fetchTagsLike(com.webobjects.eocontrol.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(com.webobjects.eoaccess.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 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,
java.lang.String tagsRelationshipName)
Registers the given entity as taggable. |
|
static com.webobjects.eoaccess.EOEntity |
registerTaggable(com.webobjects.eoaccess.EOEntity entity,
java.lang.String tagsRelationshipName,
com.webobjects.eoaccess.EOEntity tagEntity,
java.lang.Class<? extends ERTaggableEntity<?>> taggableEntity)
Registers the given entity as taggable. |
|
static com.webobjects.eoaccess.EOEntity |
registerTaggable(java.lang.String entityName)
Registers the given entity name in the default model group as taggable. |
|
static com.webobjects.eoaccess.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(com.webobjects.eocontrol.EOEditingContext editingContext,
java.lang.Object tags)
Remove all of the tags from instances of this entity type. |
|
void |
replaceTags(com.webobjects.eocontrol.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. |
|
com.webobjects.foundation.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. |
|
com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.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, ... |
|
com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.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, ... |
|
com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.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, ... |
|
com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.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, ... |
|
com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.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, ... |
|
com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.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 com.webobjects.foundation.NSArray<com.webobjects.eoaccess.EOEntity> |
taggableEntities()
Returns an array of taggable entities. |
|
static
|
taggableEntity(com.webobjects.eoaccess.EOEntity entity)
Constructs an ERTaggableEntity. |
|
static
|
taggableEntity(java.lang.String entityName)
Constructs an ERTaggableEntity. |
|
static
|
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. |
|
java.lang.String |
tagsRelationshipName()
Returns the name of the tags relationship for this entity. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
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
Constructor Detail |
---|
protected ERTaggableEntity(com.webobjects.eoaccess.EOEntity entity)
entity
- the entity to tagMethod Detail |
---|
public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public 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(com.webobjects.eoaccess.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 EO
public static com.webobjects.foundation.NSDictionary<com.webobjects.eoaccess.EOEntity,com.webobjects.foundation.NSArray<? extends ERXGenericRecord>> fetchAllTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext, java.lang.Object tags)
editingContext
- the editing context to fetch intotags
- the tags to search (String to tokenize, NSArraypublic static com.webobjects.foundation.NSDictionary<com.webobjects.eoaccess.EOEntity,com.webobjects.foundation.NSArray<? extends ERXGenericRecord>> fetchAllTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext, ERTag.Inclusion inclusion, java.lang.Object tags)
editingContext
- the editing context to fetch intotags
- the tags to search (String to tokenize, NSArrayinclusion
- find matches for ANY tags or ALL tags provided
public static com.webobjects.foundation.NSDictionary<com.webobjects.eoaccess.EOEntity,com.webobjects.foundation.NSArray<? extends ERXGenericRecord>> fetchAllTaggedWith(com.webobjects.eocontrol.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, NSArrayinclusion
- 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 check
public static com.webobjects.foundation.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 entity
public static com.webobjects.eoaccess.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 taggable
public static com.webobjects.eoaccess.EOEntity registerTaggable(java.lang.String entityName)
entityName
- the name of the entity to lookup
public static com.webobjects.eoaccess.EOEntity registerTaggable(com.webobjects.eoaccess.EOEntity entity)
entity
- the entity to register
public static com.webobjects.eoaccess.EOEntity registerTaggable(com.webobjects.eoaccess.EOEntity entity, java.lang.String tagsRelationshipName)
entity
- the entity to registertagsRelationshipName
- the name of the flattened to-many tags relationship
public static com.webobjects.eoaccess.EOEntity registerTaggable(com.webobjects.eoaccess.EOEntity entity, java.lang.String tagsRelationshipName, com.webobjects.eoaccess.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 taggable
public ERTagNormalizer normalizer()
public void setNormalizer(ERTagNormalizer normalizer)
normalizer
- the tag normalizer for this entitypublic ERTag fetchTagNamed(com.webobjects.eocontrol.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 created
public ERTag createTagNamed(com.webobjects.eocontrol.EOEditingContext editingContext, java.lang.String tagName)
editingContext
- the editing context to create withintagName
- the new tag name
public ERTaggable<T> taggable(T eo)
eo
- the EO to wrap
public java.lang.String tagsRelationshipName()
public com.webobjects.eoaccess.EORelationship tagsRelationship()
public static boolean isWhitespaceSeparator(java.lang.String separator)
public com.webobjects.foundation.NSArray<java.lang.String> splitTagNames(java.lang.Object tags)
tags
- the object that contains the tags to split
public com.webobjects.foundation.NSArray<T> fetchTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext, java.lang.Object tags)
editingContext
- the editing context to fetch intotags
- the tags to search (String to tokenize, NSArraypublic com.webobjects.foundation.NSArray<T> fetchTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext, ERTag.Inclusion inclusion, java.lang.Object tags)
editingContext
- the editing context to fetch intotags
- the tags to search (String to tokenize, NSArrayinclusion
- find matches for ANY tags or ALL tags provided
public com.webobjects.foundation.NSArray<T> fetchTaggedWith(com.webobjects.eocontrol.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, NSArrayinclusion
- find matches for ANY tags or ALL tags providedlimit
- limit the number of results to be returned (-1 for unlimited)
public com.webobjects.foundation.NSArray<T> fetchTaggedWith(com.webobjects.eocontrol.EOEditingContext editingContext, ERTag.Inclusion inclusion, int limit, java.lang.Object tags, com.webobjects.eocontrol.EOQualifier additionalQualifier)
editingContext
- the editing context to fetch intotags
- the tags to search (String to tokenize, NSArrayinclusion
- 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 in
public void removeTags(com.webobjects.eocontrol.EOEditingContext editingContext, java.lang.Object tags)
editingContext
- the editing context to fetch intotags
- the tags to remove (String to tokenize, NSArraypublic void replaceTags(com.webobjects.eocontrol.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, NSArraynewTags
- 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 com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Integer> tagCount(com.webobjects.eocontrol.EOEditingContext editingContext)
editingContext
- the editing context to fetch into
public com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Integer> tagCount(com.webobjects.eocontrol.EOEditingContext editingContext, com.webobjects.eocontrol.EOQualifier additionalQualifier)
editingContext
- the editing context to fetch intoadditionalQualifier
- an optional restrictingQualifier
public com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.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 com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.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 restrictingQualifier
public com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.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 com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.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, java.lang.Object tags)
editingContext
- the editing context to fetch intotags
- the tags to search (String to tokenize, NSArrayinclusion
- find matches for ANY tags or ALL tags provided
public com.webobjects.foundation.NSArray<java.lang.String> fetchRelatedTags(com.webobjects.eocontrol.EOEditingContext editingContext, java.lang.Object tags)
tags
- the tags to search (String to tokenize, NSArraypublic <U> com.webobjects.foundation.NSDictionary<java.lang.String,U> cloud(com.webobjects.eocontrol.EOEditingContext editingContext, com.webobjects.foundation.NSArray<U> categoryList)
categoryList
- An array containing the categories to split the tags
public <U> com.webobjects.foundation.NSDictionary<java.lang.String,U> cloud(com.webobjects.foundation.NSDictionary<java.lang.String,java.lang.Integer> tagHash, com.webobjects.foundation.NSArray<U> categoryList)
tagHash
- the tag dictionary returned from a tagCount callcategoryList
- An array containing the categories to split the tags
public com.webobjects.foundation.NSArray<java.lang.String> fetchAllTags(com.webobjects.eocontrol.EOEditingContext editingContext)
editingContext
- the editing context to fetch into
public com.webobjects.foundation.NSArray<java.lang.String> fetchTagsLike(com.webobjects.eocontrol.EOEditingContext editingContext, java.lang.String startsWith)
startsWith
- the prefix to lookupeditingContext
- the editing context to fetch into
protected com.webobjects.eocontrol.EOQualifier additionalTagCountQualifier()
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |