Package ch.entwine.weblounge.common.impl.security

Examples of ch.entwine.weblounge.common.impl.security.UserImpl


    // Read the configuration value for the handler class
    String handlerClass = (String) ctx.get(OPT_HANDLER_CLASS);
    if (StringUtils.isBlank(handlerClass))
      throw new JobException(this, "Configuration option '" + OPT_HANDLER_CLASS + "' is missing from the job configuration");

    UserImpl harvesterUser = new UserImpl(name, site.getIdentifier(), "Harvester");

    RecordHandler handler;
    try {
      Class<? extends AbstractWebloungeRecordHandler> c = (Class<? extends AbstractWebloungeRecordHandler>) Thread.currentThread().getContextClassLoader().loadClass(handlerClass);
      Class<?> paramTypes[] = new Class[8];
View Full Code Here


  public String toXml(Language language) {
    Modification modification = modifications.get(language);
    StringBuffer b = new StringBuffer();
    if (modification != null) {
      b.append("<modified>");
      b.append((new UserImpl(modification.getUser())).toXml());
      b.append("<date>");
      b.append(WebloungeDateFormat.formatStatic(modification.getDate()));
      b.append("</date>");
      b.append("</modified>");
    }
View Full Code Here

    // user
    else if ("user".equals(raw)) {
      String login = (String) clipboard.remove("user");
      String realm = (String) clipboard.remove("realm");
      String name = getCharacters();
      User user = new UserImpl(login, realm, name);
      clipboard.put("user", user);
    }

    // date
    else if ("date".equals(raw)) {
View Full Code Here

      throw new IllegalStateException("Missing stage definition in template '" + template.getIdentifier() + "'");

    // Standard fields
    page.setTitle(title, language);
    page.setTemplate(template.getIdentifier());
    page.setPublished(new UserImpl(site.getAdministrator()), message.getReceivedDate(), null);

    // TODO: Translate e-mail "from" into site user and throw if no such
    // user can be found
    page.setCreated(site.getAdministrator(), message.getSentDate());
View Full Code Here

   *
   * @see ch.entwine.weblounge.common.content.SearchQuery#withLockOwner()
   */
  public SearchQuery withLockOwner() {
    clearExpectations();
    this.lockOwner = new UserImpl(ANY_USER);
    return this;
  }
View Full Code Here

    // creator, modifier
    if ("user".equals(raw)) {
      String login = (String) clipboard.remove("user");
      String realm = (String) clipboard.remove("realm");
      String name = getCharacters();
      User user = new UserImpl(login, realm, name);
      clipboard.put("user", user);
    }

    // date
    else if ("date".equals(raw)) {
View Full Code Here

    // Add the pages to the index
    repository.put(pageLive);
    repository.put(pageWork);

    // Create the users
    User editor1 = new UserImpl("editor1");
    User editor2 = new UserImpl("editor2");

    // Make sure resources are unlocked initially
    for (ResourceURI uri : repository.getVersions(uriLive)) {
      assertFalse(repository.isLocked(uri));
      assertFalse(repository.get(uri).isLocked());
View Full Code Here

    // Add the pages to the index
    repository.put(pageLive);
    repository.put(pageWork);

    // Create the users
    User editor1 = new UserImpl("editor1");

    // Lock the page (using live uri)
    repository.lock(uriLive, editor1);

    // Unlock the page
View Full Code Here

    assertEquals(LIVE, ((ResourceSearchResultItem) result.getItems()[0]).getResourceURI().getVersion());
    assertEquals(WORK, ((ResourceSearchResultItem) result.getItems()[1]).getResourceURI().getVersion());
    assertEquals(LIVE, ((ResourceSearchResultItem) result.getItems()[2]).getResourceURI().getVersion());

    // Lock the page, which will trigger a call to index.update()
    repository.lock(liveAndWorkWorkURI, new UserImpl("user"));
    assertEquals(2, repository.find(workOnlyQuery).getDocumentCount());
    assertEquals(2, repository.find(liveOnlyQuery).getDocumentCount());
    result = repository.find(workPreferredQuery);
    assertEquals(3, result.getDocumentCount());
    assertEquals(LIVE, ((ResourceSearchResultItem) result.getItems()[0]).getResourceURI().getVersion());
View Full Code Here

  public void setUp() {
    site = EasyMock.createNiceMock(Site.class);
    EasyMock.expect(site.getIdentifier()).andReturn("testsite").anyTimes();
    EasyMock.replay(site);

    User john = new UserImpl(login);
    john.addPublicCredentials(roleA);
    john.addPublicCredentials(roleB);

    User johnAlterEgo = new UserImpl(login);
    johnAlterEgo.addPrivateCredentials(password);
    johnAlterEgo.addPublicCredentials(roleB);
    johnAlterEgo.addPublicCredentials(roleC);

    SiteDirectory directoryA = EasyMock.createNiceMock(SiteDirectory.class);
    EasyMock.expect(directoryA.getIdentifier()).andReturn(site.getIdentifier()).anyTimes();
    EasyMock.expect(directoryA.loadUser((String) EasyMock.anyObject(), (Site) EasyMock.anyObject())).andReturn(john).anyTimes();
    EasyMock.replay(directoryA);
View Full Code Here

TOP

Related Classes of ch.entwine.weblounge.common.impl.security.UserImpl

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.