Tuesday, March 10, 2015
Google Sites API v1 2 Page Templates and Web Address Mappings
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.
Posted by Eric Bidelman , Google Sites API Team
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment
Note: Only a member of this blog may post a comment.