本文整理汇总了Java中com.liferay.portlet.journal.model.JournalArticleConstants类的典型用法代码示例。如果您正苦于以下问题:Java JournalArticleConstants类的具体用法?Java JournalArticleConstants怎么用?Java JournalArticleConstants使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
JournalArticleConstants类属于com.liferay.portlet.journal.model包,在下文中一共展示了JournalArticleConstants类的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: addArticle
import com.liferay.portlet.journal.model.JournalArticleConstants; //导入依赖的package包/类
public static JournalArticle addArticle(long userId, long groupId, String name, String title, String srcContent) {
JournalArticle result = null;
try {
Locale defLocale = LocaleUtil.getDefault();
if (defLocale == null)
defLocale = Locale.GERMAN;
String localShort = defLocale.getLanguage()+"_"+defLocale.getCountry();
Map<Locale, String> titleMap = new HashMap<Locale, String>();
titleMap.put(defLocale, title);
//titleMap.put(Locale.GERMAN, title);
//titleMap.put(Locale.ENGLISH, title);
ServiceContext ctx = new ServiceContext();
ctx.setScopeGroupId(groupId);
String content = "<?xml version=\"1.0\"?><root available-locales=\""+localShort+"\" default-locale=\""+localShort+"\"><static-content language-id=\""+localShort+"\"><![CDATA[ "+srcContent+" ]]></static-content></root>";
String lid = LocalizationUtil.getDefaultLocale(content);
Locale defaultLocale = LocaleUtil.fromLanguageId(lid);
m_objLog.debug("Adding title for locale "+defLocale+", short "+localShort+" with lid "+lid+" and defaultLocale "+defaultLocale+" with content "+title);
result = JournalArticleLocalServiceUtil.addArticle(
userId,
groupId,
0, // folder id
0, 0, //classNameId, classPK,
name, //articleId,
false, //autoArticleId,
JournalArticleConstants.VERSION_DEFAULT,
titleMap,
null, //descriptionMap,
content,
"general", // type,
null,
null, // templateId,
StringPool.BLANK, //layoutUuid,
1, 1, 1970, 0, 0, // displayDateMonth, displayDateDay, displayDateYear,
// displayDateHour, displayDateMinute,
0, 0, 0, 0, 0, true, // expirationDateMonth, expirationDateDay,
// expirationDateYear, expirationDateHour,
//expirationDateMinute, neverExpire,
0, 0, 0, 0, 0, true, // reviewDateMonth, reviewDateDay, reviewDateYear,
//reviewDateHour, reviewDateMinute, neverReview,
true, // indexable,
false, StringPool.BLANK, null, // smallImage, smallImageURL, smallImageFile,
null, StringPool.BLANK, // images, articleURL,
ctx
);
} catch (Throwable t) {
m_objLog.warn(t);
}
return result;
}
开发者ID:fraunhoferfokus,项目名称:particity,代码行数:64,代码来源:ParticityInitializer.java
示例2: addJournalArticles
import com.liferay.portlet.journal.model.JournalArticleConstants; //导入依赖的package包/类
protected void addJournalArticles(
String ddmStructureKey, String ddmTemplateKey, String fileName,
InputStream inputStream)
throws Exception {
String journalArticleId = getJournalId(fileName);
String title = FileUtil.stripExtension(fileName);
JSONObject assetJSONObject = _assetJSONObjectMap.get(fileName);
Map<Locale, String> descriptionMap = null;
if (assetJSONObject != null) {
String abstractSummary = assetJSONObject.getString(
"abstractSummary");
descriptionMap = getMap(abstractSummary);
}
String content = StringUtil.read(inputStream);
content = processJournalArticleContent(content);
Locale articleDefaultLocale = LocaleUtil.fromLanguageId(
LocalizationUtil.getDefaultLocale(content));
Map<Locale, String> titleMap = getMap(articleDefaultLocale, title);
boolean smallImage = false;
String smallImageURL = StringPool.BLANK;
if (assetJSONObject != null) {
String smallImageFileName = assetJSONObject.getString("smallImage");
if (Validator.isNotNull(smallImageFileName)) {
smallImage = true;
FileEntry fileEntry = _fileEntries.get(smallImageFileName);
if (fileEntry != null) {
smallImageURL = DLUtil.getPreviewURL(
fileEntry, fileEntry.getFileVersion(), null,
StringPool.BLANK);
}
}
}
setServiceContext(fileName);
JournalArticle journalArticle =
JournalArticleLocalServiceUtil.addArticle(
userId, groupId, 0, 0, 0, journalArticleId, false,
JournalArticleConstants.VERSION_DEFAULT, titleMap,
descriptionMap, content, "general", ddmStructureKey,
ddmTemplateKey, StringPool.BLANK, 1, 1, 2010, 0, 0, 0, 0, 0, 0,
0, true, 0, 0, 0, 0, 0, true, true, smallImage, smallImageURL,
null, new HashMap<String, byte[]>(), StringPool.BLANK,
serviceContext);
JournalArticleLocalServiceUtil.updateStatus(
userId, groupId, journalArticle.getArticleId(),
journalArticle.getVersion(), WorkflowConstants.STATUS_APPROVED,
StringPool.BLANK, new HashMap<String, Serializable>(),
serviceContext);
}
开发者ID:rivetlogic,项目名称:liferay-evernote,代码行数:67,代码来源:FileSystemImporter.java
示例3: addJournalArticles
import com.liferay.portlet.journal.model.JournalArticleConstants; //导入依赖的package包/类
protected void addJournalArticles(
String ddmStructureKey, String ddmTemplateKey, String fileName,
InputStream inputStream)
throws Exception {
String title = FileUtil.stripExtension(fileName);
JSONObject assetJSONObject = _assetJSONObjectMap.get(fileName);
Map<Locale, String> descriptionMap = null;
if (assetJSONObject != null) {
String abstractSummary = assetJSONObject.getString(
"abstractSummary");
descriptionMap = getMap(abstractSummary);
}
String content = StringUtil.read(inputStream);
content = processJournalArticleContent(content);
Locale articleDefaultLocale = LocaleUtil.fromLanguageId(
LocalizationUtil.getDefaultLanguageId(content));
boolean smallImage = false;
String smallImageURL = StringPool.BLANK;
if (assetJSONObject != null) {
String smallImageFileName = assetJSONObject.getString("smallImage");
if (Validator.isNotNull(smallImageFileName)) {
smallImage = true;
FileEntry fileEntry = _fileEntries.get(smallImageFileName);
if (fileEntry != null) {
smallImageURL = DLUtil.getPreviewURL(
fileEntry, fileEntry.getFileVersion(), null,
StringPool.BLANK);
}
}
}
setServiceContext(fileName);
JournalArticle journalArticle =
JournalArticleLocalServiceUtil.addArticle(
userId, groupId, 0, 0, 0, getJournalId(fileName), false,
JournalArticleConstants.VERSION_DEFAULT,
getMap(articleDefaultLocale, title), descriptionMap, content,
"general", ddmStructureKey, ddmTemplateKey, StringPool.BLANK, 1,
1, 2010, 0, 0, 0, 0, 0, 0, 0, true, 0, 0, 0, 0, 0, true, true,
smallImage, smallImageURL, null, new HashMap<String, byte[]>(),
StringPool.BLANK, serviceContext);
JournalArticleLocalServiceUtil.updateStatus(
userId, groupId, journalArticle.getArticleId(),
journalArticle.getVersion(), WorkflowConstants.STATUS_APPROVED,
StringPool.BLANK, new HashMap<String, Serializable>(),
serviceContext);
}
开发者ID:rivetlogic,项目名称:liferay-voice-command,代码行数:63,代码来源:FileSystemImporter.java
注:本文中的com.liferay.portlet.journal.model.JournalArticleConstants类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论