2 Replies Latest reply: Jun 20, 2006 2:42 PM by 414326 RSS

    Getting users' email addresses in the Java CSDK?

    420008
      We're adding a feature to a web services wrapper over the Java CSDK, version 10.x, that will allow our users to add and remove attendees.

      In starting work on this, I was given the C sample code appended below by a colleague. It isn't readily obvious, however, how this might translate to equivalent calls in the Java CSDK. For instance, from the Javadocs, there doesn't appear to be a version of the Session.getHandle() call that accepts an array of User Identification strings as a parameter, like the C example below. (Or is that assumption mistaken?)

      Can you provide any analogous sample code, however skeletal, for how one might be able to obtain the email addresses for one or more users on the OC server when one has their User Identification strings?

      In addition, is this possible when one cannot directly log in to those users' accounts or act as a designate for those accounts? Or is sysop or at least designate access required? Thanks!

      --

      (with apologies for the oddly italicized portion of the sample code below and the lack of indentation, which may be an artifact of how I'm entering this or of Jive Forums ...)

      // invite these people to a meeting:
      const char * attendees[] = {
      "?/S=Who/G=Cindy Lou/",
      "?/S=Who/G=Lou Lou/",
      "?/S=Who/G=Betty Lou/"
      "grinch");
      //
      const int numAttendees = (sizeof(attendees) / sizeof(attendees[0]));
      const char ** emailAddresses = (const char **)malloc((numAttendees + 1) * sizeof(const char *));
      CAPHandle * handles = (CAPHandle *)malloc(numAttendees * sizeof(CAPHandle *));
      //
      // get handles:
      for (int i = 0; !status && (i < numAttendees); i++) {
      status = CSDK_GetHandle(mySession, attendees,CSDK_FLAG_NONE,&handles[i]);
      }
      //
      // terminate the array:
      handles[numAttendees] = CSDK_HANDLE_INITIALIZER;
      //
      if (!status) {
      // get e-mail addresses for each handle using CSDK_GetHandleInfo()
      ...
      }
        • 1. Re: Getting users' email addresses in the Java CSDK?
          420008
          Just to clarify, being able to translate User Identification strings to email addresses is a part of the add/remove attendees feature that we'd very much like to be able to offer to our customers. Not all of them will know the stored email addresses associated with each user account on our OC server, but all will know their user identification information.
          • 2. Re: Getting users' email addresses in the Java CSDK?
            414326
            Hi Aron,
            equivalent calls in the Java CSDK. For instance,
            from the Javadocs, there doesn't appear to be a
            version of the Session.getHandle() call that accepts
            an array of User Identification strings as a
            parameter, like the C example below. (Or is that
            assumption mistaken?)
            Your right about the api not accepting a string array. Your application will need to make multiple calls to the      getHandle(int in_flags, java.lang.String in_user).

            Then the email adress is available from the Handle(handle.getEmail()).

            Regards,
            Jean-Philippe