已淘汰。這個類別已淘汰,不應用於新的指令碼。
建立及存取 Google 協作平台。
已淘汰的屬性
屬性 | 類型 | 說明 |
---|---|---|
AttachmentType |
| |
PageType |
|
已淘汰的方法
方法 | 傳回類型 | 簡短說明 |
---|---|---|
|
| 透過複製現有協作平台網站的方式建立新協作平台。 |
|
| 建立新的協作平台網站。 |
|
| 如果指令碼託管於容器,則傳回使用中的頁面,否則傳回 null 。 |
|
| 如果指令碼託管於容器,則傳回使用中的容器;如果指令碼託管於容器中,則傳回 null
反之。 |
|
| 擷取屬於此網域的前 200 個協作平台。 |
|
| 擷取屬於此網域的所有協作平台。 |
|
| 透過網址擷取頁面。 |
|
| 擷取指定的 Google 協作平台網站 (如果使用者本身沒有 代管網域。 |
|
| 擷取指定的 Google 協作平台網站。 |
|
| 透過網址擷取網站。 |
|
| 如果使用者並非擁有代管網站的消費者,則擷取協作平台的第一頁 網域。 |
|
| 如果使用者是沒有 這種做法 |
|
| 擷取此網域中這位使用者的協作平台第一頁。 |
|
| 根據指定範圍,擷取此網域中屬於此使用者的所有協作平台。 |
已淘汰的方法
copySite(domain, name, title, summary, site)
copySite(domain, name, title, summary, site)
已淘汰。這個函式已淘汰,不應用於新的指令碼。
透過複製現有協作平台網站的方式建立新協作平台。
警告:複製協作平台需要花費數秒至數分鐘的時間,具體取決於 這種廣告會視網站大小 而定雖然方法會立即傳回,但複製作業仍在 叢集內的部分頁面,無法立即使用所有複製網站的網頁。這個方法 也可用於根據指定範本將新網站例項化,
// This creates a site. Note that this only works for Google Workspace domains. // There is no version of this API for consumer accounts. var site = SitesApp.createSite("examplepetstore.com", "homepage", "My Home Page", "This is a new site I created!"); var siteCopy = SitesApp.copySite("examplepetstore.com", "homepage-clone", "Cloned Home Page", "Begun, these clone wars have.", site);
參數
名稱 | 類型 | 說明 |
---|---|---|
domain | String | Google Workspace 代管網域,例如 examplepetstore.com。 |
name | String | 網址中的網頁空間名稱,例如 mySite。 |
title | String | 網站標題 |
summary | String | 網站說明 |
site |
| 要複製的協作平台網站。可以是網站或範本。如果參數為 複製網站內容,然後複製整個網站的內容。如果所附的網站是 範本,接著根據該範本建立新的協作平台網站。 |
回攻員
:複製的網站。請注意,複製作業為非同步性質,而且複製作業
即使已傳回對網站的參照,它仍可能仍在進行中。Site
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://sites.google.com/feeds
createSite(domain, name, title, summary)
createSite(domain, name, title, summary)
已淘汰。這個函式已淘汰,不應用於新的指令碼。
建立新的協作平台網站。
// This creates a site. Note that this only works for Google Workspace domains. // There is no version of this API for consumer accounts. var site = SitesApp.createSite("examplepetstore.com", "homepage", "My Home Page", "This is a new site I created!");
參數
名稱 | 類型 | 說明 |
---|---|---|
domain | String | Google Workspace 代管網域,例如 examplepetstore.com。 |
name | String | 網址中的路徑名稱,例如 mySite。 |
title | String | 網站的標題。 |
summary | String | 網站的說明。 |
回攻員
:建立的網站。Site
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://sites.google.com/feeds
getActivePage()
getActivePage()
getActiveSite()
getActiveSite()
getAllSites(domain)
getAllSites(domain)
已淘汰。這個函式已淘汰,不應用於新的指令碼。
擷取屬於此網域的前 200 個協作平台。如要取得所有網站,請使用
方法頁面瀏覽結果。
getAllSites(domain, start, max)
// This writes the first page of sites belonging to a Google Workspace // domain to the log. var sites = SitesApp.getAllSites("examplepetstore.com."); for(var i in sites) { Logger.log(sites[i].getUrl()); }
參數
名稱 | 類型 | 說明 |
---|---|---|
domain | String | Google Workspace 代管網域,例如 examplepetstore.com。 |
回攻員
:屬於網域的一組網站。Site[]
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://sites.google.com/feeds
getAllSites(domain, start, max)
getAllSites(domain, start, max)
已淘汰。這個函式已淘汰,不應用於新的指令碼。
擷取屬於此網域的所有協作平台。
// This writes the a list of sites in domain example.com to the log. var pageStart = 0; var pageSize = 50; while (true) { Logger.log("Loading sites starting at %s", pageStart); var sites = SitesApp.getAllSites("examplepetstore.com", pageStart, pageSize); if (sites.length == 0) { break; } Logger.log("Got %s sites back", sites.length); pageStart += sites.length; for(var i in sites) { Logger.log("Found site: %s", sites[i].getUrl()); } }
參數
名稱 | 類型 | 說明 |
---|---|---|
domain | String | Google Workspace 代管網域,例如 examplepetstore.com。 |
start | Integer | 要傳回的第一個網站索引。 |
max | Integer | 要傳回的結果數上限。 |
回攻員
:屬於網域的一組網站。Site[]
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://sites.google.com/feeds
getPageByUrl(url)
getPageByUrl(url)
已淘汰。這個函式已淘汰,不應用於新的指令碼。
透過網址擷取頁面。
// This snippet retrieves the page at the given URL. // Returns null if the page does not exist or if the URL given is invalid. var page = SitesApp.getPageByUrl( "https://sites.google.com/site/demositeappsscript/mylistpage"); Logger.log(page.getName());
參數
名稱 | 類型 | 說明 |
---|---|---|
url | String | 公開網址。 |
回攻員
:Page
與網址中的網頁相對應的 執行個體,或 Pagenull
頁面不存在。
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://sites.google.com/feeds
getSite(name)
getSite(name)
getSite(domain, name)
getSite(domain, name)
已淘汰。這個函式已淘汰,不應用於新的指令碼。
擷取指定的 Google 協作平台網站。
// Returns a Site instance var site = SitesApp.getSite('example.com', 'mysite');
參數
名稱 | 類型 | 說明 |
---|---|---|
domain | String | Google Workspace 代管網域,例如 examplepetstore.com。 |
name | String | 網址中的網頁空間名稱,例如 mySite。 |
回攻員
:與代管網域對應的網站執行個體。Site
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://sites.google.com/feeds
getSiteByUrl(url)
getSiteByUrl(url)
已淘汰。這個函式已淘汰,不應用於新的指令碼。
透過網址擷取網站。
// This snippet retrieves the site at the given URL // Throws an Invalid argument exception if the site does not exist or if // the URL given is invalid var site = SitesApp.getSiteByUrl("https://sites.google.com/site/demosite"); Logger.log(site.getName());
參數
名稱 | 類型 | 說明 |
---|---|---|
url | String | 公開網址。 |
回攻員
:透過指定網址找到的網站。Site
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://sites.google.com/feeds
getSites()
getSites()
已淘汰。這個函式已淘汰,不應用於新的指令碼。
如果使用者並非擁有代管網站的消費者,則擷取協作平台的第一頁 網域。
// This writes the first page of sites owned by the user running // the script to the log. var sites = SitesApp.getSites(); for(var i in sites) { Logger.log(sites[i].getUrl()); }
回攻員
:執行指令碼的使用者要嵌入的一系列網站。Site[]
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://sites.google.com/feeds
getSites(start, max)
getSites(start, max)
getSites(domain)
getSites(domain)
已淘汰。這個函式已淘汰,不應用於新的指令碼。
擷取這位使用者屬於此網域的協作平台第一頁。
// This writes the first page of sites owned by the user running // the script to the log. var sites = SitesApp.getSites("example.com"); for(var i in sites) { Logger.log(sites[i].getUrl()); }
參數
名稱 | 類型 | 說明 |
---|---|---|
domain | String | Google Workspace 代管網域,例如 examplepetstore.com。 |
回攻員
:執行指令碼的使用者要嵌入的一系列網站。Site[]
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://sites.google.com/feeds
getSites(domain, start, max)
getSites(domain, start, max)
已淘汰。這個函式已淘汰,不應用於新的指令碼。
根據指定範圍,擷取此網域中屬於此使用者的所有協作平台。
// This writes the a list of sites owned by the user running // the script in positions bounded by the start and max values to the log. var sites = SitesApp.getSites("example.com", 25, 50); for(var i in sites) { Logger.log(sites[i].getUrl()); }
參數
名稱 | 類型 | 說明 |
---|---|---|
domain | String | Google Workspace 代管網域,例如 examplepetstore.com。 |
start | Integer | 要傳回的第一個網站索引。 |
max | Integer | 要傳回的結果數上限。 |
回攻員
:使用者擁有的網站陣列。Site[]
授權
使用這個方法的指令碼需要下列一或多個範圍的授權:
-
https://sites.google.com/feeds