Examples of KeywordWeight


Examples of es.udc.tfg.journals.model.keywordweight.KeywordWeight

  @Before
  public void setUp() throws Exception {
    journalService.createJournal(new Journal("", null, null, null, null));
    keywordService.createKeywordWeightJournal(new KeywordWeightJournal(
        new KeywordWeight(10, new Keyword("etiqueta")), journalService
            .findJournalByName("")));
  }
View Full Code Here

Examples of es.udc.tfg.journals.model.keywordweight.KeywordWeight

        50, 20);
    journalService.createJournal(j);

    Keyword k = new Keyword("etiqueta test");

    KeywordWeight kw = new KeywordWeight(0, user, k);

    KeywordWeightJournal kwj = new KeywordWeightJournal(kw, j);

    keywordService.createKeywordWeightJournal(kwj);
View Full Code Here

Examples of es.udc.tfg.journals.model.keywordweight.KeywordWeight

    Keyword k1 = new Keyword("etiqueta test comun");
    Keyword k2 = new Keyword("etiqueta test 2 journal");
    Keyword k3 = new Keyword("etiqueta 3 primera");

    KeywordWeight kw1 = new KeywordWeight(0, user, k1);
    KeywordWeight kw2 = new KeywordWeight(100, user, k2);
    KeywordWeight kw3 = new KeywordWeight(50, user, k3);

    KeywordWeightJournal kwj1 = new KeywordWeightJournal(kw1, j1);
    KeywordWeightJournal kwj2 = new KeywordWeightJournal(kw1, j2);
    KeywordWeightJournal kwj3 = new KeywordWeightJournal(kw2, j2);
    KeywordWeightJournal kwj4 = new KeywordWeightJournal(kw3, j1);
View Full Code Here

Examples of es.udc.tfg.journals.model.keywordweight.KeywordWeight

    journalService.createJournal(j1);

    Keyword k1 = new Keyword("etiqueta test comun");
    Keyword k2 = new Keyword("etiqueta test 2 journal");

    KeywordWeight kw1 = new KeywordWeight(0, user, k1);
    KeywordWeight kw2 = new KeywordWeight(100, user, k2);
    KeywordWeight kw3 = new KeywordWeight(50, user, k1);

    KeywordWeightJournal kwj1 = new KeywordWeightJournal(kw1, j1);
    KeywordWeightJournal kwj2 = new KeywordWeightJournal(kw2, j1);
    KeywordWeightJournal kwj3 = new KeywordWeightJournal(kw3, j1);
View Full Code Here

Examples of es.udc.tfg.journals.model.keywordweight.KeywordWeight

    // Revista null
    Journal jnull = new Journal("", null, null, null, null);
    journalService.createJournal(jnull);
    keywordService.createKeywordWeightJournal(new KeywordWeightJournal(
        new KeywordWeight(1, user1, new Keyword("aditional keyword")),
        jnull));
  }
View Full Code Here

Examples of es.udc.tfg.journals.model.keywordweight.KeywordWeight

    for (String key : keys) {
      key = key.toLowerCase().trim();
      try {
        keyword = keywordDao.findByName(key);
        // If the keyword already exists is modified
        KeywordWeight kw = keywordWeightsMap
            .get(keyword.getKeywordId());
        if (kw == null) {
          throw new InstanceNotFoundException("", null);
        }

        if (kw.getUsers().contains(user)) {
          // TODO: Sumar siempre? (si aparece en domain y en subdomain
          // serian 50.000
          if (!user.admin()) {
            throw new DuplicateInstanceException(key,
                KeywordWeight.class.getName());
          }
        }
        weight += kw.getWeight();
        kw.setWeight(weight);
        kw.addUser(user);
      } catch (InstanceNotFoundException e) {
        keyword = new Keyword(key);
        KeywordWeight kw = new KeywordWeight(weight, user, keyword);
        KeywordWeightJournal kwj = new KeywordWeightJournal(kw, journal);
        createKeywordWeightJournal(kwj);
      }
    }
  }
View Full Code Here

Examples of es.udc.tfg.journals.model.keywordweight.KeywordWeight

        keyword = keywordsMap.get(key);
        if (keyword == null) {
          throw new InstanceNotFoundException("", null);
        }
        // If the keyword already exists is modified
        KeywordWeight kw = keywordWeightsMap
            .get(keyword.getKeywordId());
        if (kw == null) {
          throw new InstanceNotFoundException("", null);
        }

        if (kw.getUsers().contains(user)) {
          if (!user.admin()) {
            throw new DuplicateInstanceException(key,
                KeywordWeight.class.getName());
          }
        }
        weight = entry.getValue();
        weight += kw.getWeight();
        kw.setWeight(weight);
        kw.addUser(user);
      } catch (InstanceNotFoundException e) {
        keyword = new Keyword(key);
        weight = entry.getValue();
        KeywordWeight kw = new KeywordWeight(weight, user, keyword);
        KeywordWeightJournal kwj = new KeywordWeightJournal(kw, journal);
        createKeywordWeightJournal(kwj);
      }
    }
  }
View Full Code Here

Examples of es.udc.tfg.journals.model.keywordweight.KeywordWeight

  }

  public void deleteKeywordOfUser(long kwId, long userId)
      throws InstanceNotFoundException {
    User user = userDao.find(userId);
    KeywordWeight kw = keywordWeightDao.find(kwId);
    List<KeywordWeight> kwlist = keywordWeightDao
        .findKeywordsWeightByUserAndKeyword(userId, kw.getKeyword()
            .getKeywordId());
    for (KeywordWeight keywordWeight : kwlist) {
      keywordWeight.removeUser(user);
    }
  }
View Full Code Here

Examples of es.udc.tfg.journals.model.keywordweight.KeywordWeight

      return keywordwlist.get(Integer.parseInt(clientValue));
    }
  }

  Object onAddRow() {
    KeywordWeight kw;
    kw = new KeywordWeight(1, new Keyword());

    keywordwlist.add(kw);
    return kw;
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.