| 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. |
| 30 |
|
|
| 31 |
import jp.sf.pal.blog.BlogConstants; |
import jp.sf.pal.blog.BlogConstants; |
| 32 |
import jp.sf.pal.blog.converter.Converter; |
import jp.sf.pal.blog.converter.Converter; |
|
import jp.sf.pal.blog.importer.Importer; |
|
| 33 |
import jp.sf.pal.blog.model.BlogMessage; |
import jp.sf.pal.blog.model.BlogMessage; |
| 34 |
import jp.sf.pal.blog.util.BlogDaoUtil; |
import jp.sf.pal.blog.util.BlogDaoUtil; |
| 35 |
import jp.sf.pal.blog.util.BlogMessaging; |
import jp.sf.pal.blog.util.BlogMessaging; |
| 36 |
|
import jp.sf.pal.blog.util.BlogMessagingKeyToken; |
| 37 |
|
|
| 38 |
import org.apache.commons.logging.Log; |
import org.apache.commons.logging.Log; |
| 39 |
import org.apache.commons.logging.LogFactory; |
import org.apache.commons.logging.LogFactory; |
| 67 |
public BlogEditPageBean() |
public BlogEditPageBean() |
| 68 |
{ |
{ |
| 69 |
Long id = null; |
Long id = null; |
| 70 |
|
BlogMessagingKeyToken keyToken = new BlogMessagingKeyToken(); |
| 71 |
|
keyToken.setPrefix(BlogConstants.BLOG_MESSAGE_ID); |
| 72 |
|
ExternalContext externalContext = FacesContext.getCurrentInstance() |
| 73 |
|
.getExternalContext(); |
| 74 |
|
keyToken.setOwner(externalContext.getRemoteUser()); |
| 75 |
try |
try |
| 76 |
{ |
{ |
| 77 |
id = (Long) BlogMessaging |
id = (Long) BlogMessaging.receiveForEdit(keyToken.toString()); |
|
.receiveForEdit(BlogConstants.BLOG_MESSAGE_ID); |
|
| 78 |
} |
} |
| 79 |
catch (ClassCastException e) |
catch (ClassCastException e) |
| 80 |
{ |
{ |
| 223 |
{ |
{ |
| 224 |
if (getId() != null) |
if (getId() != null) |
| 225 |
{ |
{ |
| 226 |
BlogMessaging.cancelForEdit(BlogConstants.BLOG_MESSAGE_ID); |
BlogMessagingKeyToken keyToken = new BlogMessagingKeyToken(); |
| 227 |
|
keyToken.setPrefix(BlogConstants.BLOG_MESSAGE_ID); |
| 228 |
|
ExternalContext externalContext = FacesContext.getCurrentInstance() |
| 229 |
|
.getExternalContext(); |
| 230 |
|
keyToken.setOwner(externalContext.getRemoteUser()); |
| 231 |
|
BlogMessaging.cancelForEdit(keyToken.toString()); |
| 232 |
// i18n |
// i18n |
| 233 |
FacesMessageUtil.addInfoMessage(PortletResourceBundleUtil |
FacesMessageUtil.addInfoMessage(PortletResourceBundleUtil |
| 234 |
.getString(LocaleUtil.getLocale(), |
.getString(LocaleUtil.getLocale(), |