Commits

Anonymous committed 1bb8bfb

07/22 from office

Comments (0)

Files changed (7)

src/info/mrchen/gae/blog/controller/MediaObjectController.java

 			response.reset();
 			response.resetBuffer();
 			MediaObject mo = mediaObjectService.get(mediaObjectID);
-			response.getOutputStream().write(mo.getBits().getBytes());
+			if (mo != null) {
+				byte[] bytes = mo.getBits().getBytes();
+				response.setContentType(mo.getType());
+				response.setContentLength(bytes.length);
+				response.getOutputStream().write(bytes);
+			}
 			response.flushBuffer();
 		} catch (IOException e) {
 		}

src/info/mrchen/gae/blog/service/SysConfKey.java

+package info.mrchen.gae.blog.service;
+
+public enum SysConfKey {
+	BLOG_URL
+}

src/info/mrchen/gae/blog/xmlrpc/handder/MetaWeblogHandler.java

 
 		String url = "http://localhost:8888/";
 		if (SystemProperty.environment.value() == SystemProperty.Environment.Value.Production) {
-			url = "http://" + SystemProperty.applicationId.version + ".appspot.com";
+			url = "http://" + SystemProperty.applicationId.get() + ".appspot.com";
 		}
 		blog.put(BLOG_URL, url);
 		blog.put(BLOG_BLOGID, "1");

war/CommonHeaders.jsp

 <%@ page contentType="text/html;charset=UTF-8" language="java"%>
 <link rel="icon" href="/images/favicon.ico">
-<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="/Static/wlwmanifest.xml" /> 
+<link rel="wlwmanifest" type="application/wlwmanifest+xml" href="/Static/wlwmanifest.xml" />
+<link rel="alternate" type="application/rss+xml" title="全部文章" href="http://theblogofchen.appspot.com/Feed/Rss.do" /> 
 <meta name="generator" content="mrchen-gae-blog" />
 <%@ page contentType="text/xml;charset=UTF-8" language="java"%>
-<%@page isELIgnored="false"%>
-<%@ include file="/WEB-INF/views/common/includes.jsp"%>
-<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
-<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
-<?xml version="1.0"?>
-<rss version="2.0"> <channel> <title>Feed Title</title>
-<link>http://yourwebsite.com/</link> <description>Feed
-Description</description> <language>en-us</language> <pubDate>Mon, 03 Jan
-2005 12:00:00 GMT</pubDate> <item> <title>Article Title</title> <link>http://yourwebsite.com/articlelink.html</link>
-<description>Your content included here.</description> </item> </channel>Ï </rss>
+<?xml version="1.0" encoding="UTF-8"?>
+<rss version="2.0"  >
+  <channel>
+    <title>mrche gae blog</title>
+    <link>http://theblogofchen.appspot.com</link> 
+	  <description>Asia Home</description> 
+	  <language>en-us</language> 
+	  <copyright>copyright  &#169; 2010 Dow Jones &amp; Company, Inc.</copyright> 
+	  <lastBuildDate>Thu, 22 Jul 2010 03:36:09 EDT</lastBuildDate>
+
+	  <image>
+      <title>WSJ.com: Asia Home</title>
+      <url>http://online.wsj.com/img/wsj_sm_logo.gif</url>
+      <link>http://online.wsj.com</link> 
+    </image>
+<!--Item 1 of {NonSubAsiaHomePage_3}{NonSubAsiaHomePage_4}{NonSubAsiaHomePage_7}{NonSubAsiaHomePage_5}{NonSubAsiaHomePage_6} -->
+<item>
+      <title>Petraeus Sharpens Afghan Strategy</title>
+
+      <guid>http://online.wsj.com/article/SB10001424052748703954804575381223866697214.html</guid>
+      <link>http://online.wsj.com/article/SB10001424052748703954804575381223866697214.html?mod=asia_home</link>
+      <description>Gen. Petraeus plans to ramp up the military's troop-intensive strategy in Afghanistan, which has focused too much attention on hunting down Taliban leaders.</description>
+      <media:content xmlns:media="http://search.yahoo.com/mrss"
+               url="http://s.wsj.net/public/resources/images/OB-JI251_2pet07_A_20100722032640.jpg" 
+               type="image/jpeg"
+               medium="image"
+               height="76"
+               width="76"> 
+    <media:description>2pet0722</media:description>
+    </media:content>
+    <category>FREE</category>
+
+    <category>FREEASIA</category>
+    <category>FREEEUROPE</category>
+    <category>FREEINDIA</category>
+    <pubDate>Thu, 22 Jul 2010 03:29:11 EDT</pubDate>
+    </item>
+</channel>
+</rss>
+    

war/WEB-INF/appengine-web.xml

 <?xml version="1.0" encoding="utf-8"?>
 <appengine-web-app xmlns="http://appengine.google.com/ns/1.0">
 	<application>theblogofchen</application>
-	<version>4</version>
+	<version>5</version>
 	<ssl-enabled>true</ssl-enabled>
 	<sessions-enabled>true</sessions-enabled>
 	<inbound-services>
 <%@ include file="/WEB-INF/views/common/includes.jsp"%>
 <%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
 <%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
-
 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
-<!-- The HTML 4.01 Transitional DOCTYPE declaration-->
-<!-- above set at the top of the file will set     -->
-<!-- the browser's rendering engine into           -->
-<!-- "Quirks Mode". Replacing this declaration     -->
-<!-- with a "Standards Mode" doctype is supported, -->
-<!-- but may lead to some differences in layout.   -->
-
 <html>
 <head>
 <meta http-equiv="content-type" content="text/html; charset=UTF-8">