Package com.gnizr.db.dao

Examples of com.gnizr.db.dao.UserTag


      aList = tagAssertionDao.findTagAssertion(user, null,
          skosBroaderPrpt, subject);
      addUserTagSubjectToList(aList, tempResult, sourceTagId);

      for (Iterator<UserTag> it = tempResult.iterator(); it.hasNext();) {
        UserTag next2seek = it.next();
        if (result.contains(next2seek) == false) {
          result.add(next2seek);
          seekNarrower(user, next2seek, result, sourceTagId);
        }
      }
View Full Code Here


  private void addUserTagObjectToList(List<TagAssertion> tagAssertions,
      List<UserTag> userTags, int ignoreTagId) {
    for (Iterator<TagAssertion> it = tagAssertions.iterator(); it.hasNext();) {
      TagAssertion ta = it.next();
      UserTag ut = ta.getObject();
      if (ut != null) {
        if (ut.getId() != ignoreTagId && userTags.contains(ut) == false) {
          userTags.add(ut);
        }
      } else {
        logger
            .error("addUserTagObjectToList() finds TagAssertion.getObject() to return NULL.");
View Full Code Here

  private void addUserTagSubjectToList(List<TagAssertion> tagAssertions,
      List<UserTag> userTags, int ignoreTagId) {
    for (Iterator<TagAssertion> it = tagAssertions.iterator(); it.hasNext();) {
      TagAssertion ta = it.next();
      UserTag ut = ta.getSubject();
      if (ut != null) {
        if (ut.getId() != ignoreTagId && userTags.contains(ut) == false) {
          userTags.add(ut);
        }
      } else {
        logger
            .error("addUserTagSubjectToList() finds TagAssertion.getSubject() to return NULL.");
View Full Code Here

      mf = minFreq;
    }
    List<Tag> tags = new ArrayList<Tag>();
    Tag tagObj = GnizrDaoUtil.getTag(tagDao, tag);
    if (tagObj != null && gnizrUser != null) {
      UserTag userTagObj = GnizrDaoUtil.getUserTag(tagDao, gnizrUser,
          tagObj);
      if (userTagObj != null) {
        List<UserTag> relTags = findSKOSRelated(gnizrUser, userTagObj);
        for (UserTag ut : relTags) {
          if (ut.getTag().getCount() >= mf) {
View Full Code Here

      mf = minFreq;
    }
    List<Tag> tags = new ArrayList<Tag>();
    Tag tagObj = GnizrDaoUtil.getTag(tagDao, tag);
    if (tagObj != null && gnizrUser != null) {
      UserTag userTagObj = GnizrDaoUtil.getUserTag(tagDao, gnizrUser,
          tagObj);
      if (userTagObj != null) {
        List<UserTag> relTags = findSKOSNarrower(gnizrUser, userTagObj);
        for (UserTag ut : relTags) {
          if (ut.getTag().getCount() >= mf) {
View Full Code Here

      mf = minFreq;
    }
    List<Tag> tags = new ArrayList<Tag>();
    Tag tagObj = GnizrDaoUtil.getTag(tagDao, tag);
    if (tagObj != null && gnizrUser != null) {
      UserTag userTagObj = GnizrDaoUtil.getUserTag(tagDao, gnizrUser,
          tagObj);
      if (userTagObj != null) {
        List<UserTag> relTags = findSKOSBroader(gnizrUser, userTagObj);
        for (UserTag ut : relTags) {
          if (ut.getTag().getCount() >= mf) {
View Full Code Here

    assertFalse(cloud.isEmpty());
    assertEquals(3,cloud.size());
   
    cloud = tagCloud.getFreqCloud(user,5);
    assertEquals(1,cloud.size());
    UserTag ut = cloud.get(0);
    assertEquals("for:fjdksjfl",ut.getTag().getLabel());
    assertEquals((21), ut.getTag().getCount());
    assertEquals("hchen1",ut.getUser().getUsername());
    assertEquals((6),ut.getCount());
  }
View Full Code Here

    int id = manager.addTag(t);
    assertTrue((id > 0));
  }
 
  public void testCreateUserTag() throws Exception{
    UserTag ut = manager.createUserTag(new User(1),"javadevelopment");
    assertNotNull(ut);
    assertEquals("javadevelopment",ut.getTag().getLabel());

    UserTag ut2 = manager.createUserTag(new User(1),"javadevelopment");
    assertNotNull(ut2);
    assertEquals("javadevelopment",ut2.getTag().getLabel());
    assertEquals(ut.getId(),ut2.getId());
  }
View Full Code Here

    assertNotNull(asrts.get(1).getSubject().getTag().getLabel());
  }
 
  public void testDeleteTagAssertion() throws Exception{
    User user = new User("hchen1");
    UserTag subjTag = new UserTag("hchen1","webwork");
    TagProperty prpt = new TagProperty(1);
    UserTag objTag = new UserTag("hchen1","wii");
    TagAssertion asrt = new TagAssertion(subjTag,prpt,objTag,user);
   
    List<TagAssertion> asrts = manager.listTagAssertion(user);
    assertEquals(4,asrts.size());
   
View Full Code Here

    assertTrue(manager.isGeoTagTypeAssertion(assertion));
  }
 
  public void testAddTagAssertion() throws Exception{
    User user = new User("hchen1");
    UserTag subjTag = new UserTag("hchen1","videogame");
    TagProperty prpt = new TagProperty(1);
    UserTag objTag = new UserTag("hchen1","wii");
    TagAssertion asrt = new TagAssertion(subjTag,prpt,objTag,user);
   
    // we shouldnt be able to delete a non-existing tag assertion
    boolean caughtException = false;
    try{
View Full Code Here

TOP

Related Classes of com.gnizr.db.dao.UserTag

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.