Examples of AclFeed


Examples of com.google.gdata.data.acl.AclFeed

    }
    return null;
  }

  public void updateAclRole(DocumentListEntry entry, String newUser, String oldUser) {
    AclFeed aclFeed;
    boolean foundEntries = false;
    AclScope scope = new AclScope(AclScope.Type.USER, newUser);
    try {
      if (oldUser != null) {
        aclFeed = documentsService.getFeed(new URL(entry.getAclFeedLink().getHref()), AclFeed.class);
        for (AclEntry aclEntry : aclFeed.getEntries()) {
          if (aclEntry.getScope().getValue().equals(oldUser)) {
            aclEntry.setScope(scope);
            aclEntry.update();
            foundEntries = true;
          }
View Full Code Here

Examples of com.google.gdata.data.acl.AclFeed

      printMessage(COMMAND_HELP_PERMS);
      return;
    }

    if (args[1].equals("list") && args.length == 3) {
      AclFeed feed = documentList.getAclFeed(args[2]);
      if (feed != null) {
        for (AclEntry entry : feed.getEntries()) {
          printAclEntry(entry);
        }
      }
    } else if (args[1].equals("add") && args.length == 6) {
      AclRole role = new AclRole(args[2]);
View Full Code Here

Examples of com.google.gdata.data.acl.AclFeed

      // For each calendar that exposes an access control list, retrieve its ACL
      // feed. If link is null, then we are not the owner of that calendar
      // (e.g., it is a public calendar) and its ACL feed cannot be accessed.
      if (link != null) {
        AclFeed aclFeed = service.getFeed(new URL(link.getHref()),
            AclFeed.class);
        System.out.println("\tCalendar \"" + calEntry.getTitle().getPlainText()
            + "\":");
        for (AclEntry aclEntry : aclFeed.getEntries()) {
          System.out.println("\t\tScope: Type=" + aclEntry.getScope().getType()
              + " (" + aclEntry.getScope().getValue() + ")");
          System.out.println("\t\tRole: " + aclEntry.getRole().getValue());
        }
      }
View Full Code Here

Examples of com.google.gdata.data.acl.AclFeed

   * @throws ServiceException If the service is unable to handle the request.
   * @throws IOException Error communicating with the server.
   */
  private static void updateAccessControl(CalendarService service,
      String userEmail, AclRole newRole) throws ServiceException, IOException {
    AclFeed aclFeed = service.getFeed(aclFeedUrl, AclFeed.class);

    for (AclEntry aclEntry : aclFeed.getEntries()) {
      if (userEmail.equals(aclEntry.getScope().getValue())) {
        aclEntry.setRole(newRole);
        AclEntry updatedEntry = aclEntry.update();

        System.out.println("Updated user's access control:");
View Full Code Here

Examples of com.google.gdata.data.acl.AclFeed

   * @throws ServiceException If the service is unable to handle the request.
   * @throws IOException Error communicating with the server.
   */
  private static void deleteAccessControl(CalendarService service,
      String userEmail) throws ServiceException, IOException {
    AclFeed aclFeed = service.getFeed(aclFeedUrl, AclFeed.class);

    for (AclEntry aclEntry : aclFeed.getEntries()) {
      if (userEmail.equals(aclEntry.getScope().getValue())) {
        aclEntry.delete();
        System.out.println("Deleted " + userEmail + "'s access control.");

        break;
View Full Code Here

Examples of com.google.gdata.data.acl.AclFeed

  /**
   * Declare the extensions of the feeds for the Google Sites Data API.
   */
  private void declareExtensions() {
    new AclFeed().declareExtensions(extProfile);
    new SiteFeed().declareExtensions(extProfile);
    /* Declarations for extensions that need to be handled as specific type
     * should be done before call to {@see ExtensionProfile#setAutoExtending}.
     * Order of declaration is important. */
    extProfile.setAutoExtending(true);
View Full Code Here

Examples of com.google.gdata.data.acl.AclFeed

    /**
     * Fetches and displays a Site's acl feed.
     */
    public void getAclFeed(String siteName) throws IOException, ServiceException {
      AclFeed aclFeed = service.getFeed(
          new URL(getAclFeedUrl(siteName)), AclFeed.class);
      for (AclEntry entry : aclFeed.getEntries()) {
        System.out.println(entry.getScope().getValue() + " (" +
                           entry.getScope().getType() + ") : " + entry.getRole().getValue());
      }
    }
View Full Code Here

Examples of com.google.gdata.data.acl.AclFeed

      URL feedUrl = FeedUris.getAclFeedUrl(feedName, entryId);

      System.out.println("Listing all accessors for " + feedName
          + " with id" + entryId + "  ...");
      // Get the list of accessors for this entry
      AclFeed aclFeed = service.getFeed(feedUrl, AclFeed.class);
      printAclInfo(aclFeed);

    } else if (parser.containsKey("changetype")) {
      String changeType = parser.getValue("changetype");
      String emailId = parser.getValue("email");
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.