OpenNTF/SocialSDK

retrieve tags on a user profile returns no tags at all

Closed this issue · 3 comments

As per this question in stackoverflow, we don't get results when we want to retrieve tags for a userprofile.

It is this call profileService.getTags(userEmail, params) that return an empty list.

Most likely this is caused by the wrong xPath expression, I noticed that when I replace line 53 in (datahandlers)AtomEntityList with this line

List nodeEntries = getDataHandler().getEntries(ConnectionsFeedXpath.Category);

We do get tags, but this is too high a place to fix this, I hope you can find a better solution

http://stackoverflow.com/questions/32652235/retrieve-tags-from-user-profile-in-ibm-connections-using-social-business-toolkit

I think line 934 in the ProfileService.java is a better a place.
Override the createEntityList method, like below

/**
* Factory method to instantiate a FeedHandler for Tags
* @return IFeedHandler
*/
public IFeedHandler getTagFeedHandler() {
return new AtomFeedHandler(this) {
@OverRide
protected Tag entityInstance(BaseService service, Node node, XPathExpression xpath) {
return new Tag(service, node, nameSpaceCtx, xpath);
}

        @Override
        public EntityList<Tag> createEntityList(Response dataHolder) {

            return new CategoryEntityList<Tag>(dataHolder, this);
        }
    };
}

it's actually further down. I'll get it assigned for a development iteration.

Fixed it. The XPath expressions were not configured correctly, and returned the wrong entity list. It'll be in the next build.