Examples of ClientValue


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

    // a start checkpoint that skips over any ancient history in
    // the LL database.
    if (!Strings.isNullOrEmpty(includedLocationNodes)) {
      String ancestorNodes =
          Genealogist.getAncestorNodes(includedLocationNodes);
      ClientValue results = sqlQueries.execute(client, null,
          "LivelinkConnector.validateIncludedLocationStartDate",
          ancestorNodes, includedLocationNodes);

      if (results.size() > 0 &&
          results.isDefined(0, "minModifyDate")) {
        Date minDate = results.toDate(0, "minModifyDate");
        if (LOGGER.isLoggable(Level.FINEST))
          LOGGER.finest("COMPUTED START DATE: " + minDate);
        if (startDate == null || minDate.after(startDate)) {
          startDate = minDate;
          if (LOGGER.isLoggable(Level.INFO)) {
View Full Code Here

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

  private void validateEnterpriseWorkspaceAncestors(Client client)
      throws RepositoryException {
    if (!LOGGER.isLoggable(Level.WARNING))
      return;

    ClientValue info = client.AccessEnterpriseWS();
    int id = info.toInteger("ID");
    int volumeId = info.toInteger("VolumeID");

    // FIXME: We don't want to log the exception as an error, but it
    // would be nice to be able to log it as a warning.
    ClientValue missing =
        getMissingEnterpriseWorkspaceAncestors(client, id, volumeId);
    if (missing == null) {
      LOGGER.warning("Unable to check for missing entries in the " +
          "Livelink DTreeAncestors table.");
    } else if (missing.size() > 0) {
      LOGGER.warning("The Livelink DTreeAncestors table " +
          "may be missing entries from the Enterprise workspace (" +
          id + ").");
    } else {
      LOGGER.finest("The Livelink DTreeAncestors table " +
View Full Code Here

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

   *
   * @param client the client to use to access the server
   */
  private void validateTraversalUsername(Client client) {
    try {
      ClientValue userInfo = client.GetUserInfo(traversalUsername);
    } catch (RepositoryException e) {
      throw new ConfigurationException("Traversal username "
          + traversalUsername + " could not be verified."
          + e.getMessage(), "invalidTraversalUsername",
          new String[] { traversalUsername, e.getMessage() });
View Full Code Here

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

   */
  private void validateSqlWhereCondition(Client client)
      throws RepositoryException {
    // TODO: We should use the traversal client here, because it seems
    // like permissions are a valid concern in this case.
    ClientValue rows = sqlQueries.execute(client, null,
        "LivelinkConnector.validateSqlWhereCondition",
        sqlWhereCondition);
    if (rows.size() == 0) {
      // TODO: ConfigurationException or LivelinkException?
      throw new LivelinkException(
          "The additional SQL WHERE clause condition is too restrictive. "
          + "No documents were found with this condition.",
          LOGGER, "emptySqlResults", null);
View Full Code Here

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

    // Several birds with one stone. Getting the server info
    // verifies connectivity with the server, and we use the
    // results to set the character encoding for future clients
    // and confirm the availability of the overview action.
    Client client = clientFactory.createClient();
    ClientValue serverInfo = client.GetServerInfo();

    // Get the server version, which is a string like "9.5.0".
    String serverVersion = serverInfo.toString("ServerVersion");
    if (LOGGER.isLoggable(Level.INFO))
      LOGGER.info("LIVELINK SERVER VERSION: " + serverVersion);
    String[] versions = serverVersion.split("\\.");
    int majorVersion;
    int minorVersion;
    if (versions.length >= 2) {
      majorVersion = Integer.parseInt(versions[0]);
      minorVersion = Integer.parseInt(versions[1]);
    } else {
      if (LOGGER.isLoggable(Level.WARNING)) {
        LOGGER.warning(
            "Unable to parse Livelink server version; assuming 9.5.");
      }
      majorVersion = 9;
      minorVersion = 5;
    }

    // The connector requires Livelink 9.5 or later.
    if ((majorVersion < 9) || (majorVersion == 9 && minorVersion < 5)) {
      throw new LivelinkException(
          "Livelink 9.5 or later is required.", LOGGER,
          "unsupportedVersion", new String[] { "9.5" });
    }

    // Check for Livelink 9.5 or earlier; change overview action
    // if needed. We only check for the default entry, because if
    // the map has been customized, perhaps the user knows what
    // they are doing. If a user has a Livelink 9.5 with an custom
    // overview action, they can configure that in the
    // displayPatterns and we won't see it. We are leaving the
    // modified entry in the map rather than removing it and
    // relying on the default action because there are lots and
    // lots of documents, and this avoids a map lookup miss in
    // getDisplayUrl for every one of them.
    if (majorVersion == 9 && minorVersion <= 5) {
      Integer docSubType = new Integer(144);
      Object action = displayActions.get(docSubType);
      if ("overview".equals(action))
        displayActions.put(docSubType, "properties");
    }

    // Set the character encodings in the client factories if needed.
    int serverEncoding = serverInfo.toInteger("CharacterEncoding");
    if (serverEncoding == Client.CHARACTER_ENCODING_UTF8) {
      LOGGER.config("ENCODING: UTF-8");
      clientFactory.setEncoding("UTF-8");
      if (authenticationClientFactory != null)
        authenticationClientFactory.setEncoding("UTF-8");
    }

    // Check that our user has System Administration rights, get
    // the database type, and check the DTreeAncestors table (in
    // that order, because we need SA rights for the database type
    // queries, and we need the database type for the
    // DTreeAncestors queries).
    ClientValue userInfo = client.GetUserInfo(username);
    int privs = userInfo.toInteger("UserPrivileges");
    if ((privs & Client.PRIV_PERM_BYPASS) != Client.PRIV_PERM_BYPASS) {
      LOGGER.info("USER PRIVILEGES: " + privs);
      throw new ConfigurationException("User " + username +
          " does not have Livelink System Administration rights.",
          "missingSaRights", new String[] { username });
View Full Code Here

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

     * "application/octet-stream").
     */
    private void collectRecArrayProperties() throws RepositoryException {
      for (int i = 0; i < fields.length; i++) {
        if (fields[i].propertyNames.length > 0) {
          ClientValue value =
              recArray.toValue(insRow, fields[i].fieldName);
          if (value.isDefined()) {
            if (isUserIdOrGroupId(fields[i].fieldName)) {
              // FIXME: hack knows that UserID has 1 propertyName
              nameHandler.addUserByName(fields[i].propertyNames[0], value,
                  props);
            } else
View Full Code Here

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

      // DVersData that appears in the WebNodes view,
      // but there are cases (such as categories) where
      // there are rows in DVersData but FetchVersion
      // fails. So we're guessing here that if MimeType
      // is non-null then there should be a blob.
      ClientValue mimeType = recArray.toValue(insRow, "MimeType");
      if (!mimeType.isDefined())
        return;

      // XXX: This value might be wrong. There are
      // data size callbacks which can change this
      // value. For example, the value returned by
      // GetObjectInfo may be different than the
      // value retrieved from the database.
      long size = recArray.toLong(insRow, "DataSize");
      if (LOGGER.isLoggable(Level.FINER))
        LOGGER.finer("CONTENT DATASIZE = " + size);

      // The TraversalContext Interface provides additional
      // screening based upon content size and mimetype.
      if (traversalContext != null) {
        String mt = mimeType.toString2();
        if (LOGGER.isLoggable(Level.FINER))
          LOGGER.finer("CONTENT TYPE = " + mt);

        // Is this MimeType supported?  If not, don't feed content.
        int supportLevel = traversalContext.mimeTypeSupportLevel(mt);
View Full Code Here

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

      if (fields == null)
        return;

      if (objectInfo == null)
        objectInfo = client.GetObjectInfo(volumeId, objectId);
      ClientValue extendedData = objectInfo.toValue("ExtendedData");
      if (extendedData == null || !extendedData.hasValue())
        return;

      // Make a set of the names in the assoc.
      HashSet<String> names = new HashSet<String>();
      Enumeration<String> it = extendedData.enumerateNames();
      while (it.hasMoreElements())
        names.add(it.nextElement());

      // Decompose the ExtendedData into its atomic values,
      // and add them as properties.
      for (int i = 0; i < fields.length; i++) {
        if (names.contains(fields[i])) {
          ClientValue value = extendedData.toValue(fields[i]);
          if (value != null && value.hasValue()) {
            // XXX: For polls, the Questions field is a
            // stringified list of assoc. We're only handling
            // this one case, rather than handling stringified
            // values generally.
            if (subType == Client.POLLSUBTYPE &&
                fields[i].equals("Questions")) {
              value = value.stringToValue();
            }

            collectValueProperties(fields[i], value);
          }
        } else {
View Full Code Here

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

        return;

      // Extract the objectInfo items of interest and add them to the
      // property map.  We know there are no compound objectInfo fields.
      for (int i = 0; i < fields.length; i++) {
        ClientValue value = objectInfo.toValue(fields[i]);
        if (value != null && value.hasValue()) {
          // ExtendedData is the only non-atomic type, so explode it.
          // If the client specified it, slurp all the ExtendedData.
          // If the client wished to be more selective, they should
          // have added specific ExtendedData fields to the map.
          if ("ExtendedData".equalsIgnoreCase(fields[i]))
View Full Code Here

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

        return;

      // Make sure this item has versions. See the MimeType, Version and
      // DataSize comments in collectContentProperty().  If DataSize is
      // not defined, then the item has no versions.
      ClientValue dataSize = recArray.toValue(insRow, "DataSize");
      if (!dataSize.isDefined())
        return;

      if (versionInfo == null)
        versionInfo = client.GetVersionInfo(volumeId, objectId, 0);
      if (versionInfo == null || !versionInfo.hasValue())
        return;

      // Extract the versionInfo items of interest and add them to the
      // property map.  We know there are no compound versionInfo fields.
      for (int i = 0; i < fields.length; i++) {
        ClientValue value = versionInfo.toValue(fields[i]);
        if (value != null && value.hasValue()) {
          if (isUserIdOrGroupId(fields[i]))
            nameHandler.addUserByName(fields[i], value, props);
          else
            props.addProperty(fields[i], value);
        }
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.