/* (from gdata documentation...)
         * <entry xmlns='http://www.w3.org/2005/Atom'
         *  xmlns:media='http://search.yahoo.com/mrss/'
         *  xmlns:gphoto='http://schemas.google.com/photos/2007'>
         * <title type='text'>Trip To Italy</title>
         * <summary type='text'>This was the recent trip I took to Italy.</summary>
         * <gphoto:location>Italy</gphoto:location>
         * <gphoto:access>public</gphoto:access>
         * <gphoto:commentingEnabled>true</gphoto:commentingEnabled>
         * <gphoto:timestamp>1152255600000</gphoto:timestamp>
         * <media:group>
         *  <media:keywords>italy, vacation</media:keywords>
         * </media:group>
         * <category scheme='http://schemas.google.com/g/2005#kind'
         *  term='http://schemas.google.com/photos/2007#album'></category>
         * </entry>
         */

        private static string GetXmlForCreate(string title, string desc, DateTime date, AlbumAccess access)
        {
            XmlUtil xml = new XmlUtil();

            xml.WriteElementStringWithAttributes("title", title, "type", "text");
            xml.WriteElementStringWithAttributes("summary", desc, "type", "text");
            // location ?
            xml.WriteElementString("access", access.ToString().ToLower(CultureInfo.InvariantCulture), PicasaNamespaces.GPhoto);
            // commentingEnabled ?
            xml.WriteElementString("timestamp", ((long)(date - new DateTime(1970, 1, 1)).TotalSeconds * 1000).ToString(), PicasaNamespaces.GPhoto);
            //keywords ?
            xml.WriteElementStringWithAttributes("category", null,
                                                 "scheme", "http://schemas.google.com/g/2005#kind",
                                                 "term", "http://schemas.google.com/photos/2007#album");

            return(xml.GetDocumentString());
        }
Example #2
0
        static string GetXmlForTagging(string tag)
        {
            XmlUtil xml = new XmlUtil();

            xml.WriteElementString("title", tag);
            xml.WriteElementStringWithAttributes("category", null,
                                                 "scheme", "http://schemas.google.com/g/2005#kind",
                                                 "term", "http://schemas.google.com/photos/2007#tag");
            return(xml.GetDocumentString());
        }
Example #3
0
        /* from http://code.google.com/apis/picasaweb/gdata.html#Add_Photo
         * <entry xmlns='http://www.w3.org/2005/Atom'>
         * <title>darcy-beach.jpg</title>
         * <summary>Darcy on the beach</summary>
         * <category scheme="http://schemas.google.com/g/2005#kind"
         *  term="http://schemas.google.com/photos/2007#photo"/>
         * </entry>
         */

        static string GetXmlForUpload(string title, string description)
        {
            XmlUtil xml = new XmlUtil();

            xml.WriteElementString("title", title);
            xml.WriteElementString("summary", description);
            xml.WriteElementStringWithAttributes("category", null,
                                                 "scheme", "http://schemas.google.com/g/2005#kind",
                                                 "term", "http://schemas.google.com/photos/2007#photo");
            return(xml.GetDocumentString());
        }
		static string GetXmlForTagging (string tag)
		{
			XmlUtil xml = new XmlUtil ();
			xml.WriteElementString ("title", tag);
			xml.WriteElementStringWithAttributes ("category", null,
					"scheme", "http://schemas.google.com/g/2005#kind", 
					"term", "http://schemas.google.com/photos/2007#tag");
			return xml.GetDocumentString ();
		
		}
Example #5
0
        /* (from gdata documentation...)
        <entry xmlns='http://www.w3.org/2005/Atom'
            xmlns:media='http://search.yahoo.com/mrss/'
            xmlns:gphoto='http://schemas.google.com/photos/2007'>
          <title type='text'>Trip To Italy</title>
          <summary type='text'>This was the recent trip I took to Italy.</summary>
          <gphoto:location>Italy</gphoto:location>
          <gphoto:access>public</gphoto:access>
          <gphoto:commentingEnabled>true</gphoto:commentingEnabled>
          <gphoto:timestamp>1152255600000</gphoto:timestamp>
          <media:group>
            <media:keywords>italy, vacation</media:keywords>
          </media:group>
          <category scheme='http://schemas.google.com/g/2005#kind'
            term='http://schemas.google.com/photos/2007#album'></category>
        </entry>
        */
        private static string GetXmlForCreate(string title, string desc, DateTime date, AlbumAccess access)
        {
            XmlUtil xml = new XmlUtil ();
            xml.WriteElementStringWithAttributes ("title", title, "type", "text");
            xml.WriteElementStringWithAttributes ("summary", desc, "type", "text");
            // location ?
            xml.WriteElementString ("access", access.ToString ().ToLower (CultureInfo.InvariantCulture), PicasaNamespaces.GPhoto);
            // commentingEnabled ?
            xml.WriteElementString ("timestamp", ((long)(date - new DateTime (1970, 1, 1)).TotalSeconds * 1000).ToString (), PicasaNamespaces.GPhoto);
            //keywords ?
            xml.WriteElementStringWithAttributes ("category", null,
                    "scheme", "http://schemas.google.com/g/2005#kind",
                    "term", "http://schemas.google.com/photos/2007#album");

            return xml.GetDocumentString ();
        }
Example #6
0
 /* from http://code.google.com/apis/picasaweb/gdata.html#Add_Photo
 <entry xmlns='http://www.w3.org/2005/Atom'>
   <title>darcy-beach.jpg</title>
   <summary>Darcy on the beach</summary>
   <category scheme="http://schemas.google.com/g/2005#kind"
     term="http://schemas.google.com/photos/2007#photo"/>
 </entry>
 */
 static string GetXmlForUpload(string title, string description)
 {
     XmlUtil xml = new XmlUtil ();
     xml.WriteElementString ("title", title);
     xml.WriteElementString ("summary", description);
     xml.WriteElementStringWithAttributes ("category", null,
             "scheme", "http://schemas.google.com/g/2005#kind",
             "term", "http://schemas.google.com/photos/2007#photo");
     return xml.GetDocumentString ();
 }