Package com.google.enterprise.connector.otex.client

Examples of com.google.enterprise.connector.otex.client.ClientValue


      if (LOGGER.isLoggable(Level.FINEST)) {
        LOGGER.finest("ACE Info for id: " + objectId);
      }

      int ownerId = recArray.toInteger(insRow, "UserID");
      ClientValue ownerInfo =
          client.GetUserOrGroupByIDNoThrow(ownerId);
      ClientValue objectRightsInfo = client.GetObjectRights(objectId);
      for (int i = 0; i < objectRightsInfo.size(); i++) {
        int userId = objectRightsInfo.toInteger(i, "RightID");
        int userPermissions = objectRightsInfo.toInteger(i, "Permissions");
        boolean canRead = ((userPermissions & Client.PERM_SEECONTENTS)
            == Client.PERM_SEECONTENTS);

        if (canRead) {
          getPrincipals(userId, ownerInfo, userPrincipals, groupPrincipals);
View Full Code Here


            name = ownerInfo.toString("Name");
            namespace = getUserGroupNamespace(ownerInfo);
            userPrincipals.add(asPrincipalValue(name, namespace));
            break;
          case Client.RIGHT_GROUP:
            ClientValue userInfo = client.GetUserOrGroupByIDNoThrow(
                ownerInfo.toInteger("GroupID"));
            name = userInfo.toString("Name");
            namespace = getUserGroupNamespace(userInfo);
            groupPrincipals.add(asPrincipalValue(name, namespace));
            break;
          default:
            if (LOGGER.isLoggable(Level.FINEST)) {
              LOGGER.finest("Unexpected user or group id: " + userId);
            }
        }
      } else {
        ClientValue userInfo = client.GetUserOrGroupByIDNoThrow(userId);
        if (userInfo != null) {
          name = userInfo.toString("Name");
          namespace = getUserGroupNamespace(userInfo);
          if (!Strings.isNullOrEmpty(name)) {
            switch (userInfo.toInteger("Type")) {
              case Client.USER:
                userPrincipals.add(asPrincipalValue(name, namespace));
                break;
              case Client.GROUP:
                groupPrincipals.add(asPrincipalValue(name, namespace));
View Full Code Here

      }
    }

    private String getUserGroupNamespace(ClientValue userInfo)
        throws RepositoryException {
      ClientValue userData;
      String namespace;
      if (userInfo != null && userInfo.hasValue()) {
        userData = userInfo.toValue("UserData");
        if (userData != null && userData.hasValue()) {
          LOGGER.log(Level.FINEST,
              "ACE Info: UserData {0}", userData.toString());
          namespace = identityUtils.getNamespace(userData);
        } else {
          namespace = connector.getGoogleLocalNamespace();
        }
      } else {
View Full Code Here

  public void testGetLastAuditEvent() throws RepositoryException {
    Session sess = conn.login();
    LivelinkTraversalManager ltm =
        (LivelinkTraversalManager) sess.getTraversalManager();

    ClientValue results = ltm.getLastAuditEvent();
    assertEquals(1, results.size());
    // toLong works with H2 (we check the type in the production code).
    assertEquals(10042L, results.toLong(0, "EventID"));
    // The fractional seconds are OK, because LivelinkDateFormat.parse
    // handles multiple variations in the timestamp strings.
    assertEquals("2013-04-24 08:00:00.0", results.toString(0, "AuditDate"));
  }
View Full Code Here

      int firstCandidateId, Date lastCandidateDate, int lastCandidateId,
      String checkpoint) throws RepositoryException {
    Session sess = conn.login();
    LivelinkTraversalManager ltm =
        (LivelinkTraversalManager) sess.getTraversalManager();
    ClientValue candidates = new MockClientValue(
        new String[] { "ModifyDate", "DataID" },
        new Object[][] { { firstCandidateDate, firstCandidateId },
                         { lastCandidateDate, lastCandidateId } });
    ltm.checkCandidatesTimeWarp(candidates, new Checkpoint(checkpoint));
  }
View Full Code Here

    LivelinkTraversalManager ltm =
        (LivelinkTraversalManager) sess.getTraversalManager();

    // Not sure why, but 6 and 2000 are not in the WebNodes data.
    // 2901 is, but it's an excluded volume type.
    ClientValue results = ltm.getResults("6,24,42,2000,2901", new Date());
    assertEquals(2, results.size());
  }
View Full Code Here

  private void testSqlWhereCondition(boolean useDTreeAncestors,
      String sqlWhereCondition, int expectedRows) throws Exception {
    LivelinkTraversalManager ltm =
        getObjectUnderTest(useDTreeAncestors, sqlWhereCondition);
    ClientValue results = ltm.getResults("24,42", new Date());

    if (expectedRows == 0) {
      assertNullOrEmpty(results);
    } else {     
      assertEquals(expectedRows, results.size());
    }
  }
View Full Code Here

     * A distinct value is returned on each call.
     */
    @Override
    public ClientValue GetCookieInfo() throws RepositoryException {
      String value = "llcookie value goes here" + cookieCount.getAndIncrement();
      ClientValue llcookie = new MockClientValue(
          new String[] { "Name", "Value" },
          new Object[] { "LLCookie", value });
      return new MockClientValue(new Object[] { llcookie });
    }
View Full Code Here

    public ClientValue GetUserOrGroupByIDNoThrow(int id)
            throws RepositoryException {
      String query = "ID=" + id;
      String view = "KUAF";
      String[] columns = new String[] {"Name", "Type", "GroupID", "UserData"};
      ClientValue user = executeQuery(query, view, columns);

      if (user.size() > 0) {
        // Need to return a Assoc LLValue, whereas the above is a table.
        String name = user.toString(0, "Name");
        int type = user.toInteger(0, "Type");
        int groupId = user.toInteger(0, "GroupID");
        ClientValue userData = toAssoc(user.toString(0, "UserData"));
        return new MockClientValue(
            new String[] {"Name", "Type", "GroupID", "UserData"},
            new Object[] {name, type, groupId, userData});
      } else {
        return null;
View Full Code Here

TOP

Related Classes of com.google.enterprise.connector.otex.client.ClientValue

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.