| 1 |
/* |
/* |
| 2 |
* Copyright 2005-2006 The Portal Application Laboratory Team. |
* Copyright 2005-2008 The Portal Application Laboratory Team. |
| 3 |
* |
* |
| 4 |
* Licensed under the Apache License, Version 2.0 (the "License"); |
* Licensed under the Apache License, Version 2.0 (the "License"); |
| 5 |
* you may not use this file except in compliance with the License. |
* you may not use this file except in compliance with the License. |
| 15 |
*/ |
*/ |
| 16 |
package jp.sf.pal.blog.portlet; |
package jp.sf.pal.blog.portlet; |
| 17 |
|
|
|
import org.apache.commons.logging.Log; |
|
|
import org.apache.commons.logging.LogFactory; |
|
|
|
|
| 18 |
import java.io.IOException; |
import java.io.IOException; |
| 19 |
import java.util.Iterator; |
import java.util.Iterator; |
| 20 |
|
|
| 24 |
|
|
| 25 |
import jp.sf.pal.blog.BlogConstants; |
import jp.sf.pal.blog.BlogConstants; |
| 26 |
import jp.sf.pal.blog.util.BlogMessaging; |
import jp.sf.pal.blog.util.BlogMessaging; |
| 27 |
|
import jp.sf.pal.blog.util.BlogMessagingKeyToken; |
| 28 |
|
|
| 29 |
|
import org.apache.commons.logging.Log; |
| 30 |
|
import org.apache.commons.logging.LogFactory; |
| 31 |
|
|
| 32 |
public class BlogViewPortlet extends BlogGenericPortlet |
public class BlogViewPortlet extends BlogGenericPortlet |
| 33 |
{ |
{ |
| 45 |
super.processAction(request, response); |
super.processAction(request, response); |
| 46 |
//TODO |
//TODO |
| 47 |
String blogId = null; |
String blogId = null; |
| 48 |
|
String blogOwner = null; |
| 49 |
Iterator ite = request.getParameterMap().keySet().iterator(); |
Iterator ite = request.getParameterMap().keySet().iterator(); |
| 50 |
while (ite.hasNext()) |
while (ite.hasNext()) |
| 51 |
{ |
{ |
| 62 |
{ |
{ |
| 63 |
blogId = request.getParameter(key); |
blogId = request.getParameter(key); |
| 64 |
} |
} |
| 65 |
|
else if (key.indexOf(BlogConstants.BLOG_REDIRECT_OWNER) >= 0) |
| 66 |
|
{ |
| 67 |
|
blogOwner = request.getParameter(key); |
| 68 |
|
} |
| 69 |
} |
} |
| 70 |
if (log.isDebugEnabled()) |
if (log.isDebugEnabled()) |
| 71 |
{ |
{ |
| 72 |
log |
log |
| 73 |
.debug("processAction(ActionRequest, ActionResponse) - : blogId=" |
.debug("processAction(ActionRequest, ActionResponse) - : blogId=" |
| 74 |
+ blogId); |
+ blogId + " : blogOwner=" + blogOwner); |
| 75 |
} |
} |
| 76 |
if (blogId != null) |
if (blogId != null && blogOwner != null) |
| 77 |
{ |
{ |
| 78 |
BlogMessaging.publishForView(BlogConstants.BLOG_MESSAGE_ID, |
BlogMessagingKeyToken keyToken = new BlogMessagingKeyToken(); |
| 79 |
new Long(blogId)); |
keyToken.setPrefix(BlogConstants.BLOG_MESSAGE_ID); |
| 80 |
|
keyToken.setOwner(blogOwner); |
| 81 |
|
BlogMessaging.publishForView(keyToken.toString(), new Long(blogId)); |
| 82 |
} |
} |
| 83 |
|
|
| 84 |
} |
} |