|
Project Wonder 5.0 | |||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||||
See:
Description
| Interface Summary | |
|---|---|
| ERTagNormalizer | ERTagNormalizer provides an interface for processing tags to clean them up prior to persisting them. |
| Class Summary | |
|---|---|
| ERDefaultTagNormalizer | ERDefaultTagNormalizer trims and lowercases all tags. |
| ERTaggable<T extends ERXGenericRecord> | ERTaggable provides a wrapper around a taggable EO, extending it with tagging-related methods. |
| ERTaggableEntity<T extends ERXGenericRecord> | ERTaggableEntity provides entity-level tag management and fetching methods. |
| ERTaggablePrincipal | ERTaggable Framework Principal |
ERTaggable is a fairly direct port of the acts_as_taggable Rails mixin to EOF, the framework provides a very easy method of integrating delicious-style tagging support into arbitrary entities in your applications.
Lets take the example where your model "MyModel" has a "Person" entity that you want to support tagging on.
public class MyModel0 extends ERTaggableEntity0 {
public MyModel0() {
super(Person.ENTITY_NAME);
}
}
ERTaggableEntity.registerTaggable(Person.ENTITY_NAME);
public ERTaggable<Person> taggable() {
return ERTaggable.taggable(this);
}
public static ERTaggableEntity<Person> taggableEntity() {
return ERTaggableEntity.taggableEntity(Person.ENTITY_NAME);
}
Person mike = Person.createPerson(editingContext, "Mike Schrag");
ERTaggable<Person> taggableMike = mike.taggable();
taggableMike.addTags("mike employee important");
NSArray<Person> matchingPeople = Person.taggableEntity().fetchTaggedWith(editingContext, "employee");
NSDictionary<EOEntity, NSArray<? extends ERXGenericRecord>> matchingItems = ERTaggableEntity.fetchAllTaggedWith(editingContext, "mike");
If you choose to deviate from the "magical" route described above, you can provide several override hooks:
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
| PREV PACKAGE NEXT PACKAGE | FRAMES NO FRAMES | |||||||||||