• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: TagNormalizer ?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: TagNormalizer ?


  • Subject: Re: TagNormalizer ?
  • From: James Cicenia <email@hidden>
  • Date: Fri, 19 Oct 2012 14:53:32 -0500

Looks like:

  public static EOEntity registerTaggable(EOEntity entity, String tagsRelationshipName) {
    EOEntity tagEntity = entity.model().modelGroup().entityNamed(ERTag.ENTITY_NAME);
    if (tagEntity == null) {
      throw new IllegalArgumentException("There is no entity named '" + ERTag.ENTITY_NAME + "' in this model group.");
    }
======>>>    return ERTaggableEntity.registerTaggable(entity, tagsRelationshipName, tagEntity, null);
  }

looks like that null is the culprit.

which calls:

  public static EOEntity registerTaggable(EOEntity entity, String tagsRelationshipName, EOEntity tagEntity, Class<? extends ERTaggableEntity<?>> taggableEntity) {

which contains:

    if (taggableEntity != null) {
      ERTaggableEntity.setTaggableEntityForEntityNamed(taggableEntity, entity.name());
    }


Advice?

James



On Oct 19, 2012, at 1:32 PM, Mike Schrag <email@hidden> wrote:

I'm guessing somehow your taggable entity isn't getting registered … I would put some debug into registerTaggable to see if anything calls that for your entity, and if not, probably taggableEntity() should internally call setTaggableEntity in the if-block where it lazily makes an entity so you cache the one that it creates. If you didn't have an instance registered earlier, that would always make a new one … You should be able to verify where exactly you're getting a new one.

ms

On Oct 19, 2012, at 2:17 PM, James Cicenia <email@hidden> wrote:

Tracing it through to :

private void addNormalizedTags(NSMutableSet<String> set, Object[] tags) {
    for (Object objTag : tags) {
      if (objTag instanceof String) {
        String strTag = (String) objTag;
        String normalizedTag = _normalizer.normalize(strTag);

The _normalizer at this point is ALWAYS ERDefaultTagNormalizer

Thanks
James


On Oct 16, 2012, at 9:34 AM, Mike Schrag <email@hidden> wrote:

add some debug to taggableentity's splitTagNames method and see if it's getting in there … it seems like it should be. you should be able to trace through addTagNamed pretty easily.

did you verify that aTag.name() is actually case-preserved on the way in? maybe something already lowercased it by the time it got there?

On Oct 16, 2012, at 10:22 AM, James Cicenia <email@hidden> wrote:

Hmmm,

I thought that is what I was doing:

    public WOActionResults droppedTagOnCircle(){
    theTagCircle.taggable().taggableEntity().setNormalizer(new TOSTagNormalizer());
    theTagCircle.taggable().addTagNamed(aTag.name());
    theTagCircle.editingContext().saveChanges();
    
    return null;
    }

My custom normalizer didn't seem to get called.

Regards
James
Do not post admin requests to the list. They will be ignored. Webobjects-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: TagNormalizer ?
      • From: Mike Schrag <email@hidden>
    • Re: TagNormalizer ?
      • From: Mike Schrag <email@hidden>
References: 
 >TagNormalizer ? (From: James Cicenia <email@hidden>)
 >Re: TagNormalizer ? (From: Mike Schrag <email@hidden>)
 >Re: TagNormalizer ? (From: James Cicenia <email@hidden>)
 >Re: TagNormalizer ? (From: Mike Schrag <email@hidden>)
 >Re: TagNormalizer ? (From: James Cicenia <email@hidden>)
 >Re: TagNormalizer ? (From: Mike Schrag <email@hidden>)

  • Prev by Date: Re: WOWODC 2013?
  • Next by Date: Re: TagNormalizer ?
  • Previous by thread: Re: TagNormalizer ?
  • Next by thread: Re: TagNormalizer ?
  • Index(es):
    • Date
    • Thread