Package com.google.gdata.data.sites

Examples of com.google.gdata.data.sites.SiteEntry


     * @throws IOException
     * @throws MalformedURLException
     */
    public SiteEntry createSite(String title, String summary, String theme)
        throws MalformedURLException, IOException, ServiceException {
      SiteEntry entry = new SiteEntry();
      entry.setTitle(new PlainTextConstruct(title));
      entry.setSummary(new PlainTextConstruct(summary));

      // Set theme if user specified it.
      if (theme !=  null) {
        Theme tt = new Theme();
        tt.setValue(theme);
        entry.setTheme(tt);
      }

      return service.insert(new URL(getSiteFeedUrl()), entry);
    }
View Full Code Here


     * @throws IOException
     * @throws MalformedURLException
     */
    public SiteEntry copySite(String title, String summary, String sourceHref)
        throws MalformedURLException, IOException, ServiceException {
      SiteEntry entry = new SiteEntry();
      entry.setTitle(new PlainTextConstruct(title));
      entry.setSummary(new PlainTextConstruct(summary));
      entry.addLink(SitesLink.Rel.SOURCE, Link.Type.ATOM, sourceHref);

      return service.insert(new URL(getSiteFeedUrl()), entry);
    }
View Full Code Here

      if (args.length < 3) {
        System.out.flush();
        throw new SitesException("Wrong number of args");
      }

      SiteEntry siteEntry = null;

      if (args.length == 4) {
        siteEntry = sitesHelper.createSite(args[1], args[2], args[3]);
      } else if (args.length == 3) {
        siteEntry =  sitesHelper.createSite(args[1], args[2]);
      }

      System.out.println("Created!");
      if (siteEntry.getHtmlLink() != null) {
        System.out.println("View it at " + siteEntry.getHtmlLink().getHref());
      }

    } else if (name.equals("copysite")) {
      if (args.length < 4) {
        System.out.flush();
        throw new SitesException("Wrong number of args");
      }

      SiteEntry siteEntry =  siteEntry = sitesHelper.copySite(args[1], args[2], args[3]);

      System.out.println("Created!");
      if (siteEntry.getHtmlLink() != null) {
        System.out.println("View it at " + siteEntry.getHtmlLink().getHref());
      }

    } else if (name.equals("content")) {
      if (args.length == 1) {
        sitesHelper.listSiteContents("all");
View Full Code Here

TOP

Related Classes of com.google.gdata.data.sites.SiteEntry

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.