当前位置: 首页>>代码示例>>Java>>正文


Java DDMTemplateLocalServiceUtil.addTemplate方法代码示例

本文整理汇总了Java中com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalServiceUtil.addTemplate方法的典型用法代码示例。如果您正苦于以下问题:Java DDMTemplateLocalServiceUtil.addTemplate方法的具体用法?Java DDMTemplateLocalServiceUtil.addTemplate怎么用?Java DDMTemplateLocalServiceUtil.addTemplate使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalServiceUtil的用法示例。


在下文中一共展示了DDMTemplateLocalServiceUtil.addTemplate方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: addDDMTemplates

import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalServiceUtil; //导入方法依赖的package包/类
protected void addDDMTemplates(
		String ddmStructureKey, String fileName, InputStream inputStream)
	throws Exception {

	String ddmTemplateKey = getJournalId(fileName);

	String name = FileUtil.stripExtension(fileName);

	Map<Locale, String> nameMap = getMap(name);

	String language = getDDMTemplateLanguage(fileName);

	String xsl = StringUtil.read(inputStream);

	xsl = replaceFileEntryURL(xsl);

	setServiceContext(fileName);

	DDMStructure ddmStructure = DDMStructureLocalServiceUtil.getStructure(
		groupId, PortalUtil.getClassNameId(JournalArticle.class),
		ddmStructureKey);

	DDMTemplate ddmTemplate = DDMTemplateLocalServiceUtil.addTemplate(
		userId, groupId, PortalUtil.getClassNameId(DDMStructure.class),
		ddmStructure.getStructureId(), ddmTemplateKey, nameMap, null,
		DDMTemplateConstants.TEMPLATE_TYPE_DISPLAY, null, language, xsl,
		false, false, null, null, serviceContext);

	addJournalArticles(
		ddmStructureKey, ddmTemplate.getTemplateKey(),
		_JOURNAL_ARTICLES_DIR_NAME + name);
}
 
开发者ID:rivetlogic,项目名称:liferay-elasticsearch-integration,代码行数:33,代码来源:FileSystemImporter.java

示例2: addDDMTemplate

import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalServiceUtil; //导入方法依赖的package包/类
protected void addDDMTemplate(
		long templateGroupId, long ddmStructureId, String fileName,
		String language, String script, String type, String mode)
	throws Exception {

	fileName = FileUtil.getShortFileName(fileName);

	fileName = FileUtil.stripExtension(fileName);

	String name = getName(fileName);

	DDMTemplate ddmTemplate = DDMTemplateLocalServiceUtil.fetchTemplate(
		groupId, PortalUtil.getClassNameId(DDMStructure.class),
		getKey(fileName));

	if (ddmTemplate != null) {
		if (!developerModeEnabled) {
			if (_log.isInfoEnabled()) {
				_log.info(
					"DDM template with name " + name + " and version " +
						version + " already exists");
			}

			return;
		}

		DDMTemplateLocalServiceUtil.deleteTemplate(ddmTemplate);
	}

	DDMTemplateLocalServiceUtil.addTemplate(
		userId, templateGroupId,
		PortalUtil.getClassNameId(DDMStructure.class), ddmStructureId,
		getKey(fileName), getMap(name), null, type, mode, language, script,
		false, false, StringPool.BLANK, null, serviceContext);
}
 
开发者ID:rivetlogic,项目名称:liferay-voice-command,代码行数:36,代码来源:FileSystemImporter.java

示例3: addApplicationDisplayTemplate

import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalServiceUtil; //导入方法依赖的package包/类
protected void addApplicationDisplayTemplate(
		String script, File file, long classNameId)
	throws PortalException, SystemException {

	String fileName = FileUtil.stripExtension(file.getName());

	String name = getName(fileName);

	DDMTemplate ddmTemplate = DDMTemplateLocalServiceUtil.fetchTemplate(
		groupId, classNameId, getKey(fileName));

	if (ddmTemplate != null) {
		if (!developerModeEnabled) {
			if (_log.isInfoEnabled()) {
				_log.info(
					"DDM template with name " + name + " and version " +
						version + " already exists");
			}

			return;
		}

		DDMTemplateLocalServiceUtil.deleteTemplate(ddmTemplate);
	}

	DDMTemplateLocalServiceUtil.addTemplate(
		userId, groupId, classNameId, 0, getKey(fileName), getMap(name),
		null, DDMTemplateConstants.TEMPLATE_TYPE_DISPLAY, StringPool.BLANK,
		getDDMTemplateLanguage(name), script, false, false,
		StringPool.BLANK, null, serviceContext);
}
 
开发者ID:rivetlogic,项目名称:liferay-voice-command,代码行数:32,代码来源:FileSystemImporter.java

示例4: addDDMTemplates

import com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalServiceUtil; //导入方法依赖的package包/类
protected void addDDMTemplates(
		String ddmStructureKey, String fileName, InputStream inputStream)
	throws Exception {

	fileName = FileUtil.stripExtension(fileName);

	String name = getName(fileName);

	String xsl = StringUtil.read(inputStream);

	setServiceContext(fileName);

	DDMStructure ddmStructure = DDMStructureLocalServiceUtil.getStructure(
		groupId, PortalUtil.getClassNameId(JournalArticle.class),
		ddmStructureKey);

	DDMTemplate ddmTemplate = DDMTemplateLocalServiceUtil.fetchTemplate(
		groupId, PortalUtil.getClassNameId(DDMStructure.class),
		getKey(fileName));

	if (ddmTemplate != null) {
		if (!developerModeEnabled) {
			if (_log.isInfoEnabled()) {
				_log.info(
					"DDM template with name " + name + " and version " +
						version + " already exists");
			}

			return;
		}

		DDMTemplateLocalServiceUtil.deleteTemplate(ddmTemplate);
	}

	ddmTemplate = DDMTemplateLocalServiceUtil.addTemplate(
		userId, groupId, PortalUtil.getClassNameId(DDMStructure.class),
		ddmStructure.getStructureId(), getKey(fileName), getMap(name), null,
		DDMTemplateConstants.TEMPLATE_TYPE_DISPLAY, null,
		getDDMTemplateLanguage(fileName), replaceFileEntryURL(xsl), false,
		false, null, null, serviceContext);

	addJournalArticles(
		ddmStructureKey, ddmTemplate.getTemplateKey(),
		_JOURNAL_ARTICLES_DIR_NAME + fileName);
}
 
开发者ID:rivetlogic,项目名称:liferay-voice-command,代码行数:46,代码来源:FileSystemImporter.java


注:本文中的com.liferay.portlet.dynamicdatamapping.service.DDMTemplateLocalServiceUtil.addTemplate方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。