Package com.google.gdata.data.appsforyourdomain.generic

Examples of com.google.gdata.data.appsforyourdomain.generic.GenericFeed


     //*/
    LOGGER.log(Level.INFO, "Creating users for groups sample run");
    createUser(memberUserName, memberFirstName, memberLastName, memberPassword);
    createUser(ownerUserName, ownerFirstName, ownerLastName, ownerPassword);

    GenericFeed groupsFeed = null;
    GenericEntry groupsEntry = null;
    Iterator<GenericEntry> groupsEntryIterator = null;

    LOGGER.log(Level.INFO, "Creating group: " + testGroupId);
    groupsEntry =
        groupService.createGroup(testGroupId, testGroupName,
            testGroupDescription, "");
    LOGGER.log(Level.INFO, "Group created with following properties:\n"
        + groupsEntry.getAllProperties());

    groupsEntry =
        groupService.addMemberToGroup(testGroupId, memberUserName);
    LOGGER.log(Level.INFO, "Added member: \n" + groupsEntry.getAllProperties());

    groupsEntry = groupService.addOwnerToGroup(testGroupId, ownerUserName);
    LOGGER.log(Level.INFO, "Added owner: \n" + groupsEntry.getAllProperties());

    groupsEntry =
        groupService.updateGroup(testGroupId, testGroupName,
            testGroupDescription + "Updated: ", "");
    LOGGER.log(Level.INFO, "Updated group description:\n"
        + groupsEntry.getAllProperties());

    groupsFeed = groupService.retrieveAllMembers(testGroupId);
    groupsEntryIterator = groupsFeed.getEntries().iterator();

    StringBuffer members = new StringBuffer();

    while (groupsEntryIterator.hasNext()) {
      members.append(groupsEntryIterator.next().getProperty(
          AppsGroupsService.APPS_PROP_GROUP_MEMBER_ID));
      if (groupsEntryIterator.hasNext()) {
        members.append(", ");
      }
    }
    LOGGER.log(Level.INFO, testGroupId + " has these members: "
        + members.toString());

    groupsFeed = groupService.retreiveGroupOwners(testGroupId);
    groupsEntryIterator = groupsFeed.getEntries().iterator();

    StringBuffer owners = new StringBuffer();
    while (groupsEntryIterator.hasNext()) {
      owners.append(groupsEntryIterator.next().getProperty(
          AppsGroupsService.APPS_PROP_GROUP_EMAIL));
      if (groupsEntryIterator.hasNext()) {
        owners.append(", ");
      }
    }

    LOGGER.log(Level.INFO, testGroupName + " has these owners: "
        + owners.toString());
    groupsFeed = groupService.retrieveAllGroups();
    groupsEntryIterator = groupsFeed.getEntries().iterator();

    StringBuffer groups = new StringBuffer();
    while (groupsEntryIterator.hasNext()) {
      groups.append(groupsEntryIterator.next().getProperty(
          AppsGroupsService.APPS_PROP_GROUP_ID));
      if (groupsEntryIterator.hasNext()) {
        groups.append(", ");
      }
    }
    LOGGER.log(Level.INFO, "Domain has these groups:\n" + groups.toString());

    groupsFeed = groupService.retrieveGroups(memberUserName, true);
    groupsEntryIterator = groupsFeed.getEntries().iterator();

    groups = new StringBuffer();
    while (groupsEntryIterator.hasNext()) {
      groups.append(groupsEntryIterator.next().getProperty(
          AppsGroupsService.APPS_PROP_GROUP_ID));
View Full Code Here


   */
  private List<GenericEntry> retrieveAllPages(URL feedUrl) throws IOException, ServiceException {
    List<GenericEntry> allEntries = new ArrayList<GenericEntry>();
    try {
      do {
        GenericFeed feed = service.getFeed(feedUrl, GenericFeed.class);
        allEntries.addAll(feed.getEntries());
        feedUrl = (feed.getNextLink() == null) ? null : new URL(feed.getNextLink().getHref());
      } while (feedUrl != null);
    } catch (ServiceException se) {
      AppsForYourDomainException ae = AppsForYourDomainException.narrow(se);
      throw (ae != null) ? ae : se;
    }
View Full Code Here

TOP

Related Classes of com.google.gdata.data.appsforyourdomain.generic.GenericFeed

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.