This service provides access to Google Sites (classic).
Classes
Name | Brief description |
---|---|
Attachment | A Sites Attachment such as a file attached to a page. |
AttachmentType | A typesafe enum for sites attachment type. |
Column | A Sites Column - a column from a Sites List page. |
Comment | A Comment attached to any Sites page. |
ListItem | A Sites ListItem - a list element from a Sites List page. |
Page | A Page on a Google Site. |
PageType | A typesafe enum for sites page type. |
Site | An object representing a Google Site. |
SitesApp | Create and access Google Sites. |
Attachment
Methods
Method | Return type | Brief description |
---|---|---|
deleteAttachment() | void | Deletes this attachment. |
getAs(contentType) | Blob | Return the data inside this object as a blob converted to the specified content type. |
getAttachmentType() | AttachmentType | Return the type of this attachment (HOSTED or WEB). |
getBlob() | Blob | Return the data inside this object as a blob. |
getContentType() | String | Return the mime type of this attachment. |
getDatePublished() | Date | Return the date this attachment was first published. |
getDescription() | String | Return the description of this attachment. |
getLastUpdated() | Date | Return the date this attachment was last updated. |
getParent() | Page | Get the parent page of this attachment. |
getTitle() | String | Return the title of this attachment. |
getUrl() | String | Return the download url for this attachment. |
setContentType(contentType) | Attachment | Set the mime type of this attachment. |
setDescription(description) | Attachment | Set the descripton of this attachment. |
setFrom(blob) | Attachment | Set the actual data of this attachment. |
setParent(parent) | Attachment | Set the parent page of this attachment. |
setTitle(title) | Attachment | Set the title of this attachment. |
setUrl(url) | Attachment | Sets the download url for this attachment. |
AttachmentType
Properties
Property | Type | Description |
---|---|---|
WEB | Enum | |
HOSTED | Enum |
Column
Methods
Method | Return type | Brief description |
---|---|---|
deleteColumn() | void | Deletes this column. |
getName() | String | Gets the name of this column. |
getParent() | Page | Returns the List Page this column belongs to. |
setName(name) | Column | Sets the name of this column. |
Comment
Methods
Method | Return type | Brief description |
---|---|---|
deleteComment() | void | Deletes this comment. |
getAuthorEmail() | String | Gets the email address of the author of this comment. |
getAuthorName() | String | Gets the name of the author of this comment. |
getContent() | String | Return the content of this comment as a String. |
getDatePublished() | Date | Return the date this comment was originally published. |
getLastUpdated() | Date | Return the date this comment was last updated. |
getParent() | Page | Get the parent page of this comment. |
setContent(content) | Comment | Set the content of this comment. |
setParent(parent) | Comment | Set the parent page of this comment. |
ListItem
Methods
Method | Return type | Brief description |
---|---|---|
deleteListItem() | void | Deletes this list item. |
getDatePublished() | Date | Return the date this list item was first published. |
getLastUpdated() | Date | Return the date this comment was last updated. |
getParent() | Page | Get the parent page of this list item. |
getValueByIndex(index) | String | Get the value of this ListItem for a numbered column. |
getValueByName(name) | String | Get the value of this ListItem for a named column. |
setParent(parent) | ListItem | Set the parent page of this list item. |
setValueByIndex(index, value) | ListItem | Set the value of this ListItem for a numbered column. |
setValueByName(name, value) | ListItem | Set the value of this ListItem for a numbered column. |
Page
Methods
Method | Return type | Brief description |
---|---|---|
addColumn(name) | Column | Add a new column to the list. |
addHostedAttachment(blob) | Attachment | Add an attachment to the page. |
addHostedAttachment(blob, description) | Attachment | Add an attachment to the page. |
addListItem(values) | ListItem | Add a list item to the list. |
addWebAttachment(title, description, url) | Attachment | Add a web attachment to the page. |
createAnnouncement(title, html) | Page | Create an announcements for this page. |
createAnnouncement(title, html, asDraft) | Page | Create an announcements for this page. |
createAnnouncementsPage(title, name, html) | Page | Create a new announcements page. |
createFileCabinetPage(title, name, html) | Page | Create a new file-cabinet page. |
createListPage(title, name, html, columnNames) | Page | Create a new list page. |
createPageFromTemplate(title, name, template) | Page | Create a new page from a template. |
createWebPage(title, name, html) | Page | Create a new web page. |
deletePage() | void | Deletes this page. |
getAllDescendants() | Page[] | Gets an array of descendant pages (direct and indirect), up to a limit of 200 pages. |
getAllDescendants(options) | Page[] | Gets an array of descendant pages, with optional advanced arguments. |
getAnnouncements() | Page[] | Get the announcements for this page. |
getAnnouncements(optOptions) | Page[] | Get the announcements for this page. |
getAttachments() | Attachment[] | Get the attachments for this page. |
getAttachments(optOptions) | Attachment[] | Get the attachments for this page. |
getAuthors() | String[] | Get the emails of the authors of the page |
getChildByName(name) | Page | Gets a particular child page. |
getChildren() | Page[] | Gets an array of child pages, up to a limit of 200 pages. |
getChildren(options) | Page[] | Gets an array of child pages, with optional advanced arguments. |
getColumns() | Column[] | Get the columns for the list. |
getDatePublished() | Date | Return the date this page was first published. |
getHtmlContent() | String | Get the HTML content of the page. |
getIsDraft() | Boolean | Returns whether the page is in draft mode. |
getLastEdited() | Date | Return the last edit date, which includes only content edits. |
getLastUpdated() | Date | Return the last updated date, which includes non-content changes like moving. |
getListItems() | ListItem[] | Get the list items for the list. |
getListItems(optOptions) | ListItem[] | Get the list items for the list. |
getName() | String | Return the page's name. |
getPageType() | PageType | Return the type of this page as a SitesApp.PageType enum. |
getParent() | Page | Return the parent of this page. |
getTextContent() | String | Returns the plain-text page content. |
getTitle() | String | Return the page's title. |
getUrl() | String | Get the url of the page. |
isDeleted() | Boolean | Returns whether a page has been deleted. |
isTemplate() | Boolean | Returns whether this page is a copyable template. |
publishAsTemplate(name) | Page | Publish this page as a copyable template. |
search(query) | Page[] | Gets an array of descendant pages that match a search query, up to a limit of 200 pages. |
search(query, options) | Page[] | Gets an array of descendant pages that match a search query, with optional advanced arguments. |
setHtmlContent(html) | Page | Set the HTML content of the page. |
setIsDraft(draft) | Page | Sets whether the page is in draft mode. |
setName(name) | Page | Set this page's name. |
setParent(parent) | Page | Set the parent of this page. |
setTitle(title) | Page | Set the page's title. |
PageType
Properties
Property | Type | Description |
---|---|---|
WEB_PAGE | Enum | |
LIST_PAGE | Enum | |
ANNOUNCEMENT | Enum | |
ANNOUNCEMENTS_PAGE | Enum | |
FILE_CABINET_PAGE | Enum |
Site
Methods
Method | Return type | Brief description |
---|---|---|
addEditor(emailAddress) | Site | Adds the given user to the list of editors for the Site . |
addEditor(user) | Site | Adds the given user to the list of editors for the Site . |
addEditors(emailAddresses) | Site | Adds the given array of users to the list of editors for the Site . |
addOwner(email) | Site | Add a new owner to the website |
addOwner(user) | Site | Add a new owner to the website |
addViewer(emailAddress) | Site | Adds the given user to the list of viewers for the Site . |
addViewer(user) | Site | Adds the given user to the list of viewers for the Site . |
addViewers(emailAddresses) | Site | Adds the given array of users to the list of viewers for the Site . |
createAnnouncementsPage(title, name, html) | Page | Create a new announcements page. |
createFileCabinetPage(title, name, html) | Page | Create a new file-cabinet page. |
createListPage(title, name, html, columnNames) | Page | Create a new list page. |
createPageFromTemplate(title, name, template) | Page | Create a new page from a template. |
createWebPage(title, name, html) | Page | Create a new web page. |
getAllDescendants() | Page[] | Gets an array of descendant pages (direct and indirect), up to a limit of 200 pages. |
getAllDescendants(options) | Page[] | Gets an array of descendant pages, with optional advanced arguments. |
getChildByName(name) | Page | Gets a particular child page. |
getChildren() | Page[] | Gets an array of child pages, up to a limit of 200 pages. |
getChildren(options) | Page[] | Gets an array of child pages, with optional advanced arguments. |
getEditors() | User[] | Gets the list of editors for this Site . |
getName() | String | Return the name of the site |
getOwners() | User[] | Retrieves list of owners for the site |
getSummary() | String | Return the summary of the web site |
getTemplates() | Page[] | Returns all template pages. |
getTheme() | String | Gets the theme of the site |
getTitle() | String | Return the title of the site |
getUrl() | String | Retrieves the url of this Site. |
getViewers() | User[] | Gets the list of viewers and commenters for this Site . |
removeEditor(emailAddress) | Site | Removes the given user from the list of editors for the Site . |
removeEditor(user) | Site | Removes the given user from the list of editors for the Site . |
removeOwner(email) | Site | Removes owner from the site by user email |
removeOwner(user) | Site | Removes owner from the site |
removeViewer(emailAddress) | Site | Removes the given user from the list of viewers and commenters for the Site . |
removeViewer(user) | Site | Removes the given user from the list of viewers and commenters for the Site . |
search(query) | Page[] | Gets an array of descendant pages that match a search query, up to a limit of 200 pages. |
search(query, options) | Page[] | Gets an array of descendant pages that match a search query, with optional advanced arguments. |
setSummary(summary) | Site | Set the summary of the web site |
setTheme(theme) | Site | Sets the theme of the site |
setTitle(title) | Site | Set the title of the site |
SitesApp
Properties
Property | Type | Description |
---|---|---|
AttachmentType | AttachmentType | |
PageType | PageType |
Methods
Method | Return type | Brief description |
---|---|---|
copySite(domain, name, title, summary, site) | Site | Creates a new Site by copying an existing Site. |
createSite(domain, name, title, summary) | Site | Creates a new Site. |
getActivePage() | Page | Returns the active page, if the script is hosted in a container, or null otherwise. |
getActiveSite() | Site | Returns the active container, if the script is hosted in a container, or null
otherwise. |
getAllSites(domain) | Site[] | Retrieves first 200 Sites belonging to this domain. |
getAllSites(domain, start, max) | Site[] | Retrieves all Sites belonging to this domain. |
getPageByUrl(url) | Page | Retrieves a Page by url. |
getSite(name) | Site | Retrieves a Site for the given Google Site, if the user is a consumer who does not have a hosted domain. |
getSite(domain, name) | Site | Retrieves a Site for the given Google Site. |
getSiteByUrl(url) | Site | Retrieves a Site by url. |
getSites() | Site[] | Retrieves first page of Sites for a user, if the user is a consumer who does not have a hosted domain. |
getSites(start, max) | Site[] | Retrieves Sites for a user between the given bounds if the user is a consumer who does not have a hosted domain. |
getSites(domain) | Site[] | Retrieves first page of Sites belonging to this user in this domain. |
getSites(domain, start, max) | Site[] | Retrieves all Sites belonging to this user in this domain for the given range given. |