Wycofano. Ta klasa została wycofana i nie należy jej używać w nowych skryptach.
Strona w Witrynach Google.
Wycofane metody
Metoda | Zwracany typ | Krótki opis |
---|---|---|
|
| Dodaj nową kolumnę do listy. |
|
| Rola wycofana. |
|
| Dodaj załącznik do strony. |
|
| Dodaj załącznik do strony. |
|
| Dodaj element listy do listy. |
|
| Dodaj do strony załącznik internetowy. |
|
| Utwórz ogłoszenia dla tej strony. |
|
| Utwórz ogłoszenia dla tej strony. |
|
| Utwórz nową stronę z ogłoszeniami. |
|
| Utwórz nową stronę magazynu plików. |
|
| Utwórz nową stronę z listą. |
|
| Utwórz nową stronę na podstawie szablonu. |
|
| Utwórz nową stronę internetową. |
| void | Usuwa tę stronę. |
|
| Pobiera tablicę stron podrzędnych (bezpośrednich i pośrednich), maksymalnie 200 stron. |
|
| Pobiera tablicę stron podrzędnych z opcjonalnymi argumentami zaawansowanymi. |
|
| Otrzymuj powiadomienia na tej stronie. |
|
| Otrzymuj powiadomienia na tej stronie. |
|
| Pobierz załączniki dla tej strony. |
|
| Pobierz załączniki dla tej strony. |
| String[] | Otrzymywanie adresów e-mail autorów strony |
|
| Pobiera określoną stronę podrzędną. |
|
| Pobiera tablicę stron podrzędnych, maksymalnie 200. |
|
| Pobiera tablicę stron podrzędnych z opcjonalnymi argumentami zaawansowanymi. |
|
| Pobierz kolumny listy. |
|
| Rola wycofana. |
|
| Rola wycofana. |
| Date | Zwraca datę pierwszej publikacji strony. |
| String | Pobierz zawartość HTML strony. |
| Boolean | Wskazuje, czy strona jest w wersji roboczej. |
| Date | Zwraca datę ostatniej zmiany, która obejmuje tylko zmiany treści. |
| Date | Zwraca datę ostatniej aktualizacji, która obejmuje zmiany niestanowiące treści, np. przeniesienie. |
|
| Pobierz elementy listy. |
|
| Pobierz elementy listy. |
| String | Zwraca nazwę strony. |
| String | Rola wycofana. |
|
| Zwraca typ tej strony jako wyliczenie SitesApp.PageType. |
|
| Zwraca obiekt nadrzędny tej strony. |
| String | Rola wycofana. |
| String | Zwraca zawartość strony w postaci zwykłego tekstu. |
| String | Zwraca tytuł strony. |
| String | Uzyskaj adres URL strony. |
| Boolean | Wskazuje, czy strona została usunięta. |
| Boolean | Wskazuje, czy strona jest szablonem możliwym do skopiowania. |
|
| Opublikuj tę stronę jako szablon możliwy do skopiowania. |
|
| Pobiera tablicę stron podrzędnych pasujących do zapytania (maksymalnie 200 stron). |
|
| Pobiera tablicę stron podrzędnych pasujących do zapytania wraz z opcjonalnymi argumentami zaawansowanymi. |
|
| Ustaw treść HTML strony. |
|
| Określa, czy strona jest w wersji roboczej. |
|
| Ustaw nazwę tej strony. |
|
| Ustaw element nadrzędny tej strony. |
|
| Ustaw tytuł strony. |
Wycofane metody
addColumn(name)
addColumn(name)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Dodaj nową kolumnę do listy. Dotyczy tylko stron z listą.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildByName("listpage"); // Only valid on List pages. Check for the type like so: // if(page.getPageType() == SitesApp.PageType.LIST_PAGE)) var columns = page.addColumn("new-column");
Parametry
Nazwa | Typ | Opis |
---|---|---|
name | String | nazwa nowej kolumny |
Powrót
– nowo utworzona kolumna.Column
Rzuty
Error
– w przypadku stron, które nie są stronami z listą.
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
addComment(content)
addComment(content)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Rola wycofana. Dodaj komentarz do strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; page.addComment("This is a comment created automatically by a script using the account " + "of the user running the script");
Parametry
Nazwa | Typ | Opis |
---|---|---|
content | String | treść komentarza |
Powrót
– nowo utworzony komentarzComment
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
addHostedAttachment(blob)
addHostedAttachment(blob)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Dodaj załącznik do strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; // Create a new blob and attach it. Many useful functions also return // blobs file uploads, URLFetch var blob = Utilities.newBlob("Here is some data", "text/plain", "data.txt"); // Note that the filename must be unique or this call will fail page.addHostedAttachment(blob);
Parametry
Nazwa | Typ | Opis |
---|---|---|
blob | BlobSource | dane załącznika |
Powrót
– nowo utworzony załącznik,Attachment
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
addHostedAttachment(blob, description)
addHostedAttachment(blob, description)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Dodaj załącznik do strony. Ta wersja funkcji umożliwia dodanie opisu.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; // Create a new blob and attach it. Many useful: functions also return // blobs file uploads, URLFetch var blob = Utilities.newBlob("Here is some data", "text/plain", "data.txt"); // Note that the filename must be unique or this call will fail page.addHostedAttachment(blob, "Some newly created data");
Parametry
Nazwa | Typ | Opis |
---|---|---|
blob | BlobSource | dane załącznika |
description | String | opis załącznika |
Powrót
– nowo utworzony załącznik,Attachment
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
addListItem(values)
addListItem(values)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Dodaj element listy do listy. Dotyczy tylko stron z listą.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildByName("listpage"); // Only valid on List pages. Check for the type like so: // if(page.getPageType() == SitesApp.PageType.LIST_PAGE)) // Returns only one item page.addListItem([ "John", "Smith", "123 Main St"]);
Parametry
Nazwa | Typ | Opis |
---|---|---|
values | String[] | wartości w każdej kolumnie |
Powrót
– nowo utworzony ListItemListItem
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
addWebAttachment(title, description, url)
addWebAttachment(title, description, url)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Dodaj do strony załącznik internetowy. Dotyczy tylko stron do przechowywania plików.
Załączniki internetowe to linki – nie są one hostowane przez Witryny Google.
var site = SitesApp.getSite("example.com", "mysite"); // fetch the child - this must be a File Cabinet page // to programmatically check this, do a comparison: // if(page.getPageType() == SitesApp.PageType.FILE_CABINET_PAGE) var page = site.getChildByName("files"); page.addWebAttachment("Google Robots file", "This is Google's robots.txt file", "http://www.google.com/robots.txt");
Parametry
Nazwa | Typ | Opis |
---|---|---|
title | String | tytuł załącznika |
description | String | opis załącznika |
url | String | adres URL dołączanego pliku |
Powrót
– nowo utworzony załącznik,Attachment
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
createAnnouncement(title, html)
createAnnouncement(title, html)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Utwórz ogłoszenia związane z tą stroną. Dotyczy tylko stron z ogłoszeniami.
var site = SitesApp.getSite("example.com", "mysite"); // This snippet will only work with announcement pages - this is different // from a page that is an announcement (individual announcements). To check // if this method can be called: // if(page.getPageType() == SitesApp.PageType.ANNOUNCEMENTS_PAGE)) var page = site.getChildByName("news"); page.createAnnouncement("Breaking news!", "<h1>Apps Script rocks!</h1>");
Parametry
Nazwa | Typ | Opis |
---|---|---|
title | String | tytuł strony |
html | String | zawartość strony |
Powrót
– nowo utworzone ogłoszeniaPage
Rzuty
Error
– w przypadku stron, które nie są stronami z ogłoszeniami,
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
createAnnouncement(title, html, asDraft)
createAnnouncement(title, html, asDraft)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Utwórz ogłoszenia związane z tą stroną. Dotyczy tylko stron z ogłoszeniami.
var site = SitesApp.getSite("example.com", "mysite"); // This snippet will only work with announcement pages - this is different // from a page that is an announcement (individual announcements). To check // if this method can be called: // if(page.getPageType() == SitesApp.PageType.ANNOUNCEMENTS_PAGE)) var page = site.getChildByName("news"); page.createAnnouncement("Breaking news!", "<h1>Apps Script rocks!</h1>", true);
Parametry
Nazwa | Typ | Opis |
---|---|---|
title | String | tytuł strony |
html | String | zawartość strony |
asDraft | Boolean | czy ma być wersją roboczą ogłoszenia |
Powrót
– nowo utworzone ogłoszeniaPage
Rzuty
Error
– w przypadku stron, które nie są stronami z ogłoszeniami,
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
createAnnouncementsPage(title, name, html)
createAnnouncementsPage(title, name, html)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Utwórz nową stronę z ogłoszeniami. Pamiętaj, że witryna lub strona nadrzędna nie może mieć więcej niż 500 stronach podrzędnych.
// This method can be called from both a Site instance // as well as a Page instance var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; site.createAnnouncementsPage("New Announcement", "new-announcement", "<h1>Your announcement goes here</h1>"); page.createAnnouncementsPage("New Announcement", "new-announcement-child", "<h1>Your announcement goes here</h1>");
Parametry
Nazwa | Typ | Opis |
---|---|---|
title | String | tytuł strony |
name | String | nazwa strony |
html | String | zawartość strony |
Powrót
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
createFileCabinetPage(title, name, html)
createFileCabinetPage(title, name, html)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Utwórz nową stronę magazynu plików. Pamiętaj, że witryna lub strona nadrzędna nie może mieć więcej niż 500 elementów podrzędnych stron.
// This method can be called from either a site or a page. var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; site.createFileCabinetPage("New File Cabinet", "new-file-cabinet", "<h1>Your HTML here</h1>"); page.createFileCabinetPage("New File Cabinet", "new-file-cabinet-child", "<h1>Your HTML here</h1>");
Parametry
Nazwa | Typ | Opis |
---|---|---|
title | String | tytuł strony |
name | String | nazwa strony |
html | String | zawartość strony |
Powrót
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
createListPage(title, name, html, columnNames)
createListPage(title, name, html, columnNames)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Utwórz nową stronę z listą. Pamiętaj, że witryna lub strona nadrzędna nie może mieć więcej niż 500 stron podrzędnych.
// This method can be called from either a site or a page. var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; site.createListPage("New List Page", "new-list-page", "<h1>Your List Page HTML here</h1>", [ "col1", "col2" ]); page.createListPage("New List Page", "new-list-page-child", "<h1>Your List Page HTML here</h1>", [ "col1", "col2" ]);
Parametry
Nazwa | Typ | Opis |
---|---|---|
title | String | tytuł strony |
name | String | nazwa strony |
html | String | zawartość strony |
columnNames | String[] | nazwy kolumn używane na liście |
Powrót
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
createPageFromTemplate(title, name, template)
createPageFromTemplate(title, name, template)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Utwórz nową stronę na podstawie szablonu. Pamiętaj, że witryna lub strona nadrzędna nie może mieć więcej niż 500 stronach podrzędnych.
// This method can be called from either a site or a page. var site = SitesApp.getSite("example.com", "mysite"); var template = site.getTemplates()[0]; // If an invalid template is passed, this will throw an "Invalid Argument" error. site.createPageFromTemplate("ClonedPage", "cloned-page", template);
Parametry
Nazwa | Typ | Opis |
---|---|---|
title | String | tytuł strony |
name | String | nazwa strony |
template |
| strona szablonu |
Powrót
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
createWebPage(title, name, html)
createWebPage(title, name, html)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Utwórz nową stronę internetową. Pamiętaj, że witryna lub strona nadrzędna nie może mieć więcej niż 500 stron podrzędnych.
// This method can be called from either a site or a page. var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; site.createAnnouncementsPage("New Announcement", "new-announcement", "<h1>Your announcement goes here</h1>"); page.createAnnouncementsPage("New Announcement", "new-announcement-child", "<h1>Your announcement goes here</h1>");
Parametry
Nazwa | Typ | Opis |
---|---|---|
title | String | tytuł strony |
name | String | nazwa strony |
html | String | zawartość strony |
Powrót
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
deletePage()
deletePage()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Usuwa tę stronę.
var site = SitesApp.getSite("example.com", "mysite"); // Delete ALL the pages! var pages = site.getAllDescendants(); for(var i in pages) { pages[i].deletePage(); }
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getAllDescendants()
getAllDescendants()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobiera tablicę stron podrzędnych (bezpośrednich i pośrednich), maksymalnie 200 stron.
var site = SitesApp.getSite("example.com", "mysite"); var pages = site.getAllDescendants();
Powrót
– tablica bezpośrednich i pośrednich stron podrzędnychPage[]
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getAllDescendants(options)
getAllDescendants(options)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobiera tablicę stron podrzędnych z opcjonalnymi argumentami zaawansowanymi.
var site = SitesApp.getSite("example.com", "mysite"); var descendants = site.getAllDescendants({ type: SitesApp.PageType.WEB_PAGE, start: 0, max: 25, includeDrafts: false, includeDeleted: true, search: "target" }); for(var i in descendants) { Logger.log(descendants[i].getName()); }
Parametry
Nazwa | Typ | Opis |
---|---|---|
options | Object | Pola obiektów JavaScript zdefiniowane w poniższej sekcji Argumenty zaawansowane |
Parametry zaawansowane
Nazwa | Typ | Opis |
---|---|---|
type |
| pobierz tylko strony tego typu |
start | Integer | rozpocznij tutaj wyniki |
max | Integer | maksymalna liczba wyników (domyślnie 200) |
includeDrafts | Boolean | czy uwzględniać wersje robocze stron (domyślnie fałsz) |
includeDeleted | Boolean | czy uwzględniać usunięte strony (domyślnie false) |
search | String | zwróci tylko strony pasujące do tego zapytania |
Powrót
– tablica bezpośrednich i pośrednich stron podrzędnych danego typuPage[]
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getAnnouncements()
getAnnouncements()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Otrzymuj powiadomienia na tej stronie. Dotyczy tylko stron z ogłoszeniami.
var site = SitesApp.getSite("example.com", "mysite"); // This snippet will only work with announcement pages - this is different // from a page that is an announcement (individual announcements). To check // if this method can be called: // if(page.getPageType() == SitesApp.PageType.ANNOUNCEMENTS_PAGE)) var page = site.getChildByName("news"); var announcements = page.getAnnouncements(); for(var i in announcements) { Logger.log(announcements[i].getHtmlContent()); }
Powrót
– tablica ogłoszeńPage[]
Rzuty
Error
– w przypadku stron, które nie są stronami z ogłoszeniami,
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getAnnouncements(optOptions)
getAnnouncements(optOptions)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Otrzymuj powiadomienia na tej stronie. Dotyczy tylko stron z ogłoszeniami.
var site = SitesApp.getSite("example.com", "mysite"); // This snippet will only work with announcement pages - this is different // from a page that is an announcement (individual announcements). To check // if this method can be called: // if(page.getPageType() == SitesApp.PageType.ANNOUNCEMENTS_PAGE)) var page = site.getChildByName("news"); var announcements = page.getAnnouncements({ start: 0, max: 20, includeDrafts: false, includeDeleted: false, search: "Breaking" }); for(var i in announcements) { Logger.log(announcements[i].getHtmlContent()); }
Parametry
Nazwa | Typ | Opis |
---|---|---|
optOptions | Object | Obiekt JavaScriptu zawierający zaawansowane parametry |
Parametry zaawansowane
Nazwa | Typ | Opis |
---|---|---|
start | Integer | indeks początkowy wyników |
max | Integer | maksymalna liczba wyników do zwrócenia, która jest wartością domyślną i może nie więcej niż 200 |
includeDrafts | Boolean | czy uwzględniać wersje robocze stron (domyślnie fałsz) |
includeDeleted | Boolean | czy uwzględniać usunięte strony (domyślnie false) |
search | String | zwróci tylko strony pasujące do tego zapytania |
Powrót
– tablica ogłoszeńPage[]
Rzuty
Error
– w przypadku stron, które nie są stronami z ogłoszeniami,
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getAttachments()
getAttachments()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobierz załączniki dla tej strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; var attachments = page.getAttachments(); for(var i in attachments) { Logger.log(attachments[i].getTitle()); }
Powrót
– tablica załączników;Attachment[]
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getAttachments(optOptions)
getAttachments(optOptions)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobierz załączniki dla tej strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; // This returns only one attachment var attachments = page.getAttachments({ start: 0, max: 1}); for(var i in attachments) { Logger.log(attachments[i].getTitle()); }
Parametry
Nazwa | Typ | Opis |
---|---|---|
optOptions | Object | obiekt JavaScript zawierający opcjonalne parametry |
Parametry zaawansowane
Nazwa | Typ | Opis |
---|---|---|
start | Integer | pierwszy indeks, który ma zacząć zwracać załączniki |
max | Integer | maksymalna liczba wyników do zwrócenia, która jest wartością domyślną i może nie więcej niż 200 |
Powrót
– tablica załączników;Attachment[]
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getAuthors()
getAuthors()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Otrzymywanie adresów e-mail autorów strony
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; var authors = page.getAuthors(); for(var i in authors) { Logger.log(authors[i]); }
Powrót
String[]
– tablica adresów e-mail autorów,
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getChildByName(name)
getChildByName(name)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobiera określoną stronę podrzędną.
var site = SitesApp.getSite("example.com", "mysite"); var pages = site.getChildByName("childPage");
Parametry
Nazwa | Typ | Opis |
---|---|---|
name | String | nazwa strony podrzędnej |
Powrót
– strona podrzędna,Page
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getChildren()
getChildren()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobiera tablicę stron podrzędnych, maksymalnie 200.
var site = SitesApp.getSite("example.com", "mysite"); var pages = site.getChildren();
Powrót
– tablica bezpośrednich stron podrzędnych,Page[]
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getChildren(options)
getChildren(options)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobiera tablicę stron podrzędnych z opcjonalnymi argumentami zaawansowanymi.
var site = SitesApp.getSite("example.com", "mysite"); var childPages = site.getChildren({ type: SitesApp.PageType.WEB_PAGE, start: 0, max: 25, includeDrafts: false, includeDeleted: true, search: "target" }); for(var i in childPages) { Logger.log(childPages[i].getName()); }
Parametry
Nazwa | Typ | Opis |
---|---|---|
options | Object | Pola obiektów JavaScript zdefiniowane w poniższej sekcji Argumenty zaawansowane |
Parametry zaawansowane
Nazwa | Typ | Opis |
---|---|---|
type |
| pobierz tylko strony tego typu |
start | Integer | rozpocznij tutaj wyniki |
max | Integer | maksymalna liczba wyników (domyślnie 200) |
includeDrafts | Boolean | czy uwzględniać wersje robocze stron (domyślnie fałsz) |
includeDeleted | Boolean | czy uwzględniać usunięte strony (domyślnie false) |
search | String | zwróci tylko strony pasujące do tego zapytania |
Powrót
– tablica bezpośrednich stron podrzędnych danego typu,Page[]
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getColumns()
getColumns()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobierz kolumny listy. Dotyczy tylko stron z listą.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildByName("listpage"); // Only valid on List pages. Check for the type like so: // if(page.getPageType() == SitesApp.PageType.LIST_PAGE)) var columns = page.getColumns(); for(var i in columns) { Logger.log(columns[i].getName()); }
Powrót
– tablica Column[]
instancji,Column
Rzuty
Error
– w przypadku stron, które nie są stronami z listą.
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getComments()
getComments()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Rola wycofana. Uzyskaj komentarze do tej strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; var comments = page.getComments(); for(var i in comments) { Logger.log(comments[i].getContent()); }
Powrót
– tablica komentarzy.Comment[]
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getComments(optOptions)
getComments(optOptions)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Rola wycofana. Uzyskaj komentarze do tej strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; // Return only one comment var comments = page.getComments({ start:0, max: 1}); for(var i in comments) { Logger.log(comments[i].getContent()); }
Parametry
Nazwa | Typ | Opis |
---|---|---|
optOptions | Object | obiekt JavaScript zawierający opcjonalne parametry |
Parametry zaawansowane
Nazwa | Typ | Opis |
---|---|---|
start | Integer | pierwszy indeks, który ma zacząć zwracać komentarze |
max | Integer | maksymalna liczba wyników do zwrócenia, która jest wartością domyślną i może nie więcej niż 200 |
Powrót
– tablica komentarzy.Comment[]
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getDatePublished()
getDatePublished()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Zwraca datę pierwszej publikacji strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; Logger.log(page.getName() + " was published " + page.getDatePublished());
Powrót
Date
– data pierwotnej publikacji;
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getHtmlContent()
getHtmlContent()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobierz zawartość HTML strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; Logger.log(page.getHtmlContent());
Powrót
String
– zawartość HTML;
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getIsDraft()
getIsDraft()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Wskazuje, czy strona jest w wersji roboczej. Dotyczy tylko ogłoszeń.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; Logger.log("Is this Announcement Page a draft?", page.getIsDraft());
Powrót
Boolean
– informacja o tym, czy strona jest w wersji roboczej;
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getLastEdited()
getLastEdited()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Zwraca datę ostatniej zmiany, która obejmuje tylko zmiany treści.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; Logger.log(page.getName() + " was last updated " + page.getLastEdited());
Powrót
Date
– data ostatniej aktualizacji strony, w tym tylko zmiany treści.
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getLastUpdated()
getLastUpdated()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Zwraca datę ostatniej aktualizacji, która obejmuje zmiany niestanowiące treści, np. przeniesienie.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; Logger.log(page.getName() + " was last updated " + page.getLastUpdated());
Powrót
Date
– data ostatniej aktualizacji strony ze zmianami niedotyczącymi treści.
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getListItems()
getListItems()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobierz elementy listy. Dotyczy tylko stron z listą.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildByName("listpage"); // Only valid on List pages. Check for the type like so: // if(page.getPageType() == SitesApp.PageType.LIST_PAGE)) var items = page.getListItems(); for(var i in items) { Logger.log(items[i].getValueByName("Status")); }
Powrót
– tablica ListItem[]
instancji,ListItem
Rzuty
Error
– w przypadku stron, które nie są stronami z listą.
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getListItems(optOptions)
getListItems(optOptions)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobierz elementy listy. Dotyczy tylko stron z listą.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildByName("listpage"); // Only valid on List pages. Check for the type like so: // if(page.getPageType() == SitesApp.PageType.LIST_PAGE)) // Returns only one item var items = page.getListItems({ start:0, max: 1 }); for(var i in items) { Logger.log(items[i].getValueByName("Status")); }
Parametry
Nazwa | Typ | Opis |
---|---|---|
optOptions | Object | Obiekt JavaScript z opcjonalnymi parametrami |
Parametry zaawansowane
Nazwa | Typ | Opis |
---|---|---|
start | Integer | pierwszy indeks, od którego rozpocznie się iteracje |
max | Integer | maksymalna liczba wyników do zwrócenia, która jest wartością domyślną i może nie więcej niż 200 |
Powrót
– tablica ListItem[]
instancji,ListItem
Rzuty
Error
– w przypadku stron, które nie są stronami z listą.
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getName()
getName()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Zwraca nazwę strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; Logger.log(page.getName());
Powrót
String
– nazwa tej strony
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getPageName()
getPageName()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Rola wycofana. Zastąpiono polecenie getName w celu zachowania spójności.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; Logger.log(page.getPageName());
Powrót
String
– nazwa tej strony
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getPageType()
getPageType()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Zwraca typ tej strony jako wyliczenie SitesApp.PageType.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; var pageType = page.getPageType(); if(pageType == SitesApp.PageType.WEB_PAGE) { Logger.log(page.getName() + " is a Web Page"); }
Powrót
– wyliczenie typu PageType określające, czy jest to strona internetowa, lista, ogłoszenie czy strona do przechowywania plików.PageType
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getParent()
getParent()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Zwraca obiekt nadrzędny tej strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; Logger.log(page.getName() + " parent: " + page.getParent().getName());
Powrót
– strona nadrzędna tej stronyPage
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getSelfLink()
getSelfLink()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Rola wycofana. Zwraca link do pliku danych gData tej strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; Logger.log(page.getSelfLink());
Powrót
String
– link do pliku danych gData,
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getTextContent()
getTextContent()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Zwraca zawartość strony w postaci zwykłego tekstu.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; Logger.log(page.getName() + " content: " + page.getTextContent());
Powrót
String
– zwykły tekst na stronie;
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getTitle()
getTitle()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Zwraca tytuł strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; Logger.log(page.getTitle());
Powrót
String
– tytuł tej strony
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
getUrl()
getUrl()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Uzyskaj adres URL strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; Logger.log(page.getUrl());
Powrót
String
– adres URL strony;
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
isDeleted()
isDeleted()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Wskazuje, czy strona została usunięta.
Powrót
Boolean
– informacja, czy strona została usunięta;
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
isTemplate()
isTemplate()
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Wskazuje, czy strona jest szablonem możliwym do skopiowania.
var site = SitesApp.getSite("example.com", "mysite"); var firstTemplate = site.getTemplates()[0]; if(firstTemplate.isTemplate()) { Logger.log("This will always return true"); }
Powrót
Boolean
– określa, czy strona jest szablonem.
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
publishAsTemplate(name)
publishAsTemplate(name)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Opublikuj tę stronę jako szablon możliwy do skopiowania.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; // Turn this page into a publishable template page.publishedAsTemplate("template-name");
Parametry
Nazwa | Typ | Opis |
---|---|---|
name | String | Nazwa nowego szablonu |
Powrót
– nowo opublikowany szablon,Page
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
search(query)
search(query)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobiera tablicę stron podrzędnych pasujących do zapytania (maksymalnie 200 stron).
var site = SitesApp.getSite("example.com", "mysite"); var matches = site.search("targetText"); for(var i in matches) { Logger.log(matches[i].getName()); }
Parametry
Nazwa | Typ | Opis |
---|---|---|
query | String | całe wyszukiwane hasło, które ma zostać dopasowane |
Powrót
– tablica bezpośrednich i pośrednich stron podrzędnych danego typuPage[]
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
search(query, options)
search(query, options)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Pobiera tablicę stron podrzędnych pasujących do zapytania wraz z opcjonalnymi argumentami zaawansowanymi.
var site = SitesApp.getSite("example.com", "mysite"); var childPages = site.getChildren({ type: SitesApp.PageType.WEB_PAGE, start: 0, max: 25, includeDrafts: false, includeDeleted: true, search: "target" }); for(var i in childPages) { Logger.log(childPages[i].getName()); }
Parametry
Nazwa | Typ | Opis |
---|---|---|
query | String | całe wyszukiwane hasło, które ma zostać dopasowane |
options | Object | Pola obiektów JavaScript zdefiniowane w poniższej sekcji Argumenty zaawansowane |
Parametry zaawansowane
Nazwa | Typ | Opis |
---|---|---|
type |
| pobierz tylko strony tego typu |
start | Integer | rozpocznij tutaj wyniki |
max | Integer | maksymalna liczba wyników (domyślnie 200) |
includeDrafts | Boolean | czy uwzględniać wersje robocze stron (domyślnie fałsz) |
includeDeleted | Boolean | czy uwzględniać usunięte strony (domyślnie false) |
Powrót
– tablica bezpośrednich i pośrednich stron podrzędnych danego typuPage[]
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
setHtmlContent(html)
setHtmlContent(html)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Ustaw treść HTML strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; page.setHtmlContent("<h1>New Page Content</h1>");
Parametry
Nazwa | Typ | Opis |
---|---|---|
html | String | nowe treści |
Powrót
– ta strona do tworzenia łańcuchówPage
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
setIsDraft(draft)
setIsDraft(draft)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Określa, czy strona jest w wersji roboczej. Dotyczy tylko ogłoszeń.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; // Take the page out of draft mode page.setIsDraft(false);
Parametry
Nazwa | Typ | Opis |
---|---|---|
draft | Boolean | nowy stan |
Powrót
– ta strona do tworzenia łańcuchówPage
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
setName(name)
setName(name)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Ustaw nazwę tej strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; page.setName("new-name");
Parametry
Nazwa | Typ | Opis |
---|---|---|
name | String | Nowa nazwa |
Powrót
– ta strona do tworzenia łańcuchówPage
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
setParent(parent)
setParent(parent)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Ustaw element nadrzędny tej strony.
var site = SitesApp.getSite("example.com", "mysite"); var child = site.getChildByName("childToBeMoved"); var parent = site.getChildByName("newParent"); child.setParent(parent);
Parametry
Nazwa | Typ | Opis |
---|---|---|
parent |
| nowy rodzic |
Powrót
– ta strona do tworzenia łańcuchówPage
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds
setTitle(title)
setTitle(title)
Wycofano. Ta funkcja została wycofana i nie należy jej używać w nowych skryptach.
Ustaw tytuł strony.
var site = SitesApp.getSite("example.com", "mysite"); var page = site.getChildren()[0]; page.setTitle("New Title");
Parametry
Nazwa | Typ | Opis |
---|---|---|
title | String | nowy tytuł |
Powrót
– ta strona do tworzenia łańcuchówPage
Autoryzacja
Skrypty korzystające z tej metody wymagają autoryzacji z co najmniej jednym z tych zakresów:
-
https://sites.google.com/feeds