forked from liferay/liferay-portal
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
LPS-86553 Add new field for blog entries
- Loading branch information
Showing
1 changed file
with
41 additions
and
0 deletions.
There are no files selected for viewing
41 changes: 41 additions & 0 deletions
41
...eb/internal/asset/display/contributor/BlogsEntrySubtitleAssetDisplayContributorField.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
package com.liferay.blogs.web.internal.asset.display.contributor; | ||
|
||
import com.liferay.asset.display.contributor.AssetDisplayContributorField; | ||
import com.liferay.blogs.model.BlogsEntry; | ||
import com.liferay.portal.kernel.language.LanguageUtil; | ||
|
||
import java.util.Locale; | ||
|
||
import org.osgi.service.component.annotations.Component; | ||
|
||
/** | ||
* @author Kyle Miho | ||
*/ | ||
@Component( | ||
property = "model.class.name=com.liferay.blogs.model.BlogsEntry", | ||
service = AssetDisplayContributorField.class | ||
) | ||
public class BlogsEntrySubtitleAssetDisplayContributorField | ||
implements AssetDisplayContributorField<BlogsEntry> { | ||
|
||
@Override | ||
public String getKey() { | ||
return "subtitle"; | ||
} | ||
|
||
@Override | ||
public String getLabel(Locale locale) { | ||
return LanguageUtil.get(locale, "subtitle"); | ||
} | ||
|
||
@Override | ||
public String getType() { | ||
return "text"; | ||
} | ||
|
||
@Override | ||
public String getValue(BlogsEntry blogsEntry, Locale locale) { | ||
return blogsEntry.getSubtitle(); | ||
} | ||
|
||
} |