Pages

Tuesday, March 10, 2015

Google Sites API v1 2 Page Templates and Web Address Mappings

Today we’re releasing Google Sites API, version 1.2, which includes two top requested new features:

Web address mappings

Web address mappings are now programmatically accessible in the API using a new parameter on the site feed: with-mappings=true. If you’re not familar with this feature in Google Sites, web address mappings enable users to point their own domains to a Google Site. For example, you can map the address http://www.mydomainsite.com to http://sites.google.com/a/domain.com/mysite. They’re a great way to fully customize a site.

See our help center article for more information on web address mappings.

Page templates

A few months ago we launched site templates in the API, but there was no way to use page templates or access them programmatically. With the new page templates API, you can create templates as well as instantiate new pages from existing templates.

As an example usage, this Java snippet creates a new filecabinetpage from an existing template filecabinet:
FileCabinetPageEntry templateInstanceEntry = new FileCabinetPageEntry();
templateInstanceEntry.setTitle(
new PlainTextConstruct("File cabinet template instance"));
templateInstanceEntry.addLink(new Link(SitesLink.Rel.TEMPLATE,
Link.Type.ATOM,
existingTemplateEntry.getSelfLink().getHref()));

String feedUrl = "https://sites.google.com/feeds/content/site/siteName";
FileCabinetPageEntry fileCabFromTemplate = client.insert(
new URL(feedUrl), templateInstanceEntry);

Check out the documentation, updated Java guide, and changelog for further information.

Bug fixes in this release: 1903, 1762


No comments:

Post a Comment

Note: Only a member of this blog may post a comment.