Net::Google::DocumentsList::Item - document or folder in Google Documents List Data API


Net-Google-DocumentsList documentation  | view source Contained in the Net-Google-DocumentsList distribution.

Index


NAME

Top

Net::Google::DocumentsList::Item - document or folder in Google Documents List Data API

SYNOPSIS

Top

  use Net::Google::DocumentsList;

  my $client = Net::Google::DocumentsList->new(
      username => 'myname@gmail.com',
      password => 'p4$$w0rd'
  );

  # taking one document
  my $doc = $client->item;




DESCRIPTION

Top

This module represents document of folder object for Google Documents List Data API.

METHODS

Top

add_item, items, item, add_folder, folders, folder

creates or retrieves items. This method works only for the object with 'folder' kind. This method is implemented in Net::Google::DocumentsList::Role::HasItems.

add_acl, acls, acl

creates and gets Access Control List object attached to the object. See Net::Google::DocumentsList::ACL for the details.

revisions, revision

gets revision objects of the object. See Net::Google::DocumentsList::Revision for the details.

update_content

updates the content of the document with specified file.

  my $new_object = $doc->update_content('/path/to/my/new_content.ppt');

move_to

move the object to specified folder.

  my $client = Net::Google::DocumentsList->new(
    usernaem => 'foo.bar@gmail.com',
    password => 'p4ssw0rd',
  );
  my $doc = $client->item({title => 'my doc', category => 'document'});
  my $folder = $client->folder({title => 'my folder'});
  $doc->move_to($folder);

move_out_of

move the object out of specified folder.

  my $client = Net::Google::DocumentsList->new(
    usernaem => 'foo.bar@gmail.com',
    password => 'p4ssw0rd',
  );
  my $folder = $client->folder({title => 'my folder'});
  my $doc = $folder->item({title => 'my doc', category => 'document'});
  $doc->move_out_of($folder);

copy

copies the document to a new document. You can copy documents, spreadsheets, and presentations. PDFs or folders is not supported.

  my $client = Net::Google::DocumentsList->new(
    usernaem => 'foo.bar@gmail.com',
    password => 'p4ssw0rd',
  );
  my $doc = $client->add_item({title => 'my doc', kind => 'document'});
  my $copied = $doc->copy('copied doc');

delete

deletes the object.

  my $client = Net::Google::DocumentsList->new(
    usernaem => 'foo.bar@gmail.com',
    password => 'p4ssw0rd',
  );
  my $doc = $client->item({title => 'my doc', category => 'document'});

  $doc->delete; # goes to trash

If you set delete argument to true, the object will be deleted completely.

  $doc->delete({delete => 1}); # deletes completely

export

downloads the document. This method doesn't work for the object whose kind is 'folder'. This method is implemented in Net::Google::DocumentsList::Role::Exportable.

ATTRIBUTES

Top

you can get and set (if it is rw) these attributes in a moose way.

* title (rw)
* kind (ro)
* alternate (ro)

You can view the item from the web browser with the url associated with this attribute.

* published (ro)
* updated (ro)
* edited (ro)
* resource_id (ro)
* last_viewed (ro)
* deleted (ro)
* parent (ro)

AUTHOR

Top

Noubo Danjou <nobuo.danjou@gmail.com>

SEE ALSO

Top

XML::Atom

Net::Google::DataAPI

Net::Google::DocumentsList::Role::Exportable

http://code.google.com/apis/documents/docs/3.0/developers_guide_protocol.html

LICENSE

Top

This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself.


Net-Google-DocumentsList documentation  | view source Contained in the Net-Google-DocumentsList distribution.